summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2018-07-02 00:23:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-03 19:38:04 (GMT)
commit0590ff26c406204281262c2753b3b92aa07f59c7 (patch)
tree59857964cf6ade6e1600e150e795e3ae4d347210 /t/t7501-commit.sh
parent83279748594cf1c7a38ebf518cd6b63cd3d8de37 (diff)
downloadgit-0590ff26c406204281262c2753b3b92aa07f59c7.zip
git-0590ff26c406204281262c2753b3b92aa07f59c7.tar.gz
git-0590ff26c406204281262c2753b3b92aa07f59c7.tar.bz2
t: use test_write_lines() instead of series of 'echo' commands
These tests employ a noisy subshell (with missing &&-chain) to feed input into Git commands or files: (echo a; echo b; echo c) | git some-command ... Simplify by taking advantage of test_write_lines(): test_write_lines a b c | git some-command ... Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 9dbbd01..282ff42 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -47,7 +47,7 @@ test_expect_success 'paths and -a do not mix' '
test_expect_success PERL 'can use paths with --interactive' '
echo bong-o-bong >file &&
# 2: update, 1:st path, that is all, 7: quit
- ( echo 2; echo 1; echo; echo 7 ) |
+ test_write_lines 2 1 "" 7 |
git commit -m foo --interactive file &&
git reset --hard HEAD^
'
@@ -293,7 +293,7 @@ test_expect_success PERL 'interactive add' '
test_expect_success PERL "commit --interactive doesn't change index if editor aborts" '
echo zoo >file &&
test_must_fail git diff --exit-code >diff1 &&
- (echo u ; echo "*" ; echo q) |
+ test_write_lines u "*" q |
(
EDITOR=: &&
export EDITOR &&