Add new `git update` tool
[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-lib.sh
7
8 test_expect_success 'setup' \
9         ': >file &&
10          git add file &&
11          git commit -m initial &&
12          git branch other &&
13          echo upstream >file &&
14          git add file &&
15          git commit -m upstream'
16
17 test_expect_success 'do not switch branches with dirty file' \
18         'git reset --hard &&
19          git checkout other &&
20          echo dirt >file &&
21          git update-index --assume-unchanged file &&
22          test_must_fail git checkout master'
23
24 test_done