summaryrefslogtreecommitdiffstats
path: root/reftable
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-23 16:12:46 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-23 17:04:47 +0200
commit4ac2fd9b4aabe72f8bc652b71d2fcd9d952e8093 (patch)
treee6129247772348240bee643c6e4769f981983b4d /reftable
parentreftable/reader: inline `reader_close()` (diff)
downloadgit-4ac2fd9b4aabe72f8bc652b71d2fcd9d952e8093.tar.xz
git-4ac2fd9b4aabe72f8bc652b71d2fcd9d952e8093.zip
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>
Diffstat (limited to 'reftable')
-rw-r--r--reftable/stack_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/reftable/stack_test.c b/reftable/stack_test.c
index 42044ed8a3..de0669b7b8 100644
--- a/reftable/stack_test.c
+++ b/reftable/stack_test.c
@@ -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);