@matheusbsbs / matheus-bagliano / commits / ef5b4eabb6
Fork 0

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>

Yasushi SHOJI committed Mar 30, 2006 at 17:01 UTC ef5b4eabb6da7cead197e387589896345d3dfbc6
1 file changed +8 -2
git-clone.sh
+8 -2
@@ -98,6 +98,7 @@ close FH;
98 '
99
100 quiet=
101 +local=no
102 use_local=no
103 local_shared=no
104 no_checkout=
@@ -156,6 +157,13 @@ do
157 shift
158 done
159
160 +repo="$1"
161 +if test -z "$repo"
162 +then
163 + echo >&2 'you must specify a repository to clone.'
164 + exit 1
165 +fi
166 +
167 # --bare implies --no-checkout
168 if test yes = "$bare"
169 then
@@ -179,8 +187,6 @@ fi
187
188 # Turn the source into an absolute path if
189 # it is local
182 -repo="$1"
183 -local=no
190 if base=$(get_repo_base "$repo"); then
191 repo="$base"
192 local=yes