Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 9bc7d52e753afacf9f65851cad597e78e03e5bca..eb66039a7154651415691a42cbfeb2a9960ad6eb 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -589,6 +589,7 @@ class Settings(object): |
self.updated = False |
self.is_gerrit = None |
self.squash_gerrit_uploads = None |
+ self.gerrit_skip_ensure_authenticated = None |
self.git_editor = None |
self.project = None |
self.force_https_commit_url = None |
@@ -771,6 +772,15 @@ class Settings(object): |
error_ok=True).strip() == 'true') |
return self.squash_gerrit_uploads |
+ def GetGerritSkipEnsureAuthenticated(self): |
+ """Return True if EnsureAuthenticated should not be done for Gerrit |
+ uploads.""" |
+ if self.gerrit_skip_ensure_authenticated is None: |
+ self.gerrit_skip_ensure_authenticated = ( |
+ RunGit(['config', '--bool', 'gerrit.skip_ensure_authenticated'], |
+ error_ok=True).strip() == 'true') |
+ return self.gerrit_skip_ensure_authenticated |
+ |
def GetGitEditor(self): |
"""Return the editor specified in the git config, or None if none is.""" |
if self.git_editor is None: |
@@ -2022,6 +2032,10 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): |
def EnsureAuthenticated(self, force): |
"""Best effort check that user is authenticated with Gerrit server.""" |
+ if settings.GetGerritSkipEnsureAuthenticated(): |
+ # For projects with unusual authentication schemes. |
+ # See http://crbug.com/603378. |
+ return |
# Lazy-loader to identify Gerrit and Git hosts. |
if gerrit_util.GceAuthenticator.is_gce(): |
return |
@@ -2717,6 +2731,10 @@ def LoadCodereviewSettingsFromFile(fileobj): |
RunGit(['config', 'gerrit.squash-uploads', |
keyvals['GERRIT_SQUASH_UPLOADS']]) |
+ if 'GERRIT_SKIP_ENSURE_AUTHENTICATED' in keyvals: |
+ RunGit(['config', 'gerrit.skip_ensure_authenticated', |
+ keyvals['GERRIT_SKIP_ENSURE_AUTHENTICATED']]) |
+ |
if 'PUSH_URL_CONFIG' in keyvals and 'ORIGIN_URL_CONFIG' in keyvals: |
#should be of the form |
#PUSH_URL_CONFIG: url.ssh://gitrw.chromium.org.pushinsteadof |