diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-05-06 22:10:35 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-08 15:12:58 +0900 |
commit | 944cffbd18a7dbe0b4c5849da6f093c41b49ea00 (patch) | |
tree | 2f772ea511efebff44244c955345182ce2dfedd1 /diff-lib.c | |
parent | a9b5f5bfd50bfd0a96e464ccf926092ffe03163a (diff) | |
download | git-944cffbd18a7dbe0b4c5849da6f093c41b49ea00.tar.gz |
diff-lib: convert do_diff_cache to struct object_id
This is needed to convert parse_tree_indirect.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/diff-lib.c b/diff-lib.c index 52447466b5..ee9df0f847 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -478,7 +478,7 @@ static int oneway_diff(const struct cache_entry * const *src, } static int diff_cache(struct rev_info *revs, - const unsigned char *tree_sha1, + const struct object_id *tree_oid, const char *tree_name, int cached) { @@ -486,10 +486,10 @@ static int diff_cache(struct rev_info *revs, struct tree_desc t; struct unpack_trees_options opts; - tree = parse_tree_indirect(tree_sha1); + tree = parse_tree_indirect(tree_oid->hash); if (!tree) return error("bad tree object %s", - tree_name ? tree_name : sha1_to_hex(tree_sha1)); + tree_name ? tree_name : oid_to_hex(tree_oid)); memset(&opts, 0, sizeof(opts)); opts.head_idx = 1; opts.index_only = cached; @@ -512,7 +512,7 @@ int run_diff_index(struct rev_info *revs, int cached) struct object_array_entry *ent; ent = revs->pending.objects; - if (diff_cache(revs, ent->item->oid.hash, ent->name, cached)) + if (diff_cache(revs, &ent->item->oid, ent->name, cached)) exit(128); diff_set_mnemonic_prefix(&revs->diffopt, "c/", cached ? "i/" : "w/"); @@ -522,7 +522,7 @@ int run_diff_index(struct rev_info *revs, int cached) return 0; } -int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt) +int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt) { struct rev_info revs; @@ -530,7 +530,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt) copy_pathspec(&revs.prune_data, &opt->pathspec); revs.diffopt = *opt; - if (diff_cache(&revs, tree_sha1, NULL, 1)) + if (diff_cache(&revs, tree_oid, NULL, 1)) exit(128); return 0; } |