Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10] builder: fix running git commands on Windows #44332

Merged
merged 2 commits into from Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion builder/remotecontext/git/gitutils.go
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down