X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-clone.sh;h=f99e0adf86254c7e3c6848b767b60dd0b8017096;hb=ceae78b438d2e5ca035aec9b067643ca79ed4ccd;hp=8e7150127aff222059f3549a8b7f647b8f792c7d;hpb=0879aa28708dcdfa255fff631781e5178755498e;p=git.git diff --git a/git-clone.sh b/git-clone.sh index 8e715012..f99e0adf 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) ) &&