t7800: fix quoting
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 30 Oct 2018 09:22:29 +0000 (02:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 31 Oct 2018 02:43:12 +0000 (11:43 +0900)
When passing a command-line to call an external diff command to the
difftool, we must be prepared for paths containing special characters,
e.g. backslashes in the temporary directory's path on Windows.

This patch is needed in preparation for the next commit, which will
make the MinGW version of Git *not* rewrite TMP to use forward slashes
instead of backslashes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7800-difftool.sh
index 668bbee73c8dc58c6ba61c4a8002ed68206d1445..f29aa8f344f1a6ff8a953b20efb7b6b0486d4d81 100755 (executable)
@@ -332,7 +332,7 @@ test_expect_success 'difftool --extcmd cat arg1' '
 test_expect_success 'difftool --extcmd cat arg2' '
        echo branch >expect &&
        git difftool --no-prompt \
-               --extcmd sh\ -c\ \"cat\ \$2\" branch >actual &&
+               --extcmd sh\ -c\ \"cat\ \\\"\$2\\\"\" branch >actual &&
        test_cmp expect actual
 '