зеркало из https://github.com/golang/dep.git
gps: vcs: suppress git password prompts
This commit is contained in:
Родитель
4ecb1d1fb9
Коммит
8065bb2db9
|
@ -4,6 +4,7 @@ BUG FIXES:
|
|||
|
||||
* Releases targeting Windows now have a `.exe` suffix (#1291).
|
||||
* Adaptively recover from dirty and corrupted git repositories in cache (#1279).
|
||||
* Suppress git password prompts in more places (#1357).
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
|
|
|
@ -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()...))
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return newVcsRemoteErrorOr(err, cmd.Args(), string(out),
|
||||
"unable to get repository")
|
||||
|
@ -110,6 +112,8 @@ func (r *gitRepo) fetch(ctx context.Context) error {
|
|||
r.RemoteLocation,
|
||||
)
|
||||
cmd.SetDir(r.LocalPath())
|
||||
// Ensure no prompting for PWs
|
||||
cmd.SetEnv(append([]string{"GIT_ASKPASS=", "GIT_TERMINAL_PROMPT=0"}, os.Environ()...))
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return newVcsRemoteErrorOr(err, cmd.Args(), string(out),
|
||||
"unable to update repository")
|
||||
|
@ -142,6 +146,8 @@ func (r *gitRepo) defendAgainstSubmodules(ctx context.Context) error {
|
|||
"--recursive",
|
||||
)
|
||||
cmd.SetDir(r.LocalPath())
|
||||
// Ensure no prompting for PWs
|
||||
cmd.SetEnv(append([]string{"GIT_ASKPASS=", "GIT_TERMINAL_PROMPT=0"}, os.Environ()...))
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return newVcsLocalErrorOr(err, cmd.Args(), string(out),
|
||||
"unexpected error while defensively updating submodules")
|
||||
|
|
Загрузка…
Ссылка в новой задаче