Handle (ignore) binary file diffs

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

Change-Id: Ib4f615e2f2bd8d633657949c8732556b4a0575c6
This commit is contained in:
Jeremy Stanley 2015-01-23 13:47:18 +00:00
parent 12edc3aaf9
commit 480610506c
1 changed files with 2 additions and 0 deletions

View File

@ -454,6 +454,8 @@ class Repo(object):
continue
if line.startswith("index"):
continue
if line.startswith("Binary files"):
continue
if not last_line:
raise Exception("Unhandled line: %s" % line)
f.finalize()