From 80dc5186ec7fd122ad755e32febf851216b59e9a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 21 Oct 2022 17:41:41 +0200 Subject: [PATCH] builder/remotecontext/git: allow building on go1.18 cmd.Environ() is new in go1.19, and not needed for this specific case. Without this, trying to use this package in code that uses go1.18 will fail; builder/remotecontext/git/gitutils.go:216:23: cmd.Environ undefined (type *exec.Cmd has no field or method Environ) Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 4fdc1bb1fb4bba22bc8cf8beccc37b3af284b4a7) Signed-off-by: Sebastiaan van Stijn --- builder/remotecontext/git/gitutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/remotecontext/git/gitutils.go b/builder/remotecontext/git/gitutils.go index 6af957c40f..c20f8da75b 100644 --- a/builder/remotecontext/git/gitutils.go +++ b/builder/remotecontext/git/gitutils.go @@ -213,7 +213,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.Environ(), "GIT_PROTOCOL_FROM_USER=0") + cmd.Env = append(os.Environ(), "GIT_PROTOCOL_FROM_USER=0") if repo.isolateConfig { cmd.Env = append(cmd.Env,