{"thread":{"id":"24719","subject":"[PATCH] index-pack: Don't follow replace refs.","startedAt":"2010-08-12T14:18:12Z","lastAt":"2010-08-12T14:18:12Z","messageCount":1,"participants":["Nelson Elhage"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"147905","messageId":"1281622692-29460-1-git-send-email-nelhage@ksplice.com","threadId":"24719","inReplyTo":null,"subject":"[PATCH] index-pack: Don't follow replace refs.","fromName":"Nelson Elhage","fromEmail":"nelhage@ksplice.com","sentAt":"2010-08-12T14:18:12Z","receivedAt":"2010-08-12T14:18:12Z","isPatch":true,"sender":{"key":"nelhage@mit.edu","avatar":"https://avatars.githubusercontent.com/u/16725?v=4"},"body":"Without this, attempting to index a pack containing objects that have been\nreplaced results in a fatal error that looks like:\n\nfatal: SHA1 COLLISION FOUND WITH <replaced-object> !\n\nSigned-off-by: Nelson Elhage <nelhage@ksplice.com>\nAcked-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/index-pack.c |    2 ++\n t/t6050-replace.sh   |    6 ++++++\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex a89ae83..fad76bf 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -884,6 +884,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)\n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n \t\tusage(index_pack_usage);\n \n+\tread_replace_refs = 0;\n+\n \t/*\n \t * We wish to read the repository's config file if any, and\n \t * for that it is necessary to call setup_git_directory_gently().\ndiff --git a/t/t6050-replace.sh b/t/t6050-replace.sh\nindex 203ffdb..cf423b8 100755\n--- a/t/t6050-replace.sh\n+++ b/t/t6050-replace.sh\n@@ -219,6 +219,12 @@ test_expect_success 'bisect and replacements' '\n      git bisect reset\n '\n \n+test_expect_success 'index-pack and replacements' '\n+     git --no-replace-objects rev-list --objects HEAD | \\\n+       git --no-replace-objects pack-objects test- &&\n+     git index-pack test-*.pack\n+'\n+\n #\n #\n test_done\n-- \n1.7.1.29.g6093d\n"}]}