소스 검색

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 년 전
부모
커밋
ca569158cf
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  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):