Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-26 20:58:41 +0300
committerJunio C Hamano <gitster@pobox.com>2008-11-26 20:58:41 +0300
commit61af494ca4e63cdc484ea091617ab5f3974f2f9c (patch)
tree5c8b00bf07ef002926f667852c5e48ef6bb3f6df /t/t4020-diff-external.sh
parent37a7744ffe31af785571858f7341d588a6c66784 (diff)
Teach "git diff" to honour --[no-]ext-diff
The original intention of 72909be (Add diff-option --ext-diff, 2007-06-30) was to optionally allow the use of external diff viewer in "git log" family (while keeping them disabled by default). It exposed the "allow external diff" bit to the UI, but forgot to adjust the "git diff" codepath that was set up to always allow use of the external diff viewer. Noticed by Nazri Ramliy; tests by René Scharfe squashed in. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4020-diff-external.sh')
-rwxr-xr-xt/t4020-diff-external.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 637b4e19d5..22ef7d44b0 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -43,6 +43,13 @@ test_expect_success 'GIT_EXTERNAL_DIFF environment should apply only to diff' '
'
+test_expect_success 'GIT_EXTERNAL_DIFF environment and --no-ext-diff' '
+
+ GIT_EXTERNAL_DIFF=echo git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'diff attribute' '
git config diff.parrot.command echo &&
@@ -68,6 +75,13 @@ test_expect_success 'diff attribute should apply only to diff' '
'
+test_expect_success 'diff attribute and --no-ext-diff' '
+
+ git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'diff attribute' '
git config --unset diff.parrot.command &&
@@ -94,6 +108,13 @@ test_expect_success 'diff attribute should apply only to diff' '
'
+test_expect_success 'diff attribute and --no-ext-diff' '
+
+ git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'no diff with -diff' '
echo >.gitattributes "file -diff" &&
git diff | grep Binary