3 test_description='Test that adding/removing many notes triggers automatic fanout restructuring'
7 test_expect_success 'creating many notes with git-notes' '
10 while test $i -lt $num_notes
14 echo "file for commit #$i" > file &&
16 git commit -q -m "commit #$i" &&
17 git notes add -m "note #$i" || return 1
21 test_expect_success 'many notes created correctly with git-notes' '
22 git log | grep "^ " > output &&
30 test_cmp expect output
33 test_expect_success 'many notes created with git-notes triggers fanout' '
34 # Expect entire notes tree to have a fanout == 1
35 git ls-tree -r --name-only refs/notes/commits |
39 ??/??????????????????????????????????????)
43 echo "Invalid path \"$path\"" &&
50 test_expect_success 'deleting most notes with git-notes' '
57 if test $i -gt $num_notes
62 git notes remove "$sha1"
66 test_expect_success 'most notes deleted correctly with git-notes' '
67 git log HEAD~250 | grep "^ " > output &&
75 test_cmp expect output
78 test_expect_success 'deleting most notes triggers fanout consolidation' '
79 # Expect entire notes tree to have a fanout == 0
80 git ls-tree -r --name-only refs/notes/commits |
84 ????????????????????????????????????????)
88 echo "Invalid path \"$path\"" &&