MCPcopy Create free account
hub / github.com/git/git / write_n_ref_tables

Function write_n_ref_tables

t/unit-tests/u-reftable-stack.c:111–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static 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
137struct write_log_arg {
138 struct reftable_log_record *log;

Calls 3

cl_reftable_set_hashFunction · 0.85
reftable_stack_addFunction · 0.85