@@ -29,12 +29,7 @@ test_expect_success 'setup full repo' '
2929 cd "$TRASH_DIRECTORY/full" &&
3030 git init &&
3131 git config core.commitGraph true &&
32- objdir=".git/objects" &&
33-
34- test_oid_cache <<-EOF
35- oid_version sha1:1
36- oid_version sha256:2
37- EOF
32+ objdir=".git/objects"
3833'
3934
4035test_expect_success POSIXPERM ' tweak umask for modebit tests' '
@@ -69,46 +64,10 @@ test_expect_success 'create commits and repack' '
6964 git repack
7065'
7166
72- graph_git_two_modes () {
73- git -c core.commitGraph=true $1 > output &&
74- git -c core.commitGraph=false $1 > expect &&
75- test_cmp expect output
76- }
77-
78- graph_git_behavior () {
79- MSG=$1
80- DIR=$2
81- BRANCH=$3
82- COMPARE=$4
83- test_expect_success " check normal git operations: $MSG " '
84- cd "$TRASH_DIRECTORY/$DIR" &&
85- graph_git_two_modes "log --oneline $BRANCH" &&
86- graph_git_two_modes "log --topo-order $BRANCH" &&
87- graph_git_two_modes "log --graph $COMPARE..$BRANCH" &&
88- graph_git_two_modes "branch -vv" &&
89- graph_git_two_modes "merge-base -a $BRANCH $COMPARE"
90- '
91- }
67+ . " $TEST_DIRECTORY " /lib-commit-graph.sh
9268
9369graph_git_behavior ' no graph' full commits/3 commits/1
9470
95- graph_read_expect () {
96- OPTIONAL=" "
97- NUM_CHUNKS=3
98- if test ! -z " $2 "
99- then
100- OPTIONAL=" $2 "
101- NUM_CHUNKS=$(( 3 + $(echo "$2 " | wc - w)) )
102- fi
103- cat > expect << - EOF
104- header: 43475048 1 $( test_oid oid_version) $NUM_CHUNKS 0
105- num_commits: $1
106- chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL
107- EOF
108- test-tool read-graph > output &&
109- test_cmp expect output
110- }
111-
11271test_expect_success ' exit with correct error on bad input to --stdin-commits' '
11372 cd "$TRASH_DIRECTORY/full" &&
11473 # invalid, non-hex OID
@@ -466,10 +425,10 @@ test_expect_success 'warn on improper hash version' '
466425 )
467426'
468427
469- test_expect_success ' lower layers have overflow chunk' '
428+ test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT ' lower layers have overflow chunk' '
470429 cd "$TRASH_DIRECTORY/full" &&
471430 UNIX_EPOCH_ZERO="@0 +0000" &&
472- FUTURE_DATE="@2147483646 +0000" &&
431+ FUTURE_DATE="@4147483646 +0000" &&
473432 rm -f .git/objects/info/commit-graph &&
474433 test_commit --date "$FUTURE_DATE" future-1 &&
475434 test_commit --date "$UNIX_EPOCH_ZERO" old-1 &&
@@ -497,7 +456,7 @@ test_expect_success 'git commit-graph verify' '
497456 cd "$TRASH_DIRECTORY/full" &&
498457 git rev-parse commits/8 | git -c commitGraph.generationVersion=1 commit-graph write --stdin-commits &&
499458 git commit-graph verify >output &&
500- graph_read_expect 9 extra_edges
459+ graph_read_expect 9 extra_edges 1
501460'
502461
503462NUM_COMMITS=9
@@ -825,10 +784,6 @@ test_expect_success 'set up and verify repo with generation data overflow chunk'
825784 objdir=".git/objects" &&
826785 UNIX_EPOCH_ZERO="@0 +0000" &&
827786 FUTURE_DATE="@2147483646 +0000" &&
828- test_oid_cache <<-EOF &&
829- oid_version sha1:1
830- oid_version sha256:2
831- EOF
832787 cd "$TRASH_DIRECTORY" &&
833788 mkdir repo &&
834789 cd repo &&
0 commit comments