From bda475e2f89e8f84370e26bf3b0e8e74b91452a3 Mon Sep 17 00:00:00 2001 From: "borenet@google.com" Date: Mon, 24 Mar 2014 19:04:45 +0000 Subject: [PATCH] gclient: Fix nested checkout bug when validating .gclient BUG=355492 Review URL: https://codereview.chromium.org/209963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@258989 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index 76b4d8dd2..242b2c45c 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -142,16 +142,12 @@ class SCMWrapper(object): def GetActualRemoteURL(self): """Attempt to determine the remote URL for this SCMWrapper.""" - try: + if os.path.exists(os.path.join(self.checkout_path, '.git')): return shlex.split(scm.GIT.Capture( ['config', '--local', '--get-regexp', r'remote.*.url'], self.checkout_path))[1] - except Exception: - pass - try: + if os.path.exists(os.path.join(self.checkout_path, '.svn')): return scm.SVN.CaptureLocalInfo([], self.checkout_path)['URL'] - except Exception: - pass return None def DoesRemoteURLMatch(self):