Merge branch 'kn/reflog-migration-fix' into kn/reflog-migration-fix-followup

* kn/reflog-migration-fix:
  reftable: write correct max_update_index to header
This commit is contained in:
Junio C Hamano
2025-01-17 15:42:58 -08:00
4 changed files with 30 additions and 10 deletions

7
refs.c
View File

@@ -1345,6 +1345,13 @@ int ref_transaction_update_reflog(struct ref_transaction *transaction,
update->flags &= ~REF_HAVE_OLD;
update->index = index;
/*
* Reference backends may need to know the max index to optimize
* their writes. So we store the max_index on the transaction level.
*/
if (index > transaction->max_index)
transaction->max_index = index;
return 0;
}