Ver código fonte

Handle None elements in lists of TreeChange objects

The docstring of diff_tree.tree_changes_for_merge reports that it yields
lists of TreeChange objects, and that "An element may be None...".
Alex Holmes 13 anos atrás
pai
commit
9f5cca6111
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      dulwich/walk.py

+ 3 - 0
dulwich/walk.py

@@ -255,6 +255,9 @@ class Walker(object):
         return False
 
     def _change_matches(self, change):
+        if not change:
+            return False
+
         old_path = change.old.path
         new_path = change.new.path
         if self._path_matches(new_path):