index-pack: Don't follow replace refs.
Without this, attempting to index a pack containing objects that have been replaced results in a fatal error that looks like: fatal: SHA1 COLLISION FOUND WITH <replaced-object> ! Signed-off-by: Nelson Elhage <nelhage@ksplice.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nelson Elhage committed
Aug 12, 2010 at 10:18 UTC
6e2a09d24b2634cdfec3395122cd4a07eb517b0d
2 files changed
+8
builtin/index-pack.c
+2
@@ -884,6 +884,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
884
if (argc == 2 && !strcmp(argv[1], "-h"))
885
usage(index_pack_usage);
886
887
+ read_replace_refs = 0;
888
+
889
/*
890
* We wish to read the repository's config file if any, and
891
* for that it is necessary to call setup_git_directory_gently().
t/t6050-replace.sh
+6
@@ -219,6 +219,12 @@ test_expect_success 'bisect and replacements' '
219
git bisect reset
220
'
221
222
+test_expect_success 'index-pack and replacements' '
223
+ git --no-replace-objects rev-list --objects HEAD |
224
+ git --no-replace-objects pack-objects test- &&
225
+ git index-pack test-*.pack
226
+'
227
+
228
#
229
#
230
test_done