]> git.ipfire.org Git - thirdparty/git.git/commit
refs: add `index` field to `struct ref_udpate`
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 16 Dec 2024 16:44:27 +0000 (17:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Dec 2024 17:45:32 +0000 (09:45 -0800)
commita3582e2eacfae4328146b5142a0950fffcc05198
tree19b3b8cf351fc5a8f8add72b34300f9b93fb4aab
parent1a83e26d72eb2601798dfc07e6f5112964dc9413
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>
refs/refs-internal.h
refs/reftable-backend.c