find set of paths that every parent touches */
| 1376 | |
| 1377 | /* find set of paths that every parent touches */ |
| 1378 | static struct combine_diff_path *find_paths_generic(const struct object_id *oid, |
| 1379 | const struct oid_array *parents, |
| 1380 | struct diff_options *opt, |
| 1381 | int combined_all_paths) |
| 1382 | { |
| 1383 | struct combine_diff_path *paths = NULL; |
| 1384 | int i, num_parent = parents->nr; |
| 1385 | int output_format = opt->output_format; |
| 1386 | char *orderfile = opt->orderfile; |
| 1387 | |
| 1388 | opt->output_format = DIFF_FORMAT_NO_OUTPUT; |
| 1389 | /* tell diff_tree to emit paths in sorted (=tree) order */ |
| 1390 | opt->orderfile = NULL; |
| 1391 | |
| 1392 | /* D(A,P1...Pn) = D(A,P1) ^ ... ^ D(A,Pn) (wrt paths) */ |
| 1393 | for (i = 0; i < num_parent; i++) { |
| 1394 | /* |
| 1395 | * show stat against the first parent even when doing |
| 1396 | * combined diff. |
| 1397 | */ |
| 1398 | int stat_opt = output_format & STAT_FORMAT_MASK; |
| 1399 | if (i == 0 && stat_opt) |
| 1400 | opt->output_format = stat_opt; |
| 1401 | else |
| 1402 | opt->output_format = DIFF_FORMAT_NO_OUTPUT; |
| 1403 | diff_tree_oid(&parents->oid[i], oid, "", opt); |
| 1404 | diffcore_std(opt); |
| 1405 | paths = intersect_paths(paths, i, num_parent, |
| 1406 | combined_all_paths); |
| 1407 | |
| 1408 | /* if showing diff, show it in requested order */ |
| 1409 | if (opt->output_format != DIFF_FORMAT_NO_OUTPUT && |
| 1410 | orderfile) { |
| 1411 | diffcore_order(orderfile); |
| 1412 | } |
| 1413 | |
| 1414 | diff_flush(opt); |
| 1415 | } |
| 1416 | |
| 1417 | opt->output_format = output_format; |
| 1418 | opt->orderfile = orderfile; |
| 1419 | return paths; |
| 1420 | } |
| 1421 | |
| 1422 | |
| 1423 | /* |
no test coverage detected