shithub: git9

Download patch

ref: 53a45f053e40abb04d4d72eff89a3cc79e287b2c
parent: 3654fb07a6539a64e82f7e00064fad13169bddc8
author: Ori Bernstein <[email protected]>
date: Tue Apr 28 11:08:08 EDT 2020

add 'fetch -l' to only list our branch information.

--- a/fetch.c
+++ b/fetch.c
@@ -7,6 +7,7 @@
 char *fetchbranch;
 char *upstream = "origin";
 char *packtmp = ".git/objects/pack/fetch.tmp";
+int listonly;
 
 int
 resolveremote(Hash *h, char *ref)
@@ -174,6 +175,10 @@
 		print("remote %s %H local %H\n", sp[1], want[nref], have[nref]);
 		nref++;
 	}
+	if(listonly){
+		flushpkt(c);
+		return 0;
+	}
 
 	if(writephase(c) == -1)
 		sysfatal("write: %r");
@@ -259,6 +264,7 @@
 	case 'b':	fetchbranch=EARGF(usage());	break;
 	case 'u':	upstream=EARGF(usage());	break;
 	case 'd':	chattygit++;			break;
+	case 'l':	listonly++;			break;
 	default:	usage();			break;
 	}ARGEND;