Skip to content

Commit 88c145a

Browse files
committed
client: Ensure thin_packs parameter is honored with git protocol v2
With git protocol v2, requesting a thin pack must be done through an argument to the fetch command sent to the git server. This was missed when the initial support of git protocol v2 was introduced in 2b975ec.
1 parent 3965f49 commit 88c145a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dulwich/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,8 @@ def fetch_pack(
14151415
if self.protocol_version == 2:
14161416
proto.write_pkt_line(b"command=fetch\n")
14171417
proto.write(b"0001") # delim-pkt
1418+
if CAPABILITY_THIN_PACK in self._fetch_capabilities:
1419+
proto.write(pkt_line(b"thin-pack\n"))
14181420
if (
14191421
find_capability(
14201422
negotiated_capabilities, CAPABILITY_FETCH, CAPABILITY_FILTER
@@ -2693,6 +2695,8 @@ def fetch_pack(
26932695
)
26942696
if self.protocol_version == 2:
26952697
data = pkt_line(b"command=fetch\n") + b"0001"
2698+
if CAPABILITY_THIN_PACK in self._fetch_capabilities:
2699+
data += pkt_line(b"thin-pack\n")
26962700
if (
26972701
find_capability(
26982702
negotiated_capabilities, CAPABILITY_FETCH, CAPABILITY_FILTER

0 commit comments

Comments
 (0)