[PATCH v6 2/4] commit test: Use write_script
- From
Caleb Thompson <caleb@calebthompson.io>
- Date
- Jun 17, 2014, 19:38 UTC
- Message-ID
- <fa7260f688bccac09138c8ef5ef1982cee0f0dde.1403033723.git.caleb@calebthompson.io>
- In-Reply-To
- <cover.1403033723.git.caleb@calebthompson.io>
Use write_script from t/test-lib-functions.sh instead of cat, shebang, and chmod. This aids in readability for creating the script by using the named function and allows us to turn off interpolation in the heredoc of the script body to avoid extra escaping, since $SHELL_PATH is handled for us.
Signed-off-by: Caleb Thompson <caleb@calebthompson.io> Reviewed-by: Jeremiah Mahler <jmmahler@gmail.com> --- t/t7507-commit-verbose.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh index 6d778ed..db09107 100755 --- a/t/t7507-commit-verbose.sh +++ b/t/t7507-commit-verbose.sh @@ -3,11 +3,9 @@ test_description='verbose commit template' . ./test-lib.sh -cat >check-for-diff <<EOF -#!$SHELL_PATH -exec grep '^diff --git' "\$1" +write_script check-for-diff <<-'EOF' + exec grep '^diff --git' "$1" EOF -chmod +x check-for-diff test_set_editor "$PWD/check-for-diff" cat >message <<'EOF'
-- 2.0.0