commit - 740e7917ac3f37feb39510c99a184089bd22f519
commit + 310a8ea5d9d2eca34e7cdd0484fc2a1ce40dba1e
blob - 77af3223695f08a4c263ad27a9d0d0333b0307e6
blob + e7ffbe35c285fb2e83fb85251116d412bee6743d
--- gotd/repo_imsg.c
+++ gotd/repo_imsg.c
char hex[SHA1_DIGEST_STRING_LENGTH];
if (log_getverbose() > 0 &&
- got_sha1_digest_to_str(id->sha1, hex, sizeof(hex)))
+ got_object_id_hex(id, hex, sizeof(hex)))
log_debug("sending ACK for %s", hex);
memset(&iack, 0, sizeof(iack));
char hex[SHA1_DIGEST_STRING_LENGTH];
if (log_getverbose() > 0 &&
- got_sha1_digest_to_str(id->sha1, hex, sizeof(hex)))
+ got_object_id_hex(id, hex, sizeof(hex)))
log_debug("sending NAK for %s", hex);
memset(&inak, 0, sizeof(inak));
blob - 7e04767d68c4c1e7eff6a3520785b24aac07efcf
blob + 8e583c72710583238e82354eae3e6075176b7820
--- gotd/repo_read.c
+++ gotd/repo_read.c
memcpy(id.sha1, iwant.object_id, SHA1_DIGEST_LENGTH);
if (log_getverbose() > 0 &&
- got_sha1_digest_to_str(id.sha1, hex, sizeof(hex)))
+ got_object_id_hex(&id, hex, sizeof(hex)))
log_debug("client wants %s", hex);
imsg_init(&ibuf, client->fd);
memcpy(id.sha1, ihave.object_id, SHA1_DIGEST_LENGTH);
if (log_getverbose() > 0 &&
- got_sha1_digest_to_str(id.sha1, hex, sizeof(hex)))
+ got_object_id_hex(&id, hex, sizeof(hex)))
log_debug("client has %s", hex);
imsg_init(&ibuf, client->fd);
blob - 65e8d06c9243e84fd149a9a8f68dc5afe4032615
blob + f06337e95fa7c9e3eabd7ab414f3060e6755265a
--- gotd/repo_write.c
+++ gotd/repo_write.c
idx = got_packidx_get_object_idx(packidx, id);
if (idx == -1) {
- got_sha1_digest_to_str(id->sha1, hex, sizeof(hex));
+ got_object_id_hex(id, hex, sizeof(hex));
return got_error_fmt(GOT_ERR_BAD_PACKFILE,
"object %s is missing from pack file", hex);
}
return err;
if (obj->type != expected_obj_type) {
- got_sha1_digest_to_str(id->sha1, hex, sizeof(hex));
+ got_object_id_hex(id, hex, sizeof(hex));
got_object_type_label(&typestr, expected_obj_type);
err = got_error_fmt(GOT_ERR_OBJ_TYPE,
"%s is not pointing at a %s object", hex, typestr);
goto done;
if (obj_type != GOT_OBJ_TYPE_COMMIT) {
- got_sha1_digest_to_str(expected_yca_id->sha1, hex, sizeof(hex));
+ got_object_id_hex(expected_yca_id, hex, sizeof(hex));
err = got_error_fmt(GOT_ERR_OBJ_TYPE,
"%s is not pointing at a commit object", hex);
goto done;
idx = got_packidx_get_object_idx(packidx, &qid->id);
if (idx == -1) {
- got_sha1_digest_to_str(qid->id.sha1,
- hex, sizeof(hex));
+ got_object_id_hex(&qid->id, hex, sizeof(hex));
err = got_error_fmt(GOT_ERR_BAD_PACKFILE,
"object %s is missing from pack file", hex);
goto done;
goto done;
if (obj->type != GOT_OBJ_TYPE_COMMIT) {
- got_sha1_digest_to_str(qid->id.sha1,
- hex, sizeof(hex));
+ got_object_id_hex(&qid->id, hex, sizeof(hex));
err = got_error_fmt(GOT_ERR_OBJ_TYPE,
"%s is not pointing at a commit object",
hex);
int idx = got_packidx_get_object_idx(packidx,
&ref_update->new_id);
if (idx == -1) {
- got_sha1_digest_to_str(ref_update->new_id.sha1,
+ got_object_id_hex(&ref_update->new_id,
hex, sizeof(hex));
err = got_error_fmt(GOT_ERR_BAD_PACKFILE,
"object %s is missing from pack file",
blob - 6bf274adf88e73b93de4344f929dd503dc20aa24
blob + f4f6c729dd161c635672dc12af8bdf34b2c7721e
--- lib/patch.c
+++ lib/patch.c
err = got_object_tree_find_path(&id, NULL, repo, tree, path);
if (err)
return err;
- got_sha1_digest_to_str(id->sha1, p->blob, sizeof(p->blob));
- got_sha1_digest_to_str(commit_id->sha1, p->cid, sizeof(p->cid));
+ got_object_id_hex(id, p->blob, sizeof(p->blob));
+ got_object_id_hex(commit_id, p->cid, sizeof(p->cid));
free(id);
err = open_blob(apath, afile, p->blob, repo);
*do_merge = err == NULL;
blob - 5dcffb2885a13005b4a036fbdd3148bafb5410d6
blob + 6ec79e85a76b5ba40ce146e249e75e24f79d7df9
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
for (i = 0; i < nref; i++) {
if (got_object_id_cmp(&have[i], &want[i]) == 0)
continue;
- got_sha1_digest_to_str(want[i].sha1, hashstr, sizeof(hashstr));
+ got_object_id_hex(&want[i], hashstr, sizeof(hashstr));
n = snprintf(buf, sizeof(buf), "want %s%s\n", hashstr,
sent_my_capabilites || my_capabilities == NULL ?
"" : my_capabilities);
TAILQ_FOREACH(pe, have_refs, entry) {
struct got_object_id *id = pe->data;
- got_sha1_digest_to_str(id->sha1, hashstr, sizeof(hashstr));
+ got_object_id_hex(id, hashstr, sizeof(hashstr));
n = snprintf(buf, sizeof(buf), "have %s\n", hashstr);
if (n < 0 || (size_t)n >= sizeof(buf)) {
err = got_error(GOT_ERR_NO_SPACE);
blob - 7c7c29553882ad9c792d99d2dc1c9cdda83597de
blob + 2a2c22971801db07832f237f3969bc2e90a0c745
--- libexec/got-send-pack/got-send-pack.c
+++ libexec/got-send-pack/got-send-pack.c
goto done;
}
- got_sha1_digest_to_str(their_id->sha1, old_hashstr,
+ got_object_id_hex(their_id, old_hashstr,
sizeof(old_hashstr));
got_sha1_digest_to_str(zero_id, new_hashstr,
sizeof(new_hashstr));
}
continue;
}
- got_sha1_digest_to_str(their_id->sha1, old_hashstr,
+ got_object_id_hex(their_id, old_hashstr,
sizeof(old_hashstr));
} else {
got_sha1_digest_to_str(zero_id, old_hashstr,
sizeof(old_hashstr));
}
- got_sha1_digest_to_str(id->sha1, new_hashstr,
- sizeof(new_hashstr));
+ got_object_id_hex(id, new_hashstr, sizeof(new_hashstr));
err = describe_refchange(&n, &sent_my_capabilites,
my_capabilities, buf, sizeof(buf), refname,
old_hashstr, new_hashstr);