Pārlūkot izejas kodu

Presence in the index doesn't imply presence on disk.

Jelmer Vernooij 9 gadi atpakaļ
vecāks
revīzija
d558cb7c08
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      dulwich/index.py

+ 6 - 2
dulwich/index.py

@@ -389,8 +389,12 @@ def changes_from_tree(names, lookup_entry, object_store, tree,
 
     # Mention added files
     for name in other_names:
-        (other_sha, other_mode) = lookup_entry(name)
-        yield ((None, name), (None, other_mode), (None, other_sha))
+        try:
+            (other_sha, other_mode) = lookup_entry(name)
+        except KeyError:
+            pass
+        else:
+            yield ((None, name), (None, other_mode), (None, other_sha))
 
 
 def index_entry_from_stat(stat_val, hex_sha, flags, mode=None):