diff options
author | parnic <github@parnic.com> | 2021-03-27 09:55:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 15:55:40 +0100 |
commit | f4d27498bdc615605e14f783501e1d1256cd8d22 (patch) | |
tree | 8d04695b060bd8bac65b4a0d669628fe220a23e6 /modules/convert | |
parent | 6b836ac5f7546bc9ffb118b213dba92d3dd9ba8e (diff) | |
download | gitea-f4d27498bdc615605e14f783501e1d1256cd8d22.tar.gz gitea-f4d27498bdc615605e14f783501e1d1256cd8d22.zip |
Add DefaultMergeStyle option to repository (#14789)
Fixes #12293
Diffstat (limited to 'modules/convert')
-rw-r--r-- | modules/convert/repository.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/convert/repository.go b/modules/convert/repository.go index 813201ca68..63a22bb04e 100644 --- a/modules/convert/repository.go +++ b/modules/convert/repository.go @@ -71,6 +71,7 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool) allowRebase := false allowRebaseMerge := false allowSquash := false + defaultMergeStyle := models.MergeStyleMerge if unit, err := repo.GetUnit(models.UnitTypePullRequests); err == nil { config := unit.PullRequestsConfig() hasPullRequests = true @@ -79,6 +80,7 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool) allowRebase = config.AllowRebase allowRebaseMerge = config.AllowRebaseMerge allowSquash = config.AllowSquash + defaultMergeStyle = config.GetDefaultMergeStyle() } hasProjects := false if _, err := repo.GetUnit(models.UnitTypeProjects); err == nil { @@ -139,6 +141,7 @@ func innerToRepo(repo *models.Repository, mode models.AccessMode, isParent bool) AllowRebase: allowRebase, AllowRebaseMerge: allowRebaseMerge, AllowSquash: allowSquash, + DefaultMergeStyle: string(defaultMergeStyle), AvatarURL: repo.AvatarLink(), Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate, MirrorInterval: mirrorInterval, |