Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1614)

Unified Diff: scm.py

Issue 18292005: Fix bug with parsing capitalized git shas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 8810c2aa2603535eb9937e080c015393acb92ae2..5e72464e5f9b4498677fd653ee4426e6994a037b 100644
--- a/scm.py
+++ b/scm.py
@@ -454,12 +454,12 @@ class GIT(object):
if re.match(r'^[0-9a-fA-F]{40}$', rev):
lookup_rev = rev[:-1]
try:
- sha = GIT.Capture(['rev-parse', lookup_rev], cwd=cwd)
+ sha = GIT.Capture(['rev-parse', lookup_rev], cwd=cwd).lower()
if lookup_rev != rev:
# Make sure we get the original 40 chars back.
- return rev == sha
+ return rev.lower() == sha
if sha_only:
- return sha.startswith(rev)
+ return sha.startswith(rev.lower())
return True
except subprocess2.CalledProcessError:
return False
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698