diff --git a/shared/build/repo/repo.go b/shared/build/repo/repo.go index 01daa073c..355b93ab9 100644 --- a/shared/build/repo/repo.go +++ b/shared/build/repo/repo.go @@ -114,7 +114,7 @@ func (r *Repo) Commands() []string { cmds := []string{} if len(r.PR) > 0 { // If a specific PR is provided then we need to clone it. - cmds = append(cmds, fmt.Sprintf("git clone --depth=%d --recursive %s %s", r.Depth, r.Path, r.Dir)) + cmds = append(cmds, fmt.Sprintf("git clone --depth=%d --recursive --branch=%s %s %s", r.Depth, branch, r.Path, r.Dir)) cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/head:refs/remotes/origin/pr/%s", r.PR, r.PR)) cmds = append(cmds, fmt.Sprintf("git checkout -qf -b pr/%s origin/pr/%s", r.PR, r.PR)) } else {