Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
tree-diff: convert try_to_follow_renames to struct object_id
author
Brandon Williams
<bmwill@google.com>
Tue, 30 May 2017 17:31:05 +0000
(10:31 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 5 Jun 2017 02:23:58 +0000
(11:23 +0900)
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree-diff.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
315f49f
)
diff --git
a/tree-diff.c
b/tree-diff.c
index fc020d76dc651757ea0c6d69d42dedf066370200..29e3f6144b961446f4d976475caf5fdb3faf80de 100644
(file)
--- a/
tree-diff.c
+++ b/
tree-diff.c
@@
-577,7
+577,9
@@
static inline int diff_might_be_rename(void)
!DIFF_FILE_VALID(diff_queued_diff.queue[0]->one);
}
!DIFF_FILE_VALID(diff_queued_diff.queue[0]->one);
}
-static void try_to_follow_renames(const unsigned char *old, const unsigned char *new, struct strbuf *base, struct diff_options *opt)
+static void try_to_follow_renames(const struct object_id *old_oid,
+ const struct object_id *new_oid,
+ struct strbuf *base, struct diff_options *opt)
{
struct diff_options diff_opts;
struct diff_queue_struct *q = &diff_queued_diff;
{
struct diff_options diff_opts;
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
diff_opts.break_opt = opt->break_opt;
diff_opts.rename_score = opt->rename_score;
diff_setup_done(&diff_opts);
diff_opts.break_opt = opt->break_opt;
diff_opts.rename_score = opt->rename_score;
diff_setup_done(&diff_opts);
- ll_diff_tree_sha1(old
, new
, base, &diff_opts);
+ ll_diff_tree_sha1(old
_oid->hash, new_oid->hash
, base, &diff_opts);
diffcore_std(&diff_opts);
clear_pathspec(&diff_opts.pathspec);
diffcore_std(&diff_opts);
clear_pathspec(&diff_opts.pathspec);
@@
-706,7
+708,7
@@
int diff_tree_oid(const struct object_id *old_oid,
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())
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_oid
->hash, new_oid->hash
, &base, opt);
+ try_to_follow_renames(old_oid
, new_oid
, &base, opt);
strbuf_release(&base);
strbuf_release(&base);