-
Notifications
You must be signed in to change notification settings - Fork 1k
gps: vcs: suppress git password prompts #1357
Conversation
tip $GOCACHE CI failures:
|
internal/gps/vcs_repo.go
Outdated
@@ -92,6 +92,8 @@ func (r *gitRepo) get(ctx context.Context) error { | |||
r.Remote(), | |||
r.LocalPath(), | |||
) | |||
// Ensure no prompting for PWs | |||
cmd.SetEnv(append([]string{"GIT_ASKPASS=", "GIT_TERMINAL_PROMPT=0"}, os.Environ()...)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When dep runs git commands, does it inherit our current environment variables? I'm wondering if we can just set the environment variable once, instead of directly on the git command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure - I copied from this:
Lines 241 to 246 in 80e94e8
func (s *gitSource) listVersions(ctx context.Context) (vlist []PairedVersion, err error) { | |
r := s.repo | |
cmd := commandContext(ctx, "git", "ls-remote", r.Remote()) | |
// Ensure no prompting for PWs | |
cmd.SetEnv(append([]string{"GIT_ASKPASS=", "GIT_TERMINAL_PROMPT=0"}, os.Environ()...)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha, yeah it doesn't inherit any environment variables then. 👍
This now includes a bonus commit to resolve some intermittent appveyor failures. |
If you fix our AppVeyor builds I owe you a lb of chocolates and your beverage of choice! 👍 |
What does this do / why do we need it?
This change suppresses git password prompts in more places. Cherry picked from #1250 (f1f0bac).
Which issue(s) does this PR fix?
It might fix: #1356