Commit 46ffd1bc authored by Joanna Wang's avatar Joanna Wang Committed by LUCI CQ

Allow sso remotes for `git cl status`.

Bug:1364237
Change-Id: Iff3419097f86db125990001fe316c9c52974e3b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3899165
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
parent 421c4fe8
...@@ -1718,12 +1718,13 @@ class Changelist(object): ...@@ -1718,12 +1718,13 @@ class Changelist(object):
if remote_url is None: if remote_url is None:
logging.warning('invalid remote') logging.warning('invalid remote')
return return
if urllib.parse.urlparse(remote_url).scheme != 'https': if urllib.parse.urlparse(remote_url).scheme not in ['https', 'sso']:
logging.warning('Ignoring branch %(branch)s with non-https remote ' logging.warning(
'%(remote)s', { 'Ignoring branch %(branch)s with non-https/sso remote '
'branch': self.branch, '%(remote)s', {
'remote': self.GetRemoteUrl() 'branch': self.branch,
}) 'remote': self.GetRemoteUrl()
})
return return
# Lazy-loader to identify Gerrit and Git hosts. # Lazy-loader to identify Gerrit and Git hosts.
......
...@@ -2093,11 +2093,11 @@ class TestGitCl(unittest.TestCase): ...@@ -2093,11 +2093,11 @@ class TestGitCl(unittest.TestCase):
self.mockGit.config['remote.origin.url'] = 'custom-scheme://repo' self.mockGit.config['remote.origin.url'] = 'custom-scheme://repo'
self.calls = [ self.calls = [
(('logging.warning', (('logging.warning',
'Ignoring branch %(branch)s with non-https remote ' 'Ignoring branch %(branch)s with non-https/sso remote '
'%(remote)s', { '%(remote)s', {
'branch': 'main', 'branch': 'main',
'remote': 'custom-scheme://repo'} 'remote': 'custom-scheme://repo'
), None), }), None),
] ]
mock.patch('git_cl.gerrit_util.CookiesAuthenticator', mock.patch('git_cl.gerrit_util.CookiesAuthenticator',
CookiesAuthenticatorMockFactory(hosts_with_creds={})).start() CookiesAuthenticatorMockFactory(hosts_with_creds={})).start()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment