summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92b3385)
raw | patch | inline | side by side (parent: 92b3385)
author | Johan Herland <johan@herland.net> | |
Sat, 13 Feb 2010 21:28:26 +0000 (22:28 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 14 Feb 2010 03:36:14 +0000 (19:36 -0800) |
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3305-notes-fanout.sh | patch | blob | history |
index 823b0ff23b981e898de6930d0f5aa37e31966fad..c6d263b236248c488ddfb3d0e63978896da8b057 100755 (executable)
--- a/t/t3305-notes-fanout.sh
+++ b/t/t3305-notes-fanout.sh
#!/bin/sh
-test_description='Test that adding many notes triggers automatic fanout restructuring'
+test_description='Test that adding/removing many notes triggers automatic fanout restructuring'
. ./test-lib.sh
done
'
+test_expect_success 'deleting most notes with git-notes' '
+ num_notes=250 &&
+ i=0 &&
+ git rev-list HEAD |
+ while read sha1
+ do
+ i=$(($i + 1)) &&
+ if test $i -gt $num_notes
+ then
+ break
+ fi &&
+ test_tick &&
+ git notes remove "$sha1"
+ done
+'
+
+test_expect_success 'most notes deleted correctly with git-notes' '
+ git log HEAD~250 | grep "^ " > output &&
+ i=50 &&
+ while test $i -gt 0
+ do
+ echo " commit #$i" &&
+ echo " note #$i" &&
+ i=$(($i - 1));
+ done > expect &&
+ test_cmp expect 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 |
+ while read path
+ do
+ case "$path" in
+ ????????????????????????????????????????)
+ : true
+ ;;
+ *)
+ echo "Invalid path \"$path\"" &&
+ return 1
+ ;;
+ esac
+ done
+'
+
test_done