diff options
Diffstat (limited to 'builtin/diff-tree.c')
| -rw-r--r-- | builtin/diff-tree.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index 116097a404..a8e68ce8ef 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -1,12 +1,15 @@ -#define USE_THE_INDEX_COMPATIBILITY_MACROS -#include "cache.h" +#define USE_THE_INDEX_VARIABLE +#include "builtin.h" #include "config.h" #include "diff.h" #include "commit.h" +#include "gettext.h" +#include "hex.h" #include "log-tree.h" -#include "builtin.h" -#include "submodule.h" +#include "read-cache-ll.h" #include "repository.h" +#include "revision.h" +#include "tree.h" static struct rev_info log_tree_opt; @@ -83,8 +86,10 @@ static int diff_tree_stdin(char *line) } static const char diff_tree_usage[] = -"git diff-tree [--stdin] [-m] [-c | --cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " -"[<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]\n" +"git diff-tree [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]\n" +" [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]\n" +" [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]\n" +"\n" " -r diff recursively\n" " -c show combined diff for merge commits\n" " --cc show combined diff for merge commits removing uninteresting hunks\n" @@ -93,7 +98,7 @@ static const char diff_tree_usage[] = " --root include the initial commit as diff against /dev/null\n" COMMON_DIFF_OPTIONS_HELP; -static void diff_tree_tweak_rev(struct rev_info *rev, struct setup_revision_opt *opt) +static void diff_tree_tweak_rev(struct rev_info *rev) { if (!rev->diffopt.output_format) { if (rev->dense_combined_merges) @@ -117,8 +122,12 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) usage(diff_tree_usage); git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ + + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + repo_init_revisions(the_repository, opt, prefix); - if (read_cache() < 0) + if (repo_read_index(the_repository) < 0) die(_("index file corrupt")); opt->abbrev = 0; opt->diff = 1; @@ -222,5 +231,5 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) diff_free(&opt->diffopt); } - return diff_result_code(&opt->diffopt, 0); + return diff_result_code(&opt->diffopt); } |
