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

Function index_differs_from

diff-lib.c:674–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674int index_differs_from(struct repository *r,
675 const char *def, const struct diff_flags *flags,
676 int ita_invisible_in_index)
677{
678 struct rev_info rev;
679 struct setup_revision_opt opt;
680 unsigned has_changes;
681
682 repo_init_revisions(r, &rev, NULL);
683 memset(&opt, 0, sizeof(opt));
684 opt.def = def;
685 setup_revisions(0, NULL, &rev, &opt);
686 rev.diffopt.flags.quick = 1;
687 rev.diffopt.flags.exit_with_status = 1;
688 if (flags) {
689 diff_flags_or(&rev.diffopt.flags, flags);
690 /*
691 * Now that flags are merged, honor override_submodule_config
692 * and ignore_submodules from passed flags.
693 */
694 if (flags->override_submodule_config)
695 rev.diffopt.flags.ignore_submodules = flags->ignore_submodules;
696 }
697 rev.diffopt.ita_invisible_in_index = ita_invisible_in_index;
698 run_diff_index(&rev, DIFF_INDEX_CACHED);
699 has_changes = rev.diffopt.flags.has_changes;
700 release_revisions(&rev);
701 return (has_changes != 0);
702}
703
704static const char *idiff_prefix_cb(struct diff_options *opt UNUSED, void *data)
705{

Callers 4

do_pick_commitFunction · 0.85
sequencer_continueFunction · 0.85
prepare_to_commitFunction · 0.85
cmd_merge_oursFunction · 0.85

Calls 5

repo_init_revisionsFunction · 0.85
setup_revisionsFunction · 0.85
diff_flags_orFunction · 0.85
run_diff_indexFunction · 0.85
release_revisionsFunction · 0.85

Tested by

no test coverage detected