Fix generation of "humanish" part of source repo
If repo has the form <host>:<path> and <path> doesn't contain a slash, the cloned repository is named "<host>:<path>", instead of "<path>" only. Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Uwe Zeisberger committed
Jan 20, 2006 at 07:47 UTC
e7555785f4edcf4988c53305349e3f525216e2cb
1 file changed
+1
-1
git-clone.sh
+1
-1
@@ -99,7 +99,7 @@ fi
99
100
dir="$2"
101
# Try using "humanish" part of source repo if user didn't specify one
102
-[ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*/||g')
102
+[ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g')
103
[ -e "$dir" ] && echo "$dir already exists." && usage
104
mkdir -p "$dir" &&
105
D=$(cd "$dir" && pwd) &&