提交 ef5b4eab 编写于 作者: Y Yasushi SHOJI 提交者: Junio C Hamano

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: NYasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 98a4fef3
......@@ -98,6 +98,7 @@ close FH;
'
quiet=
local=no
use_local=no
local_shared=no
no_checkout=
......@@ -156,6 +157,13 @@ do
shift
done
repo="$1"
if test -z "$repo"
then
echo >&2 'you must specify a repository to clone.'
exit 1
fi
# --bare implies --no-checkout
if test yes = "$bare"
then
......@@ -179,8 +187,6 @@ fi
# Turn the source into an absolute path if
# it is local
repo="$1"
local=no
if base=$(get_repo_base "$repo"); then
repo="$base"
local=yes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册