-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL (#f) not allowed for git_diff_options
#4
Comments
I tried working around this from my program, and got stuck at every attempt:
Based on the upstream docs, I think the most low-level way to create a non-null "default" value would be something like:
but this fails with "the expected number of arguments does not match the given number" because |
Thanks for the report!
These are definitely our bug and should be fixed.
We can't really use C macros like
ought to work, but for bugs (though maybe we shouldn't expose This is also crying out for a convenience function with optional keyword arguments. |
That's true, but the Racket bindings already say things like That said, I don't think I need any non-default diff options for my program. Allowing null (and letting libgit2 use its default value) would work just fine for me. |
I've never used Racket FFI before, so I have no idea what I'm doing. Does this change make sense? Still left to do, to completely support
|
The libgit2 docs for
git_diff_options
say "passing NULL for the options structure will give the defaults", and the libgit2 sample code shows this in practice.With these Racket bindings, though, several functions (like
git_diff_tree_to_tree
) use_git_diff_opts-pointer
rather than_git_diff_opts-pointer/null
, so passing#f
here results in an error:The scrbl docs even say that this parameter has type
[opts (or/c git_diff_opts? #f)]
.The text was updated successfully, but these errors were encountered: