tree-diff: convert diff_root_tree_sha1 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:30 UTC
7b8dea0c7570a2028f204498c82c8ca7ec6950e3
5 files changed
+8
-8
builtin/fast-export.c
+2
-2
@@ -566,8 +566,8 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
566
commit->tree->object.oid.hash, "", &rev->diffopt);
567
}
568
else
569
- diff_root_tree_sha1(commit->tree->object.oid.hash,
570
- "", &rev->diffopt);
569
+ diff_root_tree_oid(&commit->tree->object.oid,
570
+ "", &rev->diffopt);
571
572
/* Export the referenced blobs, and remember the marks. */
573
for (i = 0; i < diff_queued_diff.nr; i++)
diff.h
+2
-2
@@ -215,8 +215,8 @@ extern struct combine_diff_path *diff_tree_paths(
215
struct strbuf *base, struct diff_options *opt);
216
extern int diff_tree_sha1(const unsigned char *old, const unsigned char *new,
217
const char *base, struct diff_options *opt);
218
-extern int diff_root_tree_sha1(const unsigned char *new, const char *base,
219
- struct diff_options *opt);
218
+extern int diff_root_tree_oid(const struct object_id *new_oid, const char *base,
219
+ struct diff_options *opt);
220
221
struct combine_diff_path {
222
struct combine_diff_path *next;
log-tree.c
+1
-1
@@ -803,7 +803,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
803
parents = get_saved_parents(opt, commit);
804
if (!parents) {
805
if (opt->show_root_diff) {
806
- diff_root_tree_sha1(oid->hash, "", &opt->diffopt);
806
+ diff_root_tree_oid(oid, "", &opt->diffopt);
807
log_tree_diff_flush(opt);
808
}
809
return !opt->loginfo;
patch-ids.c
+1
-1
@@ -20,7 +20,7 @@ int commit_patch_id(struct commit *commit, struct diff_options *options,
20
diff_tree_sha1(commit->parents->item->object.oid.hash,
21
commit->object.oid.hash, "", options);
22
else
23
- diff_root_tree_sha1(commit->object.oid.hash, "", options);
23
+ diff_root_tree_oid(&commit->object.oid, "", options);
24
diffcore_std(options);
25
return diff_flush_patch_id(options, oid, diff_header_only);
26
}
tree-diff.c
+2
-2
@@ -711,7 +711,7 @@ int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const cha
711
return retval;
712
}
713
714
-int diff_root_tree_sha1(const unsigned char *new, const char *base, struct diff_options *opt)
714
+int diff_root_tree_oid(const struct object_id *new_oid, const char *base, struct diff_options *opt)
715
{
716
- return diff_tree_sha1(NULL, new, base, opt);
716
+ return diff_tree_sha1(NULL, new_oid->hash, base, opt);
717
}