Skip to content

Commit da6efbb

Browse files
pks-tgitster
authored andcommitted
reftable/stack: fix broken refnames in write_n_ref_tables()
The `write_n_ref_tables()` helper function writes N references in separate tables. We never reset the computed name of those references though, leading us to end up with unexpected names. Fix this by resetting the buffer. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent d2d67f7 commit da6efbb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: reftable/stack_test.c

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ static void write_n_ref_tables(struct reftable_stack *st,
125125
.value_type = REFTABLE_REF_VAL1,
126126
};
127127

128+
strbuf_reset(&buf);
128129
strbuf_addf(&buf, "refs/heads/branch-%04u", (unsigned) i);
129130
ref.refname = buf.buf;
130131
set_test_hash(ref.value.val1, i);

0 commit comments

Comments
 (0)