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' '
54 while test $i -lt $num_notes && read sha1
58 git notes remove "$sha1" ||
63 test_expect_success
'most notes deleted correctly with git-notes' '
64 git log HEAD~250 | grep "^ " > output &&
72 test_cmp expect output
75 test_expect_success
'deleting most notes triggers fanout consolidation' '
76 # Expect entire notes tree to have a fanout == 0
77 git ls-tree -r --name-only refs/notes/commits |
81 ????????????????????????????????????????)
85 echo "Invalid path \"$path\"" &&