[GN]: Fix typo and a bug in the GN roll script.

When complete, the script attempts to switch from the branches it creates
to build and roll things back to the branch you were on before.

The way it determines what branch you were on before is by looking at
git's reflog. However, the way I was looking at the reflog was wrong;
first, it was doing an re.match() instead of an re.search(), and so
it was looking for a match at the beginning of the output (which would
never be true). Second, we were looking at only the most recent entry,
and when the roll script actually executed, the most recent entry would
always be a commit, not a checkout, and so we wouldn't see what the
previous branch was.

BUG=none
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/1381753003

Cr-Original-Commit-Position: refs/heads/master@{#351613}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c9ef0df1e21a0e9be8c855fbbf01386ed0617d2a
1 file changed
tree: 3bf1bc2519ac33b2d6c71ada757554da844dc8b5
  1. tools/