浏览代码

Fix borg-check --verify-data failing with rebuilt objects

There are some instances where --repair would do something. In these
instances --verify-data would fail if --repair was not given also, since
the changes without --repair are only in the index, but not in the
repository.
Marian Beermann 9 年之前
父节点
当前提交
d0ec7e76bb
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/borg/archive.py

+ 2 - 2
src/borg/archive.py

@@ -909,6 +909,8 @@ class ArchiveChecker:
         self.repository = repository
         self.init_chunks()
         self.key = self.identify_key(repository)
+        if verify_data:
+            self.verify_data()
         if Manifest.MANIFEST_ID not in self.chunks:
             logger.error("Repository manifest not found!")
             self.error_found = True
@@ -916,8 +918,6 @@ class ArchiveChecker:
         else:
             self.manifest, _ = Manifest.load(repository, key=self.key)
         self.rebuild_refcounts(archive=archive, last=last, prefix=prefix)
-        if verify_data:
-            self.verify_data()
         self.orphan_chunks_check()
         self.finish(save_space=save_space)
         if self.error_found: