0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-18 15:12:55 +02:00

Fix some missed GitHeadRefName when renaming (#35102)

This commit is contained in:
Lunny Xiao 2025-07-17 22:01:11 +08:00 committed by GitHub
parent de1114b4e8
commit 8ee96039aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

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