Merge pull request #44332 from corhere/backport-20.10/fix-git-windows-environ
[20.10] builder: fix running git commands on Windows
This commit is contained in:
commit
93c2c3bc60
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ type gitRepo struct {
|
|||
isolateConfig bool
|
||||
}
|
||||
|
||||
// CloneOption changes the behaviour of Clone().
|
||||
type CloneOption func(*gitRepo)
|
||||
|
||||
// WithIsolatedConfig disables reading the user or system gitconfig files when
|
||||
|
@ -213,7 +214,7 @@ func (repo gitRepo) gitWithinDir(dir string, args ...string) ([]byte, error) {
|
|||
cmd := exec.Command("git", args...)
|
||||
cmd.Dir = dir
|
||||
// Disable unsafe remote protocols.
|
||||
cmd.Env = append(cmd.Env, "GIT_PROTOCOL_FROM_USER=0")
|
||||
cmd.Env = append(os.Environ(), "GIT_PROTOCOL_FROM_USER=0")
|
||||
|
||||
if repo.isolateConfig {
|
||||
cmd.Env = append(cmd.Env,
|
||||
|
|
Loading…
Reference in a new issue