commit - ea58e974280c920fa9d7ed103f89fddcaa68e867
commit + 0f23036a1e7b488206af69d68173c2654d9add80
blob - c2ad56a30ba18becd4e2ae92ae09c83fd8c44023
blob + 8e8fa8cd52baa65aa76c0a56a4df206a5c0906b5
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
/* Structure for GOT_IMSG_SEND_REMOTE_REF data. */
struct got_imsg_send_remote_ref {
- uint8_t id[SHA1_DIGEST_LENGTH];
+ struct got_object_id id;
size_t name_len;
/* Followed by name_len data bytes. */
} __attribute__((__packed__));
blob - 4f6cbbc3914a6fd6cc794cb8f781bce3e2a8ecbd
blob + 5490b22f536975ef6009f10e8c9939072b0580f3
--- lib/privsep.c
+++ lib/privsep.c
err = got_error_from_errno("malloc");
goto done;
}
- memcpy(id->sha1, iremote_ref.id, SHA1_DIGEST_LENGTH);
+ memcpy(id, &iremote_ref.id, sizeof(*id));
refname = strndup(imsg.data + sizeof(iremote_ref),
datalen - sizeof(iremote_ref));
if (refname == NULL) {
blob - bec38f299d9e1f8d432810a730ea140117bc039b
blob + a98746344cc5f8e8e258cde72dee8d66b9c1e846
--- libexec/got-send-pack/got-send-pack.c
+++ libexec/got-send-pack/got-send-pack.c
return got_error_from_errno("imsg_create SEND_REMOTE_REF");
/* Keep in sync with struct got_imsg_send_remote_ref definition! */
- if (imsg_add(wbuf, refid->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, refid, sizeof(*refid)) == -1)
return got_error_from_errno("imsg_add SEND_REMOTE_REF");
if (imsg_add(wbuf, &reflen, sizeof(reflen)) == -1)
return got_error_from_errno("imsg_add SEND_REMOTE_REF");