| 636 | }; |
| 637 | |
| 638 | static void reftable_addition_close(struct reftable_addition *add) |
| 639 | { |
| 640 | struct reftable_buf nm = REFTABLE_BUF_INIT; |
| 641 | size_t i; |
| 642 | |
| 643 | for (i = 0; i < add->new_tables_len; i++) { |
| 644 | if (!stack_filename(&nm, add->stack, add->new_tables[i])) |
| 645 | unlink(nm.buf); |
| 646 | reftable_free(add->new_tables[i]); |
| 647 | add->new_tables[i] = NULL; |
| 648 | } |
| 649 | reftable_free(add->new_tables); |
| 650 | add->new_tables = NULL; |
| 651 | add->new_tables_len = 0; |
| 652 | add->new_tables_cap = 0; |
| 653 | |
| 654 | flock_release(&add->tables_list_lock); |
| 655 | reftable_buf_release(&nm); |
| 656 | } |
| 657 | |
| 658 | static int reftable_stack_init_addition(struct reftable_addition *add, |
| 659 | struct reftable_stack *st, |
no test coverage detected