commit - 76417208178b64eacc7f1491543d3b4f345aac2a
commit + aaa34732674e9b84fe27a8eac7fce43f1f55d36f
blob - e7ffbe35c285fb2e83fb85251116d412bee6743d
blob + 77b067240f937a51ae13c32d0bbc9362d7796286
--- gotd/repo_imsg.c
+++ gotd/repo_imsg.c
log_debug("sending ACK for %s", hex);
memset(&iack, 0, sizeof(iack));
- memcpy(iack.object_id, id->sha1, SHA1_DIGEST_LENGTH);
+ memcpy(iack.object_id, id->hash, SHA1_DIGEST_LENGTH);
if (imsg_compose(ibuf, GOTD_IMSG_ACK, peerid, pid, -1,
&iack, sizeof(iack)) == -1) {
log_debug("sending NAK for %s", hex);
memset(&inak, 0, sizeof(inak));
- memcpy(inak.object_id, id->sha1, SHA1_DIGEST_LENGTH);
+ memcpy(inak.object_id, id->hash, SHA1_DIGEST_LENGTH);
if (imsg_compose(ibuf, GOTD_IMSG_NAK, peerid, pid, -1,
&inak, sizeof(inak)) == -1) {
blob - 8e583c72710583238e82354eae3e6075176b7820
blob + 1cfaea31afa52c9ffd7e5e5c14d8605279ead7cd
--- gotd/repo_read.c
+++ gotd/repo_read.c
memset(&isymref, 0, sizeof(isymref));
isymref.name_len = strlen(refname);
isymref.target_len = strlen(target);
- memcpy(isymref.target_id, target_id->sha1, sizeof(isymref.target_id));
+ memcpy(isymref.target_id, target_id->hash, sizeof(isymref.target_id));
len = sizeof(isymref) + isymref.name_len + isymref.target_len;
if (len > MAX_IMSGSIZE - IMSG_HEADER_SIZE) {
}
/* Keep in sync with struct gotd_imsg_ref definition. */
- if (imsg_add(wbuf, id->sha1, SHA1_DIGEST_LENGTH) == -1) {
+ if (imsg_add(wbuf, id->hash, SHA1_DIGEST_LENGTH) == -1) {
err = got_error_from_errno("imsg_add REF");
goto done;
}
}
/* Keep in sync with struct gotd_imsg_ref definition. */
- if (imsg_add(wbuf, id->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, id->hash, SHA1_DIGEST_LENGTH) == -1)
return got_error_from_errno("imsg_add REF");
if (imsg_add(wbuf, &namelen, sizeof(namelen)) == -1)
return got_error_from_errno("imsg_add REF");
memcpy(&iwant, imsg->data, sizeof(iwant));
memset(&id, 0, sizeof(id));
- memcpy(id.sha1, iwant.object_id, SHA1_DIGEST_LENGTH);
+ memcpy(id.hash, iwant.object_id, SHA1_DIGEST_LENGTH);
if (log_getverbose() > 0 &&
got_object_id_hex(&id, hex, sizeof(hex)))
memcpy(&ihave, imsg->data, sizeof(ihave));
memset(&id, 0, sizeof(id));
- memcpy(id.sha1, ihave.object_id, SHA1_DIGEST_LENGTH);
+ memcpy(id.hash, ihave.object_id, SHA1_DIGEST_LENGTH);
if (log_getverbose() > 0 &&
got_object_id_hex(&id, hex, sizeof(hex)))
blob - 6562cd897111bbf157c2279bd29af3e12fe3aa1a
blob + ccba40109ee7f3669dde9c2c13b51d72d39158b2
--- gotd/repo_write.c
+++ gotd/repo_write.c
}
/* Keep in sync with struct gotd_imsg_ref definition. */
- if (imsg_add(wbuf, id->sha1, SHA1_DIGEST_LENGTH) == -1) {
+ if (imsg_add(wbuf, id->hash, SHA1_DIGEST_LENGTH) == -1) {
err = got_error_from_errno("imsg_add REF");
goto done;
}
}
/* Keep in sync with struct gotd_imsg_ref definition. */
- if (imsg_add(wbuf, id->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, id->hash, SHA1_DIGEST_LENGTH) == -1)
return got_error_from_errno("imsg_add REF");
if (imsg_add(wbuf, &namelen, sizeof(namelen)) == -1)
return got_error_from_errno("imsg_add REF");
goto done;
}
- memcpy(ref_update->old_id.sha1, iref.old_id, SHA1_DIGEST_LENGTH);
- memcpy(ref_update->new_id.sha1, iref.new_id, SHA1_DIGEST_LENGTH);
+ memcpy(ref_update->old_id.hash, iref.old_id, SHA1_DIGEST_LENGTH);
+ memcpy(ref_update->new_id.hash, iref.new_id, SHA1_DIGEST_LENGTH);
err = got_ref_open(&ref, repo_write.repo, refname, 0);
if (err) {
if (err->code != GOT_ERR_NOT_REF)
goto done;
- if (memcmp(ref_update->new_id.sha1,
+ if (memcmp(ref_update->new_id.hash,
zero_id, sizeof(zero_id)) == 0) {
err = got_error_fmt(GOT_ERR_BAD_OBJ_ID,
"%s", refname);
repo_write.pid);
ref_update->ref = ref;
- if (memcmp(ref_update->new_id.sha1, zero_id, sizeof(zero_id)) == 0) {
+ if (memcmp(ref_update->new_id.hash, zero_id, sizeof(zero_id)) == 0) {
ref_update->delete_ref = 1;
client->nref_del++;
}
size_t len;
memset(&iref, 0, sizeof(iref));
- memcpy(iref.old_id, ref_update->old_id.sha1, SHA1_DIGEST_LENGTH);
- memcpy(iref.new_id, ref_update->new_id.sha1, SHA1_DIGEST_LENGTH);
+ memcpy(iref.old_id, ref_update->old_id.hash, SHA1_DIGEST_LENGTH);
+ memcpy(iref.new_id, ref_update->new_id.hash, SHA1_DIGEST_LENGTH);
iref.ref_is_new = ref_update->ref_is_new;
iref.delete_ref = ref_update->delete_ref;
iref.name_len = strlen(refname);
blob - d367657cf7189b3acce06cec296174ac9016c349
blob + 3e379f9e08e2cc6c3649d68f36f5aff4245910dc
--- gotd/session_write.c
+++ gotd/session_write.c
log_debug("updating ref %s for uid %d", refname, client->euid);
memset(&old_id, 0, sizeof(old_id));
- memcpy(old_id.sha1, iref.old_id, SHA1_DIGEST_LENGTH);
+ memcpy(old_id.hash, iref.old_id, SHA1_DIGEST_LENGTH);
memset(&new_id, 0, sizeof(new_id));
- memcpy(new_id.sha1, iref.new_id, SHA1_DIGEST_LENGTH);
+ memcpy(new_id.hash, iref.new_id, SHA1_DIGEST_LENGTH);
err = got_repo_find_object_id(iref.delete_ref ? &old_id : &new_id,
repo);
if (err)
blob - 32187d2046b3c350e8f51ea150d5f082f79ad56b
blob + 2274686ae2246b9d7b4294fbd041ff854de59b8e
--- include/got_object.h
+++ include/got_object.h
};
struct got_object_id {
- u_int8_t sha1[SHA1_DIGEST_LENGTH];
+ u_int8_t hash[SHA1_DIGEST_LENGTH];
};
struct got_blob_object;
blob - c0161ad25f562b9a152de2dc3d46259e2360c32b
blob + 00d3d6ab13e69cc6ad1cabc03980761c02cf2933
--- lib/fetch.c
+++ lib/fetch.c
err = got_privsep_recv_fetch_progress(&done,
&id, &refname, symrefs, &server_progress,
- &packfile_size_cur, (*pack_hash)->sha1, &fetchibuf);
+ &packfile_size_cur, (*pack_hash)->hash, &fetchibuf);
if (err != NULL)
goto done;
/* Don't report size progress for an empty pack file. */
err = got_error_from_errno("dup");
goto done;
}
- err = got_privsep_send_index_pack_req(&idxibuf, (*pack_hash)->sha1,
+ err = got_privsep_send_index_pack_req(&idxibuf, (*pack_hash)->hash,
npackfd);
if (err != NULL)
goto done;
blob - 5bcbcfa6ca6a299f58ac1d654a279b51a3b29ad4
blob + bd0bf8276ab597dc7ed38191a85fa2c472393a80
--- lib/fileindex.c
+++ lib/fileindex.c
struct got_fileindex_entry *ie)
{
memset(id, 0, sizeof(*id));
- memcpy(id->sha1, ie->staged_blob_sha1, sizeof(ie->staged_blob_sha1));
+ memcpy(id->hash, ie->staged_blob_sha1, sizeof(ie->staged_blob_sha1));
return id;
}
struct got_fileindex_entry *ie)
{
memset(id, 0, sizeof(*id));
- memcpy(id->sha1, ie->blob_sha1, sizeof(ie->blob_sha1));
+ memcpy(id->hash, ie->blob_sha1, sizeof(ie->blob_sha1));
return id;
}
struct got_fileindex_entry *ie)
{
memset(id, 0, sizeof(*id));
- memcpy(id->sha1, ie->commit_sha1, sizeof(ie->commit_sha1));
+ memcpy(id->hash, ie->commit_sha1, sizeof(ie->commit_sha1));
return id;
}
blob - c604f275f01dbbef64fe927f5c9abd75a32dd94d
blob + 858b723ec18cc35148de23dbc170ed12cff46f72
--- lib/hash.c
+++ lib/hash.c
got_object_id_cmp(const struct got_object_id *id1,
const struct got_object_id *id2)
{
- return memcmp(id1->sha1, id2->sha1, SHA1_DIGEST_LENGTH);
+ return memcmp(id1->hash, id2->hash, SHA1_DIGEST_LENGTH);
}
const struct got_error *
char *
got_object_id_hex(struct got_object_id *id, char *buf, size_t len)
{
- return got_sha1_digest_to_str(id->sha1, buf, len);
+ return got_sha1_digest_to_str(id->hash, buf, len);
}
int
if (algo != GOT_HASH_SHA1)
return 0;
- return got_parse_hash_digest(id->sha1, line, algo);
+ return got_parse_hash_digest(id->hash, line, algo);
}
void
{
memset(id, 0, sizeof(*id));
if (hash->algo == GOT_HASH_SHA1)
- SHA1Final(id->sha1, &hash->sha1_ctx);
+ SHA1Final(id->hash, &hash->sha1_ctx);
else
abort();
}
blob - 544f59bad76e1479b2badc43c1532f06d70db9d9
blob + 962e7a4169b31da0b55afd2771071eb95ab32c11
--- lib/load.c
+++ lib/load.c
/* XXX SHA256 */
memset(&expected_id, 0, sizeof(expected_id));
- memcpy(&expected_id.sha1, sha1buf, sizeof(expected_id.sha1));
+ memcpy(&expected_id.hash, sha1buf, sizeof(expected_id.hash));
if (got_object_id_cmp(id, &expected_id) != 0)
return got_error(GOT_ERR_PACKIDX_CSUM);
imsg_idxfds[1] = -1;
imsg_init(&idxibuf, imsg_idxfds[0]);
- err = got_privsep_send_index_pack_req(&idxibuf, id.sha1, packfd);
+ err = got_privsep_send_index_pack_req(&idxibuf, id.hash, packfd);
if (err)
goto done;
packfd = -1;
blob - 2e12a69bb09622ca93b1e6240e2f9d4b5f204a91
blob + fa94d175e717cff80203dddea664810eba1e9ee5
--- lib/object.c
+++ lib/object.c
goto done;
if (asprintf(path, "%s/%.2x/%s", path_objects,
- id->sha1[0], hex + 2) == -1)
+ id->hash[0], hex + 2) == -1)
err = got_error_from_errno("asprintf");
done:
blob - 4ab8eb812ff2dae65b617a1f7699919ca73d32e9
blob + 31061919e0541beda09a3d663aa5909ef9240853
--- lib/object_create.c
+++ lib/object_create.c
treesize += n;
len = SHA1_DIGEST_LENGTH;
- n = fwrite(te->id.sha1, 1, len, treefile);
+ n = fwrite(te->id.hash, 1, len, treefile);
if (n != len) {
err = got_ferror(treefile, GOT_ERR_IO);
goto done;
}
- got_hash_update(&ctx, te->id.sha1, len);
+ got_hash_update(&ctx, te->id.hash, len);
treesize += n;
}
blob - c1602919d2977cd55ba83d051a26fb748e1153e5
blob + 743f12860b06971ab752a49e3b79f7e3e05fcd65
--- lib/object_idset.c
+++ lib/object_idset.c
static uint64_t
idset_hash(struct got_object_idset *set, struct got_object_id *id)
{
- return SipHash24(&set->key, id->sha1, sizeof(id->sha1));
+ return SipHash24(&set->key, id->hash, sizeof(id->hash));
}
static const struct got_error *
blob - 60307d5b70c26ee153a22138d08852f616acf52a
blob + c26d62c16a4a7b6b393af5f80b4f7e30a369c8c6
--- lib/object_open_io.c
+++ lib/object_open_io.c
err = got_error(GOT_ERR_NO_SPACE);
goto done;
}
- memcpy(te->id.sha1, pe->id, SHA1_DIGEST_LENGTH);
+ memcpy(te->id.hash, pe->id, SHA1_DIGEST_LENGTH);
te->mode = pe->mode;
te->idx = i;
}
blob - 530976c9d02bf1c055238e2cad8109ee4b7dbe79
blob + 665766db5c9d9e4c139aca134f802b112e172a7e
--- lib/pack.c
+++ lib/pack.c
got_packidx_get_object_idx(struct got_packidx *packidx,
struct got_object_id *id)
{
- u_int8_t id0 = id->sha1[0];
+ u_int8_t id0 = id->hash[0];
uint32_t totobj = be32toh(packidx->hdr.fanout_table[0xff]);
int left = 0, right = totobj - 1;
size_t digest_len = got_hash_digest_length(packidx->algo);
i = ((left + right) / 2);
oid = packidx->hdr.sorted_ids + i * digest_len;
- cmp = memcmp(id->sha1, oid, digest_len);
+ cmp = memcmp(id->hash, oid, digest_len);
if (cmp == 0)
return i;
else if (cmp > 0)
return got_error(GOT_ERR_NO_OBJ);
oid = packidx->hdr.sorted_ids + idx * digest_len;
- memcpy(id->sha1, oid, digest_len);
+ memcpy(id->hash, oid, digest_len);
return NULL;
}
err = got_object_qid_alloc_partial(&qid);
if (err)
return err;
- memcpy(qid->id.sha1, oid, digest_len);
+ memcpy(qid->id.hash, oid, digest_len);
STAILQ_INSERT_TAIL(matched_ids, qid, entry);
oid = packidx->hdr.sorted_ids + (++i) * digest_len;
blob - ac4cf855434fedcf1669f57482225399f9486b03
blob + fa93dc91c296087d5f21fbfafe66effd3f66b29e
--- lib/pack_create.c
+++ lib/pack_create.c
if (err)
return err;
*packfile_size += nh;
- err = hwrite(packfd, m->prev->id.sha1,
- sizeof(m->prev->id.sha1), ctx);
+ err = hwrite(packfd, m->prev->id.hash,
+ sizeof(m->prev->id.hash), ctx);
if (err)
return err;
- *packfile_size += sizeof(m->prev->id.sha1);
+ *packfile_size += sizeof(m->prev->id.hash);
}
return NULL;
blob - bdf8d2fa044c36ef8e599957fb912fc761b444fb
blob + 420df55900fae5048926e340c76737b0480284d2
--- lib/pack_index.c
+++ lib/pack_index.c
free(data);
break;
case GOT_OBJ_TYPE_REF_DELTA:
- memset(obj->id.sha1, 0xff, digest_len);
+ memset(obj->id.hash, 0xff, digest_len);
if (pack->map) {
if (mapoff + digest_len >= pack->filesize) {
err = got_error(GOT_ERR_BAD_PACKFILE);
break;
}
- memcpy(obj->delta.ref.ref_id.sha1, pack->map + mapoff,
+ memcpy(obj->delta.ref.ref_id.hash, pack->map + mapoff,
digest_len);
obj->crc = crc32(obj->crc, pack->map + mapoff,
digest_len);
if (err)
break;
} else {
- n = read(pack->fd, obj->delta.ref.ref_id.sha1,
+ n = read(pack->fd, obj->delta.ref.ref_id.hash,
digest_len);
if (n == -1) {
err = got_error_from_errno("read");
err = got_error(GOT_ERR_BAD_PACKFILE);
break;
}
- obj->crc = crc32(obj->crc, obj->delta.ref.ref_id.sha1,
+ obj->crc = crc32(obj->crc, obj->delta.ref.ref_id.hash,
digest_len);
got_hash_update(pack_hash_ctx,
- obj->delta.ref.ref_id.sha1, digest_len);
+ obj->delta.ref.ref_id.hash, digest_len);
err = got_inflate_to_mem_fd(NULL, &datalen, &obj->len,
&csum, obj->size, pack->fd);
if (err)
obj->len += digest_len;
break;
case GOT_OBJ_TYPE_OFFSET_DELTA:
- memset(obj->id.sha1, 0xff, digest_len);
+ memset(obj->id.hash, 0xff, digest_len);
err = got_pack_parse_offset_delta(&obj->delta.ofs.base_offset,
&obj->delta.ofs.base_offsetlen, pack, obj->off,
obj->tslen);
size_t digest_len = got_hash_digest_length(packidx->algo);
oid = packidx->hdr.sorted_ids + idx * digest_len;
- memcpy(oid, obj->id.sha1, digest_len);
+ memcpy(oid, obj->id.hash, digest_len);
packidx->hdr.crc32[idx] = htobe32(obj->crc);
if (obj->off < GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX)
packidx->hdr.offsets[idx] = htobe32(obj->off);
packidx->nlargeobj++;
}
- for (i = obj->id.sha1[0]; i <= 0xff; i++) {
+ for (i = obj->id.hash[0]; i <= 0xff; i++) {
uint32_t n = be32toh(packidx->hdr.fanout_table[i]);
packidx->hdr.fanout_table[i] = htobe32(n + 1);
}
size_t digest_len = got_hash_digest_length(packidx->algo);
uint8_t *from, *to;
- idx = find_object_idx(packidx, obj->id.sha1);
+ idx = find_object_idx(packidx, obj->id.hash);
if (idx == -1)
return; /* object already indexed */
blob - 2ba330c0f358f16e376a462ff551e80515cc1def
blob + ca34316533171eaaffebc13cf14010ae8e32d87c
--- lib/privsep.c
+++ lib/privsep.c
te_name = buf + sizeof(ite);
memcpy(te->name, te_name, ite.namelen);
te->name[ite.namelen] = '\0';
- memcpy(te->id.sha1, ite.id, sizeof(te->id.sha1));
+ memcpy(te->id.hash, ite.id, sizeof(te->id.sha1));
te->mode = ite.mode;
te->idx = *nentries;
(*nentries)++;
blob - feddab7822ac272eff0ebf1280dd08ce8e64454f
blob + dca64c5b3e52082226f276cca9afe7e6a997004e
--- lib/repository.c
+++ lib/repository.c
bf = get_packidx_bloom_filter(repo, path_packidx, strlen(path_packidx));
if (bf)
- return bloom_check(bf->bloom, id->sha1, sizeof(id->sha1));
+ return bloom_check(bf->bloom, id->hash, sizeof(id->hash));
/* No bloom filter means this pack index must be searched. */
return 1;
blob - 10594688c987e7923021d20f92967f9f61235ada
blob + f70fd48fd09091b36d366da7f2e938a4cf92b691
--- lib/repository_admin.c
+++ lib/repository_admin.c
goto done;
}
- err = got_pack_create((*pack_hash)->sha1, packfd, delta_cache,
+ err = got_pack_create((*pack_hash)->hash, packfd, delta_cache,
theirs, ntheirs, ours, nours, repo, loose_obj_only,
0, force_refdelta, progress_cb, progress_arg, &rl,
cancel_cb, cancel_arg);
err = got_error_from_errno("dup");
goto done;
}
- err = got_privsep_send_index_pack_req(&idxibuf, pack_hash->sha1,
+ err = got_privsep_send_index_pack_req(&idxibuf, pack_hash->hash,
npackfd);
if (err != NULL)
goto done;
break;
}
oid = packidx->hdr.sorted_ids + i * digest_len;
- memcpy(id.sha1, oid, digest_len);
+ memcpy(id.hash, oid, digest_len);
offset = got_packidx_get_object_offset(packidx, i);
if (offset == -1) {
pid = packidx->hdr.sorted_ids + i * digest_len;
memset(&id, 0, sizeof(id));
- memcpy(&id.sha1, pid, digest_len);
+ memcpy(&id.hash, pid, digest_len);
if (got_object_idset_contains(idset, &id))
continue;
blob - 6df059e9a98fbe2f538884f14d8c80a5e3f4fc97
blob + bcfaef17f181af2634bca5eb3d7db41766783487
--- lib/worktree.c
+++ lib/worktree.c
return err;
err = got_fileindex_entry_update(new_ie, wt_fd, path,
- blob_id->sha1, base_commit_id->sha1, update_timestamps);
+ blob_id->hash, base_commit_id->hash, update_timestamps);
if (err)
goto done;
* updating contents of this file.
*/
if (got_fileindex_entry_has_commit(ie) &&
- memcmp(ie->commit_sha1, worktree->base_commit_id->sha1,
+ memcmp(ie->commit_sha1, worktree->base_commit_id->hash,
SHA1_DIGEST_LENGTH) == 0) {
/* Same commit. */
err = sync_timestamps(worktree->root_fd,
goto done;
}
if (got_fileindex_entry_has_blob(ie) &&
- memcmp(ie->blob_sha1, te->id.sha1,
+ memcmp(ie->blob_sha1, te->id.hash,
SHA1_DIGEST_LENGTH) == 0) {
/* Different commit but the same blob. */
if (got_fileindex_entry_has_commit(ie)) {
/* Update the base commit ID of this file. */
memcpy(ie->commit_sha1,
- worktree->base_commit_id->sha1,
+ worktree->base_commit_id->hash,
sizeof(ie->commit_sha1));
}
err = sync_timestamps(worktree->root_fd,
* unmodified files again.
*/
err = got_fileindex_entry_update(ie, worktree->root_fd, path,
- blob->id.sha1, worktree->base_commit_id->sha1,
+ blob->id.hash, worktree->base_commit_id->hash,
update_timestamps);
} else if (status == GOT_STATUS_MODE_CHANGE) {
err = got_fileindex_entry_update(ie, worktree->root_fd, path,
- blob->id.sha1, worktree->base_commit_id->sha1, 0);
+ blob->id.hash, worktree->base_commit_id->hash, 0);
} else if (status == GOT_STATUS_DELETE) {
err = (*progress_cb)(progress_arg, GOT_STATUS_MERGE, path);
if (err)
goto done;
err = got_fileindex_entry_update(ie, worktree->root_fd, path,
- blob->id.sha1, worktree->base_commit_id->sha1, 0);
+ blob->id.hash, worktree->base_commit_id->hash, 0);
if (err)
goto done;
} else {
if (ie) {
err = got_fileindex_entry_update(ie,
- worktree->root_fd, path, blob->id.sha1,
- worktree->base_commit_id->sha1, 1);
+ worktree->root_fd, path, blob->id.hash,
+ worktree->base_commit_id->hash, 1);
} else {
err = create_fileindex_entry(&ie, fileindex,
worktree->base_commit_id, worktree->root_fd, path,
if (got_fileindex_entry_was_skipped(ie))
return NULL;
- if (memcmp(ie->commit_sha1, a->base_commit_id->sha1,
+ if (memcmp(ie->commit_sha1, a->base_commit_id->hash,
SHA1_DIGEST_LENGTH) == 0)
return NULL;
if (err)
return err;
}
- memcpy(ie->commit_sha1, a->base_commit_id->sha1, SHA1_DIGEST_LENGTH);
+ memcpy(ie->commit_sha1, a->base_commit_id->hash, SHA1_DIGEST_LENGTH);
return NULL;
}
/* Re-adding a locally deleted file. */
err = got_fileindex_entry_update(ie,
worktree->root_fd, path2, ie->blob_sha1,
- worktree->base_commit_id->sha1, 0);
+ worktree->base_commit_id->hash, 0);
if (err)
return err;
}
/* Reject merges into a work tree with mixed base commits. */
if (got_fileindex_entry_has_commit(ie) &&
- memcmp(ie->commit_sha1, a->worktree->base_commit_id->sha1,
+ memcmp(ie->commit_sha1, a->worktree->base_commit_id->hash,
SHA1_DIGEST_LENGTH) != 0)
return got_error(GOT_ERR_MIXED_COMMITS);
status == GOT_STATUS_MODE_CHANGE) {
err = got_fileindex_entry_update(ie,
a->worktree->root_fd, relpath,
- blob->id.sha1,
- a->worktree->base_commit_id->sha1, 1);
+ blob->id.hash,
+ a->worktree->base_commit_id->hash, 1);
if (err)
goto done;
}
err = got_fileindex_entry_update(ie,
worktree->root_fd, relpath,
- ct->staged_blob_id->sha1,
- new_base_commit_id->sha1,
+ ct->staged_blob_id->hash,
+ new_base_commit_id->hash,
!have_staged_files);
} else
err = got_fileindex_entry_update(ie,
worktree->root_fd, relpath,
- ct->blob_id->sha1,
- new_base_commit_id->sha1,
+ ct->blob_id->hash,
+ new_base_commit_id->hash,
!have_staged_files);
} else {
err = got_fileindex_entry_alloc(&ie, pe->path);
if (err)
goto done;
err = got_fileindex_entry_update(ie,
- worktree->root_fd, relpath, ct->blob_id->sha1,
- new_base_commit_id->sha1, 1);
+ worktree->root_fd, relpath, ct->blob_id->hash,
+ new_base_commit_id->hash, 1);
if (err) {
got_fileindex_entry_free(ie);
goto done;
char *ondisk_path;
/* Reject rebase of a work tree with mixed base commits. */
- if (memcmp(ie->commit_sha1, a->worktree->base_commit_id->sha1,
+ if (memcmp(ie->commit_sha1, a->worktree->base_commit_id->hash,
SHA1_DIGEST_LENGTH))
return got_error(GOT_ERR_MIXED_COMMITS);
path_content ? path_content : ondisk_path, a->repo);
if (err)
break;
- memcpy(ie->staged_blob_sha1, new_staged_blob_id->sha1,
+ memcpy(ie->staged_blob_sha1, new_staged_blob_id->hash,
SHA1_DIGEST_LENGTH);
if (status == GOT_STATUS_ADD || staged_status == GOT_STATUS_ADD)
stage = GOT_FILEIDX_STAGE_ADD;
goto done;
if (new_staged_blob_id) {
- memcpy(ie->staged_blob_sha1, new_staged_blob_id->sha1,
+ memcpy(ie->staged_blob_sha1, new_staged_blob_id->hash,
SHA1_DIGEST_LENGTH);
} else {
got_fileindex_entry_stage_set(ie, GOT_FILEIDX_STAGE_NONE);
blob - f488cd9dcd98b68c647973cb84a54e18daefced4
blob + 84299babeb28ef6e301c8be76710ba7474a4deec
--- lib/worktree_cvg.c
+++ lib/worktree_cvg.c
err = got_fileindex_entry_update(ie,
worktree->root_fd, relpath,
- ct->staged_blob_id->sha1,
- new_base_commit_id->sha1,
+ ct->staged_blob_id->hash,
+ new_base_commit_id->hash,
!have_staged_files);
} else
err = got_fileindex_entry_update(ie,
worktree->root_fd, relpath,
- ct->blob_id->sha1,
- new_base_commit_id->sha1,
+ ct->blob_id->hash,
+ new_base_commit_id->hash,
!have_staged_files);
} else {
err = got_fileindex_entry_alloc(&ie, pe->path);
if (err)
goto done;
err = got_fileindex_entry_update(ie,
- worktree->root_fd, relpath, ct->blob_id->sha1,
- new_base_commit_id->sha1, 1);
+ worktree->root_fd, relpath, ct->blob_id->hash,
+ new_base_commit_id->hash, 1);
if (err) {
got_fileindex_entry_free(ie);
goto done;
blob - c7eef485c3721f42444509df2a03dc201784624a
blob + f08ec067641ea4c9b844f9d5ff590d976d692e18
--- libexec/got-read-pack/got-read-pack.c
+++ libexec/got-read-pack/got-read-pack.c
struct got_object_id id1, id2;
int idx;
- memcpy(id1.sha1, pte1.id, SHA1_DIGEST_LENGTH);
+ memcpy(id1.hash, pte1.id, SHA1_DIGEST_LENGTH);
idx = got_packidx_get_object_idx(packidx, &id1);
if (idx == -1) {
err = got_error_no_obj(&id1);
next_entry1 = *buf1;
remain1 = *len1;
- memcpy(id2.sha1, pte2.id, SHA1_DIGEST_LENGTH);
+ memcpy(id2.hash, pte2.id, SHA1_DIGEST_LENGTH);
idx = got_packidx_get_object_idx(packidx, &id2);
if (idx == -1) {
err = got_error_no_obj(&id2);
err = got_object_qid_alloc_partial(&eqid);
if (err)
goto done;
- memcpy(eqid->id.sha1, pte->id, sizeof(eqid->id.sha1));
+ memcpy(eqid->id.hash, pte->id, sizeof(eqid->id.hash));
if (got_object_idset_contains(idset, &eqid->id)) {
got_object_qid_free(eqid);