]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5318-commit-graph.sh
commit-graph: verify parent list
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 27 Jun 2018 13:24:38 +0000 (09:24 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jun 2018 17:29:10 +0000 (10:29 -0700)
commit53614b13516ffd27bb045b696d0815b9da435cb0
treecef6ce762baab5a5cc051f36d7354654f8f70789
parent2e3c07378f9b777a708e1078a474666a00a8be05
commit-graph: verify parent list

The commit-graph file stores parents in a two-column portion of the
commit data chunk. If there is only one parent, then the second column
stores 0xFFFFFFFF to indicate no second parent.

The 'verify' subcommand checks the parent list for the commit loaded
from the commit-graph and the one parsed from the object database. Test
these checks for corrupt parents, too many parents, and wrong parents.

Add a boundary check to insert_parent_or_die() for when the parent
position value is out of range.

The octopus merge will be tested in a later commit.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
t/t5318-commit-graph.sh