Skip to content

Commit

Permalink
Bugfix: stop if directory already exists
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Weidendorfer authored and Junio C Hamano committed Nov 14, 2005
1 parent 94d2331 commit b0c698a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b0c698a

Please sign in to comment.