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:
parent
db85b952eb
commit
3223f4772a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user