Explorar el Código

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

Jelmer Vernooij hace 14 años
padre
commit
4563003e04
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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