diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-23 16:12:46 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-23 08:04:47 -0700 |
| commit | 4ac2fd9b4aabe72f8bc652b71d2fcd9d952e8093 (patch) | |
| tree | e6129247772348240bee643c6e4769f981983b4d | |
| parent | reftable/reader: inline `reader_close()` (diff) | |
| download | git-4ac2fd9b4aabe72f8bc652b71d2fcd9d952e8093.tar.gz 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>
| -rw-r--r-- | reftable/stack_test.c | 1 |
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); |
