refs: allow passing flags when setting up a transaction

Allow passing flags when setting up a transaction such that the
behaviour of the transaction itself can be altered. This functionality
will be used in a subsequent patch.

Adapt callers accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-11-20 08:51:30 +01:00
committed by Junio C Hamano
parent facbe4f633
commit a0efef1446
14 changed files with 33 additions and 26 deletions

View File

@ -1849,7 +1849,7 @@ static void execute_commands_non_atomic(struct command *commands,
continue;
transaction = ref_store_transaction_begin(get_main_ref_store(the_repository),
&err);
0, &err);
if (!transaction) {
rp_error("%s", err.buf);
strbuf_reset(&err);
@ -1878,7 +1878,7 @@ static void execute_commands_atomic(struct command *commands,
const char *reported_error = "atomic push failure";
transaction = ref_store_transaction_begin(get_main_ref_store(the_repository),
&err);
0, &err);
if (!transaction) {
rp_error("%s", err.buf);
strbuf_reset(&err);