regex: use regexec_buf()
[gitweb.git] / builtin / diff-index.c
index 1c737f79216fda2e5395422d8aee2e4f5d6482a4..1af373d0021f56f539a1d261e908a60d92ff5b4f 100644 (file)
@@ -7,7 +7,7 @@
 
 static const char diff_cache_usage[] =
 "git diff-index [-m] [--cached] "
-"[<common diff options>] <tree-ish> [<path>...]"
+"[<common-diff-options>] <tree-ish> [<path>...]"
 COMMON_DIFF_OPTIONS_HELP;
 
 int cmd_diff_index(int argc, const char **argv, const char *prefix)
@@ -21,6 +21,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
        gitmodules_config();
        git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
        rev.abbrev = 0;
+       precompose_argv(argc, argv);
 
        argc = setup_revisions(argc, argv, &rev, NULL);
        for (i = 1; i < argc; i++) {
@@ -43,7 +44,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
                usage(diff_cache_usage);
        if (!cached) {
                setup_work_tree();
-               if (read_cache_preload(rev.diffopt.pathspec.raw) < 0) {
+               if (read_cache_preload(&rev.diffopt.pathspec) < 0) {
                        perror("read_cache_preload");
                        return -1;
                }