MCPcopy Create free account
hub / github.com/git/git / range_set_map_across_diff

Function range_set_map_across_diff

line-log.c:457–475  ·  view source on GitHub ↗

* Given a diff and the set of interesting ranges, map the ranges * across the diff. That is: observe that the target commit takes * blame for all the + (target-side) ranges. So for every pair of * ranges in the diff that was touched, we remove the latter and add * its parent side. */

Source from the content-addressed store, hash-verified

455 * its parent side.
456 */
457static void range_set_map_across_diff(struct range_set *out,
458 struct range_set *rs,
459 struct diff_ranges *diff,
460 struct diff_ranges **touched_out)
461{
462 struct diff_ranges *touched = xmalloc(sizeof(*touched));
463 struct range_set tmp1 = RANGE_SET_INIT;
464 struct range_set tmp2 = RANGE_SET_INIT;
465
466 diff_ranges_init(touched);
467 diff_ranges_filter_touched(touched, diff, rs);
468 range_set_difference(&tmp1, rs, &touched->target);
469 range_set_shift_diff(&tmp2, &tmp1, diff);
470 range_set_union(out, &tmp2, &touched->parent);
471 range_set_release(&tmp1);
472 range_set_release(&tmp2);
473
474 *touched_out = touched;
475}
476
477static struct commit *check_single_commit(struct rev_info *revs)
478{

Callers 1

process_diff_filepairFunction · 0.85

Calls 7

diff_ranges_initFunction · 0.85
range_set_differenceFunction · 0.85
range_set_shift_diffFunction · 0.85
range_set_unionFunction · 0.85
range_set_releaseFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected