mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
@@ -102,6 +102,7 @@ type PullRequestsConfig struct {
|
||||
AllowSquash bool
|
||||
AllowManualMerge bool
|
||||
AutodetectManualMerge bool
|
||||
DefaultMergeStyle MergeStyle
|
||||
}
|
||||
|
||||
// FromDB fills up a PullRequestsConfig from serialized format.
|
||||
@@ -125,6 +126,15 @@ func (cfg *PullRequestsConfig) IsMergeStyleAllowed(mergeStyle MergeStyle) bool {
|
||||
mergeStyle == MergeStyleManuallyMerged && cfg.AllowManualMerge
|
||||
}
|
||||
|
||||
// GetDefaultMergeStyle returns the default merge style for this pull request
|
||||
func (cfg *PullRequestsConfig) GetDefaultMergeStyle() MergeStyle {
|
||||
if len(cfg.DefaultMergeStyle) != 0 {
|
||||
return cfg.DefaultMergeStyle
|
||||
}
|
||||
|
||||
return MergeStyleMerge
|
||||
}
|
||||
|
||||
// AllowedMergeStyleCount returns the total count of allowed merge styles for the PullRequestsConfig
|
||||
func (cfg *PullRequestsConfig) AllowedMergeStyleCount() int {
|
||||
count := 0
|
||||
|
Reference in New Issue
Block a user