#!/bin/sh global test_description := ''diff with assume-unchanged entries'' source ./test-lib.sh # external diff has been tested in t4020-diff-external.sh test_expect_success 'setup' ' echo zero > zero && git add zero && git commit -m zero && echo one > one && echo two > two && git add one two && git commit -m onetwo && git update-index --assume-unchanged one && echo borked >> one && test "$(git ls-files -v one)" = "h one" ' test_expect_success 'diff-index does not examine assume-unchanged entries' ' git diff-index HEAD^ -- one | grep -q 5626abf0f72e58d7a153368ba57db4c673c0e171 ' test_expect_success 'diff-files does not examine assume-unchanged entries' ' rm one && test -z "$(git diff-files -- one)" ' test_expect_success POSIXPERM 'find-copies-harder is not confused by mode bits' ' echo content >exec && chmod +x exec && git add exec && git commit -m exec && git update-index --assume-unchanged exec && >expect && git diff-files --find-copies-harder -- exec >actual && test_cmp expect actual ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"diff with assume-unchanged entries">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ )} { (SQ <"\n"> <"\techo zero > zero &&\n"> <"\tgit add zero &&\n"> <"\tgit commit -m zero &&\n"> <"\techo one > one &&\n"> <"\techo two > two &&\n"> <"\tgit add one two &&\n"> <"\tgit commit -m onetwo &&\n"> <"\tgit update-index --assume-unchanged one &&\n"> <"\techo borked >> one &&\n"> <"\ttest \"$(git ls-files -v one)\" = \"h one\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"diff-index does not examine assume-unchanged entries">)} { (SQ <"\n"> <"\tgit diff-index HEAD^ -- one | grep -q 5626abf0f72e58d7a153368ba57db4c673c0e171\n"> ) } ) (C {(test_expect_success)} {(SQ <"diff-files does not examine assume-unchanged entries">)} {(SQ <"\n"> <"\trm one &&\n"> <"\ttest -z \"$(git diff-files -- one)\"\n">)} ) (C {(test_expect_success)} {(POSIXPERM)} {(SQ <"find-copies-harder is not confused by mode bits">)} { (SQ <"\n"> <"\techo content >exec &&\n"> <"\tchmod +x exec &&\n"> <"\tgit add exec &&\n"> <"\tgit commit -m exec &&\n"> <"\tgit update-index --assume-unchanged exec &&\n"> <"\t>expect &&\n"> <"\tgit diff-files --find-copies-harder -- exec >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_done)}) ] )