mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
4d35bb2aba
commit
799237852b
@@ -29,7 +29,7 @@ struct reftable_stack;
|
||||
* stored in 'dir'. Typically, this should be .git/reftables.
|
||||
*/
|
||||
int reftable_new_stack(struct reftable_stack **dest, const char *dir,
|
||||
struct reftable_write_options opts);
|
||||
const struct reftable_write_options *opts);
|
||||
|
||||
/* returns the update_index at which a next table should be written. */
|
||||
uint64_t reftable_stack_next_update_index(struct reftable_stack *st);
|
||||
|
||||
Reference in New Issue
Block a user