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
1616 exit usage
1717 }
1818
19−remote=''
19+remote=()
2020 sendall=''
2121 remove=()
2222 upstream='origin'
2323 branch=`{awk '$1=="branch"{print $2}' < /mnt/git/ctl}
2424 while(~ $1 -* && ! ~ $1 --){
25− echo branch
2625 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
3034 case -r;
3135 shift
3236 remove=(-r$1 $remove);
@@ -34,10 +38,15 @@ while(~ $1 -* && ! ~ $1 --){ · 1 unmodified line
3438 }
3539 shift
3640 }
37−if(~ $remote '')
41+
42+if(~ $#remote 0)
3843 remote=`{git/conf 'remote "'$upstream'".url'}
39−if not
44+if(~ $#remote 0)
4045 remote=$upstream
46+if(~ $#remote 0){
47+ echo 'no idea where to push'
48+ exit upstream
49+}
4150 if(~ $sendall '')
4251 git/send -b $branch $remove $remote
4352 if not