diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-08-08 16:06:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-08 10:14:42 -0700 |
commit | 558f6fbeb1f194116231218b3e7496ceef4b9618 (patch) | |
tree | 378c0cdbc17bddb6555ce881553cb2ace567354b /builtin/commit.c | |
parent | 5f0ed603a1653f2394c468814bde4b0dca2cff45 (diff) |
reftable/stack: simplify tracking of table locks
When compacting tables, we store the locks of all tables we are about to
compact in the `table_locks` array. As we currently only ever compact
all tables in the user-provided range or none, we simply track those
locks via the indices of the respective tables in the merged stack.
This is about to change though, as we will introduce a mode where auto
compaction gracefully handles the case of already-locked files. In this
case, it may happen that we only compact a subset of the user-supplied
range of tables. In this case, the indices will not necessarily match
the lock indices anymore.
Refactor the code such that we track the number of locks via a separate
variable. The resulting code is expected to perform the same, but will
make it easier to perform the described change.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions