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

Bugfix: stop if directory already exists

Fix a typo: We do not want to run the directory as command, and want to terminate if the directory exists Additionally, update the usage message Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Josef Weidendorfer committed Nov 13, 2005 at 15:03 UTC b0c698a6e41c47ef3e036367e58a0cf2639c1f0d
1 file changed +2 -2
git-clone.sh
+2 -2
@@ -9,7 +9,7 @@
9 unset CDPATH
10
11 usage() {
12 - echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> <dir>"
12 + echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]"
13 exit 1
14 }
15
@@ -98,7 +98,7 @@ fi
98 dir="$2"
99 # Try using "humanish" part of source repo if user didn't specify one
100 [ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*/||g')
101 -[ -e "$dir" ] && $(echo "$dir already exists."; usage)
101 +[ -e "$dir" ] && echo "$dir already exists." && usage
102 mkdir -p "$dir" &&
103 D=$(
104 (cd "$dir" && git-init-db && pwd)