"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
nit: avoid unnecessary loop in cmdline/status.sh
To:
gameoftrees@openbsd.org
Date:
Fri, 15 Apr 2022 19:43:50 +0200

Download raw body.

Thread
as per subject, isn't simpler to just redirect jot(1) output instead?

diff e96aec1328ca9513d063b18f45613f1bda4685a4 /home/op/w/got
blob - 4639246145d93e24cbf89dd139a7c9891de5c9be
file + regress/cmdline/status.sh
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
@@ -330,10 +330,7 @@ test_status_shows_no_mods_after_complete_merge() {
 	local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
 
 	# make this file larger than the usual blob buffer size of 8192
-	echo -n > $testroot/repo/numbers
-	for i in `jot 16384`; do
-		echo "$i" >> $testroot/repo/numbers
-	done
+	jot 16384 > $testroot/repo/numbers
 
 	(cd $testroot/repo && git add numbers)
 	git_commit $testroot/repo -m "added numbers file"