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
This commit is contained in:
7
refs.c
7
refs.c
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user