Skip to content

Commit 945944c

Browse files
avargitster
authored andcommitted
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 2a2e32b ("commit-graph: implement git commit-graph read", 2018-04-10), but there was no test for it. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f6761fa commit 945944c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t5318-commit-graph.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ corrupt_graph_and_verify() {
399399

400400
}
401401

402+
test_expect_success 'detect too small' '
403+
corrupt_graph_setup &&
404+
echo "a small graph" >$objdir/info/commit-graph &&
405+
corrupt_graph_verify "too small"
406+
'
407+
402408
test_expect_success 'detect bad signature' '
403409
corrupt_graph_and_verify 0 "\0" \
404410
"graph signature"

0 commit comments

Comments
 (0)