aboutsummaryrefslogtreecommitdiff
path: root/builtin-diff-files.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-25 23:35:27 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-28 16:32:31 -0800
commitfcfa33ec905fcde1c16e7cbbe00d7147b89f1f01 (patch)
tree2de48ce64183245fd0beba56ef817dbc8e41d281 /builtin-diff-files.c
parent2eb06531e3d53c2604f20c32e5cb791d5044ff02 (diff)
downloadgit-fcfa33ec905fcde1c16e7cbbe00d7147b89f1f01.tar.gz
git-fcfa33ec905fcde1c16e7cbbe00d7147b89f1f01.tar.xz
diff: make more cases implicit --no-index
When specifying an absolute path, or a relative path pointing outside the working tree, do not fail, but roll your own diffopt parsing, and execute a --no-index diff. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-diff-files.c')
-rw-r--r--builtin-diff-files.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-diff-files.c b/builtin-diff-files.c
index e1199f80a..aec833842 100644
--- a/builtin-diff-files.c
+++ b/builtin-diff-files.c
@@ -23,7 +23,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
git_config(git_default_config); /* no "diff" UI options */
rev.abbrev = 0;
- argc = setup_revisions(argc, argv, &rev, NULL);
+ if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+ argc = 0;
+ else
+ argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format)
rev.diffopt.output_format = DIFF_FORMAT_RAW;
return run_diff_files_cmd(&rev, argc, argv);