diff options
Diffstat (limited to 'builtin/diff-tree.c')
| -rw-r--r-- | builtin/diff-tree.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index a8e68ce8ef..e31cc797fe 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -1,4 +1,5 @@ -#define USE_THE_INDEX_VARIABLE +#define USE_THE_REPOSITORY_VARIABLE + #include "builtin.h" #include "config.h" #include "diff.h" @@ -7,8 +8,8 @@ #include "hex.h" #include "log-tree.h" #include "read-cache-ll.h" -#include "repository.h" #include "revision.h" +#include "tmp-objdir.h" #include "tree.h" static struct rev_info log_tree_opt; @@ -108,7 +109,10 @@ static void diff_tree_tweak_rev(struct rev_info *rev) } } -int cmd_diff_tree(int argc, const char **argv, const char *prefix) +int cmd_diff_tree(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { char line[1000]; struct object *tree1, *tree2; @@ -118,8 +122,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) int read_stdin = 0; int merge_base = 0; - if (argc == 2 && !strcmp(argv[1], "-h")) - usage(diff_tree_usage); + show_usage_if_asked(argc, argv, diff_tree_usage); git_config(git_diff_basic_config, NULL); /* no "diff" UI options */ @@ -206,7 +209,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) opt->diffopt.rotate_to_strict = 0; opt->diffopt.no_free = 1; if (opt->diffopt.detect_rename) { - if (!the_index.cache) + if (the_repository->index->cache) repo_read_index(the_repository); opt->diffopt.setup |= DIFF_SETUP_USE_SIZE_CACHE; } @@ -231,5 +234,5 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) diff_free(&opt->diffopt); } - return diff_result_code(&opt->diffopt); + return diff_result_code(opt); } |
