* Queue a reference update for the correct stack. We potentially need to * handle multiple stack updates in a single transaction when it spans across * multiple worktrees. */
| 1015 | * multiple worktrees. |
| 1016 | */ |
| 1017 | static int queue_transaction_update(struct reftable_ref_store *refs, |
| 1018 | struct reftable_transaction_data *tx_data, |
| 1019 | struct ref_update *update, |
| 1020 | struct object_id *current_oid, |
| 1021 | struct strbuf *err) |
| 1022 | { |
| 1023 | struct write_transaction_table_arg *arg = NULL; |
| 1024 | int ret; |
| 1025 | |
| 1026 | if (update->backend_data) |
| 1027 | BUG("reference update queued more than once"); |
| 1028 | |
| 1029 | ret = prepare_transaction_update(&arg, refs, tx_data, update, err); |
| 1030 | if (ret < 0) |
| 1031 | return ret; |
| 1032 | |
| 1033 | ALLOC_GROW(arg->updates, arg->updates_nr + 1, |
| 1034 | arg->updates_alloc); |
| 1035 | arg->updates[arg->updates_nr].update = update; |
| 1036 | oidcpy(&arg->updates[arg->updates_nr].current_oid, current_oid); |
| 1037 | update->backend_data = &arg->updates[arg->updates_nr++]; |
| 1038 | |
| 1039 | return 0; |
| 1040 | } |
| 1041 | |
| 1042 | static enum ref_transaction_error prepare_single_update(struct reftable_ref_store *refs, |
| 1043 | struct reftable_transaction_data *tx_data, |
no test coverage detected