mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 13:43:43 +09:00
chore: raise minimum git version to 2.25 (#39131)
This commit is contained in:
@@ -156,7 +156,7 @@ func CreateBlameReader(ctx context.Context, objectFormat ObjectFormat, repo Repo
|
|||||||
rd.bufferedReader = bufio.NewReader(stdoutReader)
|
rd.bufferedReader = bufio.NewReader(stdoutReader)
|
||||||
rd.cleanupFuncs = append(rd.cleanupFuncs, stdoutReaderClose)
|
rd.cleanupFuncs = append(rd.cleanupFuncs, stdoutReaderClose)
|
||||||
|
|
||||||
if DefaultFeatures().CheckVersionAtLeast("2.23") && !bypassBlameIgnore {
|
if !bypassBlameIgnore {
|
||||||
ignoreRevsFileName, ignoreRevsFileCleanup, err := tryCreateBlameIgnoreRevsFile(ctx, gitRepo, commit)
|
ignoreRevsFileName, ignoreRevsFileCleanup, err := tryCreateBlameIgnoreRevsFile(ctx, gitRepo, commit)
|
||||||
if err != nil && !IsErrNotExist(err) {
|
if err != nil && !IsErrNotExist(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@@ -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 {
|
||||||
if !setting.Git.DisablePartialClone && DefaultFeatures().CheckVersionAtLeast("2.22") {
|
|
||||||
if err = configSet(ctx, "uploadpack.allowfilter", "true"); err != nil {
|
if err = configSet(ctx, "uploadpack.allowfilter", "true"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/hashicorp/go-version"
|
"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 {
|
type Features struct {
|
||||||
gitVersion *version.Version
|
gitVersion *version.Version
|
||||||
|
|||||||
@@ -90,11 +90,8 @@ func createTemporaryRepoForPR(ctx context.Context, pr *issues_model.PullRequest)
|
|||||||
|
|
||||||
remoteRepoName := "head_repo"
|
remoteRepoName := "head_repo"
|
||||||
|
|
||||||
fetchArgs := gitcmd.TrustedCmdArgs{"--no-tags"}
|
// writing the commit graph can be slow and is not needed here
|
||||||
if git.DefaultFeatures().CheckVersionAtLeast("2.25.0") {
|
fetchArgs := gitcmd.TrustedCmdArgs{"--no-tags", "--no-write-commit-graph"}
|
||||||
// Writing the commit graph can be slow and is not needed here
|
|
||||||
fetchArgs = append(fetchArgs, "--no-write-commit-graph")
|
|
||||||
}
|
|
||||||
|
|
||||||
// addCacheRepo adds git alternatives for the cacheRepoPath in the repoPath
|
// addCacheRepo adds git alternatives for the cacheRepoPath in the repoPath
|
||||||
addCacheRepo := func(repoPath, cacheRepoPath string) error {
|
addCacheRepo := func(repoPath, cacheRepoPath string) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user