diff --git a/CHANGELOG.md b/CHANGELOG.md index dca4981310..55ccdc3b4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.20.2 - 2025-05-05 +[0.20.1...0.20.2](https://github.com/rust-lang/git2-rs/compare/git2-0.20.1...git2-0.20.2) + +### Added + +- Added `Status::WT_UNREADABLE`. + [#1151](https://github.com/rust-lang/git2-rs/pull/1151) + +### Fixed + +- Added missing codes for `GIT_EDIRECTORY`, `GIT_EMERGECONFLICT`, `GIT_EUNCHANGED`, `GIT_ENOTSUPPORTED`, and `GIT_EREADONLY` to `Error::raw_code`. + [#1153](https://github.com/rust-lang/git2-rs/pull/1153) +- Fixed missing initialization in `Indexer::new`. + [#1160](https://github.com/rust-lang/git2-rs/pull/1160) + ## 0.20.1 - 2025-03-17 [0.20.0...0.20.1](https://github.com/rust-lang/git2-rs/compare/git2-0.20.0...git2-0.20.1) diff --git a/Cargo.lock b/Cargo.lock index 8df8c64719..1d4d2f2fc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -357,7 +357,7 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.1" +version = "0.20.2" dependencies = [ "bitflags 2.6.0", "clap", diff --git a/Cargo.toml b/Cargo.toml index d0620d7466..02b4ddea8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git2" -version = "0.20.1" +version = "0.20.2" authors = ["Josh Triplett ", "Alex Crichton "] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/README.md b/README.md index 7ac0c33826..b96234a095 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ libgit2 bindings for Rust. ```toml [dependencies] -git2 = "0.20.1" +git2 = "0.20.2" ``` ## Rust version requirements diff --git a/src/error.rs b/src/error.rs index 076667af98..ecc7f4f776 100644 --- a/src/error.rs +++ b/src/error.rs @@ -286,6 +286,8 @@ impl Error { GIT_EEOF, GIT_EINVALID, GIT_EUNCOMMITTED, + GIT_EDIRECTORY, + GIT_EMERGECONFLICT, GIT_PASSTHROUGH, GIT_ITEROVER, GIT_RETRY, @@ -294,6 +296,9 @@ impl Error { GIT_EAPPLYFAIL, GIT_EOWNER, GIT_TIMEOUT, + GIT_EUNCHANGED, + GIT_ENOTSUPPORTED, + GIT_EREADONLY, ) } diff --git a/src/indexer.rs b/src/indexer.rs index ddca5fa2d5..3a3ff62a5a 100644 --- a/src/indexer.rs +++ b/src/indexer.rs @@ -118,10 +118,13 @@ impl<'a> Indexer<'a> { /// can be `None` if no thin pack is expected, in which case missing bases /// will result in an error. /// + /// `path` is the directory where the packfile should be stored. + /// /// `mode` is the permissions to use for the output files, use `0` for defaults. /// /// If `verify` is `false`, the indexer will bypass object connectivity checks. pub fn new(odb: Option<&Odb<'a>>, path: &Path, mode: u32, verify: bool) -> Result { + crate::init(); let path = path.into_c_string()?; let odb = odb.map(Binding::raw).unwrap_or_else(ptr::null_mut); diff --git a/src/lib.rs b/src/lib.rs index 4b26b8c023..541277bfba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1049,6 +1049,8 @@ bitflags! { const WT_TYPECHANGE = raw::GIT_STATUS_WT_TYPECHANGE as u32; #[allow(missing_docs)] const WT_RENAMED = raw::GIT_STATUS_WT_RENAMED as u32; + #[allow(missing_docs)] + const WT_UNREADABLE = raw::GIT_STATUS_WT_UNREADABLE as u32; #[allow(missing_docs)] const IGNORED = raw::GIT_STATUS_IGNORED as u32; diff --git a/src/repo.rs b/src/repo.rs index 464530332e..061078d670 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -2137,7 +2137,7 @@ impl Repository { /// /// For compatibility with git, the repository is put into a merging state. /// Once the commit is done (or if the user wishes to abort), you should - /// clear this state by calling cleanup_state(). + /// clear this state by calling [`cleanup_state()`][Repository::cleanup_state]. pub fn merge( &self, annotated_commits: &[&AnnotatedCommit<'_>],