Commit 4dc49d23 authored by Burcu Dogan's avatar Burcu Dogan Committed by Andrew Gerrand

cmd/go: don't override GIT_TERMINAL_PROMPT

This CL keeps disallowing `go get` from falling to the prompt unless
user has set GIT_TERMINAL_PROMPT env variable. If GIT_TERMINAL_PROMPT
is set, go-get will not override its value and will prompt for
username/password in the case of GIT_TERMINAL_PROMPT=1.

Fixes #12706.

Change-Id: Ibd6b1100af6b04fb8114279cdcf608943e7765be
Reviewed-on: https://go-review.googlesource.com/16091Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
parent 88fa2e0b
......@@ -84,8 +84,12 @@ func runGet(cmd *Command, args []string) {
// Disable any prompting for passwords by Git.
// Only has an effect for 2.3.0 or later, but avoiding
// the prompt in earlier versions is just too hard.
// See golang.org/issue/9341.
os.Setenv("GIT_TERMINAL_PROMPT", "0")
// If user has explicitly set GIT_TERMINAL_PROMPT=1, keep
// prompting.
// See golang.org/issue/9341 and golang.org/issue/12706.
if v := os.Getenv("GIT_TERMINAL_PROMPT"); v == "" {
os.Setenv("GIT_TERMINAL_PROMPT", "0")
}
// Phase 1. Download/update.
var stk importStack
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment