Unified · Split
| @@ -16,17 +16,21 @@ fn usage { · 15 unmodified lines | ||
| 16 | 16 | exit usage |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | −remote='' | |
| 19 | +remote=() | |
| 20 | 20 | sendall='' |
| 21 | 21 | remove=() |
| 22 | 22 | upstream='origin' |
| 23 | 23 | branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl} |
| 24 | 24 | while(~ $1 -* && ! ~ $1 --){ |
| 25 | − echo branch | |
| 26 | 25 | switch($1){ |
| 27 | − case -u; upstream=$1 | |
| 28 | − case -a; sendall=true | |
| 29 | − case -b; branch=$1 | |
| 26 | + case -u; | |
| 27 | + shift | |
| 28 | + upstream=$1 | |
| 29 | + case -a; | |
| 30 | + sendall=true | |
| 31 | + case -b; | |
| 32 | + shift | |
| 33 | + branch=$1 | |
| 30 | 34 | case -r; |
| 31 | 35 | shift |
| 32 | 36 | remove=(-r$1 $remove); |
| @@ -34,10 +38,15 @@ while(~ $1 -* && ! ~ $1 --){ · 1 unmodified line | ||
| 34 | 38 | } |
| 35 | 39 | shift |
| 36 | 40 | } |
| 37 | −if(~ $remote '') | |
| 41 | + | |
| 42 | +if(~ $#remote 0) | |
| 38 | 43 | remote=`{git/conf 'remote "'$upstream'".url'} |
| 39 | −if not | |
| 44 | +if(~ $#remote 0) | |
| 40 | 45 | remote=$upstream |
| 46 | +if(~ $#remote 0){ | |
| 47 | + echo 'no idea where to push' | |
| 48 | + exit upstream | |
| 49 | +} | |
| 41 | 50 | if(~ $sendall '') |
| 42 | 51 | git/send -b $branch $remove $remote |
| 43 | 52 | if not |