shithub: git9

Download patch

ref: 08920d75cc0033bad647b37f927ab2f7efdabf58
parent: 55b89c19827641bd05156fb5a3869d8448e397be
author: Ori Bernstein <[email protected]>
date: Sat Sep 26 22:16:41 EDT 2020

git/compat: fix 'git init', 'git remote', gitroot.

Work towards a fully working git/compat.

--- a/compat
+++ b/compat
@@ -108,11 +108,15 @@
 }
 
 fn cmd_remote{
-	if(! ~ $1 add)
+	if({! ~ $#* 3 && ! ~ $#* 4} || ! ~ $1 add)
 		die unimplemented remote cmd $*
+	name=$2
+	url=$3
+	if(~ $3 '--')
+		url=$4
 	>>$gitroot/.git/config{
-		echo '[remote "'$2'"]'
-		echo '	url='$3
+		echo '[remote "'$name'"]'
+		echo '	url='$url
 	}
 }
 
@@ -142,5 +146,6 @@
 	die git $1: commmand not implemented
 }
 
-gitroot=`{git/conf -r} || exit repo
+if(! ~ $1 init && ! ~ $1 clone)
+	gitroot=`{git/conf -r} || die repo
 cmd_$1 $*(2-)