summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0879aa2)
raw | patch | inline | side by side (parent: 0879aa2)
author | Andreas Ericsson <exon@op5.se> | |
Thu, 10 Nov 2005 11:58:08 +0000 (12:58 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 11 Nov 2005 09:34:27 +0000 (01:34 -0800) |
This patch adds -p to mkdir and an explicit check to see if the target
directory exists (since mkdir -p doesn't throw an error if it does).
Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
directory exists (since mkdir -p doesn't throw an error if it does).
Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-clone.sh | patch | blob | history |
diff --git a/git-clone.sh b/git-clone.sh
index 8e7150127aff222059f3549a8b7f647b8f792c7d..f99e0adf86254c7e3c6848b767b60dd0b8017096 100755 (executable)
--- a/git-clone.sh
+++ b/git-clone.sh
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')
-mkdir "$dir" &&
+[ -e "$dir" ] && $(echo "$dir already exists."; usage)
+mkdir -p "$dir" &&
D=$(
(cd "$dir" && git-init-db && pwd)
) &&