Re: [PATCH] drop support for "experimental" loose objects
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 21, 2013, 12:43 UTC
- Message-ID
- <CACsJy8B5xY1FZyhPdct8Nt6Gad2cveRvmOXTXJP=uCaG2_0KuA@mail.gmail.com>
- In-Reply-To
- <20131121114837.GB7171@sigill.intra.peff.net>
On Thu, Nov 21, 2013 at 6:48 PM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> @@ -1514,14 +1469,6 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf,
>
> int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz)
> {
> - unsigned long size, used;
> - static const char valid_loose_object_type[8] = {
> - 0, /* OBJ_EXT */
> - 1, 1, 1, 1, /* "commit", "tree", "blob", "tag" */
> - 0, /* "delta" and others are invalid in a loose object */
> - };
> - enum object_type type;
> -
> /* Get the data stream */
> memset(stream, 0, sizeof(*stream));
> stream->next_in = map;
> @@ -1529,27 +1476,6 @@ int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long ma
> stream->next_out = buffer;
> stream->avail_out = bufsiz;
>
> - if (experimental_loose_object(map)) {Perhaps keep this..
Show 19 quoted lines
> - /* > - * 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");
?
> - } > git_inflate_init(stream); > return git_inflate(stream, 0); > }
-- Duy