shithub: git9

Download patch

ref: 13d06d57da0cb22e89429e87dd706e4e8667d50c
parent: d337d534e4043b32205bb36008ea2e81b3edf71f
author: Ori Bernstein <[email protected]>
date: Sun Sep 6 17:42:07 EDT 2020

pack.c: fix both thin and thick packs

Broke things, need to be more careful about caching.

--- a/pack.c
+++ b/pack.c
@@ -368,7 +368,7 @@
 	o->len = Boffset(f) - o->off;
 	if(d == nil || n != nd)
 		goto error;
-	if((b = readidxobject(f, h, flag & ~Cidx)) == nil)
+	if((b = readidxobject(f, h, flag|Cthin)) == nil)
 		goto error;
 	if(applydelta(o, b, d, n) == -1)
 		goto error;
@@ -842,6 +842,8 @@
 		if(obj->flag & Cloaded)
 			return obj;
 	}
+	if(flag & Cthin)
+		flag &= ~Cidx;
 	if(flag & Cidx)
 		return nil;
 	new = nil;