commit - ffcada4305d6b134e214790fa1e74873e36484fb
commit + dfe0a3d83340456fd269a59991dc47c4ac7e3ad3
blob - 559839987c1189a29404277bd6cfc773f938df71
blob + 673fbab9bb8b4be2c1fa2678831d61531cc03a34
--- lib/object_create.c
+++ lib/object_create.c
goto done;
}
SHA1Final((*id)->hash, &hash_ctx);
+ (*id)->algo = GOT_HASH_SHA1;
if (fflush(*blobfile) != 0) {
err = got_error_from_errno("fflush");
goto done;
}
SHA1Final((*id)->hash, &hash_ctx);
+ (*id)->algo = GOT_HASH_SHA1;
if (fflush(treefile) != 0) {
err = got_error_from_errno("fflush");
goto done;
}
SHA1Final((*id)->hash, &hash_ctx);
+ (*id)->algo = GOT_HASH_SHA1;
if (fflush(commitfile) != 0) {
err = got_error_from_errno("fflush");
goto done;
}
SHA1Final((*id)->hash, &hash_ctx);
+ (*id)->algo = GOT_HASH_SHA1;
if (fflush(tagfile) != 0) {
err = got_error_from_errno("fflush");
blob - a8c4aac0b9ae220bc77e40c1222dbee1ca8c14ed
blob + 12b9dc0ae6a49c8188054c596ce11355019ce40f
--- lib/repository.c
+++ lib/repository.c
goto done;
}
- if (!got_parse_sha1_digest(id.hash, id_str))
+ id.algo = repo->algo;
+ if (!got_parse_hash_digest(id.hash, id_str, repo->algo, NULL))
continue;
/*
goto done;
}
+ /* XXX: sha256 */
if (!got_parse_sha1_digest(id.hash, id_str)) {
free(id_str);
continue;
blob - 79eb9116f97c5351fb550525e0bbaac32aa1ced3
blob + 55931cbfebbf7bac51d26d273c8e79721f75e874
--- lib/worktree.c
+++ lib/worktree.c
#define GOT_MERGE_LABEL_MERGED "merged change"
#define GOT_MERGE_LABEL_BASE "3-way merge base"
+
+#define WORKTREE_ALGO(wt) ((wt)->base_commit_id->algo)
static mode_t apply_umask(mode_t);
}
struct got_object_id id2;
memcpy(id2.hash, ie->blob_hash, SHA1_DIGEST_LENGTH);
+ id2.algo = got_repo_get_hash_algorithm(repo);
err = got_object_open_as_blob(&blob2, repo, &id2, 8192,
fd2);
if (err)
if (got_fileindex_entry_has_blob(ie)) {
memcpy(blob_id.hash, ie->blob_hash, SHA1_DIGEST_LENGTH);
+ blob_id.algo = got_repo_get_hash_algorithm(repo);
blob_idp = &blob_id;
}
if (got_fileindex_entry_has_commit(ie)) {
memcpy(commit_id.hash, ie->commit_hash, SHA1_DIGEST_LENGTH);
+ commit_id.algo = got_repo_get_hash_algorithm(repo);
commit_idp = &commit_id;
}
if (staged_status == GOT_STATUS_ADD ||
staged_status == GOT_STATUS_MODIFY) {
memcpy(staged_blob_id.hash, ie->staged_blob_hash,
SHA1_DIGEST_LENGTH);
+ staged_blob_id.algo = got_repo_get_hash_algorithm(repo);
staged_blob_idp = &staged_blob_id;
}
return NULL;
memcpy(blob_id.hash, ie->blob_hash, SHA1_DIGEST_LENGTH);
+ blob_id.algo = got_repo_get_hash_algorithm(a->repo);
memcpy(commit_id.hash, ie->commit_hash, SHA1_DIGEST_LENGTH);
+ commit_id.algo = got_repo_get_hash_algorithm(a->repo);
if (got_fileindex_entry_has_file_on_disk(ie))
status = GOT_STATUS_MISSING;
else
} else
memcpy(id.hash, ie->blob_hash,
SHA1_DIGEST_LENGTH);
+ id.algo = got_repo_get_hash_algorithm(a->repo);
+
fd = got_opentempfd();
if (fd == -1) {
err = got_error_from_errno("got_opentempfd");
if (got_fileindex_entry_has_commit(ie)) {
memcpy(base_commit_id.hash, ie->commit_hash,
SHA1_DIGEST_LENGTH);
+ base_commit_id.algo = got_repo_get_hash_algorithm(a->repo);
base_commit_idp = &base_commit_id;
}
if (got_fileindex_entry_has_blob(ie)) {
memcpy(blob_id.hash, ie->blob_hash, SHA1_DIGEST_LENGTH);
+ blob_id.algo = WORKTREE_ALGO(a->worktree);
blob_idp = &blob_id;
}
stage = got_fileindex_entry_stage_get(ie);
stage == GOT_FILEIDX_STAGE_ADD) {
memcpy(staged_blob_id.hash, ie->staged_blob_hash,
SHA1_DIGEST_LENGTH);
+ staged_blob_id.algo = WORKTREE_ALGO(a->worktree);
staged_blob_idp = &staged_blob_id;
}
if (got_fileindex_entry_has_commit(ie)) {
memcpy(commit_id.hash, ie->commit_hash, SHA1_DIGEST_LENGTH);
+ commit_id.algo = WORKTREE_ALGO(a->worktree);
commit_idp = &commit_id;
}