Re: [PATCH v2 09/12] fsck: verify commit-graph
From: Martin Ågren <hidden>
Date: 2018-05-17 18:13:05
On 11 May 2018 at 23:15, Derrick Stolee [off-list ref] wrote:
If core.commitGraph is true, verify the contents of the commit-graph during 'git fsck' using the 'git commit-graph verify' subcommand. Run this check on all alternates, as well.
quoted hunk ↗ jump to hunk
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 5ab268a024..91c8406d97 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh@@ -205,6 +205,16 @@ test_expect_success 'build graph from commits with append' ' graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1 graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2 +test_expect_success 'build graph using --reachable' ' + cd "$TRASH_DIRECTORY/full" && + git commit-graph write --reachable && + test_path_is_file $objdir/info/commit-graph && + graph_read_expect "11" "large_edges" +'
This should be in the next patch.
+graph_git_behavior 'append graph, commit 8 vs merge 1' full commits/8 merge/1 +graph_git_behavior 'append graph, commit 8 vs merge 2' full commits/8 merge/2
(Possibly the same here.)
quoted hunk ↗ jump to hunk
test_expect_success 'setup bare repo' ' cd "$TRASH_DIRECTORY" && git clone --bare --no-local full bare &&@@ -335,7 +345,7 @@ test_expect_success 'detect OID not in object database' ' cd "$TRASH_DIRECTORY/full" && cp $objdir/info/commit-graph commit-graph-backup && test_when_finished mv commit-graph-backup $objdir/info/commit-graph && - corrupt_data $objdir/info/commit-graph 1134 "\01" && + corrupt_data $objdir/info/commit-graph 1134 "\00" &&
This and two similar ones as well, I guess. Actually, I can drop them altogether and the tests still pass. Rebase mishap?
+test_expect_success 'git fsck (checks commit-graph)' ' + cd "$TRASH_DIRECTORY/full" && + git fsck +'
Maybe inject an error and verify that `git fsck` does indeed catch it, i.e., it does call out to check the commit-graph. Maybe also a run with `-c core.commitGraph=no` where the error should not be found because the commit-graph should not be checked? Martin