diff options
Diffstat (limited to 'builtin-diff.c')
-rw-r--r-- | builtin-diff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-diff.c b/builtin-diff.c index 28b660a780..4efbb8237b 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -215,7 +215,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix) git_config(git_diff_ui_config); init_revisions(&rev, prefix); - 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_PATCH; if (diff_setup_done(&rev.diffopt) < 0) |