am: release strbuf on error return in hg_patch_to_mail()
[gitweb.git] / builtin / diff-index.c
index 1af373d0021f56f539a1d261e908a60d92ff5b4f..9d772f8f27fe722921c00ea57af1087f988856da 100644 (file)
@@ -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);