Bug 1629115 - Also run `git cinnabar fsck` after conversion. r=dhouse
authorMike Hommey <mh@glandium.org>
Wed, 15 Apr 2020 06:25:01 +0900
changeset 4488 904f897a1305a6a2dc02cfe754f006a7da37605d
parent 4487 f9e15479984a94a7cdd03fa6fc6c0b6b94ac2852
child 4489 187ceee0ce97ce7e1a7ee1dd68dfe58fa68f0584
push id3590
push usermh@glandium.org
push dateThu, 16 Apr 2020 21:42:48 +0000
reviewersdhouse
bugs1629115
Bug 1629115 - Also run `git cinnabar fsck` after conversion. r=dhouse
scripts/vcs-sync/vcs_sync.py
--- a/scripts/vcs-sync/vcs_sync.py
+++ b/scripts/vcs-sync/vcs_sync.py
@@ -946,16 +946,31 @@ intree=1
                 'cwd': dest,
                 'error_list': GitErrorList,
                 'partial_env': partial_env,
             },
             error_level=FATAL,
         ):
             self.fatal('Error converting tags')
 
+        # Extra security: run git cinnabar fsck.
+        if self.retry(
+            self.run_command,
+            args=(git + [
+                '-c', 'cinnabar.check=no-version-check',
+                'cinnabar', 'fsck'], ),
+            kwargs={
+                'output_timeout': 120 * 60,
+                'cwd': dest,
+                'partial_env': partial_env,
+            },
+            error_level=FATAL,
+        ):
+            self.fatal('Consistency error in the git-cinnabar repository')
+
         # Extra cleanup step: if there are more than 6700 loose objects or more than 50 packs,
         # repack everything.
         self.retry(
             self.run_command,
             args=(git + [
                 '-c', 'gc.autoDetach=false',
                 # This is only supported by git >= 2.18.0 but earlier versions will just ignore.
                 '-c', 'gc.bigPackThreshold=1g',