commit - 43428b698225cb8ddfebc487046c88ddc05fe482
commit + d30182290dbc8e6972ead312fee101e3708b8df6
blob - c58c4fe44da605cb0d46618f269c572599aa09b5
blob + 243c5931f7a30fc39cd23277aabf7d50a8b915ce
--- lib/repository_admin.c
+++ lib/repository_admin.c
goto done;
}
*dot = '\0';
- if (!got_parse_sha1_digest(id.hash, p)) {
+
+ memset(&id, 0, sizeof(id));
+ id.algo = repo->algo;
+ if (!got_parse_hash_digest(id.hash, p, repo->algo)) {
err = got_error_fmt(GOT_ERR_BAD_PATH,
"'%s' is not a valid pack file name",
packfile_name);
char *id_str = NULL, *idxpath = NULL, *packpath = NULL;
struct got_packidx *packidx = NULL;
struct got_pack *pack = NULL;
+ size_t idlen;
uint32_t nobj, i;
+ idlen = got_hash_digest_length(repo->algo);
+
err = got_object_id_str(&id_str, pack_hash);
if (err)
goto done;
if (err)
break;
}
- oid = packidx->hdr.sorted_ids + i * SHA1_DIGEST_LENGTH;
+ oid = packidx->hdr.sorted_ids + i * idlen;
memset(&id, 0, sizeof(id));
- memcpy(id.hash, oid->hash, SHA1_DIGEST_LENGTH);
+ id.algo = repo->algo;
+ memcpy(id.hash, oid->hash, idlen);
offset = got_packidx_get_object_offset(packidx, i);
if (offset == -1) {
}
memset(&id, 0, sizeof(id));
- if (!got_parse_sha1_digest(id.hash, id_str)) {
+ id.algo = repo->algo;
+ if (!got_parse_hash_digest(id.hash, id_str,
+ repo->algo)) {
free(id_str);
continue;
}