summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-02 20:12:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-02 20:12:02 (GMT)
commit9b274e28871b3e4a4109582a34625df5fddc91c8 (patch)
treec921299d1381a3bd6486ef999e3cc432118d1d72 /t
parente46249f73ebddca06cf16c01e8de1f310360c856 (diff)
parentf3eda90ffc10f9152e7492a34408a9f5e4c28b0f (diff)
downloadgit-9b274e28871b3e4a4109582a34625df5fddc91c8.zip
git-9b274e28871b3e4a4109582a34625df5fddc91c8.tar.gz
git-9b274e28871b3e4a4109582a34625df5fddc91c8.tar.bz2
Merge branch 'jc/log-mailmap-flip-defaults'
Hotfix for making "git log" use the mailmap by default. * jc/log-mailmap-flip-defaults: log: really flip the --mailmap default log: flip the --mailmap default unconditionally
Diffstat (limited to 't')
-rwxr-xr-xt/t4203-mailmap.sh33
-rwxr-xr-xt/t7006-pager.sh2
2 files changed, 33 insertions, 2 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 43b1522..918ada6 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -442,6 +442,34 @@ test_expect_success 'Log output with log.mailmap' '
test_cmp expect actual
'
+test_expect_success 'log.mailmap=false disables mailmap' '
+ cat >expect <<-\EOF &&
+ Author: CTO <cto@coompany.xx>
+ Author: claus <me@company.xx>
+ Author: santa <me@company.xx>
+ Author: nick2 <nick2@company.xx>
+ Author: nick2 <bugs@company.xx>
+ Author: nick1 <bugs@company.xx>
+ Author: A U Thor <author@example.com>
+ EOF
+ git -c log.mailmap=False log | grep Author > actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--no-use-mailmap disables mailmap' '
+ cat >expect <<-\EOF &&
+ Author: CTO <cto@coompany.xx>
+ Author: claus <me@company.xx>
+ Author: santa <me@company.xx>
+ Author: nick2 <nick2@company.xx>
+ Author: nick2 <bugs@company.xx>
+ Author: nick1 <bugs@company.xx>
+ Author: A U Thor <author@example.com>
+ EOF
+ git log --no-use-mailmap | grep Author > actual &&
+ test_cmp expect actual
+'
+
cat >expect <<\EOF
Author: Santa Claus <santa.claus@northpole.xx>
Author: Santa Claus <santa.claus@northpole.xx>
@@ -461,6 +489,11 @@ test_expect_success 'Grep author with log.mailmap' '
test_cmp expect actual
'
+test_expect_success 'log.mailmap is true by default these days' '
+ git log --author Santa | grep Author >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'Only grep replaced author with --use-mailmap' '
git log --use-mailmap --author "<cto@coompany.xx>" >actual &&
test_must_be_empty actual
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 7976fa7..00e09a3 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -7,8 +7,6 @@ test_description='Test automatic use of a pager.'
. "$TEST_DIRECTORY"/lib-terminal.sh
test_expect_success 'setup' '
- : squelch advice messages during the transition &&
- git config --global log.mailmap false &&
sane_unset GIT_PAGER GIT_PAGER_IN_USE &&
test_unconfig core.pager &&