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

Function run_diff_index

diff-lib.c:621–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621void run_diff_index(struct rev_info *revs, unsigned int option)
622{
623 struct object_array_entry *ent;
624 int cached = !!(option & DIFF_INDEX_CACHED);
625 int merge_base = !!(option & DIFF_INDEX_MERGE_BASE);
626 struct object_id oid;
627 const char *name;
628 char merge_base_hex[GIT_MAX_HEXSZ + 1];
629 struct index_state *istate = revs->diffopt.repo->index;
630
631 if (revs->pending.nr != 1)
632 BUG("run_diff_index must be passed exactly one tree");
633
634 trace_performance_enter();
635 ent = revs->pending.objects;
636
637 refresh_fsmonitor(istate);
638
639 if (merge_base) {
640 diff_get_merge_base(revs, &oid);
641 name = oid_to_hex_r(merge_base_hex, &oid);
642 } else {
643 oidcpy(&oid, &ent->item->oid);
644 name = ent->name;
645 }
646
647 if (diff_cache(revs, &oid, name, cached))
648 exit(128);
649
650 diff_set_mnemonic_prefix(&revs->diffopt, "c/", cached ? "i/" : "w/");
651 diffcore_fix_diff_index();
652 diffcore_std(&revs->diffopt);
653 diff_flush(&revs->diffopt);
654 trace_performance_leave("diff-index");
655}
656
657int do_diff_cache(const struct object_id *tree_oid, struct diff_options *opt)
658{

Callers 14

has_uncommitted_changesFunction · 0.85
index_differs_fromFunction · 0.85
get_modified_filesFunction · 0.85
write_index_patchFunction · 0.85
fall_back_threewayFunction · 0.85
cmd_diff_indexFunction · 0.85
stash_working_treeFunction · 0.85
cmd_describeFunction · 0.85
show_local_changesFunction · 0.85

Calls 10

trace_performance_enterFunction · 0.85
refresh_fsmonitorFunction · 0.85
diff_get_merge_baseFunction · 0.85
oid_to_hex_rFunction · 0.85
oidcpyFunction · 0.85
diff_cacheFunction · 0.85
diff_set_mnemonic_prefixFunction · 0.85
diffcore_fix_diff_indexFunction · 0.85
diffcore_stdFunction · 0.85
diff_flushFunction · 0.85

Tested by

no test coverage detected