diff options
Diffstat (limited to 't/t4203-mailmap.sh')
-rwxr-xr-x | t/t4203-mailmap.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index cd1cab3e54..fa7f987284 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -1022,4 +1022,69 @@ test_expect_success '--mailmap enables mailmap in cat-file for annotated tag obj test_cmp expect actual ' +test_expect_success 'git cat-file -s 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 + git cat-file commit HEAD >commit.out && + echo $(wc -c <commit.out) >expect && + git cat-file --use-mailmap commit HEAD >commit.out && + echo $(wc -c <commit.out) >>expect && + git cat-file -s HEAD >actual && + git cat-file --use-mailmap -s HEAD >>actual && + test_cmp expect actual +' + +test_expect_success 'git cat-file -s returns correct size with --use-mailmap for tag objects' ' + test_when_finished "rm .mailmap" && + cat >.mailmap <<-\EOF && + Orig <orig@example.com> C O Mitter <committer@example.com> + EOF + git tag -a -m "annotated tag" v3 && + git cat-file tag v3 >tag.out && + echo $(wc -c <tag.out) >expect && + git cat-file --use-mailmap tag v3 >tag.out && + echo $(wc -c <tag.out) >>expect && + git cat-file -s v3 >actual && + git cat-file --use-mailmap -s v3 >>actual && + 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 + git cat-file commit HEAD >commit.out && + commit_size=$(wc -c <commit.out) && + commit_sha=$(git rev-parse HEAD) && + echo $commit_sha commit $commit_size >expect && + git cat-file --use-mailmap commit HEAD >commit.out && + commit_size=$(wc -c <commit.out) && + echo $commit_sha commit $commit_size >>expect && + 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 + git cat-file commit HEAD >commit.out && + commit_size=$(wc -c <commit.out) && + commit_sha=$(git rev-parse HEAD) && + echo $commit_sha commit $commit_size >expect && + git cat-file --use-mailmap commit HEAD >commit.out && + commit_size=$(wc -c <commit.out) && + echo $commit_sha commit $commit_size >>expect && + 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 |