From 8324c4b38cf37af416833d36696577d8d35dce7f Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 29 Jul 2015 15:14:41 +0200 Subject: fix(diff): mode-assertions now deal with 0 If the file was not present, the mode seen in a diff can be legally '0', which previously caused an assertion to fail for no good reason. Now the assertion tests for None instead. Closes #323 --- git/diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git/diff.py') diff --git a/git/diff.py b/git/diff.py index dc53f3f7..9059091e 100644 --- a/git/diff.py +++ b/git/diff.py @@ -223,12 +223,12 @@ class Diff(object): if a_blob_id is None: self.a_blob = None else: - assert self.a_mode + assert self.a_mode is not None self.a_blob = Blob(repo, hex_to_bin(a_blob_id), mode=self.a_mode, path=a_path) if b_blob_id is None: self.b_blob = None else: - assert self.b_mode + assert self.b_mode is not None self.b_blob = Blob(repo, hex_to_bin(b_blob_id), mode=self.b_mode, path=b_path) self.new_file = new_file -- cgit v1.2.1