Преглед изворни кода

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

Jelmer Vernooij пре 14 година
родитељ
комит
4563003e04
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      dulwich/object_store.py

+ 2 - 0
dulwich/object_store.py

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