Re: [PATCH 2/2] archive: support gzipped tar files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 14, 2011, 20:30 UTC
- Message-ID
- <7vaadkkvew.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110614181821.GA32685@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
I didn't know it was that easy (primarily because I didn't know zlib had a ready-to-eat interface to do this).
Show 5 quoted lines
> + if (!strcasecmp(ext, "tgz")) > + return "--format=tgz"; > + if (!strcasecmp(ext, "gz") && > + ext - 4 >= filename && > + !strcasecmp(ext - 4, "tar.gz"))
Shouldn't this be
if (!strcasecmp(ext, "gz") && filename < ext - 5 &&
!strcasecmp(ext - 5, ".tar.gz"))to exclude "hellotar.gz" and possibly ".tar.gz" ("<=" vs "<")?Show 9 quoted lines
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index cff1b3e..faf2784 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -26,6 +26,7 @@ commit id embedding:
>
> . ./test-lib.sh
> UNZIP=${UNZIP:-unzip}
> +GUNZIP=${GUNZIP:-gunzip}Just a personal preference but I find myself using "gzip -d" more often than "gunzip".