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

Function run_diffstat

diff.c:5078–5110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5076}
5077
5078static void run_diffstat(struct diff_filepair *p, struct diff_options *o,
5079 struct diffstat_t *diffstat)
5080{
5081 const char *name;
5082 const char *other;
5083
5084 if (!o->ignore_driver_algorithm) {
5085 struct userdiff_driver *drv = userdiff_find_by_path(o->repo->index,
5086 p->one->path);
5087
5088 if (drv && drv->algorithm)
5089 set_diff_algorithm(o, drv->algorithm);
5090 }
5091
5092 if (DIFF_PAIR_UNMERGED(p)) {
5093 /* unmerged */
5094 builtin_diffstat(p->one->path, NULL, NULL, NULL,
5095 diffstat, o, p);
5096 return;
5097 }
5098
5099 name = p->one->path;
5100 other = (strcmp(name, p->two->path) ? p->two->path : NULL);
5101
5102 if (o->prefix_length)
5103 strip_prefix(o->prefix_length, &name, &other);
5104
5105 diff_fill_oid_info(p->one, o->repo->index);
5106 diff_fill_oid_info(p->two, o->repo->index);
5107
5108 builtin_diffstat(name, other, p->one, p->two,
5109 diffstat, o, p);
5110}
5111
5112static void run_checkdiff(struct diff_filepair *p, struct diff_options *o)
5113{

Callers 1

diff_flush_statFunction · 0.85

Calls 5

userdiff_find_by_pathFunction · 0.85
builtin_diffstatFunction · 0.85
strip_prefixFunction · 0.85
diff_fill_oid_infoFunction · 0.85
set_diff_algorithmFunction · 0.70

Tested by

no test coverage detected