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

Unified Diff: tools/gn/bin/roll_gn.py

Issue 1376583003: Fix a bug in the GN roll script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: tools/gn/bin/roll_gn.py
diff --git a/tools/gn/bin/roll_gn.py b/tools/gn/bin/roll_gn.py
index 1e9dec9e79d594fa0c6410dad55fe602e5cf5680..ae9489fde0cab87451f0c482ffee160c9787e29b 100644
--- a/tools/gn/bin/roll_gn.py
+++ b/tools/gn/bin/roll_gn.py
@@ -376,8 +376,11 @@ class GNRoller(object):
return 0
def MovetoLastHead(self):
- _, out, _ = self.Call('git reflog -1')
- m = re.match('moving from ([^\s]+)', out)
+ # When this is called, there will be a commit + a checkout as
+ # the two most recent entries in the reflog, assuming nothing as
+ # modified the repo while this script has been running.
+ _, out, _ = self.Call('git reflog -2')
+ m = re.search('moving from ([^\s]+)', out)
last_head = m.group(1)
self.Call('git checkout %s' % last_head)
« 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