8000 Merge pull request #6499 from libgit2/ethomson/sha256_fix_2 · libgit2/libgit2@6f2eedb · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f2eedb

Browse files
authored
Merge pull request #6499 from libgit2/ethomson/sha256_fix_2
odb: don't unconditionally add oid_type to stream
2 parents bf7d388 + d16b59c commit 6f2eedb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/git2/odb_backend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ struct git_odb_stream {
171171
unsigned int mode;
172172
void *hash_ctx;
173173

174+
#ifdef GIT_EXPERIMENTAL_SHA256
174175
git_oid_t oid_type;
176+
#endif
175177

176178
git_object_size_t declared_size;
177179
git_object_size_t received_bytes;

src/libgit2/odb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,9 @@ int git_odb_open_wstream(
17041704
(error = hash_header(ctx, size, type)) < 0)
17051705
goto done;
17061706

1707+
#ifdef GIT_EXPERIMENTAL_SHA256
17071708
(*stream)->oid_type = db->options.oid_type;
1709+
#endif
17081710
(*stream)->hash_ctx = ctx;
17091711
(*stream)->declared_size = size;
17101712
(*stream)->received_bytes = 0;

0 commit comments

Comments
 (0)
0