Skip to content

Commit

Permalink
Merge branch 'kn/reflog-migration-fix-fix' into seen
Browse files Browse the repository at this point in the history
Fix bugs in an earlier attempt to fix "git refs migration".

* kn/reflog-migration-fix-fix:
  SQUASH - needs to describe the breakage and fix in v1
  • Loading branch information
gitster committed Jan 23, 2025
2 parents 5a7449b + 27ac51d commit 169052c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions refs/reftable-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out,
arg->updates_nr = 0;
arg->updates_alloc = 0;
arg->updates_expected = 0;
arg->max_index = 0;
}

arg->updates_expected++;
Expand Down Expand Up @@ -1630,10 +1631,9 @@ static int reftable_be_transaction_finish(struct ref_store *ref_store UNUSED,
struct reftable_transaction_data *tx_data = transaction->backend_data;
int ret = 0;

if (tx_data->args)
tx_data->args->max_index = transaction->max_index;

for (size_t i = 0; i < tx_data->args_nr; i++) {
tx_data->args[i].max_index = transaction->max_index;

ret = reftable_addition_add(tx_data->args[i].addition,
write_transaction_table, &tx_data->args[i]);
if (ret < 0)
Expand Down

0 comments on commit 169052c

Please sign in to comment.