summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-09-30 08:11:40 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-10-02 16:34:47 -0400
commit31ecaca2d3e87d20782a54cb319f5c19e6c6e62f (patch)
tree06131413f2e42a8c3e51bbe0134f9267531bad62 /src/odb.c
parent2a713da1ec2e9f74c9edc75b06540ab095c68c34 (diff)
downloadlibgit2-31ecaca2d3e87d20782a54cb319f5c19e6c6e62f.tar.gz
hash: hash functions operate on byte arrays not git_oids
Separate the concerns of the hash functions from the git_oid functions. The git_oid structure will need to understand either SHA1 or SHA256; the hash functions should only deal with the appropriate one of these.
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 c24780834..baa287348 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, GIT_HASH_ALGORITHM_SHA1);
+ return git_hash_vec(id->id, vec, 2, GIT_HASH_ALGORITHM_SHA1);
}
@@ -237,7 +237,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
goto done;
}
- error = git_hash_final(out, &ctx);
+ error = git_hash_final(out->id, &ctx);
done:
git_hash_ctx_cleanup(&ctx);
@@ -1607,7 +1607,7 @@ int git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream)
return git_odb_stream__invalid_length(stream,
"stream_finalize_write()");
- git_hash_final(out, stream->hash_ctx);
+ git_hash_final(out->id, stream->hash_ctx);
if (git_odb__freshen(stream->backend->odb, out))
return 0;