diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2018-07-02 00:23:42 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 19:38:04 (GMT) |
commit | 0590ff26c406204281262c2753b3b92aa07f59c7 (patch) | |
tree | 59857964cf6ade6e1600e150e795e3ae4d347210 /t/t7501-commit.sh | |
parent | 83279748594cf1c7a38ebf518cd6b63cd3d8de37 (diff) | |
download | git-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-x | t/t7501-commit.sh | 4 |
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 && |