commit - 1b1a386df9068b7cb3ceb8a67d88ccd24f5b2deb
commit + 740e7917ac3f37feb39510c99a184089bd22f519
blob - 96ea6e4692bb24d2f128702524fea15db694ddb5
blob + 86c780f1b39bd6593b1deb94215ecf9405b05740
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
/* Structure for GOT_IMSG_PAINTED_COMMITS. */
struct got_imsg_painted_commit {
- uint8_t id[SHA1_DIGEST_LENGTH];
+ struct got_object_id id;
intptr_t color;
} __attribute__((__packed__));
blob - 0ca99e2d0f60973cd9f9304f89eb72f756cc520b
blob + 337a7e73209bcce74e47b6f588ebc9eef0119ae9
--- lib/privsep.c
+++ lib/privsep.c
color = (intptr_t)qid->data;
/* Keep in sync with struct got_imsg_painted_commit! */
- if (imsg_add(wbuf, qid->id.sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, &qid->id, sizeof(qid->id)) == -1)
return got_error_from_errno("imsg_add PAINTED_COMMITS");
if (imsg_add(wbuf, &color, sizeof(color)) == -1)
return got_error_from_errno("imsg_add PAINTED_COMMITS");
if (icommits.present_in_pack) {
struct got_object_id id;
- memcpy(id.sha1, icommit.id, SHA1_DIGEST_LENGTH);
+ memcpy(&id, &icommit.id, sizeof(id));
err = cb(cb_arg, &id, icommit.color);
if (err)
break;
err = got_object_qid_alloc_partial(&qid);
if (err)
break;
- memcpy(qid->id.sha1, icommit.id,
- SHA1_DIGEST_LENGTH);
+ memcpy(&qid->id, &icommit.id,
+ sizeof(qid->id));
qid->data = (void *)icommit.color;
STAILQ_INSERT_TAIL(new_ids, qid, entry);
}