Parcourir la source

Don't specify depth to determine_wants if it's not set, for backwards compatibility.

Jelmer Vernooij il y a 4 ans
Parent
commit
22b22a52b0
2 fichiers modifiés avec 9 ajouts et 3 suppressions
  1. 8 2
      dulwich/client.py
  2. 1 1
      dulwich/repo.py

+ 8 - 2
dulwich/client.py

@@ -1023,7 +1023,10 @@ class TraditionalGitClient(GitClient):
                 return FetchPackResult(refs, symrefs, agent)
 
             try:
-                wants = determine_wants(refs, depth=depth)
+                if depth is not None:
+                    wants = determine_wants(refs, depth=depth)
+                else:
+                    wants = determine_wants(refs)
             except BaseException:
                 proto.write_pkt_line(None)
                 raise
@@ -2042,7 +2045,10 @@ class HttpGitClient(GitClient):
             symrefs,
             agent,
         ) = self._negotiate_upload_pack_capabilities(server_capabilities)
-        wants = determine_wants(refs, depth=depth)
+        if depth is not None:
+            wants = determine_wants(refs, depth=depth)
+        else:
+            wants = determine_wants(refs)
         if wants is not None:
             wants = [cid for cid in wants if cid != ZERO_SHA]
         if not wants:

+ 1 - 1
dulwich/repo.py

@@ -495,7 +495,7 @@ class BaseRepo(object):
                     refs[ref + ANNOTATED_TAG_SUFFIX] = obj.object[1]
                 refs[ref] = sha
 
-        wants = determine_wants(refs, depth=depth)
+        wants = determine_wants(refs)
         if not isinstance(wants, list):
             raise TypeError("determine_wants() did not return a list")