From 101cde8092911aaef4292f42fe1e7d9490d63176 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 26 May 2014 20:24:56 -0700 Subject: [PATCH] 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 --- gertty/gitrepo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gertty/gitrepo.py b/gertty/gitrepo.py index c13773e..2806c16 100644 --- a/gertty/gitrepo.py +++ b/gertty/gitrepo.py @@ -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()