Merge pull request #3083 from cli/update-notice-redirect

Avoid checking for new releases when authenticating git
This commit is contained in:
Mislav Marohnić 2021-03-04 17:52:09 +01:00 committed by GitHub
commit 6b483aa468
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,7 +236,7 @@ func shouldCheckForUpdate() bool {
if os.Getenv("CODESPACES") != "" {
return false
}
return updaterEnabled != "" && !isCI() && !isCompletionCommand() && utils.IsTerminal(os.Stderr)
return updaterEnabled != "" && !isCI() && utils.IsTerminal(os.Stdout) && utils.IsTerminal(os.Stderr)
}
// based on https://github.com/watson/ci-info/blob/HEAD/index.js
@ -246,10 +246,6 @@ func isCI() bool {
os.Getenv("RUN_ID") != "" // TaskCluster, dsari
}
func isCompletionCommand() bool {
return len(os.Args) > 1 && os.Args[1] == "completion"
}
func checkForUpdate(currentVersion string) (*update.ReleaseInfo, error) {
if !shouldCheckForUpdate() {
return nil, nil