| 290 | } |
| 291 | |
| 292 | static void add_remove_files(struct string_list *list) |
| 293 | { |
| 294 | int i; |
| 295 | for (i = 0; i < list->nr; i++) { |
| 296 | struct stat st; |
| 297 | struct string_list_item *p = &(list->items[i]); |
| 298 | |
| 299 | /* p->util is skip-worktree */ |
| 300 | if (p->util) |
| 301 | continue; |
| 302 | |
| 303 | if (!lstat(p->string, &st)) { |
| 304 | if (add_to_index(the_repository->index, p->string, &st, 0)) |
| 305 | die(_("updating files failed")); |
| 306 | } else |
| 307 | remove_file_from_index(the_repository->index, p->string); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | static void create_base_index(const struct commit *current_head) |
| 312 | { |
no test coverage detected