code: plan9front

Download patch

ref: c947bf80874168f8bd3786c0ccb473cd5e6adbcb
parent: 614f1d6268fd986fc628eec3754bd4599363ad13
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Dec 20 10:16:29 EST 2021

git: fetch all branches by default.

when the remote side creates a new branch, it is
desirable to have it show up in the repo.

--- a/sys/src/cmd/git/fetch.c
+++ b/sys/src/cmd/git/fetch.c
@@ -260,7 +260,7 @@
 	if(writepkt(c, buf, n) == -1)
 		sysfatal("write: %r");
 	if(!req)
-		return 0;
+		goto showrefs;
 	if(readphase(c) == -1)
 		sysfatal("read: %r");
 	if((n = readpkt(c, buf, sizeof(buf))) == -1)
--- a/sys/src/cmd/git/pull
+++ b/sys/src/cmd/git/pull
@@ -7,13 +7,10 @@
 	upstream=$2
 	url=$3
 	dir=$4
-	bflag=()
 	dflag=()
-	if(! ~ $#branch 0)
-		bflag=(-b $branch)
 	if(! ~ $#debug 0)
 		dflag='-d'
-	{git/fetch $dflag $bflag -u $upstream $url >[2=3] || die $status} | awk '
+	{git/fetch $dflag -u $upstream $url >[2=3] || die $status} | awk '
 	/^remote/{
 		if($2=="HEAD")
 			next