shithub: git9

Download patch

ref: eb55373edba39be0bac6caa76b373576f2cc6e48
parent: fe719622152446116dac35f1773ff6066b010ca9
author: Ori Bernstein <[email protected]>
date: Sun Sep 6 15:51:41 EDT 2020

git/serve: support thin packs

Git push defaults to thin packs, so we
may as well honor them.

--- 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)) == nil)
+	if((b = readidxobject(f, h, flag & ~Cidx)) == nil)
 		goto error;
 	if(applydelta(o, b, d, n) == -1)
 		goto error;
--- a/serve.c
+++ b/serve.c
@@ -384,7 +384,7 @@
 
 	if(recvnegotiate(c, &cur, &upd, &ref, &nupd) == -1)
 		sysfatal("negotiate refs: %r");
-	if(nupd != 0 && updatepack(c) == 0)
+	if(nupd != 0 && updatepack(c) == -1)
 		sysfatal("update pack: %r");
 	if(nupd != 0 && updaterefs(c, cur, upd, ref, nupd) == -1)
 		sysfatal("update refs: %r");