mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[git_auth] Add guard against bad URLs
In particular, when we enable new auth by default, one of the tests that uses gclient to clone a local directory fails. Bug: 404613530 Change-Id: I1bd41da2a3aba6f92cc3d5d9c75ab4d8fc293f22 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6426441 Commit-Queue: Allen Li <ayatane@chromium.org> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
This commit is contained in:
@@ -319,8 +319,14 @@ def Configure(cwd: str, cl: git_cl.Changelist) -> None:
|
||||
def ConfigureGlobal(cwd: str, remote_url: str) -> None:
|
||||
"""Configure global/user Git authentication."""
|
||||
logging.debug('Configuring global Git authentication for %s', remote_url)
|
||||
# Checks to ensure this doesn't error when called with "bad" URLs.
|
||||
#
|
||||
# Don't try to configure auth for local files.
|
||||
if remote_url.startswith('file://'):
|
||||
return
|
||||
# Skip for local files that aren't even URIs.
|
||||
if '://' not in remote_url:
|
||||
return
|
||||
ConfigChanger.new_for_remote(cwd, remote_url).apply_global(cwd)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user