MCPcopy Index your code
hub / github.com/git/git / show_submodule_diff_summary

Function show_submodule_diff_summary

submodule.c:614–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614void 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
643out:
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
654void show_submodule_inline_diff(struct diff_options *o, const char *path,
655 struct object_id *one, struct object_id *two,

Callers 1

builtin_diffFunction · 0.85

Calls 9

open_submoduleFunction · 0.85
show_submodule_headerFunction · 0.85
commit_list_freeFunction · 0.85
release_revisionsFunction · 0.85
clear_commit_marksFunction · 0.85
repo_clearFunction · 0.85

Tested by

no test coverage detected