Browse Source

combine-diff: convert diff_tree_combined to struct object_id

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Brandon Williams 8 years ago committed by Junio C Hamano
parent
commit
b9acf54dbd
  1. 2
      builtin/diff.c
  2. 10
      combine-diff.c
  3. 2
      diff.h

2
builtin/diff.c

@ -194,7 +194,7 @@ static int builtin_diff_combined(struct rev_info *revs,
revs->dense_combined_merges = revs->combine_merges = 1; revs->dense_combined_merges = revs->combine_merges = 1;
for (i = 1; i < ents; i++) for (i = 1; i < ents; i++)
oid_array_append(&parents, &ent[i].item->oid); oid_array_append(&parents, &ent[i].item->oid);
diff_tree_combined(ent[0].item->oid.hash, &parents, diff_tree_combined(&ent[0].item->oid, &parents,
revs->dense_combined_merges, revs); revs->dense_combined_merges, revs);
oid_array_clear(&parents); oid_array_clear(&parents);
return 0; return 0;

10
combine-diff.c

@ -1384,7 +1384,7 @@ static struct combine_diff_path *find_paths_multitree(
} }




void diff_tree_combined(const unsigned char *sha1, void diff_tree_combined(const struct object_id *oid,
const struct oid_array *parents, const struct oid_array *parents,
int dense, int dense,
struct rev_info *rev) struct rev_info *rev)
@ -1448,11 +1448,11 @@ void diff_tree_combined(const unsigned char *sha1,
* diff(sha1,parent_i) for all i to do the job, specifically * diff(sha1,parent_i) for all i to do the job, specifically
* for parent0. * for parent0.
*/ */
paths = find_paths_generic(sha1, parents, &diffopts); paths = find_paths_generic(oid->hash, parents, &diffopts);
} }
else { else {
int stat_opt; int stat_opt;
paths = find_paths_multitree(sha1, parents, &diffopts); paths = find_paths_multitree(oid->hash, parents, &diffopts);


/* /*
* show stat against the first parent even * show stat against the first parent even
@ -1463,7 +1463,7 @@ void diff_tree_combined(const unsigned char *sha1,
if (stat_opt) { if (stat_opt) {
diffopts.output_format = stat_opt; diffopts.output_format = stat_opt;


diff_tree_sha1(parents->oid[0].hash, sha1, "", &diffopts); diff_tree_sha1(parents->oid[0].hash, oid->hash, "", &diffopts);
diffcore_std(&diffopts); diffcore_std(&diffopts);
if (opt->orderfile) if (opt->orderfile)
diffcore_order(opt->orderfile); diffcore_order(opt->orderfile);
@ -1539,6 +1539,6 @@ void diff_tree_combined_merge(const struct commit *commit, int dense,
oid_array_append(&parents, &parent->item->object.oid); oid_array_append(&parents, &parent->item->object.oid);
parent = parent->next; parent = parent->next;
} }
diff_tree_combined(commit->object.oid.hash, &parents, dense, rev); diff_tree_combined(&commit->object.oid, &parents, dense, rev);
oid_array_clear(&parents); oid_array_clear(&parents);
} }

2
diff.h

@ -236,7 +236,7 @@ struct combine_diff_path {
extern void show_combined_diff(struct combine_diff_path *elem, int num_parent, extern void show_combined_diff(struct combine_diff_path *elem, int num_parent,
int dense, struct rev_info *); int dense, struct rev_info *);


extern void diff_tree_combined(const unsigned char *sha1, const struct oid_array *parents, int dense, struct rev_info *rev); extern void diff_tree_combined(const struct object_id *oid, const struct oid_array *parents, int dense, struct rev_info *rev);


extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev); extern void diff_tree_combined_merge(const struct commit *commit, int dense, struct rev_info *rev);



Loading…
Cancel
Save