浏览代码

Provide abort() when working in thin client mode.

Jelmer Vernooij 9 年之前
父节点
当前提交
4cc972cd67
共有 1 个文件被更改,包括 10 次插入8 次删除
  1. 10 8
      dulwich/client.py

+ 10 - 8
dulwich/client.py

@@ -234,15 +234,17 @@ class GitClient(object):
         if determine_wants is None:
             determine_wants = target.object_store.determine_wants_all
         if CAPABILITY_THIN_PACK in self._fetch_capabilities:
-           # TODO(jelmer): Avoid reading entire file into memory and
-           # only processing it after the whole file has been fetched.
-           f = BytesIO()
-           def commit():
-              if f.tell():
-                f.seek(0)
-                target.object_store.add_thin_pack(f.read, None)
+            # TODO(jelmer): Avoid reading entire file into memory and
+            # only processing it after the whole file has been fetched.
+            f = BytesIO()
+            def commit():
+                if f.tell():
+                    f.seek(0)
+                    target.object_store.add_thin_pack(f.read, None)
+            def abort():
+                pass
         else:
-           f, commit, abort = target.object_store.add_pack()
+            f, commit, abort = target.object_store.add_pack()
         try:
             result = self.fetch_pack(
                 path, determine_wants, target.get_graph_walker(), f.write,