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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got_object_open: copy the whole id
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 5 Feb 2023 01:14:24 +0100

Download raw body.

Thread
On Sat, Feb 04, 2023 at 06:07:18PM +0100, Omar Polo wrote:
> as per subject; for now the struct got_object_id is only a wrapper
> around the sha1 array, in the future things might change ;-)

Yes, trivial. ok.

> diff /home/op/w/got
> commit - 3c23f6cdb61cc63d6fd9ecbcc015cd1347793eb1
> path + /home/op/w/got
> blob - f80d86a8686711ff5888dd6847e0d84b98bc0672
> file + lib/object_open_privsep.c
> --- lib/object_open_privsep.c
> +++ lib/object_open_privsep.c
> @@ -446,7 +446,7 @@ got_object_open(struct got_object **obj, struct got_re
>  	if (err)
>  		return err;
>  
> -	memcpy((*obj)->id.sha1, id->sha1, SHA1_DIGEST_LENGTH);
> +	memcpy(&(*obj)->id, id, sizeof(*id));
>  
>  	(*obj)->refcnt++;
>  	return got_repo_cache_object(repo, id, *obj);
> 
>