Open joshtriplett opened 4 years ago
I was just looking for exactly the same thing... Consider this my 👍 .
This will not be possible on stable rust until https://github.com/rust-lang/rust/issues/44930 is stabilised, right?
At least for the existing options, we could write C wrappers that provide non-variadic versions?
Also GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION
is definitely the big one, so perhaps just supporting that for now? Maybe I'll put together a PR real quick.
@extrawurst That feature is for defining C-compatible variadic functions in Rust. Stable Rust supports calling C variadic functions, without any wrapper needed.
@taralx Thanks for the PR! Could you please adapt it to call the variadic function directly, without a C wrapper?
I'd like to be able to call
git_libgit2_opts
usinggit2-rs
.By default, when reading in objects, libgit2 computes their sha1 hash and confirms that it matches the expected hash. That's a reasonable default, but it costs a lot of performance. Calling
git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0)
can substantially improve the performance of reading objects.git_libgit2_opts
is a varargs function, and the arguments depend on the option. Thus, I'd suggest type-safe bindings for individual options.