6 static const char diff_cache_usage
[] =
7 "git-diff-index [-m] [--cached] "
8 "[<common diff options>] <tree-ish> [<path>...]"
9 COMMON_DIFF_OPTIONS_HELP
;
11 int main(int argc
, const char **argv
)
14 int match_missing
= 0;
18 git_config(git_diff_config
);
22 argc
= setup_revisions(argc
, argv
, &rev
, NULL
);
23 for (i
= 1; i
< argc
; i
++) {
24 const char *arg
= argv
[i
];
26 if (!strcmp(arg
, "--cached"))
29 usage(diff_cache_usage
);
32 * Make sure there is one revision (i.e. pending object),
33 * and there is no revision filtering parameters.
35 if (!rev
.pending_objects
|| rev
.pending_objects
->next
||
36 rev
.max_count
!= -1 || rev
.min_age
!= -1 || rev
.max_age
!= -1)
37 usage(diff_cache_usage
);
38 return run_diff_index(&rev
, cached
);