Unexport git.GlobalCommandArgs (#18376)
Unexport the git.GlobalCommandArgs variable.
This commit is contained in:
parent
93250bfe27
commit
80adbebbc8
8 changed files with 39 additions and 39 deletions
|
@ -134,21 +134,21 @@ func Init(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// force cleanup args
|
||||
GlobalCommandArgs = []string{}
|
||||
globalCommandArgs = []string{}
|
||||
|
||||
if CheckGitVersionAtLeast("2.9") == nil {
|
||||
// Explicitly disable credential helper, otherwise Git credentials might leak
|
||||
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "credential.helper=")
|
||||
globalCommandArgs = append(globalCommandArgs, "-c", "credential.helper=")
|
||||
}
|
||||
|
||||
// Since git wire protocol has been released from git v2.18
|
||||
if setting.Git.EnableAutoGitWireProtocol && CheckGitVersionAtLeast("2.18") == nil {
|
||||
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "protocol.version=2")
|
||||
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")
|
||||
globalCommandArgs = append(globalCommandArgs, "-c", "uploadpack.allowfilter=true")
|
||||
}
|
||||
|
||||
// Save current git version on init to gitVersion otherwise it would require an RWMutex
|
||||
|
@ -213,7 +213,7 @@ func Init(ctx context.Context) error {
|
|||
if err := checkAndSetConfig("core.protectntfs", "false", true); err != nil {
|
||||
return err
|
||||
}
|
||||
GlobalCommandArgs = append(GlobalCommandArgs, "-c", "core.protectntfs=false")
|
||||
globalCommandArgs = append(globalCommandArgs, "-c", "core.protectntfs=false")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue