combine-diff: convert find_paths_* to struct object_id

Convert find_paths_generic and find_paths_multitree to use 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 09fae19aa8db639d2384a98f8ebd2f9ec66f6e28
1 file changed +6 -6
combine-diff.c
+6 -6
@@ -1311,7 +1311,7 @@ static const char *path_path(void *obj)
1311
1312
1313 /* find set of paths that every parent touches */
1314 -static struct combine_diff_path *find_paths_generic(const unsigned char *sha1,
1314 +static struct combine_diff_path *find_paths_generic(const struct object_id *oid,
1315 const struct oid_array *parents, struct diff_options *opt)
1316 {
1317 struct combine_diff_path *paths = NULL;
@@ -1336,7 +1336,7 @@ static struct combine_diff_path *find_paths_generic(const unsigned char *sha1,
1336 opt->output_format = stat_opt;
1337 else
1338 opt->output_format = DIFF_FORMAT_NO_OUTPUT;
1339 - diff_tree_sha1(parents->oid[i].hash, sha1, "", opt);
1339 + diff_tree_sha1(parents->oid[i].hash, oid->hash, "", opt);
1340 diffcore_std(opt);
1341 paths = intersect_paths(paths, i, num_parent);
1342
@@ -1360,7 +1360,7 @@ static struct combine_diff_path *find_paths_generic(const unsigned char *sha1,
1360 * rename/copy detection, etc, comparing all trees simultaneously (= faster).
1361 */
1362 static struct combine_diff_path *find_paths_multitree(
1363 - const unsigned char *sha1, const struct oid_array *parents,
1363 + const struct object_id *oid, const struct oid_array *parents,
1364 struct diff_options *opt)
1365 {
1366 int i, nparent = parents->nr;
@@ -1376,7 +1376,7 @@ static struct combine_diff_path *find_paths_multitree(
1376 paths_head.next = NULL;
1377
1378 strbuf_init(&base, PATH_MAX);
1379 - diff_tree_paths(&paths_head, sha1, parents_sha1, nparent, &base, opt);
1379 + diff_tree_paths(&paths_head, oid->hash, parents_sha1, nparent, &base, opt);
1380
1381 strbuf_release(&base);
1382 free(parents_sha1);
@@ -1448,11 +1448,11 @@ void diff_tree_combined(const struct object_id *oid,
1448 * diff(sha1,parent_i) for all i to do the job, specifically
1449 * for parent0.
1450 */
1451 - paths = find_paths_generic(oid->hash, parents, &diffopts);
1451 + paths = find_paths_generic(oid, parents, &diffopts);
1452 }
1453 else {
1454 int stat_opt;
1455 - paths = find_paths_multitree(oid->hash, parents, &diffopts);
1455 + paths = find_paths_multitree(oid, parents, &diffopts);
1456
1457 /*
1458 * show stat against the first parent even