From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: [PATCH] git-clone: exit early if repo isn't specified Date: Thu, 30 Mar 2006 17:01:23 +0000 (UTC) Message-ID: <87d5g3yii8.wl@mail2.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-From: git-owner@vger.kernel.org Thu Mar 30 19:01:21 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FP0WF-000842-Po for gcvg-git@gmane.org; Thu, 30 Mar 2006 19:01:12 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253AbWC3RBI (ORCPT ); Thu, 30 Mar 2006 12:01:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932252AbWC3RBI (ORCPT ); Thu, 30 Mar 2006 12:01:08 -0500 Received: from shop.atmark-techno.com ([210.191.215.173]:9452 "EHLO mail2.atmark-techno.com") by vger.kernel.org with ESMTP id S932253AbWC3RBH (ORCPT ); Thu, 30 Mar 2006 12:01:07 -0500 Received: from smtp.local-network (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id A64044882; Fri, 31 Mar 2006 02:01:06 +0900 (JST) Received: from localhost.atmark-techno.com (unknown [192.168.10.81]) by smtp.local-network (Postfix) with ESMTP id 7E397B61F; Fri, 31 Mar 2006 02:06:21 +0900 (JST) To: git@vger.kernel.org Date: Fri Mar 31 00:00:16 2006 +0900 User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- 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