History

Fix git/push option parsing.

Ori Bernstein committed 7 years ago

Commit 76794de1 parent 471f8a71 file · +16 −7Browse files

Unified · Split

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