diff options
author | 6543 <6543@obermui.de> | 2022-04-20 20:54:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 20:54:36 +0200 |
commit | a785c46ca8d046b06d442845eb7e02bb87c09b80 (patch) | |
tree | 12d3137cd0011451caabe64e8c1f74851a2272c4 | |
parent | 6bddfd3086e198daf103e3db7234a04432ed8e40 (diff) | |
download | gitea-a785c46ca8d046b06d442845eb7e02bb87c09b80.tar.gz gitea-a785c46ca8d046b06d442845eb7e02bb87c09b80.zip |
Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git clients (#19430) (#19438)
Older git clients need uploadpack.allowAnySHA1InWant if partial cloning is allowed.
Fix #19118
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r-- | modules/git/git.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/git/git.go b/modules/git/git.go index cca5ce6714..bc4c4b833e 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -112,8 +112,8 @@ func SetExecutablePath(path string) error { // VersionInfo returns git version information func VersionInfo() string { - var format = "Git Version: %s" - var args = []interface{}{gitVersion.Original()} + format := "Git Version: %s" + args := []interface{}{gitVersion.Original()} // Since git wire protocol has been released from git v2.18 if setting.Git.EnableAutoGitWireProtocol && CheckGitVersionAtLeast("2.18") == nil { format += ", Wire Protocol %s Enabled" @@ -148,7 +148,7 @@ func Init(ctx context.Context) error { // 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") + GlobalCommandArgs = append(GlobalCommandArgs, "-c", "uploadpack.allowfilter=true", "-c", "uploadpack.allowAnySHA1InWant=true") } // Save current git version on init to gitVersion otherwise it would require an RWMutex |