]> git.ipfire.org Git - thirdparty/git.git/commit
reftable: pass opts as constant pointer
authorPatrick Steinhardt <ps@pks.im>
Mon, 13 May 2024 08:17:59 +0000 (10:17 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 May 2024 00:02:38 +0000 (17:02 -0700)
commit799237852bd265feb1e1a8d4a19780e20991b4fd
treef566c5630b6305a64aad7d23850bb019228264e0
parent4d35bb2abaeff3965024b0f1599641641bcb17a6
reftable: pass opts as constant pointer

We sometimes pass the refatble write options as value and sometimes as a
pointer. This is quite confusing and makes the reader wonder whether the
options get modified sometimes.

In fact, `reftable_new_writer()` does cause the caller-provided options
to get updated when some values aren't set up. This is quite unexpected,
but didn't cause any harm until now.

Adapt the code so that we do not modify the caller-provided values
anymore. While at it, refactor the code to code to consistently pass the
options as a constant pointer to clarify that the caller-provided opts
will not ever get modified.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/reftable-backend.c
reftable/dump.c
reftable/reftable-stack.h
reftable/reftable-writer.h
reftable/stack.c
reftable/stack_test.c
reftable/writer.c