|
1 | 1 | <div class="divider"></div>
|
2 |
| -<div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.merge_instruction_hint" | Safe}} </div> |
| 2 | +<div class="instruct-toggle"> {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint" | Safe}} </div> |
3 | 3 | <div class="instruct-content gt-mt-3 gt-hidden">
|
4 |
| - <div><h3 class="gt-dib">{{ctx.Locale.Tr "step1"}}</h3> {{ctx.Locale.Tr "repo.pulls.merge_instruction_step1_desc"}}</div> |
| 4 | + <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}</div> |
| 5 | + {{$localBranch := .PullRequest.HeadBranch}} |
| 6 | + {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}} |
| 7 | + {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}} |
| 8 | + {{end}} |
5 | 9 | <div class="ui secondary segment">
|
6 |
| - {{if eq .Flow 0}} |
7 |
| - <div>git checkout -b {{if ne .HeadRepo.ID .BaseRepo.ID}}{{.HeadRepo.OwnerName}}-{{end}}{{.HeadBranch}} {{.BaseBranch}}</div> |
8 |
| - <div>git pull {{if ne .HeadRepo.ID .BaseRepo.ID}}<gitea-origin-url data-url="{{.HeadRepo.Link}}"></gitea-origin-url>{{else}}origin{{end}} {{.HeadBranch}}</div> |
| 10 | + {{if eq .PullRequest.Flow 0}} |
| 11 | + <div>git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}<gitea-origin-url data-url="{{.PullRequest.HeadRepo.Link}}"></gitea-origin-url>{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}</div> |
| 12 | + <div>git checkout {{$localBranch}}</div> |
9 | 13 | {{else}}
|
10 |
| - <div>git fetch origin {{.GetGitRefName}}:{{.HeadBranch}}</div> |
| 14 | + <div>git fetch -u origin {{.GetGitRefName}}:{{$localBranch}}</div> |
11 | 15 | {{end}}
|
12 | 16 | </div>
|
13 |
| - <div><h3 class="gt-dib">{{ctx.Locale.Tr "step2"}}</h3> {{ctx.Locale.Tr "repo.pulls.merge_instruction_step2_desc"}}</div> |
| 17 | + {{if .ShowMergeInstructions}} |
| 18 | + <div><h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}</div> |
14 | 19 | <div class="ui secondary segment">
|
15 |
| - <div>git checkout {{.BaseBranch}}</div> |
16 |
| - <div>git merge --no-ff {{if ne .HeadRepo.ID .BaseRepo.ID}}{{.HeadRepo.OwnerName}}-{{end}}{{.HeadBranch}}</div> |
17 |
| - <div>git push origin {{.BaseBranch}}</div> |
| 20 | + <div data-pull-merge-style="merge"> |
| 21 | + <div>git checkout {{.PullRequest.BaseBranch}}</div> |
| 22 | + <div>git merge --no-ff {{$localBranch}}</div> |
| 23 | + </div> |
| 24 | + <div class="gt-hidden" data-pull-merge-style="rebase"> |
| 25 | + <div>git checkout {{.PullRequest.BaseBranch}}</div> |
| 26 | + <div>git merge --ff-only {{$localBranch}}</div> |
| 27 | + </div> |
| 28 | + <div class="gt-hidden" data-pull-merge-style="rebase-merge"> |
| 29 | + <div>git checkout {{$localBranch}}</div> |
| 30 | + <div>git rebase {{.PullRequest.BaseBranch}}</div> |
| 31 | + <div>git checkout {{.PullRequest.BaseBranch}}</div> |
| 32 | + <div>git merge --no-ff {{$localBranch}}</div> |
| 33 | + </div> |
| 34 | + <div class="gt-hidden" data-pull-merge-style="squash"> |
| 35 | + <div>git checkout {{.PullRequest.BaseBranch}}</div> |
| 36 | + <div>git merge --squash {{$localBranch}}</div> |
| 37 | + </div> |
| 38 | + <div class="gt-hidden" data-pull-merge-style="manually-merged"> |
| 39 | + <div>git checkout {{.PullRequest.BaseBranch}}</div> |
| 40 | + <div>git merge {{$localBranch}}</div> |
| 41 | + </div> |
| 42 | + <div>git push origin {{.PullRequest.BaseBranch}}</div> |
18 | 43 | </div>
|
| 44 | + {{end}} |
19 | 45 | </div>
|
0 commit comments