From 1e559a28280c84348ccb49da57c8fbcfebe4b977 Mon Sep 17 00:00:00 2001 From: Igor Date: Fri, 11 Oct 2024 17:32:34 +0000 Subject: [PATCH] Fix error in gclient_scm.py during processing git configs After commit https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5252498 appers error: File ".../depot_tools/gclient_scm.py", line 884, in update strp_current_url = current_url[:-4] if current_url.endswith( ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'endswith' R=gavinmak@google.com Bug: 372510000 Change-Id: I76ee56ad909eafb832ad7f8d155ccd6cec5cade4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5920707 Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak Auto-Submit: Igor Makarov --- gclient_scm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gclient_scm.py b/gclient_scm.py index acdfcea27f..004a808c0b 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -876,7 +876,8 @@ class GitWrapper(SCMWrapper): # See if the url has changed (the unittests use git://foo for the url, # let that through). current_url = scm.GIT.GetConfig(self.checkout_path, - f'remote.{self.remote}.url') + f'remote.{self.remote}.url', + default='') return_early = False # TODO(maruel): Delete url != 'git://foo' since it's just to make the # unit test pass. (and update the comment above)