2
0
Эх сурвалжийг харах

object_store: Remove empty pack files when not moving them into the objects/ directory.

Jelmer Vernooij 14 жил өмнө
parent
commit
4563003e04

+ 2 - 0
dulwich/object_store.py

@@ -454,6 +454,7 @@ class DiskObjectStore(PackBasedObjectStore):
             if os.path.getsize(path) > 0:
             if os.path.getsize(path) > 0:
                 return self.move_in_thin_pack(path)
                 return self.move_in_thin_pack(path)
             else:
             else:
+                os.remove(path)
                 return None
                 return None
         return f, commit
         return f, commit
 
 
@@ -471,6 +472,7 @@ class DiskObjectStore(PackBasedObjectStore):
             if os.path.getsize(path) > 0:
             if os.path.getsize(path) > 0:
                 return self.move_in_pack(path)
                 return self.move_in_pack(path)
             else:
             else:
+                os.remove(path)
                 return None
                 return None
         return f, commit
         return f, commit