← Back to team overview

dulwich-users team mailing list archive

[PATCH 4/6] object_store.DiskObjectStore.move_in_thin_pack: close temp pack

 

---
 dulwich/object_store.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dulwich/object_store.py b/dulwich/object_store.py
index 9c40b5d..ef81db4 100644
--- a/dulwich/object_store.py
+++ b/dulwich/object_store.py
@@ -406,6 +406,10 @@ class DiskObjectStore(PackBasedObjectStore):
         temppath = os.path.join(self.pack_dir,
             sha_to_hex(urllib2.randombytes(20))+".temppack")
         write_pack(temppath, ((o, None) for o in p.iterobjects()), len(p))
+
+        # done with temp pack
+        p.close()
+
         pack_sha = load_pack_index(temppath+".idx").objects_sha1()
         newbasename = os.path.join(self.pack_dir, "pack-%s" % pack_sha)
         os.rename(temppath+".pack", newbasename+".pack")
-- 
1.7.3.2.msysgit.0




Follow ups

References