Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Ericsson <exon@op5.se>2005-11-10 14:58:08 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-11 12:34:27 +0300
commit7f10f7c4e4943fefbc8b8310d1d1d7753f5e3aff (patch)
tree76d3d1c302c20b82fd976e958aabd19f7f01e7b5 /git-clone.sh
parent0879aa28708dcdfa255fff631781e5178755498e (diff)
git-clone: Allow cloning into directories other than child of current dir.
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>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-xgit-clone.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-clone.sh b/git-clone.sh
index 8e7150127a..f99e0adf86 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -98,7 +98,8 @@ 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')
-mkdir "$dir" &&
+[ -e "$dir" ] && $(echo "$dir already exists."; usage)
+mkdir -p "$dir" &&
D=$(
(cd "$dir" && git-init-db && pwd)
) &&