[PATCH] Start adding the $GIT_DIR/remotes/ support.

All the necessary parsing code is in git-parse-remote-script;
update git-push-script to use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2005-08-20 02:52:24 -07:00
parent d998a0895f
commit ac4b0cff00
3 changed files with 151 additions and 23 deletions

View File

@ -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://* )