Merge branch 'bc/more-git-var'
[alt-git.git] / t / t2106-update-index-assume-unchanged.sh
blobd943ddf47e08f98b20a1f3365dca594815e06ea5
1 #!/bin/sh
3 test_description='git update-index --assume-unchanged test.
6 TEST_PASSES_SANITIZE_LEAK=true
7 . ./test-lib.sh
9 test_expect_success 'setup' '
10 : >file &&
11 git add file &&
12 git commit -m initial &&
13 git branch other &&
14 echo upstream >file &&
15 git add file &&
16 git commit -m upstream
19 test_expect_success 'do not switch branches with dirty file' '
20 git reset --hard &&
21 git checkout other &&
22 echo dirt >file &&
23 git update-index --assume-unchanged file &&
24 test_must_fail git checkout - 2>err &&
25 test_i18ngrep overwritten err
28 test_done