usability: don't ask questions if no reply is required
[gitweb.git] / t / t3701-add-interactive.sh
index 5ffe78e920c4aa292a6c16e2aa8078ede4ab065c..aaa258daa376ab6d18d71a04a517840e1b55d094 100755 (executable)
@@ -394,4 +394,22 @@ test_expect_success 'diffs can be colorized' '
        grep "$(printf "\\033")" output
 '
 
+test_expect_success 'patch-mode via -i prompts for files' '
+       git reset --hard &&
+
+       echo one >file &&
+       echo two >test &&
+       git add -i <<-\EOF &&
+       patch
+       test
+
+       y
+       quit
+       EOF
+
+       echo test >expect &&
+       git diff --cached --name-only >actual &&
+       test_cmp expect actual
+'
+
 test_done