diff options
author | Lauris BH <lauris@nix.lv> | 2018-01-05 20:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-05 20:56:50 +0200 |
commit | 8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9 (patch) | |
tree | cf9b661996134da3e39aa6ddd2af4e13f7dbf30f /modules | |
parent | a192f3052ed9b59d1404fdcebf2b5c156d6d6969 (diff) | |
download | gitea-8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9.tar.gz gitea-8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9.zip |
Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188)
* Pull request options migration and UI in settings
* Add ignore whitespace functionality
* Fix settings if pull requests are disabled
* Fix migration transaction
* Merge with Rebase functionality
* UI changes and related functionality for pull request merging button
* Implement squash functionality
* Fix rebase merging
* Fix pull request merge tests
* Add squash and rebase tests
* Fix API method to reuse default message functions
* Some refactoring and small fixes
* Remove more hardcoded values from tests
* Remove unneeded check from API method
* Fix variable name and comment typo
* Fix reset commit count after PR merge
Diffstat (limited to 'modules')
-rw-r--r-- | modules/auth/repo_form.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 221f7221a4..634274c4e8 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -107,6 +107,10 @@ type RepoSettingForm struct { TrackerURLFormat string TrackerIssueStyle string EnablePulls bool + PullsIgnoreWhitespace bool + PullsAllowMerge bool + PullsAllowRebase bool + PullsAllowSquash bool EnableTimetracker bool AllowOnlyContributorsToTrackTime bool } @@ -326,6 +330,25 @@ func (f *InitializeLabelsForm) Validate(ctx *macaron.Context, errs binding.Error return validate(errs, ctx.Data, f, ctx.Locale) } +// __________ .__ .__ __________ __ +// \______ \__ __| | | | \______ \ ____ ________ __ ____ _______/ |_ +// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\ +// | | | | / |_| |__ | | \ ___< <_| | | /\ ___/ \___ \ | | +// |____| |____/|____/____/ |____|_ /\___ >__ |____/ \___ >____ > |__| +// \/ \/ |__| \/ \/ + +// MergePullRequestForm form for merging Pull Request +type MergePullRequestForm struct { + Do string `binding:"Required;In(merge,rebase,squash)"` + MergeTitleField string + MergeMessageField string +} + +// Validate validates the fields +func (f *MergePullRequestForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { + return validate(errs, ctx.Data, f, ctx.Locale) +} + // __________ .__ // \______ \ ____ | | ____ _____ ______ ____ // | _// __ \| | _/ __ \\__ \ / ___// __ \ |