Merge pull request #6499 from libgit2/ethomson/sha256_fix_2

odb: don't unconditionally add oid_type to stream
This commit is contained in:
Edward Thomson
2023-02-23 15:39:12 +00:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -171,7 +171,9 @@ struct git_odb_stream {
unsigned int mode;
void *hash_ctx;
#ifdef GIT_EXPERIMENTAL_SHA256
git_oid_t oid_type;
#endif
git_object_size_t declared_size;
git_object_size_t received_bytes;

View File

@@ -1704,7 +1704,9 @@ int git_odb_open_wstream(
(error = hash_header(ctx, size, type)) < 0)
goto done;
#ifdef GIT_EXPERIMENTAL_SHA256
(*stream)->oid_type = db->options.oid_type;
#endif
(*stream)->hash_ctx = ctx;
(*stream)->declared_size = size;
(*stream)->received_bytes = 0;