X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3701-add-interactive.sh;h=fae64eae9f9ff9b34b935e8556df61d2093425cf;hb=7dde4bb3674da53dd9e33c741bea3fe680690a0d;hp=77c90f6fa002ce00c3ffb30d0b79adaff46b3caa;hpb=fae09a8084c9b51632726523b477a78dd28d7d7e;p=git.git diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 77c90f6fa..fae64eae9 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -66,4 +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 "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