From 480610506cd28ccdce0b9e1de45808e0afdb10f9 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 23 Jan 2015 13:47:18 +0000 Subject: [PATCH] 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 --- gertty/gitrepo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gertty/gitrepo.py b/gertty/gitrepo.py index 182a71e..0b2e0b8 100644 --- a/gertty/gitrepo.py +++ b/gertty/gitrepo.py @@ -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()