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

[PATCH] git.sh: quote all paths

From
Jonas Fonseca <fonseca@diku.dk>
Date
Oct 10, 2005, 09:32 UTC
Message-ID
<20051010093254.GD18009@diku.dk>
In-Reply-To
<20051010092638.GC18009@diku.dk>
This makes it handle spaces in paths.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Sorry I am so sloppy: s/.exe/@@X@@/ ...
diff --git a/git.sh b/git.sh
index 7400c16..b424055 100755
--- a/git.sh
+++ b/git.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 cmd=
-path=$(dirname $0)
+path=$(dirname "$0")
 case "$#" in
 0)	;;
 *)	cmd="$1"
@@ -12,13 +12,13 @@ case "$#" in
 		exit 0 ;;
 	esac
 	
-	test -x $path/git-$cmd && exec $path/git-$cmd "$@"
+	test -x "$path/git-$cmd" && exec "$path/git-$cmd" "$@"
 	
 	case '@@X@@' in
 	    '')
 		;;
 	    *)
-		test -x $path/git-$cmd@@X@@ && exec $path/git-$cmd@@X@@ "$@"
+		test -x "$path/git-$cmd.exe" && exec "$path/git-$cmd@@X@@" "$@"
 		;;
 	esac
 	;;
-- 
Jonas Fonseca
Previous: Jonas FonsecaNext: H. Peter Anvin
Message 5 of 9 in “Fix cygwin install issues”
  1. Fix cygwin install issuesJonas Fonseca, Oct 10, 2005
  2. Jonas FonsecaOct 10, 2005
  3. Junio C HamanoOct 10, 2005
  4. git.sh: quote all pathsJonas Fonseca, Oct 10, 2005
  5. git.sh: quote all pathsJonas Fonseca, Oct 10, 2005
  6. H. Peter AnvinOct 10, 2005
  7. Junio C HamanoOct 10, 2005
  8. H. Peter AnvinOct 10, 2005
  9. Deal with $(bindir) and friends with whitespaces.Junio C Hamano, Oct 10, 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.