summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-30 18:11:49 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-01-31 21:09:58 (GMT)
commit4a91a1f37e8813bf3b7de00de5b3a7ab1df89451 (patch)
treee1e155d13b77658228e99d203b60f791a642b2f8
parent76f8a302c73d7fe26b2034ab4d1dde64de39c8df (diff)
downloadgit-4a91a1f37e8813bf3b7de00de5b3a7ab1df89451.zip
git-4a91a1f37e8813bf3b7de00de5b3a7ab1df89451.tar.gz
git-4a91a1f37e8813bf3b7de00de5b3a7ab1df89451.tar.bz2
Escape --upload-pack from expr.
Recent commit ae1dffcb28ee89a23f8d2747be65e17c8eab1690 by Junio changed the way --upload-pack was passed around between clone, fetch and ls-remote and modified the handling of the command line parameter parsing. Unfortunately FreeBSD 6.1 insists that the expression expr --upload-pack=git-upload-pack : '-[^=]*=\(.*\)' is illegal, as the --upload-pack option is not supported by their implementation of expr. Elsewhere in Git we use z as a leading prefix of both arguments, ensuring the -- isn't seen by expr. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-clone.sh2
-rwxr-xr-xgit-fetch.sh2
-rwxr-xr-xgit-ls-remote.sh2
3 files changed, 3 insertions, 3 deletions
diff --git a/git-clone.sh b/git-clone.sh
index 3d83acb..4ddfa77 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -123,7 +123,7 @@ while
shift
upload_pack="--upload-pack=$1" ;;
*,--upload-pack=*)
- upload_pack=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)') ;;
+ upload_pack=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
1,--depth) usage;;
*,--depth)
shift
diff --git a/git-fetch.sh b/git-fetch.sh
index c1f6e1e..357cac2 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -37,7 +37,7 @@ do
;;
--upl=*|--uplo=*|--uploa=*|--upload=*|\
--upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
- exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
+ exec=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)')
shift
;;
-f|--f|--fo|--for|--forc|--force)
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index e6f574b..8ea5c5e 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -27,7 +27,7 @@ do
shift;;
-u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\
--upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
- exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
+ exec=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)')
shift;;
--)
shift; break ;;