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

Function increment_count

diffcore-rename.c:434–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434static void increment_count(struct dir_rename_info *info,
435 const char *old_dir,
436 const char *new_dir)
437{
438 struct strintmap *counts;
439 struct strmap_entry *e;
440
441 /* Get the {new_dirs -> counts} mapping using old_dir */
442 e = strmap_get_entry(info->dir_rename_count, old_dir);
443 if (e) {
444 counts = e->value;
445 } else {
446 counts = xmalloc(sizeof(*counts));
447 strintmap_init_with_options(counts, 0, NULL, 1);
448 strmap_put(info->dir_rename_count, old_dir, counts);
449 }
450
451 /* Increment the count for new_dir */
452 strintmap_incr(counts, new_dir, 1);
453}
454
455static void update_dir_rename_counts(struct dir_rename_info *info,
456 struct strintmap *dirs_removed,

Callers 2

update_dir_rename_countsFunction · 0.85

Calls 5

strmap_get_entryFunction · 0.85
strmap_putFunction · 0.85
strintmap_incrFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected