difftool--helper: exit when reading a prompt answer fails
[gitweb.git] / t / t7800-difftool.sh
index 5a193c500d282cc2b13e8de6e128229585897a16..9cf5dc9347971438b50e2a23cbb005758106ab5e 100755 (executable)
@@ -58,7 +58,7 @@ test_expect_success PERL 'custom tool commands override built-ins' '
 
 test_expect_success PERL 'difftool ignores bad --tool values' '
        : >expect &&
-       test_expect_code 1 \
+       test_must_fail \
                git difftool --no-prompt --tool=bad-tool branch >actual &&
        test_cmp expect actual
 '
@@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
        ! grep br2 output
 '
 
+test_expect_success PERL 'ending prompt input with EOF' '
+       git difftool -x cat branch </dev/null >output &&
+       ! grep master output &&
+       ! grep branch output &&
+       ! grep m2 output &&
+       ! grep br2 output
+'
+
 test_expect_success PERL 'difftool --tool-help' '
        git difftool --tool-help >output &&
        grep tool output