]> git.ipfire.org Git - thirdparty/git.git/commit
t5334: expose shared `nth_line()` helper
authorTaylor Blau <me@ttaylorr.com>
Fri, 12 Jun 2026 20:07:08 +0000 (16:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2026 20:39:36 +0000 (13:39 -0700)
commitacfdb54eb359c9912fb74ec260f00d73e0b2d785
tree9df812aa07a02b7a62194ab82bbb2d24ed8a529c
parentea97ad8d017de0c9037451a78008a0fd60abea0c
t5334: expose shared `nth_line()` helper

Since commit 0cd2255e64b (midx: support custom `--base` for incremental
MIDX writes, 2026-05-19), t5334 has referred to a non-existent helper
function 'nth_line', which is defined in t5335, but not here.

Move the helper to lib-midx.sh so that both tests can use the same
implementation. Ensure likewise that `nth_line()` remains visible from
within t5335 by sourcing lib-midx.sh there appropriately.

Curiously, t5334 passes both before and after this change. Before this
change, the failed command substitution leaves '--base' with an empty
value, and after this change, the custom base value is still ignored by
the normal incremental write path. The following commits will explain
and address that behavior.

Noticed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-midx.sh
t/t5335-compact-multi-pack-index.sh