summaryrefslogtreecommitdiff
path: root/t/t1512-rev-parse-disambiguation.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2021-12-09 05:11:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-12-13 18:29:48 (GMT)
commit0849541268a3aca9381591aed87b6864a203709b (patch)
tree00aa5e565425fd234928d17ad17e91c521d01d38 /t/t1512-rev-parse-disambiguation.sh
parent020b813f400b55528edca00aff4d8e95080376f6 (diff)
downloadgit-0849541268a3aca9381591aed87b6864a203709b.zip
git-0849541268a3aca9381591aed87b6864a203709b.tar.gz
git-0849541268a3aca9381591aed87b6864a203709b.tar.bz2
tests: use test_write_lines() to generate line-oriented output
Take advantage of test_write_lines() to generate line-oriented output rather than using for-loops or a series of `echo` commands. Not only is test_write_lines() a natural fit for such a task, but there is less opportunity for a broken &&-chain. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1512-rev-parse-disambiguation.sh')
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh10
1 files changed, 2 insertions, 8 deletions
diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh
index 7891a6b..15188a4 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -34,10 +34,7 @@ fi
test_expect_success 'blob and tree' '
test_tick &&
(
- for i in 0 1 2 3 4 5 6 7 8 9
- do
- echo $i
- done &&
+ test_write_lines 0 1 2 3 4 5 6 7 8 9 &&
echo &&
echo b1rwzyc3
) >a0blgqsjc &&
@@ -204,10 +201,7 @@ test_expect_success 'more history' '
git checkout v1.0.0^0 &&
git mv a0blgqsjc f5518nwu &&
- for i in h62xsjeu j08bekfvt kg7xflhm
- do
- echo $i
- done >>f5518nwu &&
+ test_write_lines h62xsjeu j08bekfvt kg7xflhm >>f5518nwu &&
git add f5518nwu &&
test_tick &&