On Sun, Sep 8, 2013 at 10:04 PM, Nguyễn Thái Ngọc Duy <pclo...@gmail.com> wrote:
> +static void prepare_sha1_table(void)
> +{
> +       unsigned i;
> +       /*
> +        * This table includes SHA-1s that may not be present in the
> +        * pack. One of the use of such SHA-1 is for completing thin
> +        * packs, where index-pack does not need to add SHA-1 to the
> +        * table at completion time.
> +        */
> +       v4.all_objs = xmalloc(nr_objects * sizeof(*v4.all_objs));
> +       v4.all_objs_nr = nr_objects;
> +       for (i = 0; i < nr_objects; i++)
> +               v4.all_objs[i] = objects[i].idx;
> +       qsort(v4.all_objs, nr_objects, sizeof(*v4.all_objs),
> +             sha1_idx_sort);
> +}
> +

fwiw this is wrong. Even in the non-thin pack case, pack-objects could
write multiple packs to disk and we need different sha-1 table for
each one. The situation is worse for thin pack because not all
preferred_base entries end up a real dependency in the final pack. I'm
working on it..
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to