diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 06:11:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 19:29:48 +0100 |
commit | efe26b9ee09d53dda0f36d0ea20cb245b934f216 (patch) | |
tree | d5daf1aaf168c03129ef8b63cc1375cba959bdd2 /t/t3600-rm.sh | |
parent | tests: apply modern idiom for exiting loop upon failure (diff) | |
download | git-efe26b9ee09d53dda0f36d0ea20cb245b934f216.tar.xz git-efe26b9ee09d53dda0f36d0ea20cb245b934f216.zip |
tests: simplify by dropping unnecessary `for` loops
Rather than manually looping over a set of items and plugging those
items into a template string which is printed repeatedly, achieve the
same effect by taking advantage of `printf` which loops over its
arguments automatically.
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/t3600-rm.sh')
-rwxr-xr-x | t/t3600-rm.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index ed3952eb98..e74a318ac3 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -274,10 +274,7 @@ test_expect_success 'Resolving by removal is not a warning-worthy event' ' git reset -q --hard && test_when_finished "rm -f .git/index.lock msg && git reset -q --hard" && blob=$(echo blob | git hash-object -w --stdin) && - for stage in 1 2 3 - do - echo "100644 $blob $stage blob" - done | git update-index --index-info && + printf "100644 $blob %d\tblob\n" 1 2 3 | git update-index --index-info && git rm blob >msg 2>&1 && test_i18ngrep ! "needs merge" msg && test_must_fail git ls-files -s --error-unmatch blob |