X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-diff-index.c;h=04837494feba401c7f689eab5574768d3fd126de;hb=264b774ba6b27cc07ef4c33d52e491d9abf029bb;hp=2f44ebfcdd86cde2347258dbeb1e5c4b9cab0622;hpb=17d778e710f9dacc770b5790e792b85cdba75a9d;p=git.git diff --git a/builtin-diff-index.c b/builtin-diff-index.c index 2f44ebfcd..04837494f 100644 --- a/builtin-diff-index.c +++ b/builtin-diff-index.c @@ -5,7 +5,7 @@ #include "builtin.h" static const char diff_cache_usage[] = -"git-diff-index [-m] [--cached] " +"git diff-index [-m] [--cached] " "[] [...]" COMMON_DIFF_OPTIONS_HELP; @@ -39,6 +39,8 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix) if (rev.pending.nr != 1 || rev.max_count != -1 || rev.min_age != -1 || rev.max_age != -1) usage(diff_cache_usage); + if (!cached) + setup_work_tree(); if (read_cache() < 0) { perror("read_cache"); return -1;