Re: [PATCH v3 5/5] archive-tar: use internal gzip by default
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 13, 2022, 21:55 UTC
- Message-ID
- <xmqqk09k449y.fsf@gitster.g>
- In-Reply-To
- <d9e75b24-c351-e226-011d-5a5cc2e1c858@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 5 quoted lines
> -test_expect_success GZIP 'git archive --format=tar.gz' ' > +test_expect_success 'git archive --format=tar.gz' ' > git archive --format=tar.gz HEAD >j1.tar.gz && > test_cmp_bin j.tgz j1.tar.gz > '
Curiously, this breaks for me. It is understandable if we are not producing byte-for-byte identical output with internal gzip.
With the following hack I can force the step pass, so it seems that the two invocations of internal gzip are not emitting identical result for the tar stream taken out of HEAD^{tree} object?
diff --git c/t/t5000-tar-tree.sh w/t/t5000-tar-tree.sh index 1a68e89a55..c0a2cb92d4 100755 --- c/t/t5000-tar-tree.sh +++ w/t/t5000-tar-tree.sh @@ -340,14 +340,16 @@ test_expect_success 'only enabled filters are available remotely' ' ' test_expect_success 'git archive --format=tgz' ' - git archive --format=tgz HEAD >j.tgz + git -c tar.tgz.command="gzip -cn" archive --format=tgz HEAD >j.tgz ' test_expect_success 'git archive --format=tar.gz' ' - git archive --format=tar.gz HEAD >j1.tar.gz && + git -c tar.tar.gz.command="gzip -cn" archive --format=tar.gz HEAD >j1.tar.gz && test_cmp_bin j.tgz j1.tar.gz ' +exit + test_expect_success 'infer tgz from .tgz filename' ' git archive --output=j2.tgz HEAD && test_cmp_bin j.tgz j2.tgz