summaryrefslogtreecommitdiffstats
path: root/services/gitdiff/gitdiff.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-05-07 10:07:33 +0800
committerGitHub <noreply@github.com>2024-05-07 02:07:33 +0000
commitd5563be0eeba8e46d8d0e9974c55fa20519f968f (patch)
treed584a09b9d53863326b472f5649f065f78725705 /services/gitdiff/gitdiff.go
parentad5a8d043c6818c0c496ebae2f5ea9373219bcd6 (diff)
downloadgitea-d5563be0eeba8e46d8d0e9974c55fa20519f968f.tar.gz
gitea-d5563be0eeba8e46d8d0e9974c55fa20519f968f.zip
Make sure git version&feature are always prepared (#30877) (#30879)
Backport #30877
Diffstat (limited to 'services/gitdiff/gitdiff.go')
-rw-r--r--services/gitdiff/gitdiff.go2
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 = ""
}