summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2005-11-13 14:03:31 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-14 08:50:17 (GMT)
commitb0c698a6e41c47ef3e036367e58a0cf2639c1f0d (patch)
tree887be2842543ea082d310fcc981434115866f6f6
parent94d2331770b08dc28faf1d950a546a0feb953323 (diff)
downloadgit-b0c698a6e41c47ef3e036367e58a0cf2639c1f0d.zip
git-b0c698a6e41c47ef3e036367e58a0cf2639c1f0d.tar.gz
git-b0c698a6e41c47ef3e036367e58a0cf2639c1f0d.tar.bz2
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>
-rwxr-xr-xgit-clone.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-clone.sh b/git-clone.sh
index f99e0ad..c09979a 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -9,7 +9,7 @@
unset CDPATH
usage() {
- echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> <dir>"
+ echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]"
exit 1
}
@@ -98,7 +98,7 @@ fi
dir="$2"
# Try using "humanish" part of source repo if user didn't specify one
[ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*/||g')
-[ -e "$dir" ] && $(echo "$dir already exists."; usage)
+[ -e "$dir" ] && echo "$dir already exists." && usage
mkdir -p "$dir" &&
D=$(
(cd "$dir" && git-init-db && pwd)