X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-write.c;h=f84adde3eb3bb6f6d3f4a871167d6a07ef73ebd8;hb=bd193f46b70fd3f8a55e2a8dcbb1fb2b4eec13d6;hp=9cd3bfbb4b3859cbbdc1b9375ea95f511fffc94e;hpb=7857e3246fef2fdfa3c0fc645cd3d72ff3e6572b;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) {