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

Function oneway_diff

diff-lib.c:517–544  ·  view source on GitHub ↗

* The unpack_trees() interface is designed for merging, so * the different source entries are designed primarily for * the source trees, with the old index being really mainly * used for being replaced by the result. * * For diffing, the index is more important, and we only have a * single tree. * * We're supposed to advance o->pos to skip what we have already processed. * * This wrapper

Source from the content-addressed store, hash-verified

515 * the skipping, the path matching, the type conflict cases etc.
516 */
517static int oneway_diff(const struct cache_entry * const *src,
518 struct unpack_trees_options *o)
519{
520 const struct cache_entry *idx = src[0];
521 const struct cache_entry *tree = src[1];
522 struct rev_info *revs = o->unpack_data;
523
524 /*
525 * Unpack-trees generates a DF/conflict entry if
526 * there was a directory in the index and a tree
527 * in the tree. From a diff standpoint, that's a
528 * delete of the tree and a create of the file.
529 */
530 if (tree == o->df_conflict_entry)
531 tree = NULL;
532
533 if (ce_path_match(revs->diffopt.repo->index,
534 idx ? idx : tree,
535 &revs->prune_data, NULL)) {
536 do_oneway_diff(o, idx, tree);
537 if (diff_can_quit_early(&revs->diffopt)) {
538 o->exiting_early = 1;
539 return -1;
540 }
541 }
542
543 return 0;
544}
545
546static int diff_cache(struct rev_info *revs,
547 const struct object_id *tree_oid,

Callers

nothing calls this directly

Calls 3

ce_path_matchFunction · 0.85
do_oneway_diffFunction · 0.85
diff_can_quit_earlyFunction · 0.85

Tested by

no test coverage detected