| 432 | } |
| 433 | |
| 434 | static 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 | |
| 455 | static void update_dir_rename_counts(struct dir_rename_info *info, |
| 456 | struct strintmap *dirs_removed, |
no test coverage detected