git2-rs
git2-rs copied to clipboard
libgit2: Bump to v1.8.0
This PR bumps libgit2 to v1.8.0, in preparation for #1031. I've bumped libgit2-sys to 0.17.0+1.8.0, but haven't touched the git2 version since I thought that's better left for the maintainers.
I haven't included any new Rust bindings for the new functions (e.g. git_commit_create_from_stage). Basically I've just done the bare minimum required to get the libgit2 v1.8.0 working.
API changes:
Remote:update_tipsnow accepts aRemoteUpdateFlagswhich is an integer consisting of bitfields instead of a booleanFetchOptions: addreport_unchangedmethod which updates theupdate_flagsbitflag (similar to above)PushOptions: addremote_push_optionsmethod to set remote push optionsWorktreeAddOptions: addcheckout_existingmethod to set the booleancheckout_existingoption
References
- https://github.com/libgit2/libgit2/blob/main/docs/changelog.md#v18
Looks like the current test failures are due to changes made in https://github.com/libgit2/libgit2/pull/6743 👀
Looks like v1.8.0 is out! I will update the PR to bump the version.
This should be ready for review. (I'm pretty new to Rust and the libgit2 / this codebase, please do let me know if there are better ways to do anything.)
The test failures on Windows are related to https://github.com/libgit2/libgit2/pull/6743 as mentioned above—I'm not too sure how to handle these conventionally using Rust.
The test failures on Windows are related to libgit2/libgit2#6743 as mentioned above—I'm not too sure how to handle these conventionally using Rust.
Hm, that's awkward. I don't really understand why TempDir is returning short path. One option is to canonicalize both paths before comparing they are equal. Another option is to use same-file to check that the paths are the same. Canonicalize might be easier if it works.
FYI, this blocks the upgrade of libgit2 to 1.8.0 in Alpine Linux (!63296).
Is this PR still blocked? this may fix https://github.com/actions/checkout/issues/1689
Approved 2 weeks ago, but still not merged… why?
@jirutka libgit 1.8.0 has used C bitfields in its ABI, and that feature is not supported by Rust's FFI and may be compiler-specific.
https://github.com/libgit2/libgit2/issues/6800
libgit2 v1.8.1 was just released, and I've updated the PR to use that. Bitfields are no longer used in the new version, so we can avoid any hacks.