mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Enable partial clone by default (#18195)
- Enable partial clones(which are by default disabled from git) by default, unless configured otherwise. - Resolves #18190
This commit is contained in:
@@ -146,6 +146,11 @@ func Init(ctx context.Context) error {
|
||||
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "protocol.version=2")
|
||||
}
|
||||
|
||||
// By default partial clones are disabled, enable them from git v2.22
|
||||
if !setting.Git.DisablePartialClone && CheckGitVersionAtLeast("2.22") == nil {
|
||||
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "uploadpack.allowfilter=true")
|
||||
}
|
||||
|
||||
// Save current git version on init to gitVersion otherwise it would require an RWMutex
|
||||
if err := LoadGitVersion(); err != nil {
|
||||
return err
|
||||
|
@@ -27,6 +27,7 @@ var (
|
||||
PullRequestPushMessage bool
|
||||
LargeObjectThreshold int64
|
||||
DisableCoreProtectNTFS bool
|
||||
DisablePartialClone bool
|
||||
Timeout struct {
|
||||
Default int
|
||||
Migrate int
|
||||
@@ -48,6 +49,7 @@ var (
|
||||
EnableAutoGitWireProtocol: true,
|
||||
PullRequestPushMessage: true,
|
||||
LargeObjectThreshold: 1024 * 1024,
|
||||
DisablePartialClone: false,
|
||||
Timeout: struct {
|
||||
Default int
|
||||
Migrate int
|
||||
|
Reference in New Issue
Block a user