author | Raja R Harinath <harinath@hurrynot.org> | |
Tue, 13 Jul 2010 11:51:48 +0000 (17:21 +0530) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Aug 2010 17:45:15 +0000 (10:45 -0700) | ||
commit | 7e7db5e4520388d3a6f1efbe2f7a29d43bd06a2b | |
tree | 2378da4897a9c2dbd2110a5723ca33ef3c950f3b | tree | snapshot |
parent | 5536934239ed0a66fc5ac1d08cfd7e6a0905f80c | commit | diff |
fast-import: export correctly marks larger than 2^20-1
dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
i.e., when the sparse array has more than two levels. The bug was
that the 'base' counter was being shifted by 20 bits at level 3, and
then again by 10 bits at level 2, rather than a total shift of 20 bits
in this argument to the recursive call:
(base + k) << m->shift
There are two ways to fix this correctly, the elegant:
(base + k) << 10
and the one I chose due to edit distance:
base + (k << m->shift)
Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
i.e., when the sparse array has more than two levels. The bug was
that the 'base' counter was being shifted by 20 bits at level 3, and
then again by 10 bits at level 2, rather than a total shift of 20 bits
in this argument to the recursive call:
(base + k) << m->shift
There are two ways to fix this correctly, the elegant:
(base + k) << 10
and the one I chose due to edit distance:
base + (k << m->shift)
Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c | diff | blob | history | |
t/t9300-fast-import.sh | diff | blob | history |