| 3444 | } |
| 3445 | |
| 3446 | static void add_to_fn_table(struct apply_state *state, struct patch *patch) |
| 3447 | { |
| 3448 | struct string_list_item *item; |
| 3449 | |
| 3450 | /* |
| 3451 | * Always add new_name unless patch is a deletion |
| 3452 | * This should cover the cases for normal diffs, |
| 3453 | * file creations and copies |
| 3454 | */ |
| 3455 | if (patch->new_name) { |
| 3456 | item = string_list_insert(&state->fn_table, patch->new_name); |
| 3457 | item->util = patch; |
| 3458 | } |
| 3459 | |
| 3460 | /* |
| 3461 | * store a failure on rename/deletion cases because |
| 3462 | * later chunks shouldn't patch old names |
| 3463 | */ |
| 3464 | if ((patch->new_name == NULL) || (patch->is_rename)) { |
| 3465 | item = string_list_insert(&state->fn_table, patch->old_name); |
| 3466 | item->util = PATH_WAS_DELETED; |
| 3467 | } |
| 3468 | } |
| 3469 | |
| 3470 | static void prepare_fn_table(struct apply_state *state, struct patch *patch) |
| 3471 | { |
no test coverage detected