Browse Source

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 years ago
parent
commit
9f5cca6111
1 changed files with 3 additions and 0 deletions
  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):