Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Commit

Permalink
Pass all env variables to git on git clone to fix SSH (#226)
Browse files Browse the repository at this point in the history
All env variables are now passed to the Command calling git clone so git
will know about custom SSH configs in host.
  • Loading branch information
evanlouie authored Jul 13, 2019
1 parent 2ab2775 commit 179a92c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (cache *gitCache) cloneRepo(repo string, commit string, branch string) chan
log.Info(emoji.Sprintf(":helicopter: Cloning %s => %s", cacheToken, clonePathOnFS))
cloneCommandArgs = append(cloneCommandArgs, clonePathOnFS)
cloneCommand := exec.Command("git", cloneCommandArgs...)
cloneCommand.Env = append(cloneCommand.Env, os.Environ()...) // pass all env variables to git command to proper SSH config is passed if needed
cloneCommand.Env = append(cloneCommand.Env, "GIT_TERMINAL_PROMPT=0") // tell git to fail if it asks for credentials

// TODO: implement usage of custom SSH key
Expand Down

0 comments on commit 179a92c

Please sign in to comment.