| 612 | } |
| 613 | |
| 614 | void show_submodule_diff_summary(struct diff_options *o, const char *path, |
| 615 | struct object_id *one, struct object_id *two, |
| 616 | unsigned dirty_submodule) |
| 617 | { |
| 618 | struct rev_info rev = REV_INFO_INIT; |
| 619 | struct commit *left = NULL, *right = NULL; |
| 620 | struct commit_list *merge_bases = NULL; |
| 621 | struct repository *sub; |
| 622 | |
| 623 | sub = open_submodule(path); |
| 624 | show_submodule_header(o, path, one, two, dirty_submodule, |
| 625 | sub, &left, &right, &merge_bases); |
| 626 | |
| 627 | /* |
| 628 | * If we don't have both a left and a right pointer, there is no |
| 629 | * reason to try and display a summary. The header line should contain |
| 630 | * all the information the user needs. |
| 631 | */ |
| 632 | if (!left || !right || !sub) |
| 633 | goto out; |
| 634 | |
| 635 | /* Treat revision walker failure the same as missing commits */ |
| 636 | if (prepare_submodule_diff_summary(sub, &rev, path, left, right, merge_bases)) { |
| 637 | diff_emit_submodule_error(o, "(revision walker failed)\n"); |
| 638 | goto out; |
| 639 | } |
| 640 | |
| 641 | print_submodule_diff_summary(sub, &rev, o); |
| 642 | |
| 643 | out: |
| 644 | commit_list_free(merge_bases); |
| 645 | release_revisions(&rev); |
| 646 | clear_commit_marks(left, ~0); |
| 647 | clear_commit_marks(right, ~0); |
| 648 | if (sub) { |
| 649 | repo_clear(sub); |
| 650 | free(sub); |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | void show_submodule_inline_diff(struct diff_options *o, const char *path, |
| 655 | struct object_id *one, struct object_id *two, |
no test coverage detected