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/gitdiff/gitdiff.go | |
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/gitdiff/gitdiff.go')
-rw-r--r-- | services/gitdiff/gitdiff.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 = "" } |