Skip to content
Snippets Groups Projects
Commit b0c698a6 authored by Josef Weidendorfer's avatar Josef Weidendorfer Committed by Junio C Hamano
Browse files

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: default avatarJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
parent 94d23317
Branches
Tags
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment