ostree/fsck: Add --verify-back-refs option

This new option verifies that the refs listed in the ref-bindings for
each commit all point to that commit (i.e. there aren’t multiple commits
listing the same ref in their ref-bindings, and there aren’t any commits
with non-empty ref-bindings which aren’t pointed at by a ref).

This is useful when generating a new repository from scratch, but not
useful when adding new commits to an existing repository (since the old
commits will still, correctly, have ref-bindings from when the refs
pointed at them). That’s why it has to be enabled explicitly using
--verify-back-refs, rather than being on by default.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1347
Approved by: cgwalters
This commit is contained in:
Philip Withnall authored and Atomic Bot committed 2017-12-14 14:18:44 +00:00
1 parent 38152d71aa
commit fb7692bd44
3 files changed
+85

No files matched your search

+11
View File
@@ -85,6 +85,17 @@ Boston, MA 02111-1307, USA.
Add tombstone commit for referenced but missing commits.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--verify-back-refs</option></term>
<listitem><para>
Verify that all the refs listed in a commit’s ref-bindings
point to that commit. This cannot be used in repositories
where the target of refs is changed over time as new commits
are added, but can be used in repositories which are
regenerated from scratch for each commit.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>