0
0
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:
Lunny Xiao 2026-01-17 12:00:22 -08:00
parent 6aa99416a7
commit b802e0840e
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 2 additions and 7 deletions

View File

@ -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

View File

@ -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)
}