summaryrefslogtreecommitdiff
path: root/git-clone.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-01-23 01:28:49 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-01-25 07:17:06 (GMT)
commite6489a1bdf6e20371e6cd6497918f1c1198d5f81 (patch)
tree05863e85ae0b8fe755c1257ecae2d066d36d2596 /git-clone.sh
parent4fb66a62eeb7bfec115cd0058d7a05ab62fc23e7 (diff)
downloadgit-e6489a1bdf6e20371e6cd6497918f1c1198d5f81.zip
git-e6489a1bdf6e20371e6cd6497918f1c1198d5f81.tar.gz
git-e6489a1bdf6e20371e6cd6497918f1c1198d5f81.tar.bz2
clone: do not accept more than one -o option.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-xgit-clone.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/git-clone.sh b/git-clone.sh
index 73fc919..47f3ec9 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -55,6 +55,7 @@ no_checkout=
upload_pack=
bare=
origin=origin
+origin_override=
while
case "$#,$1" in
0,*) break ;;
@@ -73,6 +74,11 @@ while
echo >&2 "'$2' is not suitable for a branch name"
exit 1
}
+ test -z "$origin_override" || {
+ echo >&2 "Do not give more than one -o options."
+ exit 1
+ }
+ origin_override=yes
origin="$2"; shift
;;
1,-u|1,--upload-pack) usage ;;
@@ -87,7 +93,15 @@ do
done
# --bare implies --no-checkout
-test =z "$bare" || no_checkout=yes
+if test yes = "$bare"
+then
+ if test yes = "$origin_override"
+ then
+ echo >&2 '--bare and -o $origin options are incompatible.'
+ exit 1
+ fi
+ no_checkout=yes
+fi
# Turn the source into an absolute path if
# it is local