diff --git a/models/issues/pull.go b/models/issues/pull.go index 2ff471b641..4c25b6f0c8 100644 --- a/models/issues/pull.go +++ b/models/issues/pull.go @@ -413,7 +413,7 @@ func (pr *PullRequest) getReviewedByLines(ctx context.Context, writer io.Writer) return committer.Commit() } -// GetGitRefName returns git ref for hidden pull request branch +// GetGitHeadRefName returns git ref for hidden pull request branch func (pr *PullRequest) GetGitHeadRefName() string { return fmt.Sprintf("%s%d/head", git.PullPrefix, pr.Index) } diff --git a/modules/migration/pullrequest.go b/modules/migration/pullrequest.go index c832879630..cccab3fd7e 100644 --- a/modules/migration/pullrequest.go +++ b/modules/migration/pullrequest.go @@ -49,7 +49,7 @@ func (p *PullRequest) IsForkPullRequest() bool { return p.Head.RepoFullName() != p.Base.RepoFullName() } -// GetGitRefName returns pull request relative path to head +// GetGitHeadRefName returns pull request relative path to head func (p PullRequest) GetGitHeadRefName() string { return fmt.Sprintf("%s%d/head", git.PullPrefix, p.Number) } diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl index 7362908c55..9dbcbeee21 100644 --- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -11,7 +11,7 @@ {{if eq .PullRequest.Flow 0}}
git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
{{else}} -
git fetch -u origin {{.PullRequest.GetGitRefName}}:{{$localBranch}}
+
git fetch -u origin {{.PullRequest.GetGitHeadRefName}}:{{$localBranch}}
{{end}}
git checkout {{$localBranch}}