Browse Source

Add extra asserts, skip more revisions.

Jelmer Vernooij 16 years ago
parent
commit
cc0470e402
2 changed files with 3 additions and 4 deletions
  1. 1 0
      dulwich/client.py
  2. 2 4
      dulwich/object_store.py

+ 1 - 0
dulwich/client.py

@@ -135,6 +135,7 @@ class GitClient(object):
         if not wants:
             self.proto.write_pkt_line(None)
             return refs
+        assert isinstance(wants, list) and type(wants[0]) == str
         self.proto.write_pkt_line("want %s %s\n" % (wants[0], self.capabilities()))
         for want in wants[1:]:
             self.proto.write_pkt_line("want %s\n" % want)

+ 2 - 4
dulwich/object_store.py

@@ -442,13 +442,14 @@ class MissingObjectFinder(object):
 
     :param object_store: Object store containing at least all objects to be 
         sent
+    :param haves: SHA1s of commits not to send (already present in target)
     :param wants: SHA1s of commits to send
     :param progress: Optional function to report progress to.
     """
 
     def __init__(self, object_store, haves, wants, progress=None):
         self.sha_done = set(haves)
-        self.objects_to_send = set([(w, None, False) for w in wants])
+        self.objects_to_send = set([(w, None, False) for w in wants if w not in haves])
         self.object_store = object_store
         if progress is None:
             self.progress = lambda x: None
@@ -515,6 +516,3 @@ class ObjectStoreGraphWalker(object):
             self.heads.update(ps)
             return ret
         return None
-
-
-