Re: [PATCH v4 2/3] cat-file: add mailmap support to --batch-check option
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Nov 15, 2022, 21:40 UTC
- Message-ID
- <Y3QHPYiZl7PbyFhP@nand.local>
- In-Reply-To
- <20221113212830.92609-3-siddharthasthana31@gmail.com>
On Mon, Nov 14, 2022 at 02:58:29AM +0530, Siddharth Asthana wrote:
Show 35 quoted lines
> @@ -1051,4 +1051,34 @@ test_expect_success 'git cat-file -s returns correct size with --use-mailmap for > test_cmp expect actual > ' > > +test_expect_success 'git cat-file --batch-check returns correct size with --use-mailmap' ' > + test_when_finished "rm .mailmap" && > + cat >.mailmap <<-\EOF && > + C O Mitter <committer@example.com> Orig <orig@example.com> > + EOF > + cat >expect <<-\EOF && > + 92d99959b011b1cd69fe7be5315d6732fe302575 commit 209 > + 92d99959b011b1cd69fe7be5315d6732fe302575 commit 220 > + EOF > + echo "HEAD" >in && > + git cat-file --batch-check <in >actual && > + git cat-file --use-mailmap --batch-check <in >>actual && > + test_cmp expect actual > +' > + > +test_expect_success 'git cat-file --batch-command returns correct size with --use-mailmap' ' > + test_when_finished "rm .mailmap" && > + cat >.mailmap <<-\EOF && > + C O Mitter <committer@example.com> Orig <orig@example.com> > + EOF > + cat >expect <<-\EOF && > + 92d99959b011b1cd69fe7be5315d6732fe302575 commit 209 > + 92d99959b011b1cd69fe7be5315d6732fe302575 commit 220 > + EOF > + echo "info HEAD" >in && > + git cat-file --batch-command <in >actual && > + git cat-file --use-mailmap --batch-command <in >>actual && > + test_cmp expect actual > +' > + > test_done
These two tests (and the -s ones above it) are not going to work when run under SHA-256 mode, i.e., with 'GIT_TEST_DEFAULT_HASH=sha256' in the environment:
not ok 66 - git cat-file -s returns correct size with --use-mailmap not ok 67 - git cat-file -s returns correct size with --use-mailmap for tag objects not ok 68 - git cat-file --batch-check returns correct size with --use-mailmap not ok 69 - git cat-file --batch-command returns correct size with --use-mailmap
Thanks, Taylor