diff --git a/cli/gitaskpass.go b/cli/gitaskpass.go index 52af8b31da8a9..3930fe16c8a57 100644 --- a/cli/gitaskpass.go +++ b/cli/gitaskpass.go @@ -51,7 +51,7 @@ func gitAskpass() *cobra.Command { return xerrors.Errorf("get git token: %w", err) } if token.URL != "" { - if err := openURL(cmd, token.URL); err != nil { + if err := openURL(cmd, token.URL); err == nil { cmd.Printf("Your browser has been opened to authenticate with Git:\n\n\t%s\n\n", token.URL) } else { cmd.Printf("Open the following URL to authenticate with Git:\n\n\t%s\n\n", token.URL)