]> Kevux Git Server - rit/commitdiff
t2106: ensure that the checkout fails for the expected reason
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 18 Nov 2020 14:49:07 +0000 (14:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Nov 2020 18:27:39 +0000 (10:27 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2106-update-index-assume-unchanged.sh

index 3396f23..2d450da 100755 (executable)
@@ -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