| test_description='Test that adding/removing many notes triggers automatic fanout restructuring' |
| test_expect_success 'creating many notes with git-notes' ' |
| while test $i -lt $num_notes |
| echo "file for commit #$i" > file && |
| git commit -q -m "commit #$i" && |
| git notes add -m "note #$i" || return 1 |
| test_expect_success 'many notes created correctly with git-notes' ' |
| git log | grep "^ " > output && |
| test_expect_success 'many notes created with git-notes triggers fanout' ' |
| # Expect entire notes tree to have a fanout == 1 |
| git ls-tree -r --name-only refs/notes/commits | |
| ??/??????????????????????????????????????) |
| echo "Invalid path \"$path\"" && |
| test_expect_success 'deleting most notes with git-notes' ' |
| if test $i -gt $num_notes |
| test_expect_success 'most notes deleted correctly with git-notes' ' |
| git log HEAD~250 | grep "^ " > output && |
| test_expect_success 'deleting most notes triggers fanout consolidation' ' |
| # Expect entire notes tree to have a fanout == 0 |
| git ls-tree -r --name-only refs/notes/commits | |
| ????????????????????????????????????????) |
| echo "Invalid path \"$path\"" && |