Put the main loop for the git protocol in a function

This commit is contained in:
root 2013-01-06 18:20:39 -07:00
parent 2261a5e7af
commit cd90cea0fe

View file

@ -762,6 +762,11 @@ cleanup_atexit()
rm -f "$Localdir"/tmp_*".$$" >&2 rm -f "$Localdir"/tmp_*".$$" >&2
} }
# handle git-remote-helpers protocol
gcrypt_main_loop()
{
local input_= input_inner= args_=
NAME=$1 # Remote name NAME=$1 # Remote name
URL=$2 # Remote URL URL=$2 # Remote URL
@ -770,9 +775,9 @@ trap cleanup_atexit EXIT 1 2 3 15
echo_info "Development version -- Repository format MAY CHANGE" echo_info "Development version -- Repository format MAY CHANGE"
while read Input while read input_
do do
case "$Input" in case "$input_" in
capabilities) capabilities)
do_capabilities do_capabilities
;; ;;
@ -780,10 +785,10 @@ do
do_list do_list
;; ;;
fetch\ *) fetch\ *)
args_="${Input##fetch }" args_="${input_##fetch }"
while read InputX while read input_inner
do do
case "$InputX" in case "$input_inner" in
fetch*) fetch*)
args_= #ignored args_= #ignored
;; ;;
@ -795,12 +800,12 @@ do
do_fetch "$args_" do_fetch "$args_"
;; ;;
push\ *) push\ *)
args_="${Input##push }" args_="${input_##push }"
while read InputX while read input_inner
do do
case "$InputX" in case "$input_inner" in
push\ *) push\ *)
append_to args_ "${InputX#push }" append_to args_ "${input_inner#push }"
;; ;;
*) *)
break break
@ -818,3 +823,6 @@ do
;; ;;
esac esac
done done
}
gcrypt_main_loop "$@"