diff --git a/modules/git/blame.go b/modules/git/blame.go index 6ef59dc824d..2d992f83b44 100644 --- a/modules/git/blame.go +++ b/modules/git/blame.go @@ -156,7 +156,7 @@ func CreateBlameReader(ctx context.Context, objectFormat ObjectFormat, repo Repo rd.bufferedReader = bufio.NewReader(stdoutReader) rd.cleanupFuncs = append(rd.cleanupFuncs, stdoutReaderClose) - if DefaultFeatures().CheckVersionAtLeast("2.23") && !bypassBlameIgnore { + if !bypassBlameIgnore { ignoreRevsFileName, ignoreRevsFileCleanup, err := tryCreateBlameIgnoreRevsFile(ctx, gitRepo, commit) if err != nil && !IsErrNotExist(err) { return nil, err diff --git a/modules/git/config.go b/modules/git/config.go index 648c708baab..c1b1e5fb50f 100644 --- a/modules/git/config.go +++ b/modules/git/config.go @@ -91,8 +91,7 @@ func syncGitConfig(ctx context.Context) (err error) { } } - // By default, partial clones are disabled, enable them from git v2.22 - if !setting.Git.DisablePartialClone && DefaultFeatures().CheckVersionAtLeast("2.22") { + if !setting.Git.DisablePartialClone { if err = configSet(ctx, "uploadpack.allowfilter", "true"); err != nil { return err } diff --git a/modules/git/git.go b/modules/git/git.go index 193e3837897..d2ab08061b4 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -24,7 +24,7 @@ import ( "github.com/hashicorp/go-version" ) -const RequiredVersion = "2.18.0" // the minimum Git version required +const RequiredVersion = "2.25.0" // the minimum Git version required type Features struct { gitVersion *version.Version diff --git a/services/pull/temp_repo.go b/services/pull/temp_repo.go index 8b06aa45e51..5fb295f1d05 100644 --- a/services/pull/temp_repo.go +++ b/services/pull/temp_repo.go @@ -90,11 +90,8 @@ func createTemporaryRepoForPR(ctx context.Context, pr *issues_model.PullRequest) remoteRepoName := "head_repo" - fetchArgs := gitcmd.TrustedCmdArgs{"--no-tags"} - 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") - } + // writing the commit graph can be slow and is not needed here + fetchArgs := gitcmd.TrustedCmdArgs{"--no-tags", "--no-write-commit-graph"} // addCacheRepo adds git alternatives for the cacheRepoPath in the repoPath addCacheRepo := func(repoPath, cacheRepoPath string) error {