diff --git a/error.py b/error.py index 7958a0a1..36bc2129 100644 --- a/error.py +++ b/error.py @@ -107,6 +107,10 @@ class GitError(RepoError): return self.message +class GitAuthError(RepoExitError): + """Cannot talk to remote due to auth issue.""" + + class GitcUnsupportedError(RepoExitError): """Gitc no longer supported.""" diff --git a/project.py b/project.py index b29e604f..88dd747b 100644 --- a/project.py +++ b/project.py @@ -32,6 +32,7 @@ import urllib.parse from color import Coloring from error import DownloadError +from error import GitAuthError from error import GitError from error import ManifestInvalidPathError from error import ManifestInvalidRevisionError @@ -2713,6 +2714,20 @@ class Project: file=output_redir, ) break + elif ( + ret == 128 + and gitcmd.stdout + and "remote helper 'sso' aborted session" in gitcmd.stdout + ): + # User needs to be authenticated, and Git wants to prompt for + # username and password. + print( + "git requires authentication, but repo cannot perform " + "interactive authentication.", + file=output_redir, + ) + raise GitAuthError(gitcmd.stdout) + break elif current_branch_only and is_sha1 and ret == 128: # Exit code 128 means "couldn't find the ref you asked for"; if # we're in sha1 mode, we just tried sync'ing from the upstream