X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-write.c;h=f84adde3eb3bb6f6d3f4a871167d6a07ef73ebd8;hb=39af78961d8e7f4c0aee73e77e9eb5b6033f79c2;hp=9cd3bfbb4b3859cbbdc1b9375ea95f511fffc94e;hpb=01e0f162a70f61de0b7aa0e9d8c49c03cbafeb64;p=git.git diff --git a/pack-write.c b/pack-write.c index 9cd3bfbb4..f84adde3e 100644 --- a/pack-write.c +++ b/pack-write.c @@ -129,6 +129,10 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec } sha1write(f, obj->sha1, 20); git_SHA1_Update(&ctx, obj->sha1, 20); + if ((opts->flags & WRITE_IDX_STRICT) && + (i && !hashcmp(list[-2]->sha1, obj->sha1))) + die("The same object %s appears twice in the pack", + sha1_to_hex(obj->sha1)); } if (index_version >= 2) {