瀏覽代碼

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