Skip to content

Commit 4ac2fd9

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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00e130a commit 4ac2fd9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

reftable/stack_test.c

Lines changed: 1 addition & 0 deletions
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)