Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-clone: Allow cloning into directories other than child of current dir.
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>
git-clone.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
0879aa2
)
diff --git
a/git-clone.sh
b/git-clone.sh
index 8e7150127aff222059f3549a8b7f647b8f792c7d..f99e0adf86254c7e3c6848b767b60dd0b8017096 100755
(executable)
--- 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)
) &&