Re: [PATCH 2/4] index-pack: optionally reject packs with duplicate objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2013 at 3:52 AM, Jeff King <peff@xxxxxxxx> wrote:
> @@ -68,6 +81,16 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
>         else
>                 sorted_by_sha = list = last = NULL;
>
> +       if (opts->duplicates == WRITE_IDX_DUPLICATES_REJECT) {
> +               struct pack_idx_entry **dup;
> +
> +               dup = find_duplicate(sorted_by_sha, nr_objects,
> +                                    sizeof(*sorted_by_sha), sha1_compare);
> +               if (dup)
> +                       die("pack has duplicate entries for %s",
> +                           sha1_to_hex((*dup)->sha1));
> +       }
> +
>         if (opts->flags & WRITE_IDX_VERIFY) {
>                 assert(index_name);
>                 f = sha1fd_check(index_name);

write_idx_file() is called after index-pack processes all delta
objects. Could resolve_deltas() go cyclic with certain duplicate
object setup?
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]