summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/scripts/git_submodule.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py
index f22f7323c..fa5e9691c 100644
--- a/tools/scripts/git_submodule.py
+++ b/tools/scripts/git_submodule.py
@@ -161,7 +161,6 @@ class Submodule:
oldCwd = os.getcwd()
os.chdir(self.path)
error = 0
- current_shasum = ''
if self.ref:
# Fetch the ref we parsed from the DEPS file.
error = subprocessCall(['git', 'fetch', 'origin', self.ref])
@@ -170,18 +169,20 @@ class Submodule:
return error
error = subprocessCall(['git', 'checkout', 'FETCH_HEAD']);
- current_shasum = subprocessCheckOutput(['git', 'rev-parse', 'HEAD']).strip()
- current_tag = subprocessCheckOutput(['git', 'name-rev', '--tags', '--name-only', current_shasum]).strip()
- if current_tag == resolver.currentVersion():
- # We checked out a tagged version of chromium.
- self.shasum = current_shasum
- elif self.revision:
+ if self.revision:
search_string = '\"git-svn-id: .*@' + str(self.revision) + '\"'
line = subprocessCheckOutput(['git', 'log', '-n1', '--pretty=oneline', '--grep=' + search_string])
if line:
self.shasum = line.split()[0]
+ current_shasum = subprocessCheckOutput(['git', 'rev-parse', 'HEAD']).strip()
+ current_tag = subprocessCheckOutput(['git', 'name-rev', '--tags', '--name-only', current_shasum]).strip()
+
+ if current_tag == resolver.currentVersion():
+ # We checked out a tagged version of chromium.
+ self.shasum = current_shasum
+
if not self.shasum:
# No shasum could be deduced, use the submodule shasum.
os.chdir(oldCwd)