]> git.ipfire.org Git - thirdparty/git.git/blob - t/t2106-update-index-assume-unchanged.sh
The third batch
[thirdparty/git.git] / t / t2106-update-index-assume-unchanged.sh
1 #!/bin/sh
2
3 test_description='git update-index --assume-unchanged test.
4 '
5
6 TEST_PASSES_SANITIZE_LEAK=true
7 . ./test-lib.sh
8
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
17 '
18
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_grep overwritten err
26 '
27
28 test_done