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):
if remote_url is None:
logging.warning('invalid remote')
return
if urllib.parse.urlparse(remote_url).scheme != 'https':
logging.warning('Ignoring branch %(branch)s with non-https remote '
'%(remote)s', {
'branch': self.branch,
'remote': self.GetRemoteUrl()
})
if urllib.parse.urlparse(remote_url).scheme not in ['https', 'sso']:
logging.warning(
'Ignoring branch %(branch)s with non-https/sso remote '
'%(remote)s', {
'branch': self.branch,
'remote': self.GetRemoteUrl()
})
return
# Lazy-loader to identify Gerrit and Git hosts.
......
......@@ -2093,11 +2093,11 @@ class TestGitCl(unittest.TestCase):
self.mockGit.config['remote.origin.url'] = 'custom-scheme://repo'
self.calls = [
(('logging.warning',
'Ignoring branch %(branch)s with non-https remote '
'%(remote)s', {
'Ignoring branch %(branch)s with non-https/sso remote '
'%(remote)s', {
'branch': 'main',
'remote': 'custom-scheme://repo'}
), None),
'remote': 'custom-scheme://repo'
}), None),
]
mock.patch('git_cl.gerrit_util.CookiesAuthenticator',
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