Merge branch 'ja/doc-synopsis-markup'
[git/gitster.git] / t / t4039-diff-assume-unchanged.sh
blob78090e6852d5a8362e53414a1b4fc3302a24d874
1 #!/bin/sh
3 test_description='diff with assume-unchanged entries'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 # external diff has been tested in t4020-diff-external.sh
10 test_expect_success 'setup' '
11 echo zero > zero &&
12 git add zero &&
13 git commit -m zero &&
14 echo one > one &&
15 echo two > two &&
16 blob=$(git hash-object one) &&
17 git add one two &&
18 git commit -m onetwo &&
19 git update-index --assume-unchanged one &&
20 echo borked >> one &&
21 test "$(git ls-files -v one)" = "h one"
24 test_expect_success 'diff-index does not examine assume-unchanged entries' '
25 git diff-index HEAD^ -- one | grep -q $blob
28 test_expect_success 'diff-files does not examine assume-unchanged entries' '
29 rm one &&
30 test -z "$(git diff-files -- one)"
33 test_expect_success POSIXPERM 'find-copies-harder is not confused by mode bits' '
34 echo content >exec &&
35 chmod +x exec &&
36 git add exec &&
37 git commit -m exec &&
38 git update-index --assume-unchanged exec &&
39 git diff-files --find-copies-harder -- exec >actual &&
40 test_must_be_empty actual
43 test_done