diff options
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c index 069e4507ae..cfd629da48 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -264,6 +264,9 @@ int setup_diff_no_index(struct rev_info *revs, DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS); break; } + if (nongit && argc != i + 2) + die("git diff [--no-index] takes two paths"); + if (argc != i + 2 || (!is_outside_repo(argv[i + 1], nongit, prefix) && !is_outside_repo(argv[i], nongit, prefix))) return -1; |