3 # Helper functions for testing commit-graphs.
5 # Initialize OID cache with oid_version
11 graph_git_two_modes
() {
12 git
-c core.commitGraph
=true
$1 >output
&&
13 git
-c core.commitGraph
=false
$1 >expect
&&
14 test_cmp expect output
17 graph_git_behavior
() {
22 test_expect_success
"check normal git operations: $MSG" '
23 cd "$TRASH_DIRECTORY/$DIR" &&
24 graph_git_two_modes "log --oneline $BRANCH" &&
25 graph_git_two_modes "log --topo-order $BRANCH" &&
26 graph_git_two_modes "log --graph $COMPARE..$BRANCH" &&
27 graph_git_two_modes "branch -vv" &&
28 graph_git_two_modes "merge-base -a $BRANCH $COMPARE"
38 NUM_CHUNKS
=$
((3 + $
(echo "$2" |
wc -w)))
46 if test $GENERATION_VERSION -gt 1
48 OPTIONS
=" read_generation_data"
51 header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
53 chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL
56 test-tool read-graph
>output
&&
57 test_cmp expect output