diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2024-12-16 17:44:27 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-16 09:45:32 -0800 |
| commit | a3582e2eacfae4328146b5142a0950fffcc05198 (patch) | |
| tree | 19b3b8cf351fc5a8f8add72b34300f9b93fb4aab /refs/refs-internal.h | |
| parent | refs: include committer info in `ref_update` struct (diff) | |
| download | git-a3582e2eacfae4328146b5142a0950fffcc05198.tar.gz git-a3582e2eacfae4328146b5142a0950fffcc05198.zip | |
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>
Diffstat (limited to 'refs/refs-internal.h')
| -rw-r--r-- | refs/refs-internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 0fd95cdacd..f5c733d099 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -116,6 +116,13 @@ struct ref_update { 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 * update. This is used for two purposes: |
