!strcmp(argv[1], "--no-index")) {
revs->max_count = -2;
revs->diffopt.exit_with_status = 1;
+ revs->diffopt.no_index = 1;
}
else if (!strcmp(argv[1], "-q"))
*silent = 1;
*/
read_cache();
if (!is_in_index(revs->diffopt.paths[0]) ||
- !is_in_index(revs->diffopt.paths[1]))
+ !is_in_index(revs->diffopt.paths[1])) {
revs->max_count = -2;
+ revs->diffopt.no_index = 1;
+ }
}
/*
else
revs->diffopt.paths = argv + argc - 2;
revs->diffopt.nr_paths = 2;
+ revs->diffopt.no_index = 1;
revs->max_count = -2;
+ if (diff_setup_done(&revs->diffopt) < 0)
+ die("diff_setup_done failed");
return 0;
}
if (handle_diff_files_args(revs, argc, argv, &silent_on_removed))
return -1;
- if (revs->max_count == -2) {
+ if (revs->diffopt.no_index) {
if (revs->diffopt.nr_paths != 2)
return error("need two files/directories with --no-index");
if (queue_diff(&revs->diffopt, revs->diffopt.paths[0],