diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-02-03 10:23:34 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-02-03 10:23:35 -0800 |
commit | 1f124f30244654fdf3e87efe1b70948fbfeab4b0 (patch) | |
tree | 041308ac20aa62f7073f88d70608bb1033aa4946 /refs.c | |
parent | b83a2f9006cdf5293370b1254f4f4cb2770c1b9f (diff) | |
parent | f11f0a5a2db955f68776ea95aec42df7fcb8ce1b (diff) |
Merge branch 'kn/reflog-migration-fix-fix'
Fix bugs in an earlier attempt to fix "git refs migration".
* kn/reflog-migration-fix-fix:
refs/reftable: fix uninitialized memory access of `max_index`
reftable: write correct max_update_index to header
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; } |