Selaa lähdekoodia

Don't send a depth of "None" to the server when graph walker supports shallow.

Ideally this would have a test, but we don't have good tests for shallow anyway. :-/

Fixes #747
Jelmer Vernooij 5 vuotta sitten
vanhempi
commit
f1421c8566
2 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 3 0
      NEWS
  2. 3 2
      dulwich/client.py

+ 3 - 0
NEWS

@@ -1,5 +1,8 @@
 0.19.16	UNRELEASED
 
+ * Don't send "deepen None" to server if graph walker
+   supports shallow. (Jelmer Vernooij, #747)
+
 0.19.15	2020-01-26
 
  * Properly handle files that are just executable for the

+ 3 - 2
dulwich/client.py

@@ -641,8 +641,9 @@ class GitClient(object):
                     "depth")
             for sha in graph_walker.shallow:
                 proto.write_pkt_line(COMMAND_SHALLOW + b' ' + sha + b'\n')
-            proto.write_pkt_line(COMMAND_DEEPEN + b' ' +
-                                 str(depth).encode('ascii') + b'\n')
+            if depth is not None:
+                proto.write_pkt_line(COMMAND_DEEPEN + b' ' +
+                                     str(depth).encode('ascii') + b'\n')
             proto.write_pkt_line(None)
             if can_read is not None:
                 (new_shallow, new_unshallow) = _read_shallow_updates(proto)