diff options
Diffstat (limited to 'builtin/diff-files.c')
-rw-r--r-- | builtin/diff-files.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 951c7c8994..e88493ffe5 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -4,6 +4,7 @@ * Copyright (C) Linus Torvalds, 2005 */ #include "cache.h" +#include "config.h" #include "diff.h" #include "commit.h" #include "revision.h" @@ -11,7 +12,7 @@ #include "submodule.h" static const char diff_files_usage[] = -"git diff-files [-q] [-0/-1/2/3 |-c|--cc] [<common diff options>] [<path>...]" +"git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]" COMMON_DIFF_OPTIONS_HELP; int cmd_diff_files(int argc, const char **argv, const char *prefix) @@ -20,10 +21,13 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) int result; unsigned options = 0; - init_revisions(&rev, prefix); - gitmodules_config(); + if (argc == 2 && !strcmp(argv[1], "-h")) + usage(diff_files_usage); + git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ + init_revisions(&rev, prefix); rev.abbrev = 0; + precompose_argv(argc, argv); argc = setup_revisions(argc, argv, &rev, NULL); while (1 < argc && argv[1][0] == '-') { @@ -61,7 +65,7 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) (rev.diffopt.output_format & DIFF_FORMAT_PATCH)) rev.combine_merges = rev.dense_combined_merges = 1; - if (read_cache_preload(rev.diffopt.paths) < 0) { + if (read_cache_preload(&rev.diffopt.pathspec) < 0) { perror("read_cache_preload"); return -1; } |