shell_help "Usage: $FUNCNAME create git project from current dir" "$@" && return 1
declare dir="$(basename $(pwd))"
- declare repo="$GIT_REPO"
+ declare repo=$(echo "$GIT_REPO" | perl -pe 's,^\w+://,,; s,/.*$,,;')
[ -n "$1" ] && repo="$1" && shift
#
}
git_clone() {
- git clone $GIT_REPO:${1%.git}.git
+ declare repo=$GIT_REPO
+ case "$repo" in
+ *"//"*) ;;
+ *) repo="$repo:"
+ esac
+
+ git clone ${repo}${1%.git}.git
}
git_list() {
- ssh $GIT_REPO list | perl -ne '/(\S+).git/ and print "$1\n"'
+ local repo=$(echo "$GIT_REPO" | perl -pe 's,^\w+://,,; s,/.*$,,;')
+ ssh $repo list | perl -ne '/(\S+).git/ and print "$1\n"'
}