X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=280cc2e81e98c5fe69e8528ca97069dd0b0e59f5;hb=6ab58895cd951f6f5c96fa432afb122cfeb12746;hp=f99e0adf86254c7e3c6848b767b60dd0b8017096;hpb=7f10f7c4e4943fefbc8b8310d1d1d7753f5e3aff;p=git.git diff --git a/git-clone.sh b/git-clone.sh index f99e0adf..280cc2e8 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -9,7 +9,7 @@ unset CDPATH usage() { - echo >&2 "* git clone [-l [-s]] [-q] [-u ] [-n] " + echo >&2 "Usage: $0 [-l [-s]] [-q] [-u ] [-n] []" exit 1 } @@ -73,7 +73,7 @@ while *,-n) no_checkout=yes ;; *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;; *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared) - local_shared=yes ;; + local_shared=yes; use_local=yes ;; *,-q|*,--quiet) quiet=-q ;; 1,-u|1,--upload-pack) usage ;; *,-u|*,--upload-pack) @@ -98,7 +98,7 @@ 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') -[ -e "$dir" ] && $(echo "$dir already exists."; usage) +[ -e "$dir" ] && echo "$dir already exists." && usage mkdir -p "$dir" && D=$( (cd "$dir" && git-init-db && pwd) @@ -188,7 +188,10 @@ yes,yes) cd "$D" && case "$upload_pack" in '') git-clone-pack $quiet "$repo" ;; *) git-clone-pack $quiet "$upload_pack" "$repo" ;; - esac + esac || { + echo >&2 "clone-pack from '$repo' failed." + exit 1 + } ;; esac ;;