summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorJulian <julian.toelle97@gmail.com>2018-12-27 11:27:08 +0100
committerLauris BH <lauris@nix.lv>2018-12-27 12:27:08 +0200
commit4a685f8b872a3d4c101c5e8165fa99e696c8fb45 (patch)
tree7ad36ee9bf87cec61ee0967a50037d9331d2ab58 /routers
parent58bdff53cd98e33791f91584d02887864aabc5c4 (diff)
downloadgitea-4a685f8b872a3d4c101c5e8165fa99e696c8fb45.tar.gz
gitea-4a685f8b872a3d4c101c5e8165fa99e696c8fb45.zip
Add rebase with merge commit merge style (#3844) (#4052)
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/issue.go2
-rw-r--r--routers/repo/pull.go3
-rw-r--r--routers/repo/setting.go1
3 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index 3600120fb5..f025cc3887 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -843,6 +843,8 @@ func ViewIssue(ctx *context.Context) {
ctx.Data["MergeStyle"] = models.MergeStyleMerge
} else if prConfig.AllowRebase {
ctx.Data["MergeStyle"] = models.MergeStyleRebase
+ } else if prConfig.AllowRebaseMerge {
+ ctx.Data["MergeStyle"] = models.MergeStyleRebaseMerge
} else if prConfig.AllowSquash {
ctx.Data["MergeStyle"] = models.MergeStyleSquash
} else {
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 0d5cec802c..b38ba3bf56 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -552,6 +552,9 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) {
if models.MergeStyle(form.Do) == models.MergeStyleMerge {
message = pr.GetDefaultMergeMessage()
}
+ if models.MergeStyle(form.Do) == models.MergeStyleRebaseMerge {
+ message = pr.GetDefaultMergeMessage()
+ }
if models.MergeStyle(form.Do) == models.MergeStyleSquash {
message = pr.GetDefaultSquashMessage()
}
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index f815171ac5..2bb57a0e47 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -227,6 +227,7 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
IgnoreWhitespaceConflicts: form.PullsIgnoreWhitespace,
AllowMerge: form.PullsAllowMerge,
AllowRebase: form.PullsAllowRebase,
+ AllowRebaseMerge: form.PullsAllowRebaseMerge,
AllowSquash: form.PullsAllowSquash,
},
})