git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t7800: fix quoting

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 30, 2018, 09:22 UTC
Message-ID
<77b2cfb2188b9a5b65c4564faea2a292963371bf.1540891346.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.57.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 t/t7800-difftool.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 562bd215a..22b9199d5 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -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
 '
 
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 3 in “mingw: rework the environment handling”
  1. 0/2 mingw: rework the environment handlingJohannes Schindelin via GitGitGadget, Oct 30, 2018
  2. 1/2 t7800: fix quotingJohannes Schindelin via GitGitGadget, Oct 30, 2018
  3. 2/2 mingw: reencode environment variables on the fly (UTF-16 <-> UTF-8)Johannes Schindelin via GitGitGadget, Oct 30, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.