1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

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 {