diff --git a/services/pull/merge_tree.go b/services/pull/merge_tree.go index 43e1d93fea..d62da43b4b 100644 --- a/services/pull/merge_tree.go +++ b/services/pull/merge_tree.go @@ -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 diff --git a/services/pull/patch.go b/services/pull/patch.go index f619f7fecf..8a96cd8f96 100644 --- a/services/pull/patch.go +++ b/services/pull/patch.go @@ -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) }