1
0
mirror of https://github.com/git/git.git synced 2024-09-28 08:49:45 +02:00

commit-graph tests: test a graph that's too small

Use the recently split-up components of the corrupt_graph_and_verify()
function to assert that we error on graphs that are too small. The
error was added in 2a2e32bdc5 ("commit-graph: implement git
commit-graph read", 2018-04-10), but there was no test for it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2019-02-21 23:37:47 +01:00 committed by Junio C Hamano
parent f6761faaa1
commit 945944ca70

View File

@ -399,6 +399,12 @@ corrupt_graph_and_verify() {
}
test_expect_success 'detect too small' '
corrupt_graph_setup &&
echo "a small graph" >$objdir/info/commit-graph &&
corrupt_graph_verify "too small"
'
test_expect_success 'detect bad signature' '
corrupt_graph_and_verify 0 "\0" \
"graph signature"