Skip to content

Commit

Permalink
Merge pull request #6499 from libgit2/ethomson/sha256_fix_2
Browse files Browse the repository at this point in the history
odb: don't unconditionally add oid_type to stream
  • Loading branch information
ethomson committed Feb 23, 2023
2 parents bf7d388 + d16b59c commit 6f2eedb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/git2/odb_backend.h
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/libgit2/odb.c
Expand Up @@ -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;
Expand Down

0 comments on commit 6f2eedb

Please sign in to comment.