From b33cbc0a7a0f55f3f08de8f6a6b631ce8c8b4fe8 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 17 Feb 2016 11:18:55 -0800 Subject: [PATCH] Fix diff crash on perm-only changes The update to GitPython that supports easily detecting the filenames in file-permissions-only changes merged a year ago. Start using it and raise the mininum GitPython version to one which supports it. Change-Id: I9a5104a4b399dee0d9e029fd0b10e37b8aafd3f8 --- gertty/gitrepo.py | 10 ++-------- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/gertty/gitrepo.py b/gertty/gitrepo.py index 6801398..8587fe7 100644 --- a/gertty/gitrepo.py +++ b/gertty/gitrepo.py @@ -392,14 +392,8 @@ class Repo(object): for diff_context in contexts: # Each iteration of this is a file f = DiffFile() - if diff_context.a_blob: - f.oldname = diff_context.a_blob.path - if diff_context.b_blob: - f.newname = diff_context.b_blob.path - # TODO(jeblair): if/when https://github.com/gitpython-developers/GitPython/pull/266 merges, - # remove above 4 lines and replace with these two: - # f.oldname = diff_context.a_path - # f.newname = diff_context.b_path + f.oldname = diff_context.a_path + f.newname = diff_context.b_path if diff_context.new_file: f.oldname = 'Empty file' f.old_empty = True diff --git a/requirements.txt b/requirements.txt index 8b98f6c..b07b170 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ pbr>=0.11,<2.0 urwid>=1.2.1,!=1.3.0 SQLAlchemy>=1.0.4 -GitPython>=0.3.2.RC1,<1.0.2 +GitPython>=0.3.7,<1.0.2 python-dateutil requests>=2.5.3,<3.0.0 ordereddict