Thread (14 messages) flat view 14 messages, 4 authors, 16d ago

Re: [PATCH 1/3] t5334: expose shared `nth_line()` helper

From: Taylor Blau <hidden>
Date: 2026-08-13 19:29:11

On Thu, Aug 13, 2026 at 10:48:49AM +0200, Patrick Steinhardt wrote:
On Fri, Jun 12, 2026 at 04:07:08PM -0400, Taylor Blau wrote:
quoted
diff --git a/t/lib-midx.sh b/t/lib-midx.sh
index e38c609604c..b522dbdb0f4 100644
--- a/t/lib-midx.sh
+++ b/t/lib-midx.sh
@@ -34,3 +34,9 @@ compare_results_with_midx () {
 		midx_git_two_modes "cat-file --batch-all-objects --batch-check --unordered" sorted
 	'
 }
+
+nth_line() {
+	local n="$1"
+	shift
+	awk "NR==$n" "$@"
+}
It feels a bit weird to have such a general function in "lib-midx.sh",
but so be it.
Yeah, I agree. It mostly just felt weird to write '| awk "NR==$n"' a
bunch of times.

Thanks,
Taylor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help