reftable: consistently refer to `reftable_write_options` as `opts`

Throughout the reftable library the `reftable_write_options` are sometimes referred to as `cfg` and sometimes as `opts`. Unify these to consistently use `opts` to avoid confusion. While at it, touch up the coding style a bit by removing unneeded braces around one-line statements and newlines between variable declarations. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed May 13, 2024 at 10:17 UTC 4d35bb2abaeff3965024b0f1599641641bcb17a6
5 files changed +74 -89
reftable/dump.c
+2 -2
@@ -27,9 +27,9 @@ https://developers.google.com/open-source/licenses/bsd
27 static int compact_stack(const char *stackdir)
28 {
29 struct reftable_stack *stack = NULL;
30 - struct reftable_write_options cfg = { 0 };
30 + struct reftable_write_options opts = { 0 };
31
32 - int err = reftable_new_stack(&stack, stackdir, cfg);
32 + int err = reftable_new_stack(&stack, stackdir, opts);
33 if (err < 0)
34 goto done;
35
reftable/reftable-stack.h
+1 -1
@@ -29,7 +29,7 @@ struct reftable_stack;
29 * stored in 'dir'. Typically, this should be .git/reftables.
30 */
31 int reftable_new_stack(struct reftable_stack **dest, const char *dir,
32 - struct reftable_write_options config);
32 + struct reftable_write_options opts);
33
34 /* returns the update_index at which a next table should be written. */
35 uint64_t reftable_stack_next_update_index(struct reftable_stack *st);
reftable/stack.c
+20 -21
@@ -54,15 +54,14 @@ static int reftable_fd_flush(void *arg)
54 }
55
56 int reftable_new_stack(struct reftable_stack **dest, const char *dir,
57 - struct reftable_write_options config)
57 + struct reftable_write_options opts)
58 {
59 struct reftable_stack *p = reftable_calloc(1, sizeof(*p));
60 struct strbuf list_file_name = STRBUF_INIT;
61 int err = 0;
62
63 - if (config.hash_id == 0) {
64 - config.hash_id = GIT_SHA1_FORMAT_ID;
65 - }
63 + if (opts.hash_id == 0)
64 + opts.hash_id = GIT_SHA1_FORMAT_ID;
65
66 *dest = NULL;
67
@@ -73,7 +72,7 @@ int reftable_new_stack(struct reftable_stack **dest, const char *dir,
72 p->list_file = strbuf_detach(&list_file_name, NULL);
73 p->list_fd = -1;
74 p->reftable_dir = xstrdup(dir);
76 - p->config = config;
75 + p->opts = opts;
76
77 err = reftable_stack_reload_maybe_reuse(p, 1);
78 if (err < 0) {
@@ -255,7 +254,7 @@ static int reftable_stack_reload_once(struct reftable_stack *st, char **names,
254
255 /* success! */
256 err = reftable_new_merged_table(&new_merged, new_tables,
258 - new_readers_len, st->config.hash_id);
257 + new_readers_len, st->opts.hash_id);
258 if (err < 0)
259 goto done;
260
@@ -578,8 +577,8 @@ static int reftable_stack_init_addition(struct reftable_addition *add,
577 }
578 goto done;
579 }
581 - if (st->config.default_permissions) {
582 - if (chmod(add->lock_file->filename.buf, st->config.default_permissions) < 0) {
580 + if (st->opts.default_permissions) {
581 + if (chmod(add->lock_file->filename.buf, st->opts.default_permissions) < 0) {
582 err = REFTABLE_IO_ERROR;
583 goto done;
584 }
@@ -678,7 +677,7 @@ int reftable_addition_commit(struct reftable_addition *add)
677 if (err)
678 goto done;
679
681 - if (!add->stack->config.disable_auto_compact) {
680 + if (!add->stack->opts.disable_auto_compact) {
681 /*
682 * Auto-compact the stack to keep the number of tables in
683 * control. It is possible that a concurrent writer is already
@@ -756,9 +755,9 @@ int reftable_addition_add(struct reftable_addition *add,
755 err = REFTABLE_IO_ERROR;
756 goto done;
757 }
759 - if (add->stack->config.default_permissions) {
758 + if (add->stack->opts.default_permissions) {
759 if (chmod(get_tempfile_path(tab_file),
761 - add->stack->config.default_permissions)) {
760 + add->stack->opts.default_permissions)) {
761 err = REFTABLE_IO_ERROR;
762 goto done;
763 }
@@ -766,7 +765,7 @@ int reftable_addition_add(struct reftable_addition *add,
765 tab_fd = get_tempfile_fd(tab_file);
766
767 wr = reftable_new_writer(reftable_fd_write, reftable_fd_flush, &tab_fd,
769 - &add->stack->config);
768 + &add->stack->opts);
769 err = write_table(wr, arg);
770 if (err < 0)
771 goto done;
@@ -849,14 +848,14 @@ static int stack_compact_locked(struct reftable_stack *st,
848 }
849 tab_fd = get_tempfile_fd(tab_file);
850
852 - if (st->config.default_permissions &&
853 - chmod(get_tempfile_path(tab_file), st->config.default_permissions) < 0) {
851 + if (st->opts.default_permissions &&
852 + chmod(get_tempfile_path(tab_file), st->opts.default_permissions) < 0) {
853 err = REFTABLE_IO_ERROR;
854 goto done;
855 }
856
857 wr = reftable_new_writer(reftable_fd_write, reftable_fd_flush,
859 - &tab_fd, &st->config);
858 + &tab_fd, &st->opts);
859 err = stack_write_compact(st, wr, first, last, config);
860 if (err < 0)
861 goto done;
@@ -904,7 +903,7 @@ static int stack_write_compact(struct reftable_stack *st,
903 st->readers[last]->max_update_index);
904
905 err = reftable_new_merged_table(&mt, subtabs, subtabs_len,
907 - st->config.hash_id);
906 + st->opts.hash_id);
907 if (err < 0) {
908 reftable_free(subtabs);
909 goto done;
@@ -1094,9 +1093,9 @@ static int stack_compact_range(struct reftable_stack *st,
1093 goto done;
1094 }
1095
1097 - if (st->config.default_permissions) {
1096 + if (st->opts.default_permissions) {
1097 if (chmod(get_lock_file_path(&tables_list_lock),
1099 - st->config.default_permissions) < 0) {
1098 + st->opts.default_permissions) < 0) {
1099 err = REFTABLE_IO_ERROR;
1100 goto done;
1101 }
@@ -1286,7 +1285,7 @@ static uint64_t *stack_table_sizes_for_compaction(struct reftable_stack *st)
1285 {
1286 uint64_t *sizes =
1287 reftable_calloc(st->merged->stack_len, sizeof(*sizes));
1289 - int version = (st->config.hash_id == GIT_SHA1_FORMAT_ID) ? 1 : 2;
1288 + int version = (st->opts.hash_id == GIT_SHA1_FORMAT_ID) ? 1 : 2;
1289 int overhead = header_size(version) - 1;
1290 int i = 0;
1291 for (i = 0; i < st->merged->stack_len; i++) {
@@ -1435,11 +1434,11 @@ done:
1434 int reftable_stack_print_directory(const char *stackdir, uint32_t hash_id)
1435 {
1436 struct reftable_stack *stack = NULL;
1438 - struct reftable_write_options cfg = { .hash_id = hash_id };
1437 + struct reftable_write_options opts = { .hash_id = hash_id };
1438 struct reftable_merged_table *merged = NULL;
1439 struct reftable_table table = { NULL };
1440
1442 - int err = reftable_new_stack(&stack, stackdir, cfg);
1441 + int err = reftable_new_stack(&stack, stackdir, opts);
1442 if (err < 0)
1443 goto done;
1444
reftable/stack.h
+1 -1
@@ -20,7 +20,7 @@ struct reftable_stack {
20
21 char *reftable_dir;
22
23 - struct reftable_write_options config;
23 + struct reftable_write_options opts;
24
25 struct reftable_reader **readers;
26 size_t readers_len;
reftable/stack_test.c
+50 -64
@@ -150,7 +150,7 @@ static void test_reftable_stack_add_one(void)
150 char *dir = get_tmp_dir(__LINE__);
151 struct strbuf scratch = STRBUF_INIT;
152 int mask = umask(002);
153 - struct reftable_write_options cfg = {
153 + struct reftable_write_options opts = {
154 .default_permissions = 0660,
155 };
156 struct reftable_stack *st = NULL;
@@ -163,7 +163,7 @@ static void test_reftable_stack_add_one(void)
163 };
164 struct reftable_ref_record dest = { NULL };
165 struct stat stat_result = { 0 };
166 - err = reftable_new_stack(&st, dir, cfg);
166 + err = reftable_new_stack(&st, dir, opts);
167 EXPECT_ERR(err);
168
169 err = reftable_stack_add(st, &write_test_ref, &ref);
@@ -186,7 +186,7 @@ static void test_reftable_stack_add_one(void)
186 strbuf_addstr(&scratch, "/tables.list");
187 err = stat(scratch.buf, &stat_result);
188 EXPECT(!err);
189 - EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
189 + EXPECT((stat_result.st_mode & 0777) == opts.default_permissions);
190
191 strbuf_reset(&scratch);
192 strbuf_addstr(&scratch, dir);
@@ -195,7 +195,7 @@ static void test_reftable_stack_add_one(void)
195 strbuf_addstr(&scratch, st->readers[0]->name);
196 err = stat(scratch.buf, &stat_result);
197 EXPECT(!err);
198 - EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
198 + EXPECT((stat_result.st_mode & 0777) == opts.default_permissions);
199 #else
200 (void) stat_result;
201 #endif
@@ -209,7 +209,7 @@ static void test_reftable_stack_add_one(void)
209
210 static void test_reftable_stack_uptodate(void)
211 {
212 - struct reftable_write_options cfg = { 0 };
212 + struct reftable_write_options opts = { 0 };
213 struct reftable_stack *st1 = NULL;
214 struct reftable_stack *st2 = NULL;
215 char *dir = get_tmp_dir(__LINE__);
@@ -232,10 +232,10 @@ static void test_reftable_stack_uptodate(void)
232 /* simulate multi-process access to the same stack
233 by creating two stacks for the same directory.
234 */
235 - err = reftable_new_stack(&st1, dir, cfg);
235 + err = reftable_new_stack(&st1, dir, opts);
236 EXPECT_ERR(err);
237
238 - err = reftable_new_stack(&st2, dir, cfg);
238 + err = reftable_new_stack(&st2, dir, opts);
239 EXPECT_ERR(err);
240
241 err = reftable_stack_add(st1, &write_test_ref, &ref1);
@@ -257,8 +257,7 @@ static void test_reftable_stack_uptodate(void)
257 static void test_reftable_stack_transaction_api(void)
258 {
259 char *dir = get_tmp_dir(__LINE__);
260 -
261 - struct reftable_write_options cfg = { 0 };
260 + struct reftable_write_options opts = { 0 };
261 struct reftable_stack *st = NULL;
262 int err;
263 struct reftable_addition *add = NULL;
@@ -271,8 +270,7 @@ static void test_reftable_stack_transaction_api(void)
270 };
271 struct reftable_ref_record dest = { NULL };
272
274 -
275 - err = reftable_new_stack(&st, dir, cfg);
273 + err = reftable_new_stack(&st, dir, opts);
274 EXPECT_ERR(err);
275
276 reftable_addition_destroy(add);
@@ -301,12 +299,12 @@ static void test_reftable_stack_transaction_api(void)
299 static void test_reftable_stack_transaction_api_performs_auto_compaction(void)
300 {
301 char *dir = get_tmp_dir(__LINE__);
304 - struct reftable_write_options cfg = {0};
302 + struct reftable_write_options opts = {0};
303 struct reftable_addition *add = NULL;
304 struct reftable_stack *st = NULL;
305 int i, n = 20, err;
306
309 - err = reftable_new_stack(&st, dir, cfg);
307 + err = reftable_new_stack(&st, dir, opts);
308 EXPECT_ERR(err);
309
310 for (i = 0; i <= n; i++) {
@@ -325,7 +323,7 @@ static void test_reftable_stack_transaction_api_performs_auto_compaction(void)
323 * we can ensure that we indeed honor this setting and have
324 * better control over when exactly auto compaction runs.
325 */
328 - st->config.disable_auto_compact = i != n;
326 + st->opts.disable_auto_compact = i != n;
327
328 err = reftable_stack_new_addition(&add, st);
329 EXPECT_ERR(err);
@@ -361,13 +359,13 @@ static void test_reftable_stack_auto_compaction_fails_gracefully(void)
359 .value_type = REFTABLE_REF_VAL1,
360 .value.val1 = {0x01},
361 };
364 - struct reftable_write_options cfg = {0};
362 + struct reftable_write_options opts = {0};
363 struct reftable_stack *st;
364 struct strbuf table_path = STRBUF_INIT;
365 char *dir = get_tmp_dir(__LINE__);
366 int err;
367
370 - err = reftable_new_stack(&st, dir, cfg);
368 + err = reftable_new_stack(&st, dir, opts);
369 EXPECT_ERR(err);
370
371 err = reftable_stack_add(st, write_test_ref, &ref);
@@ -404,8 +402,7 @@ static int write_error(struct reftable_writer *wr, void *arg)
402 static void test_reftable_stack_update_index_check(void)
403 {
404 char *dir = get_tmp_dir(__LINE__);
407 -
408 - struct reftable_write_options cfg = { 0 };
405 + struct reftable_write_options opts = { 0 };
406 struct reftable_stack *st = NULL;
407 int err;
408 struct reftable_ref_record ref1 = {
@@ -421,7 +418,7 @@ static void test_reftable_stack_update_index_check(void)
418 .value.symref = "master",
419 };
420
424 - err = reftable_new_stack(&st, dir, cfg);
421 + err = reftable_new_stack(&st, dir, opts);
422 EXPECT_ERR(err);
423
424 err = reftable_stack_add(st, &write_test_ref, &ref1);
@@ -436,12 +433,11 @@ static void test_reftable_stack_update_index_check(void)
433 static void test_reftable_stack_lock_failure(void)
434 {
435 char *dir = get_tmp_dir(__LINE__);
439 -
440 - struct reftable_write_options cfg = { 0 };
436 + struct reftable_write_options opts = { 0 };
437 struct reftable_stack *st = NULL;
438 int err, i;
439
444 - err = reftable_new_stack(&st, dir, cfg);
440 + err = reftable_new_stack(&st, dir, opts);
441 EXPECT_ERR(err);
442 for (i = -1; i != REFTABLE_EMPTY_TABLE_ERROR; i--) {
443 err = reftable_stack_add(st, &write_error, &i);
@@ -456,7 +452,7 @@ static void test_reftable_stack_add(void)
452 {
453 int i = 0;
454 int err = 0;
459 - struct reftable_write_options cfg = {
455 + struct reftable_write_options opts = {
456 .exact_log_message = 1,
457 .default_permissions = 0660,
458 .disable_auto_compact = 1,
@@ -469,7 +465,7 @@ static void test_reftable_stack_add(void)
465 struct stat stat_result;
466 int N = ARRAY_SIZE(refs);
467
472 - err = reftable_new_stack(&st, dir, cfg);
468 + err = reftable_new_stack(&st, dir, opts);
469 EXPECT_ERR(err);
470
471 for (i = 0; i < N; i++) {
@@ -528,7 +524,7 @@ static void test_reftable_stack_add(void)
524 strbuf_addstr(&path, "/tables.list");
525 err = stat(path.buf, &stat_result);
526 EXPECT(!err);
531 - EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
527 + EXPECT((stat_result.st_mode & 0777) == opts.default_permissions);
528
529 strbuf_reset(&path);
530 strbuf_addstr(&path, dir);
@@ -537,7 +533,7 @@ static void test_reftable_stack_add(void)
533 strbuf_addstr(&path, st->readers[0]->name);
534 err = stat(path.buf, &stat_result);
535 EXPECT(!err);
540 - EXPECT((stat_result.st_mode & 0777) == cfg.default_permissions);
536 + EXPECT((stat_result.st_mode & 0777) == opts.default_permissions);
537 #else
538 (void) stat_result;
539 #endif
@@ -555,7 +551,7 @@ static void test_reftable_stack_add(void)
551 static void test_reftable_stack_log_normalize(void)
552 {
553 int err = 0;
558 - struct reftable_write_options cfg = {
554 + struct reftable_write_options opts = {
555 0,
556 };
557 struct reftable_stack *st = NULL;
@@ -579,7 +575,7 @@ static void test_reftable_stack_log_normalize(void)
575 .update_index = 1,
576 };
577
582 - err = reftable_new_stack(&st, dir, cfg);
578 + err = reftable_new_stack(&st, dir, opts);
579 EXPECT_ERR(err);
580
581 input.value.update.message = "one\ntwo";
@@ -612,8 +608,7 @@ static void test_reftable_stack_tombstone(void)
608 {
609 int i = 0;
610 char *dir = get_tmp_dir(__LINE__);
615 -
616 - struct reftable_write_options cfg = { 0 };
611 + struct reftable_write_options opts = { 0 };
612 struct reftable_stack *st = NULL;
613 int err;
614 struct reftable_ref_record refs[2] = { { NULL } };
@@ -622,8 +617,7 @@ static void test_reftable_stack_tombstone(void)
617 struct reftable_ref_record dest = { NULL };
618 struct reftable_log_record log_dest = { NULL };
619
625 -
626 - err = reftable_new_stack(&st, dir, cfg);
620 + err = reftable_new_stack(&st, dir, opts);
621 EXPECT_ERR(err);
622
623 /* even entries add the refs, odd entries delete them. */
@@ -691,8 +685,7 @@ static void test_reftable_stack_tombstone(void)
685 static void test_reftable_stack_hash_id(void)
686 {
687 char *dir = get_tmp_dir(__LINE__);
694 -
695 - struct reftable_write_options cfg = { 0 };
688 + struct reftable_write_options opts = { 0 };
689 struct reftable_stack *st = NULL;
690 int err;
691
@@ -702,24 +695,24 @@ static void test_reftable_stack_hash_id(void)
695 .value.symref = "target",
696 .update_index = 1,
697 };
705 - struct reftable_write_options cfg32 = { .hash_id = GIT_SHA256_FORMAT_ID };
698 + struct reftable_write_options opts32 = { .hash_id = GIT_SHA256_FORMAT_ID };
699 struct reftable_stack *st32 = NULL;
707 - struct reftable_write_options cfg_default = { 0 };
700 + struct reftable_write_options opts_default = { 0 };
701 struct reftable_stack *st_default = NULL;
702 struct reftable_ref_record dest = { NULL };
703
711 - err = reftable_new_stack(&st, dir, cfg);
704 + err = reftable_new_stack(&st, dir, opts);
705 EXPECT_ERR(err);
706
707 err = reftable_stack_add(st, &write_test_ref, &ref);
708 EXPECT_ERR(err);
709
710 /* can't read it with the wrong hash ID. */
718 - err = reftable_new_stack(&st32, dir, cfg32);
711 + err = reftable_new_stack(&st32, dir, opts32);
712 EXPECT(err == REFTABLE_FORMAT_ERROR);
713
721 - /* check that we can read it back with default config too. */
722 - err = reftable_new_stack(&st_default, dir, cfg_default);
714 + /* check that we can read it back with default opts too. */
715 + err = reftable_new_stack(&st_default, dir, opts_default);
716 EXPECT_ERR(err);
717
718 err = reftable_stack_read_ref(st_default, "master", &dest);
@@ -752,8 +745,7 @@ static void test_suggest_compaction_segment_nothing(void)
745 static void test_reflog_expire(void)
746 {
747 char *dir = get_tmp_dir(__LINE__);
755 -
756 - struct reftable_write_options cfg = { 0 };
748 + struct reftable_write_options opts = { 0 };
749 struct reftable_stack *st = NULL;
750 struct reftable_log_record logs[20] = { { NULL } };
751 int N = ARRAY_SIZE(logs) - 1;
@@ -764,8 +756,7 @@ static void test_reflog_expire(void)
756 };
757 struct reftable_log_record log = { NULL };
758
767 -
768 - err = reftable_new_stack(&st, dir, cfg);
759 + err = reftable_new_stack(&st, dir, opts);
760 EXPECT_ERR(err);
761
762 for (i = 1; i <= N; i++) {
@@ -828,21 +819,19 @@ static int write_nothing(struct reftable_writer *wr, void *arg)
819
820 static void test_empty_add(void)
821 {
831 - struct reftable_write_options cfg = { 0 };
822 + struct reftable_write_options opts = { 0 };
823 struct reftable_stack *st = NULL;
824 int err;
825 char *dir = get_tmp_dir(__LINE__);
835 -
826 struct reftable_stack *st2 = NULL;
827
838 -
839 - err = reftable_new_stack(&st, dir, cfg);
828 + err = reftable_new_stack(&st, dir, opts);
829 EXPECT_ERR(err);
830
831 err = reftable_stack_add(st, &write_nothing, NULL);
832 EXPECT_ERR(err);
833
845 - err = reftable_new_stack(&st2, dir, cfg);
834 + err = reftable_new_stack(&st2, dir, opts);
835 EXPECT_ERR(err);
836 clear_dir(dir);
837 reftable_stack_destroy(st);
@@ -861,16 +850,15 @@ static int fastlog2(uint64_t sz)
850
851 static void test_reftable_stack_auto_compaction(void)
852 {
864 - struct reftable_write_options cfg = {
853 + struct reftable_write_options opts = {
854 .disable_auto_compact = 1,
855 };
856 struct reftable_stack *st = NULL;
857 char *dir = get_tmp_dir(__LINE__);
869 -
858 int err, i;
859 int N = 100;
860
873 - err = reftable_new_stack(&st, dir, cfg);
861 + err = reftable_new_stack(&st, dir, opts);
862 EXPECT_ERR(err);
863
864 for (i = 0; i < N; i++) {
@@ -900,13 +888,13 @@ static void test_reftable_stack_auto_compaction(void)
888
889 static void test_reftable_stack_add_performs_auto_compaction(void)
890 {
903 - struct reftable_write_options cfg = { 0 };
891 + struct reftable_write_options opts = { 0 };
892 struct reftable_stack *st = NULL;
893 struct strbuf refname = STRBUF_INIT;
894 char *dir = get_tmp_dir(__LINE__);
895 int err, i, n = 20;
896
909 - err = reftable_new_stack(&st, dir, cfg);
897 + err = reftable_new_stack(&st, dir, opts);
898 EXPECT_ERR(err);
899
900 for (i = 0; i <= n; i++) {
@@ -921,7 +909,7 @@ static void test_reftable_stack_add_performs_auto_compaction(void)
909 * we can ensure that we indeed honor this setting and have
910 * better control over when exactly auto compaction runs.
911 */
924 - st->config.disable_auto_compact = i != n;
912 + st->opts.disable_auto_compact = i != n;
913
914 strbuf_reset(&refname);
915 strbuf_addf(&refname, "branch-%04d", i);
@@ -948,14 +936,13 @@ static void test_reftable_stack_add_performs_auto_compaction(void)
936
937 static void test_reftable_stack_compaction_concurrent(void)
938 {
951 - struct reftable_write_options cfg = { 0 };
939 + struct reftable_write_options opts = { 0 };
940 struct reftable_stack *st1 = NULL, *st2 = NULL;
941 char *dir = get_tmp_dir(__LINE__);
954 -
942 int err, i;
943 int N = 3;
944
958 - err = reftable_new_stack(&st1, dir, cfg);
945 + err = reftable_new_stack(&st1, dir, opts);
946 EXPECT_ERR(err);
947
948 for (i = 0; i < N; i++) {
@@ -972,7 +959,7 @@ static void test_reftable_stack_compaction_concurrent(void)
959 EXPECT_ERR(err);
960 }
961
975 - err = reftable_new_stack(&st2, dir, cfg);
962 + err = reftable_new_stack(&st2, dir, opts);
963 EXPECT_ERR(err);
964
965 err = reftable_stack_compact_all(st1, NULL);
@@ -998,14 +985,13 @@ static void unclean_stack_close(struct reftable_stack *st)
985
986 static void test_reftable_stack_compaction_concurrent_clean(void)
987 {
1001 - struct reftable_write_options cfg = { 0 };
988 + struct reftable_write_options opts = { 0 };
989 struct reftable_stack *st1 = NULL, *st2 = NULL, *st3 = NULL;
990 char *dir = get_tmp_dir(__LINE__);
1004 -
991 int err, i;
992 int N = 3;
993
1008 - err = reftable_new_stack(&st1, dir, cfg);
994 + err = reftable_new_stack(&st1, dir, opts);
995 EXPECT_ERR(err);
996
997 for (i = 0; i < N; i++) {
@@ -1022,7 +1008,7 @@ static void test_reftable_stack_compaction_concurrent_clean(void)
1008 EXPECT_ERR(err);
1009 }
1010
1025 - err = reftable_new_stack(&st2, dir, cfg);
1011 + err = reftable_new_stack(&st2, dir, opts);
1012 EXPECT_ERR(err);
1013
1014 err = reftable_stack_compact_all(st1, NULL);
@@ -1031,7 +1017,7 @@ static void test_reftable_stack_compaction_concurrent_clean(void)
1017 unclean_stack_close(st1);
1018 unclean_stack_close(st2);
1019
1034 - err = reftable_new_stack(&st3, dir, cfg);
1020 + err = reftable_new_stack(&st3, dir, opts);
1021 EXPECT_ERR(err);
1022
1023 err = reftable_stack_clean(st3);