Update repo.go to clone specific branch for PR

This commit is contained in:
Mark Fayngersh 2015-10-15 13:12:58 -04:00
parent db85b952eb
commit 3223f4772a

View file

@ -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 {