"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
revert got_object_qid_alloc_partial change
To:
gameoftrees@openbsd.org
Date:
Tue, 06 Aug 2024 23:36:28 +0200

Download raw body.

Thread
now that the fileindex and worktree code has been fixed this workaround
is no longer needed.  maybe for after the release to stay on the safe
side.

passes the regress with all combinations (sha1/sha256 x pack/nopacking)
and gotd regress too.

diff /home/op/w/got
commit - e016e61067cb2f0b9e60bd6127aff65dc1f977ec
path + /home/op/w/got
blob - c079c5e221939a0486ad03cbb7d76fad283d376f
file + lib/object_qid.c
--- lib/object_qid.c
+++ lib/object_qid.c
@@ -31,16 +31,9 @@
 const struct got_error *
 got_object_qid_alloc_partial(struct got_object_qid **qid)
 {
-	/*
-	 * XXX(op) this should really be malloc(), but there are
-	 * strange interactions in the fileindex and worktree code
-	 * that are creating issues with some of the changes needed
-	 * for sha256 support.  This will have to be revisited once
-	 * that code is fixed.
-	 */
-	*qid = calloc(1, sizeof(**qid));
+	*qid = malloc(sizeof(**qid));
 	if (*qid == NULL)
-		return got_error_from_errno("calloc");
+		return got_error_from_errno("malloc");
 
 	(*qid)->data = NULL;
 	return NULL;