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:
parent
cb884d8598
commit
101cde8092
|
@ -331,6 +331,12 @@ class Repo(object):
|
||||||
if key == ' ':
|
if key == ' ':
|
||||||
f.addContextLine(rest)
|
f.addContextLine(rest)
|
||||||
continue
|
continue
|
||||||
|
if line.startswith("similarity index"):
|
||||||
|
continue
|
||||||
|
if line.startswith("rename"):
|
||||||
|
continue
|
||||||
|
if line.startswith("index"):
|
||||||
|
continue
|
||||||
if not last_line:
|
if not last_line:
|
||||||
raise Exception("Unhandled line: %s" % line)
|
raise Exception("Unhandled line: %s" % line)
|
||||||
f.finalize()
|
f.finalize()
|
||||||
|
|
Loading…
Reference in New Issue