diff options
author | Yasushi SHOJI <yashi@atmark-techno.com> | 2006-03-30 17:01:23 +0000 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-03-30 15:31:21 -0800 |
commit | ef5b4eabb6da7cead197e387589896345d3dfbc6 (patch) | |
tree | 62fa458510c139b972fe5bb100698aeddf195f65 | |
parent | 98a4fef3f28e48d12a4fecd5cf97daa774c1e5bc (diff) | |
download | git-ef5b4eabb6da7cead197e387589896345d3dfbc6.tar.gz git-ef5b4eabb6da7cead197e387589896345d3dfbc6.tar.xz |
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>
-rwxr-xr-x | git-clone.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/git-clone.sh b/git-clone.sh index 0e8a57d2b..823c74b91 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 |