config.c: remove current_parsing_scope
[git.git] / t / lib-commit-graph.sh
blob5d79e1a4e967619125a06ae1a2ecf38c0fe3fcab
1 #!/bin/sh
3 # Helper functions for testing commit-graphs.
5 # Initialize OID cache with oid_version
6 test_oid_cache <<-EOF
7 oid_version sha1:1
8 oid_version sha256:2
9 EOF
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() {
18 MSG=$1
19 DIR=$2
20 BRANCH=$3
21 COMPARE=$4
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"
32 graph_read_expect() {
33 OPTIONAL=""
34 NUM_CHUNKS=3
35 if test -n "$2"
36 then
37 OPTIONAL=" $2"
38 NUM_CHUNKS=$((3 + $(echo "$2" | wc -w)))
40 GENERATION_VERSION=2
41 if test -n "$3"
42 then
43 GENERATION_VERSION=$3
45 OPTIONS=
46 if test $GENERATION_VERSION -gt 1
47 then
48 OPTIONS=" read_generation_data"
50 cat >expect <<- EOF
51 header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
52 num_commits: $1
53 chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL
54 options:$OPTIONS
55 EOF
56 test-tool read-graph >output &&
57 test_cmp expect output