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

[PATCH] git-clone: quote destination directory name

From
PRPavel Roskin <proski@gnu.org>
Date
Nov 11, 2005, 05:19 UTC
Message-ID
<1131686344.31172.24.camel@dv>

git-clone doesn't quote the full path to the destination directory, which causes it to fail if the path contains spaces or other characters interpreted by the shell.

Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/git-clone.sh b/git-clone.sh
index 4fdd652..0f37dff 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -163,7 +163,7 @@ yes,yes)
 			rm -f "$D/.git/TMP_ALT"
 		if test -f "$D/.git/TMP_ALT"
 		then
-		    ( cd $D &&
+		    ( cd "$D" &&
 		      . git-parse-remote &&
 		      resolve_alternates "$repo" <"./.git/TMP_ALT" ) |
 		    while read alt
@@ -191,7 +191,7 @@ yes,yes)
 	;;
 esac
 
-cd $D || exit
+cd "$D" || exit
 
 if test -f ".git/HEAD"
 then
-- 
Regards,
Pavel Roskin
Message 1 of 1 in “git-clone: quote destination directory name”
  1. git-clone: quote destination directory namePavel Roskin, Nov 11, 2005

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.