]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t3701-add-interactive.sh
Merge branch 'maint-1.6.3' into maint
[git.git] / t / t3701-add-interactive.sh
index 5cdb83d28c2bc54babf463da1aa591a66b300c9a..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