summaryrefslogtreecommitdiff
path: root/builtin/diff-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/diff-index.c')
-rw-r--r--builtin/diff-index.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 7d158af6b6..b9a19bb7d3 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -1,4 +1,3 @@
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "cache.h"
#include "config.h"
#include "diff.h"
@@ -6,11 +5,13 @@
#include "commit.h"
#include "revision.h"
#include "builtin.h"
+#include "setup.h"
#include "submodule.h"
static const char diff_cache_usage[] =
-"git diff-index [-m] [--cached] "
+"git diff-index [-m] [--cached] [--merge-base] "
"[<common-diff-options>] <tree-ish> [<path>...]"
+"\n"
COMMON_DIFF_OPTIONS_HELP;
int cmd_diff_index(int argc, const char **argv, const char *prefix)
@@ -61,12 +62,12 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
usage(diff_cache_usage);
if (!(option & DIFF_INDEX_CACHED)) {
setup_work_tree();
- if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
- perror("read_cache_preload");
+ if (repo_read_index_preload(the_repository, &rev.diffopt.pathspec, 0) < 0) {
+ perror("repo_read_index_preload");
return -1;
}
- } else if (read_cache() < 0) {
- perror("read_cache");
+ } else if (repo_read_index(the_repository) < 0) {
+ perror("repo_read_index");
return -1;
}
result = run_diff_index(&rev, option);