Merge pull request 'Fix AGit pull request instructions' (#4475) from beowulf/fix-agit-checkout-instruction into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4475
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-07-13 17:52:34 +00:00
commit 010dc1ef86

View file

@ -8,11 +8,11 @@
{{end}} {{end}}
<div class="ui secondary segment"> <div class="ui secondary segment">
{{if eq .PullRequest.Flow 0}} {{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> <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>
<div>git checkout {{$localBranch}}</div>
{{else}} {{else}}
<div>git fetch -u origin {{.GetGitRefName}}:{{$localBranch}}</div> <div>git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}</div>
{{end}} {{end}}
<div>git checkout {{$localBranch}}</div>
</div> </div>
{{if .ShowMergeInstructions}} {{if .ShowMergeInstructions}}
<div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div> <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div>