summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorLibravatar Johan Herland <johan@herland.net>2011-11-25 01:09:47 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-11-28 16:38:46 -0800
commit183868578049f5a28f7166716a4b00768d148958 (patch)
treee7b085ff706db7fa689d316adca3d90fb1e7e751 /t/t6300-for-each-ref.sh
parentt9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling (diff)
downloadtgif-183868578049f5a28f7166716a4b00768d148958.tar.xz
fast-import: Fix incorrect fanout level when modifying existing notes refs
This fixes the bug uncovered by the tests added in the previous two patches. When an existing notes ref was loaded into the fast-import machinery, the num_notes counter associated with that ref remained == 0, even though the true number of notes in the loaded ref was higher. This caused a fanout level of 0 to be used, although the actual fanout of the tree could be > 0. Manipulating the notes tree at an incorrect fanout level causes removals to silently fail, and modifications of existing notes to instead produce an additional note (leaving the old object in place at a different fanout level). This patch fixes the bug by explicitly counting the number of notes in the notes tree whenever it looks like the num_notes counter could be wrong (when num_notes == 0). There may be false positives (i.e. triggering the counting when the notes tree is truly empty), but in those cases, the counting should not take long. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
0 files changed, 0 insertions, 0 deletions