mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-30 03:50:30 +01:00
Some improvements
This commit is contained in:
parent
6aa99416a7
commit
b802e0840e
@ -1,5 +1,4 @@
|
||||
// Copyright 2025 The Gitea Authors.
|
||||
// All rights reserved.
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pull
|
||||
@ -17,10 +16,6 @@ import (
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
func shouldUseMergeTree(pr *issues_model.PullRequest) bool {
|
||||
return pr.Flow == issues_model.PullRequestFlowGithub && git.DefaultFeatures().SupportGitMergeTree
|
||||
}
|
||||
|
||||
// checkConflictsMergeTree uses git merge-tree to check for conflicts and if none are found checks if the patch is empty
|
||||
// return true if there is conflicts otherwise return false
|
||||
// pr.Status and pr.ConflictedFiles will be updated as necessary
|
||||
|
||||
@ -71,7 +71,7 @@ func testPullRequestBranchMergeable(pr *issues_model.PullRequest) error {
|
||||
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("testPullRequestBranchMergeable: %s", pr))
|
||||
defer finished()
|
||||
|
||||
if shouldUseMergeTree(pr) {
|
||||
if git.DefaultFeatures().SupportGitMergeTree {
|
||||
return testPullRequestMergeTree(ctx, pr)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user