On Thu, Nov 21, 2013 at 07:43:03PM +0700, Duy Nguyen wrote:

> > -       if (experimental_loose_object(map)) {
> 
> Perhaps keep this..
> 
> > -               /*
> > -                * The old experimental format we no longer produce;
> > -                * we can still read it.
> > -                */
> > -               used = unpack_object_header_buffer(map, mapsize, &type, 
> > &size);
> > -               if (!used || !valid_loose_object_type[type])
> > -                       return -1;
> > -               map += used;
> > -               mapsize -= used;
> > -
> > -               /* Set up the stream for the rest.. */
> > -               stream->next_in = map;
> > -               stream->avail_in = mapsize;
> > -               git_inflate_init(stream);
> > -
> > -               /* And generate the fake traditional header */
> > -               stream->total_out = 1 + snprintf(buffer, bufsiz, "%s %lu",
> > -                                                typename(type), size);
> > -               return 0;
> 
> and replace all this with
> 
> die("detected an object in obsolete format, please repack the
> repository using a version before XXX");

That would eliminate the second part of my purpose, which is to not
die() on a corrupted object because we incorrectly guess that it is
experimental.

If we think these objects are in the wild, the right thing to do would
be to warn() and continue. But I really find it hard to believe any such
objects exist at this point.

-Peff
--
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