Handle (ignore) no-diff renames

If git diff detects a file rename with no changes, it might add
some (currently) unparseable text to the diff.  Ignore it to avoid
an error.

Change-Id: I3542e0dfd9d7c749510f0539066cfa0147e239a3
This commit is contained in:
James E. Blair 2014-05-26 20:24:56 -07:00
parent cb884d8598
commit 101cde8092
1 changed files with 6 additions and 0 deletions

View File

@ -331,6 +331,12 @@ class Repo(object):
if key == ' ':
f.addContextLine(rest)
continue
if line.startswith("similarity index"):
continue
if line.startswith("rename"):
continue
if line.startswith("index"):
continue
if not last_line:
raise Exception("Unhandled line: %s" % line)
f.finalize()