From: Johan Herland Date: Fri, 25 Nov 2011 00:09:46 +0000 (+0100) Subject: t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling X-Git-Tag: v1.7.8.2~19^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9ff5e21f0e2d0944535dbf4d35758a7e027ae0c6;p=git.git t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling The previous patch exposed a bug in fast-import where _removing_ an existing note fails (when that note resides on a non-zero fanout level, and was added prior to this fast-import run). This patch demostrates the same issue when _changing_ an existing note (subject to the same circumstances). Discovered-by: Henrik Grubbström Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- diff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh index fd0816168..57d85a635 100755 --- a/t/t9301-fast-import-notes.sh +++ b/t/t9301-fast-import-notes.sh @@ -505,6 +505,60 @@ test_expect_success 'verify that non-notes are untouched by a fanout change' ' test_cmp expect_non-note3 actual ' + +# Change the notes for the three top commits +test_tick +cat >input < $GIT_COMMITTER_DATE +data <>input <>expect < actual && + test_cmp expect actual + +' + +test_expect_failure 'verify that changing notes respect existing fanout' ' + + # None of the entries in the top-level notes tree should be a full SHA1 + git ls-tree --name-only refs/notes/many_notes | + while read path + do + if test $(expr length "$path") -ge 40 + then + return 1 + fi + done + +' + remaining_notes=10 test_tick cat >input <