refs: add index
field to struct ref_udpate
The reftable backend, sorts its updates by refname before applying them, this ensures that the references are stored sorted. When migrating reflogs from one backend to another, the order of the reflogs must be maintained. Add a new `index` field to the `ref_update` struct to facilitate this. This field is used in the reftable backend's sort comparison function `transaction_update_cmp`, to ensure that indexed fields maintain their order. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1a83e26d72
commit
a3582e2eac
@ -115,6 +115,13 @@ struct ref_update {
|
||||
char *msg;
|
||||
char *committer_info;
|
||||
|
||||
/*
|
||||
* The index overrides the default sort algorithm. This is needed
|
||||
* when migrating reflogs and we want to ensure we carry over the
|
||||
* same order.
|
||||
*/
|
||||
unsigned int index;
|
||||
|
||||
/*
|
||||
* If this ref_update was split off of a symref update via
|
||||
* split_symref_update(), then this member points at that
|
||||
|
Reference in New Issue
Block a user