refs: small followups to the migration corruption fix
This is a follow up to the bug that was reported [1] around git refs migrate --ref-format=reftable
where the migration would fail for repositories with reflogs with lots of entries. This was caused due to a mismatch in the reftable's header and footer, specifically WRT the 'max_update_index'.
While there was a fix posted. This series is a small followup to fix some of the topics discussed there:
- To change the type of 'max_index' from 'unsigned int' to 'uint64_t'. This would be much safer for large repositories with millions of files and on 32bit systems.
- To mark
ref_transaction_update_reflog()
as static since it is only used internally within 'refs.c'. - To add a safeguard to prevent 'update_index' changes after first block is written. This is a preventive measure to ensure such bugs don't arise in the future.
This is based on top of master 757161ef (Sync with Git 2.48.1, 2025-01-13) with 'kn/reflog-migration-fix' merged in.
Closes: #461 (closed)
Edited by Karthik Nayak