Code

Merge branch 'gp/gitweb'
[git.git] / t / t3701-add-interactive.sh
index d920d06d5a8e1f5c09f2f0a2d5a77da1b59cdccf..f15be93e7709acbb517bb85020d4d6b94a50f725 100755 (executable)
@@ -70,9 +70,19 @@ 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"
+'
+
+
 test_done