commit - 9772fc4b6b62f40cb3134a8ada6b5592b3ce8e1d
commit + b6a31527a3cd044797b16afc12e9125a6b81e36f
blob - e1a4ecc9f687a70322792d5accac679ce6a5b1cd
blob + 920415a39d4094153e27c40adf44b4ea892e8047
--- 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 - 40a6ec66b5c03902bdeea209716d3ca59c03a19f
blob + 9f73d5a2b5046ef57073e391e085ef3b588be768
--- 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 - 7ae97a2ea2c9ad104e9bf109f4f1f342448ad8c8
blob + 84f88571ad73fa856c0d868813941d3bdc298cd9
--- 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 - 1be3e818e2d7cb83aca8e3e5cca2998563e4668c
blob + 1cec0cd435a0d394a741e60135ee5b6afcb46ed6
--- 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 - 18ab5b10d5415ba969c09b492b674e9da5a53871
blob + b1884703bebb5f64b4cffe14fa4d2113a1adb636
--- 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 - 3aff91faa19fba80b86263b1b2e3c9dc46873bc9
blob + 3296812795588de5596d3dcd6dcdd3fbb4628182
--- 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);