mirror of
https://github.com/git/git
synced 2024-10-30 04:01:21 +00:00
clone: do not accept more than one -o option.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
4fb66a62ee
commit
e6489a1bdf
1 changed files with 15 additions and 1 deletions
16
git-clone.sh
16
git-clone.sh
|
@ -55,6 +55,7 @@ no_checkout=
|
||||||
upload_pack=
|
upload_pack=
|
||||||
bare=
|
bare=
|
||||||
origin=origin
|
origin=origin
|
||||||
|
origin_override=
|
||||||
while
|
while
|
||||||
case "$#,$1" in
|
case "$#,$1" in
|
||||||
0,*) break ;;
|
0,*) break ;;
|
||||||
|
@ -73,6 +74,11 @@ while
|
||||||
echo >&2 "'$2' is not suitable for a branch name"
|
echo >&2 "'$2' is not suitable for a branch name"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
test -z "$origin_override" || {
|
||||||
|
echo >&2 "Do not give more than one -o options."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
origin_override=yes
|
||||||
origin="$2"; shift
|
origin="$2"; shift
|
||||||
;;
|
;;
|
||||||
1,-u|1,--upload-pack) usage ;;
|
1,-u|1,--upload-pack) usage ;;
|
||||||
|
@ -87,7 +93,15 @@ do
|
||||||
done
|
done
|
||||||
|
|
||||||
# --bare implies --no-checkout
|
# --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
|
# Turn the source into an absolute path if
|
||||||
# it is local
|
# it is local
|
||||||
|
|
Loading…
Reference in a new issue