]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t2106: make test independent of the current main branch name
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 18 Nov 2020 14:49:06 +0000 (14:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Nov 2020 18:27:38 +0000 (10:27 -0800)
We do have this wonderful shortcut `git checkout -` to go back to the
previous branch, thanks to the reflog.

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 ff0947f38813123b8388360228cb6530d7a0b645..3396f2336362337ed104b75af71a4dc7aa3d4b2a 100755 (executable)
@@ -20,7 +20,7 @@ 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 master
+       test_must_fail git checkout -
 '
 
 test_done