Skip to content

Commit

Permalink
clone: do not accept more than one -o option.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 25, 2006
1 parent 4fb66a6 commit e6489a1
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ no_checkout=
upload_pack=
bare=
origin=origin
origin_override=
while
case "$#,$1" in
0,*) break ;;
Expand All @@ -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 ;;
Expand All @@ -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
Expand Down

0 comments on commit e6489a1

Please sign in to comment.