builtin-help: make some internal functions available to other builtins
[gitweb.git] / builtin-diff-index.c
index 81e7167438ecfc25a6f9a317af663034d653588e..17d851b29ee5de33e01745eabcd5cd735c30b352 100644 (file)
@@ -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>] <tree-ish> [<path>...]"
 COMMON_DIFF_OPTIONS_HELP;
 
@@ -17,7 +17,7 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
        int result;
 
        init_revisions(&rev, prefix);
-       git_config(git_default_config); /* no "diff" UI options */
+       git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
        rev.abbrev = 0;
 
        argc = setup_revisions(argc, argv, &rev, NULL);
@@ -44,5 +44,5 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
                return -1;
        }
        result = run_diff_index(&rev, cached);
-       return rev.diffopt.exit_with_status ? rev.diffopt.has_changes: result;
+       return diff_result_code(&rev.diffopt, result);
 }