Commit | Line | Data |
---|---|---|
540e694b NTND |
1 | #!/bin/sh |
2 | ||
3 | test_description='diff with assume-unchanged entries' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | # external diff has been tested in t4020-diff-external.sh | |
8 | ||
9 | test_expect_success 'setup' ' | |
10 | echo zero > zero && | |
11 | git add zero && | |
12 | git commit -m zero && | |
13 | echo one > one && | |
14 | echo two > two && | |
15 | git add one two && | |
16 | git commit -m onetwo && | |
17 | git update-index --assume-unchanged one && | |
18 | echo borked >> one && | |
19 | test "$(git ls-files -v one)" = "h one" | |
20 | ' | |
21 | ||
22 | test_expect_success 'diff-index does not examine assume-unchanged entries' ' | |
23 | git diff-index HEAD^ -- one | grep -q 5626abf0f72e58d7a153368ba57db4c673c0e171 | |
24 | ' | |
25 | ||
26 | test_expect_success 'diff-files does not examine assume-unchanged entries' ' | |
27 | rm one && | |
28 | test -z "$(git diff-files -- one)" | |
29 | ' | |
30 | ||
53048100 JK |
31 | test_expect_success POSIXPERM 'find-copies-harder is not confused by mode bits' ' |
32 | echo content >exec && | |
33 | chmod +x exec && | |
34 | git add exec && | |
35 | git commit -m exec && | |
36 | git update-index --assume-unchanged exec && | |
37 | >expect && | |
38 | git diff-files --find-copies-harder -- exec >actual && | |
39 | test_cmp expect actual | |
40 | ' | |
41 | ||
540e694b | 42 | test_done |