| 109 | } |
| 110 | |
| 111 | static void write_n_ref_tables(struct reftable_stack *st, |
| 112 | size_t n) |
| 113 | { |
| 114 | int disable_auto_compact; |
| 115 | |
| 116 | disable_auto_compact = st->opts.disable_auto_compact; |
| 117 | st->opts.disable_auto_compact = 1; |
| 118 | |
| 119 | for (size_t i = 0; i < n; i++) { |
| 120 | struct reftable_ref_record ref = { |
| 121 | .update_index = reftable_stack_next_update_index(st), |
| 122 | .value_type = REFTABLE_REF_VAL1, |
| 123 | }; |
| 124 | char buf[128]; |
| 125 | |
| 126 | snprintf(buf, sizeof(buf), "refs/heads/branch-%04"PRIuMAX, (uintmax_t)i); |
| 127 | ref.refname = buf; |
| 128 | cl_reftable_set_hash(ref.value.val1, i, REFTABLE_HASH_SHA1); |
| 129 | |
| 130 | cl_assert_equal_i(reftable_stack_add(st, |
| 131 | &write_test_ref, &ref, 0), 0); |
| 132 | } |
| 133 | |
| 134 | st->opts.disable_auto_compact = disable_auto_compact; |
| 135 | } |
| 136 | |
| 137 | struct write_log_arg { |
| 138 | struct reftable_log_record *log; |