Commit cc1614be authored by maruel@chromium.org's avatar maruel@chromium.org

Improve GIT.CaptureStatus() to work with incorrectly merged local branches.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3446014

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59944 0039d316-1c4b-4281-b951-d872f2087c98
parent 4ed34189
......@@ -92,11 +92,15 @@ class GIT(object):
results = []
if status:
for statusline in status.splitlines():
m = re.match('^(\w)\t(.+)$', statusline)
# 3-way merges can cause the status can be 'MMM' instead of 'M'. This
# can happen when the user has 2 local branches and he diffs between
# these 2 branches instead diffing to upstream.
m = re.match('^(\w)+\t(.+)$', statusline)
if not m:
raise gclient_utils.Error(
'status currently unsupported: %s' % statusline)
results.append(('%s ' % m.group(1), m.group(2)))
# Only grab the first letter.
results.append(('%s ' % m.group(1)[0], m.group(2)))
return results
@staticmethod
......
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