From: Pranit Bauva Date: Thu, 24 Mar 2016 08:25:18 GMT Subject: [PATCH v9 2/3] t7507-commit-verbose: make test suite use write_script Message-ID: <01020153a7ba4eae-9b88e119-0505-418f-a137-595250edaa9d-000000@eu-west-1.amazonses.com> In-Reply-To: <01020153a7ba4e07-f326395b-63df-4f8a-b378-8f387b02d0bd-000000@eu-west-1.amazonses.com> Also remove test_set_editor from global scope and use it in whichever test it is required. --- t/t7507-commit-verbose.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh index 2ddf28c..cf95efb 100755 --- a/t/t7507-commit-verbose.sh +++ b/t/t7507-commit-verbose.sh @@ -3,12 +3,11 @@ test_description='verbose commit template' . ./test-lib.sh -cat >check-for-diff <out && +test $(wc -l message <<'EOF' subject @@ -23,6 +22,7 @@ test_expect_success 'setup' ' ' test_expect_success 'initial commit shows verbose diff' ' + test_set_editor "$PWD/check-for-diff" && git commit --amend -v ' @@ -38,11 +38,13 @@ check_message() { } test_expect_success 'verbose diff is stripped out' ' + test_set_editor "$PWD/check-for-diff" && git commit --amend -v && check_message message ' test_expect_success 'verbose diff is stripped out (mnemonicprefix)' ' + test_set_editor "$PWD/check-for-diff" && git config diff.mnemonicprefix true && git commit --amend -v && check_message message @@ -66,11 +68,13 @@ test_expect_success 'diff in message is retained without -v' ' ' test_expect_success 'diff in message is retained with -v' ' + test_set_editor "$PWD/check-for-diff" && git commit --amend -F diff -v && check_message diff ' test_expect_success 'submodule log is stripped out too with -v' ' + test_set_editor "$PWD/check-for-diff" && git config diff.submodule log && git submodule add ./. sub && git commit -m "sub added" && -- https://github.com/git/git/pull/218