shithub: git9

Download patch

ref: 63287181a49017b8d5194991fc5c404ff53e56fe
parent: 6adefeebd4153bac5e25c9b6667510a8281863eb
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Nov 14 15:58:52 EST 2020

git/fetch: clear offset delta bases

Now we're slow when we unpack offset deltas, but
our memory usage doesn't blow up. Eventually this
should go away when we add an offset cache for
indexing.

--- a/pack.c
+++ b/pack.c
@@ -422,10 +422,12 @@
 		goto error;
 	if(Bseek(f, p - r, 0) == -1)
 		goto error;
+	memset(&b, 0, sizeof(Object));
 	if(readpacked(f, &b, flag) == -1)
 		goto error;
 	if(applydelta(o, &b, d, nd) == -1)
 		goto error;
+	clear(&b);
 	free(d);
 	return 0;
 error: