@matheusbsbs / matheus-bagliano / commits / 4a91a1f37e
Fork 0

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>

Shawn O. Pearce committed Jan 30, 2007 at 13:11 UTC 4a91a1f37e8813bf3b7de00de5b3a7ab1df89451
3 files changed +3 -3
git-clone.sh
+1 -1
@@ -123,7 +123,7 @@ while
123 shift
124 upload_pack="--upload-pack=$1" ;;
125 *,--upload-pack=*)
126 - upload_pack=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)') ;;
126 + upload_pack=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
127 1,--depth) usage;;
128 *,--depth)
129 shift
git-fetch.sh
+1 -1
@@ -37,7 +37,7 @@ do
37 ;;
38 --upl=*|--uplo=*|--uploa=*|--upload=*|\
39 --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
40 - exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
40 + exec=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)')
41 shift
42 ;;
43 -f|--f|--fo|--for|--forc|--force)
git-ls-remote.sh
+1 -1
@@ -27,7 +27,7 @@ do
27 shift;;
28 -u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\
29 --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)
30 - exec=--upload-pack=$(expr "$1" : '-[^=]*=\(.*\)')
30 + exec=--upload-pack=$(expr "z$1" : 'z-[^=]*=\(.*\)')
31 shift;;
32 --)
33 shift; break ;;