shithub: riscv

Download patch

ref: 9ca6ca345fa3b06dbf35e7808c35c0aaa7aa3bec
parent: ad26f82e44a5f59383edfde5f4c3727c225f4b0a
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Aug 24 22:24:15 EDT 2021

git/compat: add support for ls-remote [-d]

This is used by 'go get' sometimes, so add it.

--- a/sys/src/cmd/git/compat
+++ b/sys/src/cmd/git/compat
@@ -125,6 +125,15 @@
 	}
 }
 
+fn cmd_ls-remote{
+	if(~ $1 -q)
+		shift
+	remote=`$nl{git/conf 'remote "'$1'".url'}
+	if(~ $#remote 0)
+		remote=$1
+	git/fetch -l $remote | awk '/^remote/{print $3"\t"$2}'
+}
+
 fn cmd_version{
 	echo git version 2.2.0
 }
@@ -154,5 +163,6 @@
 if(! ~ $1 init && ! ~ $1 clone)
 	gitroot=`{git/conf -r} || die repo
 
+echo $* >/tmp/gitlog
 cmd_$1 $*(2-)
 exit ''