From cb297a6f6f6fe471b7e38907bfd432cc43677363 Mon Sep 17 00:00:00 2001 From: Beowulf Date: Sat, 13 Jul 2024 18:05:08 +0200 Subject: [PATCH] Fix AGit checkout instruction The checkout instruction for pull requests created with the AGit workflow where incorrect. (cherry picked from commit 0a5fa31edb7b07fef3d50cb1499564feb3cf39c3) --- .../repo/issue/view_content/pull_merge_instruction.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl index 42d9c82935..e89102802a 100644 --- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -8,11 +8,11 @@ {{end}}
{{if eq .PullRequest.Flow 0}} -
git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
-
git checkout {{$localBranch}}
+
git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
{{else}} -
git fetch -u origin {{.GetGitRefName}}:{{$localBranch}}
+
git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}
{{end}} +
git checkout {{$localBranch}}
{{if .ShowMergeInstructions}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}

{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}