shithub: git9

Download patch

ref: b7113d284ecd02271c20c74462ebd7ba3eeb3510
parent: 6570330970cb35d1254758128110eef76140b067
author: Ori Bernstein <[email protected]>
date: Sun Dec 8 19:04:56 EST 2019

use correct update index in readours()

--- a/send.c
+++ b/send.c
@@ -263,7 +263,7 @@
 			sysfatal("read branches: %r");
 		u = emalloc((nremoved + nd)*sizeof(Update));
 		for(i = 0; i < nd; i++){
-			snprint(u->ref, sizeof(u->ref), "refs/heads/%s", d[nu].name);
+			snprint(u[nu].ref, sizeof(u[nu].ref), "refs/heads/%s", d[nu].name);
 			if(resolveref(&u[nu].ours, u[nu].ref) == -1)
 				continue;
 			nu++;
@@ -307,7 +307,7 @@
 		if(strncmp(buf, "ERR ", 4) == 0)
 			sysfatal("%s", buf + 4);
 
-		if(getfields(buf, sp, nelem(sp), 1, " \t\n\r") != 2)
+		if(getfields(buf, sp, nelem(sp), 1, " \t\r") != 2)
 			sysfatal("invalid ref line %.*s", utfnlen(buf, n), buf);
 		if((u = findref(upd, nupd, sp[1])) == nil)
 			continue;