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

Function add_to_fn_table

apply.c:3446–3468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3444}
3445
3446static 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
3470static void prepare_fn_table(struct apply_state *state, struct patch *patch)
3471{

Callers 1

apply_dataFunction · 0.85

Calls 1

string_list_insertFunction · 0.85

Tested by

no test coverage detected