mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
![Johannes Schindelin](/assets/img/avatar_default.png)
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>
28 lines
521 B
Bash
Executable file
28 lines
521 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='git update-index --assume-unchanged test.
|
|
'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success 'setup' '
|
|
: >file &&
|
|
git add file &&
|
|
git commit -m initial &&
|
|
git branch other &&
|
|
echo upstream >file &&
|
|
git add file &&
|
|
git commit -m upstream
|
|
'
|
|
|
|
test_expect_success 'do not switch branches with dirty file' '
|
|
git reset --hard &&
|
|
git checkout other &&
|
|
echo dirt >file &&
|
|
git update-index --assume-unchanged file &&
|
|
test_must_fail git checkout - 2>err &&
|
|
test_i18ngrep overwritten err
|
|
'
|
|
|
|
test_done
|