Sfoglia il codice sorgente

Fix fetch_objects().

Jelmer Vernooij 16 anni fa
parent
commit
291a81dff4
1 ha cambiato i file con 8 aggiunte e 5 eliminazioni
  1. 8 5
      dulwich/repo.py

+ 8 - 5
dulwich/repo.py

@@ -62,7 +62,14 @@ class Repo(object):
 
   def fetch_objects(self, determine_wants, graph_walker, progress):
     sha_done = set()
-    commits_to_send = want[:]
+    wants = determine_wants(self.heads())
+    commits_to_send = []
+    ref = graph_walker.next()
+    while ref:
+        commits_to_send.append(ref)
+        if ref in self.object_store:
+            graph_walker.ack(ref)
+        ref = graph_walker.next()
     for sha in commits_to_send:
         if sha in sha_done:
             continue
@@ -71,10 +78,6 @@ class Repo(object):
         yield c
         sha_done.add(sha)
 
-        for p in c.parents:
-            if not p in commits_to_send:
-                commits_to_send.append(p)
-
         def parse_tree(tree, sha_done):
             for mode, name, x in tree.entries():
                 if not x in sha_done: