X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3701-add-interactive.sh;h=fae64eae9f9ff9b34b935e8556df61d2093425cf;hb=7dde4bb3674da53dd9e33c741bea3fe680690a0d;hp=d920d06d5a8e1f5c09f2f0a2d5a77da1b59cdccf;hpb=b717a627629e6886956af54274d507b9711d49e6;p=git.git diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index d920d06d5..fae64eae9 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -66,13 +66,30 @@ test_expect_success 'revert works (commit)' ' grep "unchanged *+3/-0 file" output ' +if test "$(git config --bool core.filemode)" = false +then + say 'skipping filemode tests (filesystem does not properly support modes)' +else + test_expect_success 'patch does not affect mode' ' git reset --hard && echo content >>file && chmod +x file && - printf "y\\n" | git add -p && + printf "n\\ny\\n" | git add -p && git show :file | grep content && git diff file | grep "new mode" ' +test_expect_success 'stage mode but not hunk' ' + git reset --hard && + echo content >>file && + chmod +x file && + printf "y\\nn\\n" | git add -p && + git diff --cached file | grep "new mode" && + git diff file | grep "+content" +' + +fi +# end of tests disabled when filemode is not usable + test_done