shithub: git9

Download patch

ref: 6f011d94cf9ceaf1d8f931cfe1ab605dcb91606e
parent: 5a6f8d7b9713f600f5029e21ece8117137f9ee12
author: Ori Bernstein <[email protected]>
date: Sat Aug 22 16:13:15 EDT 2020

missed git/init in args conversion

--- a/init
+++ b/init
@@ -2,35 +2,17 @@
 rfork ne
 . /sys/lib/git/common.rc
 
-usage='
-	git/init [-b] [-u upstream] name
-		-b        init bare repository
-		-u        set remote "origin" to upstream
-'
+flagfmt='b:bare, u:upstream upstream'; args='name'
+eval `''{aux/getflags $*} || exec aux/usage
 
-sub='/.git'
-upstream=()
-while(~ $1 -* && ! ~ $1 --){
-	switch($1){
-	case -b
-		sub=''
-	case -u
-		upstream=$2
-		shift
-	case *
-		usage
-	}
-	shift
-}
-if(~ $1 --)
-	shift
+~ $bare 1 && sub='' || sub='/.git'
 
-if (~ $#* 0)
+if(~ $#* 0)
 	dir=.
 if not if(~ $#* 1)
 	dir=$1
 if not
-	usage
+	exec aux/usage
 
 if(test -e $dir$sub)
 	die $dir$sub already exists