shithub: riscv

Download patch

ref: e03915a9f7d8c040c3b7f4e8de4f69f62aeefc99
parent: cfab8e3379449d98ca64b254050f34dab43d6b02
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jan 29 23:34:32 EST 2025

git/send: set errstr when reporting status

we print the errstr the next level up, so just set
werrstr, instead of printing and then showing a bogus
error message

--- a/sys/src/cmd/git/send.c
+++ b/sys/src/cmd/git/send.c
@@ -204,7 +204,7 @@
 		if(chattygit)
 			fprint(2, "done sending pack, status %s\n", buf);
 		nsp = getfields(buf, sp, nelem(sp), 1, " \t\n\r");
-		if(nsp < 2) 
+		if(nsp < 2)
 			continue;
 		if(nsp < 3)
 			sp[2] = "";
@@ -213,9 +213,9 @@
 		 * surrounding scripts.
 		 */
 		if(strcmp(sp[0], "unpack") == 0 && strcmp(sp[1], "ok") != 0)
-			fprint(2, "unpack %s\n", sp[1]);
+			werrstr("unpack %s", sp[1]);
 		else if(strcmp(sp[0], "ng") == 0)
-			fprint(2, "failed update: %s\n", sp[1]);
+			werrstr("failed update: %s %s\n", sp[1], sp[2]);
 		else
 			continue;
 		return -1;
--