tree-diff: convert try_to_follow_renames to struct object_id
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams committed
May 30, 2017 at 10:31 UTC
128be8767d9a20de82f032d5a422fa2a0dadb9bb
1 file changed
+5
-3
tree-diff.c
+5
-3
@@ -577,7 +577,9 @@ static inline int diff_might_be_rename(void)
577
!DIFF_FILE_VALID(diff_queued_diff.queue[0]->one);
578
}
579
580
-static void try_to_follow_renames(const unsigned char *old, const unsigned char *new, struct strbuf *base, struct diff_options *opt)
580
+static void try_to_follow_renames(const struct object_id *old_oid,
581
+ const struct object_id *new_oid,
582
+ struct strbuf *base, struct diff_options *opt)
583
{
584
struct diff_options diff_opts;
585
struct diff_queue_struct *q = &diff_queued_diff;
@@ -615,7 +617,7 @@ static void try_to_follow_renames(const unsigned char *old, const unsigned char
617
diff_opts.break_opt = opt->break_opt;
618
diff_opts.rename_score = opt->rename_score;
619
diff_setup_done(&diff_opts);
618
- ll_diff_tree_sha1(old, new, base, &diff_opts);
620
+ ll_diff_tree_sha1(old_oid->hash, new_oid->hash, base, &diff_opts);
621
diffcore_std(&diff_opts);
622
clear_pathspec(&diff_opts.pathspec);
623
@@ -706,7 +708,7 @@ int diff_tree_oid(const struct object_id *old_oid,
708
709
retval = ll_diff_tree_sha1(old_oid->hash, new_oid->hash, &base, opt);
710
if (!*base_str && DIFF_OPT_TST(opt, FOLLOW_RENAMES) && diff_might_be_rename())
709
- try_to_follow_renames(old_oid->hash, new_oid->hash, &base, opt);
711
+ try_to_follow_renames(old_oid, new_oid, &base, opt);
712
713
strbuf_release(&base);
714