summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@vercel.com>2023-02-23 14:03:16 +0000
committerEdward Thomson <ethomson@vercel.com>2023-02-23 14:03:16 +0000
commitd16b59c91e524bfa385b3db511da727a66694820 (patch)
tree9459ae377b1da6878a0c78839b30e2df6293350a /src
parentc9387a61656cd666d76a0491f6839c1a32835ca0 (diff)
downloadlibgit2-d16b59c91e524bfa385b3db511da727a66694820.tar.gz
odb: don't unconditionally add oid_type to stream
`git_odb_stream` should have an `oid_type` to disambiguate; that's not necessary on non-experimental SHA256 builds. Avoid unnecessary ABI breakage for consumers and hide it behind an ifdef for now.
Diffstat (limited to 'src')
-rw-r--r--src/libgit2/odb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libgit2/odb.c b/src/libgit2/odb.c
index edf4f001f..1a02cbad9 100644
--- a/src/libgit2/odb.c
+++ b/src/libgit2/odb.c
@@ -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;