aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authormharinder <mharinder@yandex.com>2017-10-01 05:37:24 -0700
committerUnknwon <u@gogs.io>2017-11-15 23:28:23 -0500
commit5cd1fdeb9ee1af1179a859dc5ed65561bfe5a6d6 (patch)
treef0c36bfd3a763cf7489da93d4d015c8c7fd252b6 /routes
parentdbe6de313efdff942d16b82b63f02fa10d8fc170 (diff)
pull: add an option to use rebase for merging pull requests
For DVCS, either merge or rebase works for getting new code in a pull request in the main branch. The rebase workflow produces a linear history which is cleaner, and more bisect-able. This commit adds a repo-level option to enable the rebase workflow. Once enabled, "Merge Pull Request" will be replaced by "Rebase and Merge Pull Request" which does exactly what the user wants. It's unlikely a project wants a mixed-use of both rebase and merge workflows, therefore the feature is not implemented as a drop-down button like what GitHub does (https://github.com/blog/2243-rebase-and-merge-pull-requests).
Diffstat (limited to 'routes')
-rw-r--r--routes/repo/setting.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routes/repo/setting.go b/routes/repo/setting.go
index 71369320..8e244b6e 100644
--- a/routes/repo/setting.go
+++ b/routes/repo/setting.go
@@ -147,6 +147,7 @@ func SettingsPost(c *context.Context, f form.RepoSetting) {
repo.ExternalTrackerFormat = f.TrackerURLFormat
repo.ExternalTrackerStyle = f.TrackerIssueStyle
repo.EnablePulls = f.EnablePulls
+ repo.PullUseRebase = f.PullUseRebase
if err := models.UpdateRepository(repo, false); err != nil {
c.ServerError("UpdateRepository", err)