]> git.ipfire.org Git - thirdparty/git.git/commit
reftable: check for trailing newline in 'tables.list'
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 7 Oct 2025 12:11:27 +0000 (14:11 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Oct 2025 16:22:57 +0000 (09:22 -0700)
commitf6442063775b68d9eeaeb9088379fba3298c80ac
treebbcc0f7fdde79b1f7686ca20c799220b91531847
parent1ef32f09897754c607f1e16df396c5ac545a1297
reftable: check for trailing newline in 'tables.list'

In the reftable format, the 'tables.list' file contains a
newline separated list of tables. While we parse this file, we do not
check or care about the last newline. Tighten the parser in
`parse_names()` to return an appropriate error if the last newline is
missing.

This requires modification to `parse_names()` to now return the error
while accepting the output as a third argument.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/basics.c
reftable/basics.h
reftable/stack.c
t/unit-tests/u-reftable-basics.c