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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 1af373d002..522f4fdffd 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "config.h"
#include "diff.h"
#include "commit.h"
#include "revision.h"
@@ -17,9 +18,11 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
int i;
int result;
- init_revisions(&rev, prefix);
- gitmodules_config();
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage(diff_cache_usage);
+
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
+ init_revisions(&rev, prefix);
rev.abbrev = 0;
precompose_argv(argc, argv);
@@ -53,5 +56,6 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
return -1;
}
result = run_diff_index(&rev, cached);
+ UNLEAK(rev);
return diff_result_code(&rev.diffopt, result);
}