X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-push-script;h=5fa5af2af896e3bf6854387e744b9d2643a8f510;hb=6687f8fea22e1e43ab163a8fe180155a0a0a956a;hp=70fa9684a51be3dbbcb83460c32bb8d7fe1b4cf0;hpb=2b64f88f09ae2169ec85652b46897574e352936d;p=git.git diff --git a/git-push-script b/git-push-script index 70fa9684a..5fa5af2af 100755 --- a/git-push-script +++ b/git-push-script @@ -20,8 +20,6 @@ do -*) die "Unknown parameter $1" ;; *) - remote="$1" - shift set x "$@" shift break ;; @@ -29,27 +27,13 @@ do shift done -case "$remote" in -*:* | /* | ../* | ./* ) - # An URL, host:/path/to/git, absolute and relative paths. - ;; -* ) - # Shorthand - if expr "$remote" : '..*/..*' >/dev/null - then - # a short-hand followed by a trailing path - shorthand=$(expr "$remote" : '\([^/]*\)') - remainder=$(expr "$remote" : '[^/]*\(/.*\)$') - else - shorthand="$remote" - remainder= - fi - remote=$(sed -e 's/#.*//' "$GIT_DIR/branches/$remote") && - expr "$remote" : '..*:' >/dev/null && - remote="$remote$remainder" || - die "Cannot parse remote $remote" - ;; +. git-parse-remote-script +remote=$(get_remote_url "$@") +case "$has_all" in +--all) set x ;; +'') set x $(get_remote_refs_for_push "$@") ;; esac +shift case "$remote" in http://* | https://* | git://* | rsync://* )