Commit
cbd35cadfaa9d44463ec7829f15474026aed88ab
reftable/stack: rename reftable_stack_new_addition()
Rename the function `reftable_stack_new_addition()` to `reftable_stack_addition_new()` to be more inline with our naming scheme. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karthik Nayak <karthik.188@gmail.com> · 2026-08-24 09:31 UTC · committed by Junio C Hamano
4 files changed,
+10
−10
modified refs/reftable-backend.c
| @@ -1002,7 +1002,7 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out, | |||
| 1002 | 1002 | if (!arg) { | |
| 1003 | 1003 | struct reftable_addition *addition; | |
| 1004 | 1004 | ||
| 1005 | - | ret = reftable_stack_new_addition(&addition, be->stack, | |
| 1005 | + | ret = reftable_stack_addition_new(&addition, be->stack, | |
| 1006 | 1006 | &reftable_be_write_options(refs)->opts); | |
| 1007 | 1007 | if (ret) { | |
| 1008 | 1008 | if (ret == REFTABLE_LOCK_ERROR) | |
| @@ -2616,7 +2616,7 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store, | |||
| 2616 | 2616 | if (ret < 0) | |
| 2617 | 2617 | goto done; | |
| 2618 | 2618 | ||
| 2619 | - | ret = reftable_stack_new_addition(&add, be->stack, | |
| 2619 | + | ret = reftable_stack_addition_new(&add, be->stack, | |
| 2620 | 2620 | &reftable_be_write_options(refs)->opts); | |
| 2621 | 2621 | if (ret < 0) | |
| 2622 | 2622 | goto done; | |
modified reftable/reftable-stack.h
| @@ -62,7 +62,7 @@ struct reftable_addition; | |||
| 62 | 62 | * returns a new transaction to add reftables to the given stack. As a side | |
| 63 | 63 | * effect, the ref database is locked. | |
| 64 | 64 | */ | |
| 65 | - | int reftable_stack_new_addition(struct reftable_addition **dest, | |
| 65 | + | int reftable_stack_addition_new(struct reftable_addition **dest, | |
| 66 | 66 | struct reftable_stack *st, | |
| 67 | 67 | const struct reftable_write_options *opts); | |
| 68 | 68 | ||
modified reftable/stack.c
| @@ -828,7 +828,7 @@ done: | |||
| 828 | 828 | return err; | |
| 829 | 829 | } | |
| 830 | 830 | ||
| 831 | - | int reftable_stack_new_addition(struct reftable_addition **dest, | |
| 831 | + | int reftable_stack_addition_new(struct reftable_addition **dest, | |
| 832 | 832 | struct reftable_stack *st, | |
| 833 | 833 | const struct reftable_write_options *opts) | |
| 834 | 834 | { | |
| @@ -1826,7 +1826,7 @@ static int reftable_stack_clean_locked(struct reftable_stack *st) | |||
| 1826 | 1826 | int reftable_stack_clean(struct reftable_stack *st) | |
| 1827 | 1827 | { | |
| 1828 | 1828 | struct reftable_addition *add = NULL; | |
| 1829 | - | int err = reftable_stack_new_addition(&add, st, NULL); | |
| 1829 | + | int err = reftable_stack_addition_new(&add, st, NULL); | |
| 1830 | 1830 | if (err < 0) { | |
| 1831 | 1831 | goto done; | |
| 1832 | 1832 | } | |
modified t/unit-tests/u-reftable-stack.c
| @@ -257,7 +257,7 @@ void test_reftable_stack__transaction_api(void) | |||
| 257 | 257 | ||
| 258 | 258 | reftable_addition_destroy(add); | |
| 259 | 259 | ||
| 260 | - | cl_assert_equal_i(reftable_stack_new_addition(&add, st, NULL), 0); | |
| 260 | + | cl_assert_equal_i(reftable_stack_addition_new(&add, st, NULL), 0); | |
| 261 | 261 | cl_assert_equal_i(reftable_addition_add(add, write_test_ref, | |
| 262 | 262 | &ref), 0); | |
| 263 | 263 | cl_assert_equal_i(reftable_addition_commit(add), 0); | |
| @@ -298,7 +298,7 @@ void test_reftable_stack__transaction_with_reload(void) | |||
| 298 | 298 | ||
| 299 | 299 | cl_assert_equal_i(reftable_new_stack(&st1, dir, NULL), 0); | |
| 300 | 300 | cl_assert_equal_i(reftable_new_stack(&st2, dir, NULL), 0); | |
| 301 | - | cl_assert_equal_i(reftable_stack_new_addition(&add, st1, NULL), 0); | |
| 301 | + | cl_assert_equal_i(reftable_stack_addition_new(&add, st1, NULL), 0); | |
| 302 | 302 | cl_assert_equal_i(reftable_addition_add(add, write_test_ref, | |
| 303 | 303 | &refs[0]), 0); | |
| 304 | 304 | cl_assert_equal_i(reftable_addition_commit(add), 0); | |
| @@ -308,7 +308,7 @@ void test_reftable_stack__transaction_with_reload(void) | |||
| 308 | 308 | * The second stack is now outdated, but it should automatically reload it | |
| 309 | 309 | * with the newer updates. | |
| 310 | 310 | */ | |
| 311 | - | cl_assert_equal_i(reftable_stack_new_addition(&add, st2, NULL), 0); | |
| 311 | + | cl_assert_equal_i(reftable_stack_addition_new(&add, st2, NULL), 0); | |
| 312 | 312 | cl_assert_equal_i(reftable_addition_add(add, write_test_ref, | |
| 313 | 313 | &refs[1]), 0); | |
| 314 | 314 | cl_assert_equal_i(reftable_addition_commit(add), 0); | |
| @@ -355,7 +355,7 @@ void test_reftable_stack__transaction_api_performs_auto_compaction(void) | |||
| 355 | 355 | * we can ensure that we indeed honor this setting and have | |
| 356 | 356 | * better control over when exactly auto compaction runs. | |
| 357 | 357 | */ | |
| 358 | - | cl_assert_equal_i(reftable_stack_new_addition(&add, | |
| 358 | + | cl_assert_equal_i(reftable_stack_addition_new(&add, | |
| 359 | 359 | st, &write_opts), 0); | |
| 360 | 360 | cl_assert_equal_i(reftable_addition_add(add, | |
| 361 | 361 | write_test_ref, &ref), 0); | |
| @@ -1296,7 +1296,7 @@ void test_reftable_stack__invalid_limit_updates(void) | |||
| 1296 | 1296 | ||
| 1297 | 1297 | reftable_addition_destroy(add); | |
| 1298 | 1298 | ||
| 1299 | - | cl_assert_equal_i(reftable_stack_new_addition(&add, st, &opts), 0); | |
| 1299 | + | cl_assert_equal_i(reftable_stack_addition_new(&add, st, &opts), 0); | |
| 1300 | 1300 | ||
| 1301 | 1301 | /* | |
| 1302 | 1302 | * write_limits_after_ref also updates the update indexes after adding | |