From 7c613f100e032f821df88a75954fc50b1cf2f926 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 7 May 2024 00:34:16 +0800 Subject: Make sure git version&feature are always prepared (#30877) Otherwise there would be more similar issues like #29287 --- services/gitdiff/gitdiff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/gitdiff') diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index d115686491..3a35d24dff 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -1143,7 +1143,7 @@ func GetDiff(ctx context.Context, gitRepo *git.Repository, opts *DiffOptions, fi // so if we are using at least this version of git we don't have to tell ParsePatch to do // the skipping for us parsePatchSkipToFile := opts.SkipTo - if opts.SkipTo != "" && git.CheckGitVersionAtLeast("2.31") == nil { + if opts.SkipTo != "" && git.DefaultFeatures().CheckVersionAtLeast("2.31") { cmdDiff.AddOptionFormat("--skip-to=%s", opts.SkipTo) parsePatchSkipToFile = "" } -- cgit v1.2.3