shithub: git9

Download patch

ref: 599d352cea4e8dab012c5ae77c56d567c5427e0f
parent: e21d1a12b46c71f5bf6c12a789f846ea0277376e
author: Michael Forney <mforney@mforney.org>
date: Wed Jan 13 23:59:32 EST 2021

add missing braces to if-else chain

Otherwise, the `else` statements associate to the
immediately-preceding `if`.

--- a/ref.c
+++ b/ref.c
@@ -419,18 +419,19 @@
 		idx = earealloc(idx, (nall + 1), sizeof(int));
 		all[nall] = p;
 		idx[nall] = 0;
-		if(p == a || p->commit->nparent == 0 && a == &zcommit)
+		if(p == a || p->commit->nparent == 0 && a == &zcommit){
 			if((nall = unwind(ev, all, idx, nall, &p, &keep, 1)) == -1)
 				break;
-		else if(p->commit->nparent == 0)
+		}else if(p->commit->nparent == 0){
 			if((nall = unwind(ev, all, idx, nall, &p, &skip, 0)) == -1)
 				break;
-		else if(oshas(&keep, p->hash))
+		}else if(oshas(&keep, p->hash)){
 			if((nall = unwind(ev, all, idx, nall, &p, &keep, 1)) == -1)
 				break;
-		else if(oshas(&skip, p->hash))
+		}else if(oshas(&skip, p->hash)){
 			if((nall = unwind(ev, all, idx, nall, &p, &skip, 0)) == -1)
 				break;
+		}
 		if(p->commit->nparent == 0)
 			break;
 		if((p = readobject(p->commit->parent[idx[nall]])) == nil)