]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t5318-commit-graph.sh
3 test_description
='commit graph'
6 test_expect_success
'setup full repo' '
8 cd "$TRASH_DIRECTORY/full" &&
13 test_expect_success
'write graph with no packs' '
14 cd "$TRASH_DIRECTORY/full" &&
15 git commit-graph write --object-dir . &&
16 test_path_is_file info/commit-graph
19 test_expect_success
'create commits and repack' '
20 cd "$TRASH_DIRECTORY/full" &&
21 for i in $(test_seq 3)
29 test_expect_success
'write graph' '
30 cd "$TRASH_DIRECTORY/full" &&
31 graph1=$(git commit-graph write) &&
32 test_path_is_file $objdir/info/commit-graph
35 test_expect_success
'Add more commits' '
36 cd "$TRASH_DIRECTORY/full" &&
37 git reset --hard commits/1 &&
38 for i in $(test_seq 4 5)
43 git reset --hard commits/2 &&
44 for i in $(test_seq 6 7)
49 git reset --hard commits/2 &&
50 git merge commits/4 &&
52 git reset --hard commits/4 &&
53 git merge commits/6 &&
55 git reset --hard commits/3 &&
56 git merge commits/5 commits/7 &&
61 # Current graph structure:
72 test_expect_success
'write graph with merges' '
73 cd "$TRASH_DIRECTORY/full" &&
74 git commit-graph write &&
75 test_path_is_file $objdir/info/commit-graph
78 test_expect_success
'Add one more commit' '
79 cd "$TRASH_DIRECTORY/full" &&
81 git branch commits/8 &&
82 ls $objdir/pack | grep idx >existing-idx &&
84 ls $objdir/pack| grep idx | grep -v --file=existing-idx >new-idx
87 # Current graph structure:
99 test_expect_success
'write graph with new commit' '
100 cd "$TRASH_DIRECTORY/full" &&
101 git commit-graph write &&
102 test_path_is_file $objdir/info/commit-graph
105 test_expect_success
'write graph with nothing new' '
106 cd "$TRASH_DIRECTORY/full" &&
107 git commit-graph write &&
108 test_path_is_file $objdir/info/commit-graph
111 test_expect_success
'setup bare repo' '
112 cd "$TRASH_DIRECTORY" &&
113 git clone --bare --no-local full bare &&
118 test_expect_success
'write graph in bare repo' '
119 cd "$TRASH_DIRECTORY/bare" &&
120 git commit-graph write &&
121 test_path_is_file $baredir/info/commit-graph