Browse Source

use None to represent unspecified optional parameters; suggested by Jelmer

Stefan Sperling 9 months ago
parent
commit
26344f8056
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dulwich/client.py

+ 3 - 1
dulwich/client.py

@@ -545,7 +545,7 @@ def _handle_upload_pack_head(
     wants,
     can_read,
     depth,
-    protocol_version=0,
+    protocol_version=None,
 ):
     """Handle the head of a 'git-upload-pack' request.
 
@@ -561,6 +561,8 @@ def _handle_upload_pack_head(
     """
     assert isinstance(wants, list) and isinstance(wants[0], bytes)
     wantcmd = COMMAND_WANT + b" " + wants[0]
+    if protocol_version is None:
+        protocol_version = 0
     if protocol_version != 2:
         wantcmd += b" " + b" ".join(sorted(capabilities))
     wantcmd += b"\n"