From: Pranit Bauva Date: Sat, 26 Mar 2016 19:48:49 GMT Subject: [PATCH v10 2/3] t7507-commit-verbose: store output of grep in a file Message-ID: <01020153b478cf9b-1417ac08-005c-4d72-91f1-0b07f00a24d5-000000@eu-west-1.amazonses.com> In-Reply-To: <01020153b478cf07-758c7f14-33a1-4a67-9bc9-4688de3d6742-000000@eu-west-1.amazonses.com> So that we can see how many diffs were contained in the message and use them in individual tests where ever it is required. Also use write_script() to create the fake "editor". Helped-by: Eric Sunshine Signed-off-by: Pranit Bauva --- t/t7507-commit-verbose.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh index 2ddf28c..b40eb3c 100755 --- a/t/t7507-commit-verbose.sh +++ b/t/t7507-commit-verbose.sh @@ -3,9 +3,11 @@ test_description='verbose commit template' . ./test-lib.sh -cat >check-for-diff <out EOF chmod +x check-for-diff test_set_editor "$PWD/check-for-diff" @@ -23,7 +25,8 @@ test_expect_success 'setup' ' ' test_expect_success 'initial commit shows verbose diff' ' - git commit --amend -v + git commit --amend -v && + test_line_count = 1 out ' test_expect_success 'second commit' ' @@ -39,13 +42,15 @@ check_message() { test_expect_success 'verbose diff is stripped out' ' git commit --amend -v && - check_message message + check_message message && + test_line_count = 1 out ' test_expect_success 'verbose diff is stripped out (mnemonicprefix)' ' git config diff.mnemonicprefix true && git commit --amend -v && - check_message message + check_message message && + test_line_count = 1 out ' cat >diff <<'EOF' -- https://github.com/git/git/pull/218