summaryrefslogtreecommitdiff
path: root/git/diff.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-07-29 15:14:41 +0200
committerSebastian Thiel <byronimo@gmail.com>2015-07-29 15:14:41 +0200
commit8324c4b38cf37af416833d36696577d8d35dce7f (patch)
tree9d705ac9c3aee56876895cc9196256f308868045 /git/diff.py
parentc58887a2d8554d171a7c76b03bfa919c72e918e1 (diff)
downloadgitpython-8324c4b38cf37af416833d36696577d8d35dce7f.tar.gz
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
Diffstat (limited to 'git/diff.py')
-rw-r--r--git/diff.py4
1 files changed, 2 insertions, 2 deletions
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