]>
Commit | Line | Data |
---|---|---|
aecda37c CB |
1 | #!/bin/sh |
2 | ||
3 | test_description='git update-index --assume-unchanged test. | |
4 | ' | |
5 | ||
9081a421 | 6 | TEST_PASSES_SANITIZE_LEAK=true |
aecda37c CB |
7 | . ./test-lib.sh |
8 | ||
a900999d JS |
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 | ' | |
aecda37c | 18 | |
a900999d JS |
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 && | |
b6e2a4f0 | 24 | test_must_fail git checkout - 2>err && |
6789275d | 25 | test_grep overwritten err |
a900999d | 26 | ' |
aecda37c CB |
27 | |
28 | test_done |