From: Yasushi SHOJI Date: Thu, 30 Mar 2006 17:01:23 +0000 (+0000) Subject: git-clone: exit early if repo isn't specified X-Git-Tag: v1.3.0-rc2~26 X-Git-Url: https://git.octo.it/?p=git.git;a=commitdiff_plain;h=ef5b4eabb6da7cead197e387589896345d3dfbc6 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 Signed-off-by: Junio C Hamano --- diff --git a/git-clone.sh b/git-clone.sh index 0e8a57d2..823c74b9 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -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