diff mbox series

[3/3] t2106: ensure that the checkout fails for the expected reason

Message ID 7a750f1317143bf4488c21bd11c4e59558a3d7c6.1605710947.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit b6e2a4f07c238e179e4d358e84a7f9e3a5c07005
Headers show
Series t2106 vs. the default branch name | expand

Commit Message

Johannes Schindelin Nov. 18, 2020, 2:49 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

During the transition of the test suite to a new default branch name, it
was noticed that this test case succeeded for the wrong reason when the
default branch name was overridden.

While we fixed that in the previous commit, let's make sure that we look
for a tell-tale in the error message that the `git checkout` failed for
the reason we wanted it to fail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2106-update-index-assume-unchanged.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 3396f23363..2d450daf5c 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -20,7 +20,8 @@  test_expect_success 'do not switch branches with dirty file' '
 	git checkout other &&
 	echo dirt >file &&
 	git update-index --assume-unchanged file &&
-	test_must_fail git checkout -
+	test_must_fail git checkout - 2>err &&
+	test_i18ngrep overwritten err
 '
 
 test_done