git-clone: exit early if repo isn't specified
git-clone without a repo isn't useful at all. print message and get out asap. This patch also move the variable 'local' to where other variables are initialized. Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
98a4fef3f2
commit
ef5b4eabb6
10
git-clone.sh
10
git-clone.sh
@ -98,6 +98,7 @@ close FH;
|
|||||||
'
|
'
|
||||||
|
|
||||||
quiet=
|
quiet=
|
||||||
|
local=no
|
||||||
use_local=no
|
use_local=no
|
||||||
local_shared=no
|
local_shared=no
|
||||||
no_checkout=
|
no_checkout=
|
||||||
@ -156,6 +157,13 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
repo="$1"
|
||||||
|
if test -z "$repo"
|
||||||
|
then
|
||||||
|
echo >&2 'you must specify a repository to clone.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# --bare implies --no-checkout
|
# --bare implies --no-checkout
|
||||||
if test yes = "$bare"
|
if test yes = "$bare"
|
||||||
then
|
then
|
||||||
@ -179,8 +187,6 @@ fi
|
|||||||
|
|
||||||
# Turn the source into an absolute path if
|
# Turn the source into an absolute path if
|
||||||
# it is local
|
# it is local
|
||||||
repo="$1"
|
|
||||||
local=no
|
|
||||||
if base=$(get_repo_base "$repo"); then
|
if base=$(get_repo_base "$repo"); then
|
||||||
repo="$base"
|
repo="$base"
|
||||||
local=yes
|
local=yes
|
||||||
|
Reference in New Issue
Block a user