Skip to content

Commit

Permalink
Fix thinpack support over http
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbain authored and jelmer committed Dec 3, 2015
1 parent 421c978 commit 5e9d957
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dulwich/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,14 @@ def fetch(self, path, target, determine_wants=None, progress=None):
"""
if determine_wants is None:
determine_wants = target.object_store.determine_wants_all

f, commit, abort = target.object_store.add_pack()
if CAPABILITY_THIN_PACK in self._fetch_capabilities:
f = BytesIO()
def commit():
if f.tell():
f.seek(0)
target.object_store.add_thin_pack(f.read, None)
else:
f, commit, abort = target.object_store.add_pack()
try:
result = self.fetch_pack(
path, determine_wants, target.get_graph_walker(), f.write,
Expand Down

0 comments on commit 5e9d957

Please sign in to comment.