Re: [PATCH] archive: add test testing MIME for created archive through compression filter
- From
Bagas Sanjaya <bagasdotme@gmail.com>
- Date
- Oct 12, 2021, 03:14 UTC
- Message-ID
- <fab92b70-8004-5765-1b8a-2cf1d12abb63@gmail.com>
- In-Reply-To
- <xmqqlf2zd0d4.fsf@gitster.g>
On 11/10/21 22.53, Junio C Hamano wrote:
Show 12 quoted lines
> I think a lot more portable and robust way to test the feature is to > configure git config tar.tar.test.command (or come up with a name for > a suffix to be used in the test), point it at a script created in this > test script and run git archive with output filename that would trigger > the command. Then, arrange the test to notice if the "test" script was > called with expected command line arguments and standard input. > > That way, you do not need to rely on prereqs and you do not have to > resort to un-portable use of the "file" command. After all, you are > *not* testing if "bzip2 -c" the user happens to have on their $PATH > produces output their "find" recognises as bzip2 compressed. >
The intent of this test is to ensure `git archive -o something.tar.<format>` produces proper compressed tar archive that can be decompressed with the corresponding decompression tool (such as gunzip for gz files), and not just with `tar xvf`.
-- An old man doll... just what I always wanted! - Clara