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

Function queue_transaction_update

refs/reftable-backend.c:1017–1040  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1015 * multiple worktrees.
1016 */
1017static 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
1042static enum ref_transaction_error prepare_single_update(struct reftable_ref_store *refs,
1043 struct reftable_transaction_data *tx_data,

Callers 1

prepare_single_updateFunction · 0.85

Calls 2

oidcpyFunction · 0.85

Tested by

no test coverage detected