From fcfa33ec905fcde1c16e7cbbe00d7147b89f1f01 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 25 Feb 2007 23:35:27 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- builtin-diff-files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'builtin-diff-files.c') diff --git a/builtin-diff-files.c b/builtin-diff-files.c index e1199f80ae..aec8338429 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); -- cgit v1.2.3