Merge branch 'gb/apply-ignore-whitespace'
[gitweb.git] / t / t3701-add-interactive.sh
index 9999fcd4b6e4000f199131e9b62e9aae3d278db1..62fd65e18d434711176ddb1c22ef057b879e992a 100755 (executable)
@@ -163,8 +163,25 @@ test_expect_success FILEMODE 'stage mode but not hunk' '
        git diff          file | grep "+content"
 '
 
+
+test_expect_success FILEMODE 'stage mode and hunk' '
+       git reset --hard &&
+       echo content >>file &&
+       chmod +x file &&
+       printf "y\\ny\\n" | git add -p &&
+       git diff --cached file | grep "new mode" &&
+       git diff --cached file | grep "+content" &&
+       test -z "$(git diff file)"
+'
+
 # end of tests disabled when filemode is not usable
 
+test_expect_success 'setup again' '
+       git reset --hard &&
+       test_chmod +x file &&
+       echo content >>file
+'
+
 # Write the patch file with a new line at the top and bottom
 cat >patch <<EOF
 index 180b47c..b6f2c08 100644
@@ -189,7 +206,7 @@ index b6f2c08..61b9053 100755
 +lastline
 EOF
 # Test splitting the first patch, then adding both
-test_expect_failure 'add first line works' '
+test_expect_success 'add first line works' '
        git commit -am "clear local changes" &&
        git apply patch &&
        (echo s; echo y; echo y) | git add -p file &&