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

Function line_log_data_insert

line-log.c:290–313  ·  view source on GitHub ↗

* Note: takes ownership of 'path', which happens to be what the only * caller needs. */

Source from the content-addressed store, hash-verified

288 * caller needs.
289 */
290static void line_log_data_insert(struct line_log_data **list,
291 char *path,
292 long begin, long end)
293{
294 struct line_log_data *ip;
295 struct line_log_data *p = search_line_log_data(*list, path, &ip);
296
297 if (p) {
298 range_set_append_unsafe(&p->ranges, begin, end);
299 free(path);
300 return;
301 }
302
303 CALLOC_ARRAY(p, 1);
304 p->path = path;
305 range_set_append(&p->ranges, begin, end);
306 if (ip) {
307 p->next = ip->next;
308 ip->next = p;
309 } else {
310 p->next = *list;
311 *list = p;
312 }
313}
314
315struct collect_diff_cbdata {
316 struct diff_ranges *diff;

Callers 1

parse_linesFunction · 0.85

Calls 3

search_line_log_dataFunction · 0.85
range_set_append_unsafeFunction · 0.85
range_set_appendFunction · 0.85

Tested by

no test coverage detected