]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3701: verify that the diff.algorithm config setting is handled
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 13:08:23 +0000 (13:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 16:57:34 +0000 (08:57 -0800)
Without this patch, there is actually no test in Git's test suite that
covers the diff.algorithm feature. Let's add one.

We do this by passing a bogus value and then expecting `git diff-files`
to produce the appropriate error message.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3701-add-interactive.sh

index 797610e96d00d6aa0aa5e4460b78cdb9a41b7a1b..f43634102ec59ee3687cd4e009db7941fd78c496 100755 (executable)
@@ -524,6 +524,16 @@ test_expect_success 'detect bogus diffFilter output' '
        test_must_fail force_color git add -p <y
 '
 
+test_expect_success 'diff.algorithm is passed to `git diff-files`' '
+       git reset --hard &&
+
+       >file &&
+       git add file &&
+       echo changed >file &&
+       git -c diff.algorithm=bogus add -p 2>err &&
+       test_i18ngrep "error: option diff-algorithm accepts " err
+'
+
 test_expect_success 'patch-mode via -i prompts for files' '
        git reset --hard &&