commit - 4763ba9399ea4b00a60d7d1fae1c0f494fa11eae
commit + be33277725e7c0113da0af39cfa83b621c62da85
blob - dec12e5d435683a97c818906bc125ced6c85b669
blob + 0ae6a2f84b43eb82a57af0cad422e76a523329fb
--- dulwich/object_store.py
+++ dulwich/object_store.py
copier = PackStreamCopier(read_all, read_some, f, delta_iter=indexer)
copier.verify(progress=progress)
return self._complete_pack(f, path, len(copier), indexer, progress=progress)
-
- def _move_in_pack(self, path, f):
- """Move a specific file containing a pack into the pack directory.
- Note: The file should be on the same file system as the
- packs directory.
-
- Args:
- path: Path to the pack file.
- """
- f.seek(0)
- with PackData(path, f) as pd:
- indexer = PackIndexer.for_pack_data(pd, resolve_ext_ref=self.get_raw)
- return self._complete_pack(f, path, len(pd), indexer)
-
def add_pack(self):
"""Add a new pack to this object store.
def commit():
if f.tell() > 0:
- return self._move_in_pack(path, f)
+ f.seek(0)
+ with PackData(path, f) as pd:
+ indexer = PackIndexer.for_pack_data(pd, resolve_ext_ref=self.get_raw)
+ return self._complete_pack(f, path, len(pd), indexer)
else:
f.close()
os.remove(path)