1#!/usr/bin/env sh23: ${RGIT_CONTROL_PATH:="$HOME/.ssh/controlmaster/rgit"}4: ${RGIT_INSTANCE:="ssh://git.lin.moe"}56[ -d $(dirname $RGIT_CONTROL_PATH) ] || mkdir $(dirname $RGIT_CONTROL_PATH)7if [ ! -S $RGIT_CONTROL_PATH ]; then8 ssh -f -N \9 -o ExitOnForwardFailure=yes \10 -o ControlMaster=auto \11 -o ControlPath="$RGIT_CONTROL_PATH" \12 -o ControlPersist=1h \13 $RGIT_INSTANCE14fi1516_quoted_args(){17 echo -n "'$1'"18 shift19 for arg in "$@"; do20 arg=$(echo $arg | sed "s/'/'\"'\"'/g")21 echo -n " '$arg'"22 done23}2425ssh -o ControlMaster=auto \26 -o ControlPath="$RGIT_CONTROL_PATH" \27 -T $RGIT_INSTANCE "$(_quoted_args "$@")"