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>
This commit is contained in:
committed by
Junio C Hamano
parent
00e130a6bb
commit
4ac2fd9b4a
@@ -125,6 +125,7 @@ static void write_n_ref_tables(struct reftable_stack *st,
|
||||
.value_type = REFTABLE_REF_VAL1,
|
||||
};
|
||||
|
||||
strbuf_reset(&buf);
|
||||
strbuf_addf(&buf, "refs/heads/branch-%04u", (unsigned) i);
|
||||
ref.refname = buf.buf;
|
||||
set_test_hash(ref.value.val1, i);
|
||||
|
||||
Reference in New Issue
Block a user