diff options
author | Brandon Williams <bmwill@google.com> | 2017-05-30 19:31:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-05 04:23:58 +0200 |
commit | 66f414f885aa6f44ae9e764bdd3e3cd7bd80c5a3 (patch) | |
tree | 93238d8cef2a91c8792e591e2752bb1971543581 /tree-diff.c | |
parent | notes-merge: convert write_note_to_worktree to struct object_id (diff) | |
download | git-66f414f885aa6f44ae9e764bdd3e3cd7bd80c5a3.tar.xz git-66f414f885aa6f44ae9e764bdd3e3cd7bd80c5a3.zip |
diff-tree: convert diff_tree_sha1 to struct object_id
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | tree-diff.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tree-diff.c b/tree-diff.c index f9bbaf3c47..fc020d76dc 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -419,7 +419,7 @@ static struct combine_diff_path *ll_diff_tree_paths( * load parents first, as they are probably already cached. * * ( log_tree_diff() parses commit->parent before calling here via - * diff_tree_sha1(parent, commit) ) + * diff_tree_oid(parent, commit) ) */ for (i = 0; i < nparent; ++i) tptree[i] = fill_tree_descriptor(&tp[i], parents_sha1[i]); @@ -694,7 +694,9 @@ static int ll_diff_tree_sha1(const unsigned char *old, const unsigned char *new, return 0; } -int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const char *base_str, struct diff_options *opt) +int diff_tree_oid(const struct object_id *old_oid, + const struct object_id *new_oid, + const char *base_str, struct diff_options *opt) { struct strbuf base; int retval; @@ -702,9 +704,9 @@ int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const cha strbuf_init(&base, PATH_MAX); strbuf_addstr(&base, base_str); - retval = ll_diff_tree_sha1(old, new, &base, opt); + retval = ll_diff_tree_sha1(old_oid->hash, new_oid->hash, &base, opt); if (!*base_str && DIFF_OPT_TST(opt, FOLLOW_RENAMES) && diff_might_be_rename()) - try_to_follow_renames(old, new, &base, opt); + try_to_follow_renames(old_oid->hash, new_oid->hash, &base, opt); strbuf_release(&base); @@ -713,5 +715,5 @@ int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const cha int diff_root_tree_oid(const struct object_id *new_oid, const char *base, struct diff_options *opt) { - return diff_tree_sha1(NULL, new_oid->hash, base, opt); + return diff_tree_oid(NULL, new_oid, base, opt); } |