threads / patch / 2446

patchgit-clone: quote destination directory name

Subject: [PATCH] git-clone: quote destination directory name

## tl;dr

One message between Nov 11, 2005 and Nov 11, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Nov 11, 2005, 05:19 UTC · lore

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>
Show changes to git-clone.sh +2 −2
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

← back to recent threads