summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-09-29 21:31:17 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-10-01 08:12:07 -0400
commit2a713da1ec2e9f74c9edc75b06540ab095c68c34 (patch)
tree488891e9b76cf54582738c48674e7dfde81cc638 /src/odb.c
parent3fff59705fec852b97639364ca7b3e84ff7040b7 (diff)
downloadlibgit2-2a713da1ec2e9f74c9edc75b06540ab095c68c34.tar.gz
hash: accept the algorithm in inputs
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/odb.c b/src/odb.c
index 7834e5f15..c24780834 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -136,7 +136,7 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj)
vec[1].data = obj->data;
vec[1].len = obj->len;
- return git_hash_vec(id, vec, 2);
+ return git_hash_vec(id, vec, 2, GIT_HASH_ALGORITHM_SHA1);
}
@@ -210,7 +210,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
return -1;
}
- if ((error = git_hash_ctx_init(&ctx)) < 0)
+ if ((error = git_hash_ctx_init(&ctx, GIT_HASH_ALGORITHM_SHA1)) < 0)
return error;
if ((error = git_odb__format_object_header(&hdr_len, hdr,
@@ -1561,7 +1561,7 @@ int git_odb_open_wstream(
ctx = git__malloc(sizeof(git_hash_ctx));
GIT_ERROR_CHECK_ALLOC(ctx);
- if ((error = git_hash_ctx_init(ctx)) < 0 ||
+ if ((error = git_hash_ctx_init(ctx, GIT_HASH_ALGORITHM_SHA1)) < 0 ||
(error = hash_header(ctx, size, type)) < 0)
goto done;