mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 08:42:55 +02:00
Fix some missed GitHeadRefName when renaming (#35102)
This commit is contained in:
parent
de1114b4e8
commit
8ee96039aa
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
{{if eq .PullRequest.Flow 0}}
|
||||
<div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div>
|
||||
{{else}}
|
||||
<div>git fetch -u origin {{.PullRequest.GetGitRefName}}:{{$localBranch}}</div>
|
||||
<div>git fetch -u origin {{.PullRequest.GetGitHeadRefName}}:{{$localBranch}}</div>
|
||||
{{end}}
|
||||
<div>git checkout {{$localBranch}}</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user