aboutsummaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2024-06-24 21:15:45 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-24 13:49:41 -0700
commit0f4b0d4cf0e192b770529b97712f31dcf365e118 (patch)
tree62e707ce92eda719d811bab1467ddd8c5f415bce /t/t4015-diff-whitespace.sh
parent786a3e4b8d754d2b14b1208b98eeb0a554ef19a8 (diff)
downloadgit-0f4b0d4cf0e192b770529b97712f31dcf365e118.tar.xz
diff: allow --color-moved with --no-ext-diff
We ignore the option --color-moved if an external diff program is configured, presumably because its overhead is unnecessary in that case. Respect the option if we don't actually use the external diff, though. Reported-by: lolligerhans@gmx.de Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index b443626afd..851cfe4f32 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -1184,6 +1184,15 @@ test_expect_success 'detect moved code, complete file' '
test_cmp expected actual
'
+test_expect_success '--color-moved with --no-ext-diff' '
+ test_config color.diff.oldMoved "yellow" &&
+ test_config color.diff.newMoved "blue" &&
+ args="--color --color-moved=zebra --no-renames HEAD" &&
+ git diff $args >expect &&
+ git -c diff.external=echo diff --no-ext-diff $args >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'detect malicious moved code, inside file' '
test_config color.diff.oldMoved "normal red" &&
test_config color.diff.newMoved "normal green" &&