8000 Conditional git_hash_ctx_cleanup call in git_odb_stream_free When stream->hash_ctx is set? · libgit2 libgit2 · Discussion #6835 · GitHub
[go: up one dir, main page]

Skip to content

Conditional git_hash_ctx_cleanup call in git_odb_stream_free When stream->hash_ctx is set? #6835

Answered by ethomson
gensmusic asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm, really good question. This seems like we've definitely leaked out some core implementation details that shouldn't be something that consumers should be touching. read/write streams are not mandatory (libgit2 will wrap your normal, non-streaming read and write- functions with streaming proxies that will buffer). And because of that, I suspect that this oversight exists.

I think that the proper solution is for git_odb_stream to not actually have the hash_ctx member at all. (You'll run into the same problem if / when you try to build an odb write stream, I would expect?) But we can take your fix for a quick win while we untangle this.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@gensmusic
Comment options

@ethomson
Comment options

Answer selected by gensmusic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
0