Commit Diff


commit - 9228a15c477d8ec5797456ed322923d97fd9e92d
commit + ea58e974280c920fa9d7ed103f89fddcaa68e867
blob - 02292e972104d2b45938f05eead90ec38673777a
blob + c2ad56a30ba18becd4e2ae92ae09c83fd8c44023
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
@@ -458,7 +458,7 @@ struct got_imsg_send_upload_progress {
 
 /* Structure for GOT_IMSG_SEND_REF data. */
 struct got_imsg_send_ref {
-	uint8_t id[SHA1_DIGEST_LENGTH];
+	struct got_object_id id;
 	int delete;
 	size_t name_len;
 	/* Followed by name_len data bytes. */
blob - b41abb0a41e29ff5740a78fd1bc96d414df87fdf
blob + 4f6cbbc3914a6fd6cc794cb8f781bce3e2a8ecbd
--- lib/privsep.c
+++ lib/privsep.c
@@ -816,7 +816,7 @@ send_send_ref(const char *name, size_t name_len, struc
 		return got_error_from_errno("imsg_create SEND_REF");
 
 	/* Keep in sync with struct got_imsg_send_ref! */
-	if (imsg_add(wbuf, id->sha1, sizeof(id->sha1)) == -1)
+	if (imsg_add(wbuf, id, sizeof(*id)) == -1)
 		return got_error_from_errno("imsg_add SEND_REF");
 	if (imsg_add(wbuf, &delete, sizeof(delete)) == -1)
 		return got_error_from_errno("imsg_add SEND_REF");
blob - 656b13122b6f3d7d7e5f8f57d12e56cb416e130a
blob + bec38f299d9e1f8d432810a730ea140117bc039b
--- libexec/got-send-pack/got-send-pack.c
+++ libexec/got-send-pack/got-send-pack.c
@@ -714,7 +714,7 @@ main(int argc, char **argv)
 			err = got_error_from_errno("malloc");
 			goto done;
 		}
-		memcpy(id->sha1, href.id, SHA1_DIGEST_LENGTH);
+		memcpy(id, &href.id, sizeof(*id));
 		if (href.delete)
 			err = got_pathlist_append(&delete_refs, refname, id);
 		else