diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-05-07 00:34:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 18:34:16 +0200 |
commit | 7c613f100e032f821df88a75954fc50b1cf2f926 (patch) | |
tree | 18f73e576eb62a593395919b765e7583f1a1ba06 /services/pull | |
parent | 8e8ca6c6530e49e39f970bdfa84716ffda8973d0 (diff) | |
download | gitea-7c613f100e032f821df88a75954fc50b1cf2f926.tar.gz gitea-7c613f100e032f821df88a75954fc50b1cf2f926.zip |
Make sure git version&feature are always prepared (#30877)
Otherwise there would be more similar issues like #29287
Diffstat (limited to 'services/pull')
-rw-r--r-- | services/pull/patch.go | 2 | ||||
-rw-r--r-- | services/pull/temp_repo.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/patch.go b/services/pull/patch.go index 12b79a0625..981bc989fc 100644 --- a/services/pull/patch.go +++ b/services/pull/patch.go @@ -383,7 +383,7 @@ func checkConflicts(ctx context.Context, pr *issues_model.PullRequest, gitRepo * cmdApply.AddArguments("--ignore-whitespace") } is3way := false - if git.CheckGitVersionAtLeast("2.32.0") == nil { + if git.DefaultFeatures().CheckVersionAtLeast("2.32.0") { cmdApply.AddArguments("--3way") is3way = true } diff --git a/services/pull/temp_repo.go b/services/pull/temp_repo.go index 36bdbde55c..e5753178b8 100644 --- a/services/pull/temp_repo.go +++ b/services/pull/temp_repo.go @@ -104,7 +104,7 @@ func createTemporaryRepoForPR(ctx context.Context, pr *issues_model.PullRequest) baseBranch := "base" fetchArgs := git.TrustedCmdArgs{"--no-tags"} - if git.CheckGitVersionAtLeast("2.25.0") == nil { + if git.DefaultFeatures().CheckVersionAtLeast("2.25.0") { // Writing the commit graph can be slow and is not needed here fetchArgs = append(fetchArgs, "--no-write-commit-graph") } |