diff mbox series

[v2,3/4] test: am: add the case when not passing the --always option

Message ID da024ced6686bfcae3e824c14ba0a7550c8317ad.1636700040.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series am: support --allow-empty option to am empty commits | expand

Commit Message

徐沛文 (Aleen) Nov. 12, 2021, 6:53 a.m. UTC
From: Aleen <aleen42@vip.qq.com>

Signed-off-by: Aleen <aleen42@vip.qq.com>
---
 t/t4150-am.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 5b3617857a8..364c61ba198 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -1166,7 +1166,17 @@  test_expect_success 'am a real empty patch with the --always option' '
 	test_cmp expected actual
 '
 
-test_expect_success 'am a patch with empty commits' '
+test_expect_success 'am a patch of empty commits without the --always option' '
+	grep "empty commit" empty-commit.patch &&
+	rm -fr .git/rebase-apply &&
+	git reset --hard &&
+	git checkout empty-commit^ &&
+	test_must_fail git am empty-commit.patch >err &&
+	test_path_is_dir .git/rebase-apply &&
+	test_i18ngrep "Patch is empty." err
+'
+
+test_expect_success 'am a patch of empty commits with the --always option' '
 	grep "empty commit" empty-commit.patch &&
 	rm -fr .git/rebase-apply &&
 	git reset --hard &&