Commit 9206738c authored by maruel@chromium.org's avatar maruel@chromium.org

Only call IsValidRevision() when it is a git hash.

Calling IsValidRevision('refs/head/master') will always return True.

TBR=bauerb@chromium.org
BUG=134858
TEST=Tested manually with 'managed': True


Review URL: https://chromiumcodereview.appspot.com/10694022

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@144786 0039d316-1c4b-4281-b951-d872f2087c98
parent 81473866
......@@ -353,7 +353,8 @@ class GitWrapper(SCMWrapper):
else:
raise gclient_utils.Error('Invalid Upstream: %s' % upstream_branch)
if not scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=revision):
if (not re.match(r'^[0-9a-fA-F]{40}$', revision) or
not scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=revision)):
# Update the remotes first so we have all the refs.
backoff_time = 5
for _ in range(10):
......
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