[v2,3/3] tests: add test for git log --no-use-mailmap
diff mbox series

Message ID 20190711172626.16480-4-ariadne@dereferenced.org
State New
Headers show
Series
  • use mailmap by default in git log
Related show

Commit Message

Ariadne Conill July 11, 2019, 5:26 p.m. UTC
In order to prove that the --no-use-mailmap option works as expected,
we add a test for it which runs with -Dlog.mailmap=true to ensure that
the option successfully negates the configured default.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
---
 t/t4203-mailmap.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Beat Bolli July 11, 2019, 5:32 p.m. UTC | #1
On 11.07.19 19:26, Ariadne Conill wrote:
> In order to prove that the --no-use-mailmap option works as expected,
> we add a test for it which runs with -Dlog.mailmap=true to ensure that

s/-D/-c /

This ain't Java :-)

> the option successfully negates the configured default.
> 
> Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
> ---
>  t/t4203-mailmap.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
> index 43b1522ea2..23a8947bce 100755
> --- a/t/t4203-mailmap.sh
> +++ b/t/t4203-mailmap.sh
> @@ -465,6 +465,14 @@ test_expect_success 'Only grep replaced author with --use-mailmap' '
>  	git log --use-mailmap --author "<cto@coompany.xx>" >actual &&
>  	test_must_be_empty actual
>  '
> +cat >expect <<\EOF
> +Author: santa <me@company.xx>
> +EOF
> +
> +test_expect_success 'Grep author with --no-use-mailmap + log.mailmap=True' '
> +	git -c log.mailmap=True log --no-use-mailmap --author santa | grep Author >actual &&
> +	test_cmp expect actual
> +'
>  
>  # git blame
>  cat >expect <<\EOF
> 


Cheers,
Beat
Ariadne Conill July 11, 2019, 5:38 p.m. UTC | #2
Hello,

On Thu, Jul 11, 2019 at 12:32 PM Beat Bolli <dev+git@drbeat.li> wrote:
>
> On 11.07.19 19:26, Ariadne Conill wrote:
> > In order to prove that the --no-use-mailmap option works as expected,
> > we add a test for it which runs with -Dlog.mailmap=true to ensure that
>
> s/-D/-c /
>
> This ain't Java :-)

Indeed, it is not.  I thought I caught that when proofreading the
commit message.  Will resolve in v3.

Thanks for the review!

Ariadne

Patch
diff mbox series

diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 43b1522ea2..23a8947bce 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -465,6 +465,14 @@  test_expect_success 'Only grep replaced author with --use-mailmap' '
 	git log --use-mailmap --author "<cto@coompany.xx>" >actual &&
 	test_must_be_empty actual
 '
+cat >expect <<\EOF
+Author: santa <me@company.xx>
+EOF
+
+test_expect_success 'Grep author with --no-use-mailmap + log.mailmap=True' '
+	git -c log.mailmap=True log --no-use-mailmap --author santa | grep Author >actual &&
+	test_cmp expect actual
+'
 
 # git blame
 cat >expect <<\EOF