Jelmer Vernooij 13 anni fa
parent
commit
8c168f9d60
2 ha cambiato i file con 11 aggiunte e 4 eliminazioni
  1. 10 3
      dulwich/client.py
  2. 1 1
      dulwich/tests/test_client.py

+ 10 - 3
dulwich/client.py

@@ -56,7 +56,7 @@ def _fileno_can_read(fileno):
     return len(select.select([fileno], [], [], 0)[0]) > 0
 
 COMMON_CAPABILITIES = ['ofs-delta', 'side-band-64k']
-FETCH_CAPABILITIES = ['multi_ack'] + COMMON_CAPABILITIES
+FETCH_CAPABILITIES = ['multi_ack', 'multi_ack_detailed'] + COMMON_CAPABILITIES
 SEND_CAPABILITIES = ['report-status'] + COMMON_CAPABILITIES
 
 
@@ -392,7 +392,14 @@ class TraditionalGitClient(GitClient):
                 parts = pkt.rstrip('\n').split(' ')
                 if parts[0] == 'ACK':
                     graph_walker.ack(parts[1])
-                    assert parts[2] == 'continue'
+                    if parts[2] in ('continue', 'common'):
+                        pass
+                    elif parts[2] == 'ready':
+                        break
+                    else:
+                        raise AssertionError(
+                            "%s not in ('continue', 'ready', 'common)" %
+                            parts[2])
             have = graph_walker.next()
         proto.write_pkt_line('done\n')
         pkt = proto.read_pkt_line()
@@ -400,7 +407,7 @@ class TraditionalGitClient(GitClient):
             parts = pkt.rstrip('\n').split(' ')
             if parts[0] == 'ACK':
                 graph_walker.ack(pkt.split(' ')[1])
-            if len(parts) < 3 or parts[2] != 'continue':
+            if len(parts) < 3 or parts[2] not in ('continue', 'common'):
                 break
             pkt = proto.read_pkt_line()
         if "side-band-64k" in negotiated_capabilities:

+ 1 - 1
dulwich/tests/test_client.py

@@ -61,7 +61,7 @@ class GitClientTests(TestCase):
 
     def test_caps(self):
         self.assertEquals(set(['multi_ack', 'side-band-64k', 'ofs-delta',
-                               'thin-pack']),
+                               'thin-pack', 'multi_ack_detailed']),
                           set(self.client._fetch_capabilities))
         self.assertEquals(set(['ofs-delta', 'report-status', 'side-band-64k']),
                           set(self.client._send_capabilities))