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

2013-08-21 Thread Jeff King
Git should never generate packs with duplicate objects. However, we may see such packs due to bugs in Git or other implementations (e.g., JGit had such a bug a few years ago). In theory, such packs should not be a problem for us (we will simply find one of the instances of the object when looking

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

2013-08-22 Thread Duy Nguyen
On Thu, Aug 22, 2013 at 3:52 AM, Jeff King 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) { > +

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

2013-08-22 Thread Jeff King
On Thu, Aug 22, 2013 at 08:45:19PM +0700, Nguyen Thai Ngoc Duy wrote: > On Thu, Aug 22, 2013 at 3:52 AM, Jeff King 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 =