diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-01-06 06:38:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 06:38:38 +0100 |
commit | 4b3bfd7e89cd1527d500ac44c2564d398a6b681e (patch) | |
tree | 6931e90da5cb4ee603812d029723b924f00a9f68 /modules/git/git.go | |
parent | Add option to convert CRLF to LF line endings for sendmail (#18075) (diff) | |
download | forgejo-4b3bfd7e89cd1527d500ac44c2564d398a6b681e.tar.xz forgejo-4b3bfd7e89cd1527d500ac44c2564d398a6b681e.zip |
Enable partial clone by default (#18195)
- Enable partial clones(which are by default disabled from git) by
default, unless configured otherwise.
- Resolves #18190
Diffstat (limited to 'modules/git/git.go')
-rw-r--r-- | modules/git/git.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/git/git.go b/modules/git/git.go index e6c34979e8..cca5ce6714 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -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 |