shithub: git9

Download patch

ref: 6b3d9e0bd72096b1026346b73004c1791527d82f
parent: 752da3f533f70b9f3fa9c48c635c860468ee1054
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jan 13 22:26:40 EST 2021

git/pack: remove stray '|='

We want to set the value, not or it. This is
probably the cause of some deltas gone wild.

--- a/pack.c
+++ b/pack.c
@@ -134,14 +134,14 @@
 		o->id = objcache.nobj;
 		o->flag |= Cexist;
 	}
-	if(o->prev)
+	if(o->prev != nil)
 		o->prev->next = o->next;
-	if(o->next)
+	if(o->next != nil)
 		o->next->prev = o->prev;
 	if(lrutail == o){
 		lrutail = o->prev;
 		lrutail->next = nil;
-	}else if(!lrutail)
+	}else if(lrutail != nil)
 		lrutail = o;
 	if(lruhead)
 		lruhead->prev = o;
@@ -154,7 +154,7 @@
 		ref(o);
 		ncache++;
 	}
-	while(ncache > cachemax){
+	while(ncache > cachemax && lrutail->prev != nil){
 		p = lrutail;
 		lrutail = p->prev;
 		lrutail->next = nil;
@@ -1543,7 +1543,7 @@
 
 	rbuf[0] = off & 0x7f;
 	for(i = 1; (off >>= 7) != 0; i++)
-		rbuf[i] |= (--off & 0x7f)|0x80;
+		rbuf[i] = (--off & 0x7f)|0x80;
 
 	j = 0;
 	while(i > 0)