Skip to content

Commit 9633f33

Browse files
authored
Add warning message in merge instructions when AutodetectManualMerge was not enabled (#31805)
not enabled quick-f-i-x #31433 ? , maybe need more disscusion about better solutions. example view: ![image](https://github.com/user-attachments/assets/2af7e1e8-42b9-4473-89c7-12d4a9205d3f) adtion notes about how to enable `AutodetectManualMerge` ![image](https://github.com/user-attachments/assets/28f84317-367a-40d8-b50d-a19ef7c664d4) Signed-off-by: a1012112796 <[email protected]>
1 parent df27846 commit 9633f33

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,7 @@ pulls.cmd_instruction_checkout_title = Checkout
18911891
pulls.cmd_instruction_checkout_desc = From your project repository, check out a new branch and test the changes.
18921892
pulls.cmd_instruction_merge_title = Merge
18931893
pulls.cmd_instruction_merge_desc = Merge the changes and update on Gitea.
1894+
pulls.cmd_instruction_merge_warning = Warning: This operation can not merge pull request because "autodetect manual merge" was not enable
18941895
pulls.clear_merge_message = Clear merge message
18951896
pulls.clear_merge_message_hint = Clearing the merge message will only remove the commit message content and keep generated git trailers such as "Co-Authored-By …".
18961897

routers/web/repo/issue.go

+2
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,8 @@ func ViewIssue(ctx *context.Context) {
18691869
}
18701870
prConfig := prUnit.PullRequestsConfig()
18711871

1872+
ctx.Data["AutodetectManualMerge"] = prConfig.AutodetectManualMerge
1873+
18721874
var mergeStyle repo_model.MergeStyle
18731875
// Check correct values and select default
18741876
if ms, ok := ctx.Data["MergeStyle"].(repo_model.MergeStyle); !ok ||

templates/repo/issue/view_content/pull_merge_instruction.tmpl

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
<div>git checkout {{$localBranch}}</div>
1616
</div>
1717
{{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>
18+
<div>
19+
<h3>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}</h3>
20+
{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
21+
{{if not .AutodetectManualMerge}}
22+
<div>{{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_warning"}}</div>
23+
{{end}}
24+
</div>
1925
<div class="ui secondary segment">
2026
<div data-pull-merge-style="merge">
2127
<div>git checkout {{.PullRequest.BaseBranch}}</div>

0 commit comments

Comments
 (0)