| 4427 | } |
| 4428 | |
| 4429 | static int remove_file(struct apply_state *state, struct patch *patch, int rmdir_empty) |
| 4430 | { |
| 4431 | if (state->update_index && !state->ita_only) { |
| 4432 | if (remove_file_from_index(state->repo->index, patch->old_name) < 0) |
| 4433 | return error(_("unable to remove %s from index"), patch->old_name); |
| 4434 | } |
| 4435 | if (!state->cached) { |
| 4436 | if (!remove_or_warn(patch->old_mode, patch->old_name) && rmdir_empty) { |
| 4437 | remove_path(patch->old_name); |
| 4438 | } |
| 4439 | } |
| 4440 | return 0; |
| 4441 | } |
| 4442 | |
| 4443 | static int add_index_file(struct apply_state *state, |
| 4444 | const char *path, |
no test coverage detected