git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-clone: exit early if repo isn't specified
@ 2006-03-30 17:01 Yasushi SHOJI
  0 siblings, 0 replies; only message in thread
From: Yasushi SHOJI @ 2006-03-30 17:01 UTC (permalink / raw)
  To: git

Subject: [PATCH] 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>


---

 git-clone.sh |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

a222289a855194280aade24baa005de9e55667d0
diff --git a/git-clone.sh b/git-clone.sh
index a731d15..7b05fd9 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=
@@ -155,6 +156,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
@@ -178,8 +186,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
-- 
1.3.0.rc1.gb8abc

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-30 17:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-30 17:01 [PATCH] git-clone: exit early if repo isn't specified Yasushi SHOJI

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).