Skip to content

Commit

Permalink
Fix enabling partial clones on 1.17 (#21809)
Browse files Browse the repository at this point in the history
When backporting #20902 in #21058 there was a slight misbackport. It was
missed that we needed to remove the global command option before setting
the settings.

Fix #21805

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Nov 14, 2022
1 parent 9dc53ba commit 65b5c8e
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions modules/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ func InitOnceWithSync(ctx context.Context) (err 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", "-c", "uploadpack.allowAnySHA1InWant=true")
}

// Explicitly disable credential helper, otherwise Git credentials might leak
if CheckGitVersionAtLeast("2.9") == nil {
globalCommandArgs = append(globalCommandArgs, "-c", "credential.helper=")
Expand Down

0 comments on commit 65b5c8e

Please sign in to comment.