Skip to content

Commit 8a9330d

Browse files
zeripathAbdulrhmnGhanem
authored andcommitted
Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git clients (go-gitea#19430)
Older git clients need uploadpack.allowAnySHA1InWant if partial cloning is allowed. Fix go-gitea#19118 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 7cec136 commit 8a9330d

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)