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

[PATCH 1/2] mingw (t5580): document bug when cloning from backslashed UNC paths

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 17, 2019, 20:14 UTC
Message-ID
<785b71df39c777f3ff182098a6961fceb629bfcf.1547756085.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.94.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

Due to a quirk in Git's method to spawn git-upload-pack, there is a problem when passing paths with backslashes in them: Git will force the command-line through the shell, which has different quoting semantics in Git for Windows (being an MSYS2 program) than regular Win32 executables such as git.exe itself.

The symptom is that the first of the two backslashes in UNC paths of the form \\myserver\folder\repository.git is *stripped off*.

Document this bug by introducing a test case.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t5580-clone-push-unc.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/t/t5580-clone-push-unc.sh b/t/t5580-clone-push-unc.sh
index ba548df4a9..c3703765f4 100755
--- a/t/t5580-clone-push-unc.sh
+++ b/t/t5580-clone-push-unc.sh
@@ -40,6 +40,11 @@ test_expect_success clone '
 	git clone "file://$UNCPATH" clone
 '
 
+test_expect_failure 'clone with backslashed path' '
+	BACKSLASHED="$(echo "$UNCPATH" | tr / \\\\)" &&
+	git clone "$BACKSLASHED" backslashed
+'
+
 test_expect_success push '
 	(
 		cd clone &&
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 3 in “mingw: fix git clone \\server\share”
  1. 0/2 mingw: fix git clone \\server\shareJohannes Schindelin via GitGitGadget, Jan 17, 2019
  2. 1/2 mingw (t5580): document bug when cloning from backslashed UNC pathsJohannes Schindelin via GitGitGadget, Jan 17, 2019
  3. 2/2 mingw: special-case arguments to `sh`Johannes Schindelin via GitGitGadget, Jan 17, 2019

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.