diff options
-rw-r--r-- | error.py | 4 | ||||
-rw-r--r-- | project.py | 15 |
2 files changed, 19 insertions, 0 deletions
@@ -107,6 +107,10 @@ class GitError(RepoError): | |||
107 | return self.message | 107 | return self.message |
108 | 108 | ||
109 | 109 | ||
110 | class GitAuthError(RepoExitError): | ||
111 | """Cannot talk to remote due to auth issue.""" | ||
112 | |||
113 | |||
110 | class GitcUnsupportedError(RepoExitError): | 114 | class GitcUnsupportedError(RepoExitError): |
111 | """Gitc no longer supported.""" | 115 | """Gitc no longer supported.""" |
112 | 116 | ||
@@ -32,6 +32,7 @@ import urllib.parse | |||
32 | 32 | ||
33 | from color import Coloring | 33 | from color import Coloring |
34 | from error import DownloadError | 34 | from error import DownloadError |
35 | from error import GitAuthError | ||
35 | from error import GitError | 36 | from error import GitError |
36 | from error import ManifestInvalidPathError | 37 | from error import ManifestInvalidPathError |
37 | from error import ManifestInvalidRevisionError | 38 | from error import ManifestInvalidRevisionError |
@@ -2713,6 +2714,20 @@ class Project: | |||
2713 | file=output_redir, | 2714 | file=output_redir, |
2714 | ) | 2715 | ) |
2715 | break | 2716 | break |
2717 | elif ( | ||
2718 | ret == 128 | ||
2719 | and gitcmd.stdout | ||
2720 | and "remote helper 'sso' aborted session" in gitcmd.stdout | ||
2721 | ): | ||
2722 | # User needs to be authenticated, and Git wants to prompt for | ||
2723 | # username and password. | ||
2724 | print( | ||
2725 | "git requires authentication, but repo cannot perform " | ||
2726 | "interactive authentication.", | ||
2727 | file=output_redir, | ||
2728 | ) | ||
2729 | raise GitAuthError(gitcmd.stdout) | ||
2730 | break | ||
2716 | elif current_branch_only and is_sha1 and ret == 128: | 2731 | elif current_branch_only and is_sha1 and ret == 128: |
2717 | # Exit code 128 means "couldn't find the ref you asked for"; if | 2732 | # Exit code 128 means "couldn't find the ref you asked for"; if |
2718 | # we're in sha1 mode, we just tried sync'ing from the upstream | 2733 | # we're in sha1 mode, we just tried sync'ing from the upstream |