| 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 | blob=$(git hash-object one) && |
| 16 | git add one two && |
| 17 | git commit -m onetwo && |
| 18 | git update-index --assume-unchanged one && |
| 19 | echo borked >> one && |
| 20 | test "$(git ls-files -v one)" = "h one" |
| 21 | ' |
| 22 | |
| 23 | test_expect_success 'diff-index does not examine assume-unchanged entries' ' |
| 24 | git diff-index HEAD^ -- one | grep -q $blob |
| 25 | ' |
| 26 | |
| 27 | test_expect_success 'diff-files does not examine assume-unchanged entries' ' |
| 28 | rm one && |
| 29 | test -z "$(git diff-files -- one)" |
| 30 | ' |
| 31 | |
| 32 | test_expect_success POSIXPERM 'find-copies-harder is not confused by mode bits' ' |
| 33 | echo content >exec && |
| 34 | chmod +x exec && |
| 35 | git add exec && |
| 36 | git commit -m exec && |
| 37 | git update-index --assume-unchanged exec && |
| 38 | git diff-files --find-copies-harder -- exec >actual && |
| 39 | test_must_be_empty actual |
| 40 | ' |
| 41 | |
| 42 | test_done |