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

Function diff_cache

diff-lib.c:546–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546static int diff_cache(struct rev_info *revs,
547 const struct object_id *tree_oid,
548 const char *tree_name,
549 int cached)
550{
551 struct tree *tree;
552 struct tree_desc t;
553 struct unpack_trees_options opts;
554
555 tree = repo_parse_tree_indirect(the_repository, tree_oid);
556 if (!tree)
557 return error("bad tree object %s",
558 tree_name ? tree_name : oid_to_hex(tree_oid));
559 memset(&opts, 0, sizeof(opts));
560 opts.head_idx = 1;
561 opts.index_only = cached;
562 opts.diff_index_cached = (cached &&
563 !revs->diffopt.flags.find_copies_harder);
564 opts.merge = 1;
565 opts.fn = oneway_diff;
566 opts.unpack_data = revs;
567 opts.src_index = revs->diffopt.repo->index;
568 opts.dst_index = NULL;
569 opts.pathspec = &revs->diffopt.pathspec;
570 opts.pathspec->recursive = 1;
571 if (revs->diffopt.max_depth_valid)
572 die(_("max-depth is not supported for index diffs"));
573
574 init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
575 return unpack_trees(1, &t, &opts);
576}
577
578void diff_get_merge_base(const struct rev_info *revs, struct object_id *mb)
579{

Callers 2

run_diff_indexFunction · 0.85
do_diff_cacheFunction · 0.85

Calls 6

repo_parse_tree_indirectFunction · 0.85
errorFunction · 0.85
oid_to_hexFunction · 0.85
init_tree_descFunction · 0.85
unpack_treesFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected