summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-26 17:58:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-26 17:58:41 (GMT)
commit61af494ca4e63cdc484ea091617ab5f3974f2f9c (patch)
tree5c8b00bf07ef002926f667852c5e48ef6bb3f6df /builtin-diff.c
parent37a7744ffe31af785571858f7341d588a6c66784 (diff)
downloadgit-61af494ca4e63cdc484ea091617ab5f3974f2f9c.zip
git-61af494ca4e63cdc484ea091617ab5f3974f2f9c.tar.gz
git-61af494ca4e63cdc484ea091617ab5f3974f2f9c.tar.bz2
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 'builtin-diff.c')
-rw-r--r--builtin-diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index d5fe775..26cf678 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -290,6 +290,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
/* Otherwise, we are doing the usual "git" diff */
rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
+ /* Default to let external be used */
+ DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
+
if (nongit)
die("Not a git repository");
argc = setup_revisions(argc, argv, &rev, NULL);
@@ -298,7 +301,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
if (diff_setup_done(&rev.diffopt) < 0)
die("diff_setup_done failed");
}
- DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
+
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
/*