diff options
author | Viktor Suprun <popsul1993@gmail.com> | 2020-11-03 22:35:09 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-03 13:35:09 +0200 |
commit | 7d16e6db8e1bdcbe12949ffc1f3239279772d1cc (patch) | |
tree | 00c1d474e86534a1b5e3cd099d5f001e00eb0d67 | |
parent | be880d4063c336327bb9766e4dba4355e725c675 (diff) | |
download | gitea-7d16e6db8e1bdcbe12949ffc1f3239279772d1cc.tar.gz gitea-7d16e6db8e1bdcbe12949ffc1f3239279772d1cc.zip |
Fixed git args duplication (#13411)
Because newGit() invoked twice (inside PreInstallInit() and
GlobalInit()) and git parameters is global object, all
git commands call with duplicated args
`-c credential.helper= -c protocol.version=2`
-rw-r--r-- | modules/setting/git.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/setting/git.go b/modules/setting/git.go index 968de55753..80170e37bf 100644 --- a/modules/setting/git.go +++ b/modules/setting/git.go @@ -74,6 +74,9 @@ func newGit() { log.Fatal("Error retrieving git version: %v", err) } + // force cleanup args + git.GlobalCommandArgs = []string{} + if git.CheckGitVersionAtLeast("2.9") == nil { // Explicitly disable credential helper, otherwise Git credentials might leak git.GlobalCommandArgs = append(git.GlobalCommandArgs, "-c", "credential.helper=") |