Skip to content

Commit 0762bd8

Browse files
committed
Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git clients
Older git clients need uploadpack.allowAnySHA1InWant if partial cloning is allowed. Fix go-gitea#19118 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 18727df commit 0762bd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/git/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func Init(ctx context.Context) error {
148148

149149
// By default partial clones are disabled, enable them from git v2.22
150150
if !setting.Git.DisablePartialClone && CheckGitVersionAtLeast("2.22") == nil {
151-
globalCommandArgs = append(globalCommandArgs, "-c", "uploadpack.allowfilter=true")
151+
globalCommandArgs = append(globalCommandArgs, "-c", "uploadpack.allowfilter=true", "-c", "uploadpack.allowAnySHA1InWant=true")
152152
}
153153

154154
// Save current git version on init to gitVersion otherwise it would require an RWMutex

0 commit comments

Comments
 (0)