mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Fix git cl patch for sso:// URLs
URL normalization logic incorrectly compares sso:// and https:// URLs. Unify the logic to treat both schemes identically. Bug: 450461206, 429002243 Change-Id: I912b286d787a43b34304ed3be521d9d6927ba414 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7031038 Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Scott Lee <ddoman@chromium.org>
This commit is contained in:
10
git_cl.py
10
git_cl.py
@@ -2928,13 +2928,9 @@ class Changelist(object):
|
||||
the URL).
|
||||
"""
|
||||
parts = urllib.parse.urlparse(x)
|
||||
if parts.scheme == 'sso':
|
||||
host = parts.netloc
|
||||
else:
|
||||
# This should be http(s)
|
||||
host = parts.netloc.split('.')[0]
|
||||
if host.endswith('-review'):
|
||||
host = host[:-len('-review')]
|
||||
host = parts.netloc.split('.')[0]
|
||||
if host.endswith('-review'):
|
||||
host = host[:-len('-review')]
|
||||
repo = parts.path
|
||||
if repo.endswith('.git'):
|
||||
repo = repo[:-len('.git')]
|
||||
|
||||
@@ -4135,6 +4135,8 @@ class ChangelistTest(unittest.TestCase):
|
||||
cases = [
|
||||
('https://chromium.googlesource.com/chromium/tools/depot_tools',
|
||||
'sso://chromium/chromium/tools/depot_tools'),
|
||||
('https://chromium.googlesource.com/build',
|
||||
'sso://chromium.googlesource.com/build'),
|
||||
]
|
||||
for a, b in cases:
|
||||
with self.subTest(c=(a, b)):
|
||||
|
||||
Reference in New Issue
Block a user