Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/git2-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: git2-0.20.1
Choose a base ref
...
head repository: rust-lang/git2-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: git2-0.20.2
Choose a head ref
  • 12 commits
  • 8 files changed
  • 4 contributors

Commits on Mar 29, 2025

  1. add a missing status field

    seokju-na committed Mar 29, 2025
    Copy the full SHA
    0c3cba1 View commit details

Commits on Mar 30, 2025

  1. Merge pull request #1151 from seokju-na/status-wt-unreadable

    add a missing `git2::Status::WT_UNREADABLE` field
    ehuss authored Mar 30, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7bebf64 View commit details

Commits on Apr 3, 2025

  1. Add missing code checks to Error::raw_code()

    These codes are both already handled by Error::code(), but because
    they weren't listed in Error::raw_code(), it would return -1, and so
    the paths in Error::code() for them would never be hit.  This fixes
    the code of errors from Repository::merge_commits() with
    fail_on_conflict set for me.
    alyssais authored and ehuss committed Apr 3, 2025
    Copy the full SHA
    00faf61 View commit details
  2. Merge pull request #1153 from alyssais/raw_code

    Add missing code checks to Error::raw_code()
    ehuss authored Apr 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b82f801 View commit details

Commits on Apr 22, 2025

  1. fix: add a backtick

    reddevilmidzy authored Apr 22, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    38681b1 View commit details
  2. Make link an intra-doc link

    ehuss authored Apr 22, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ba5e1b3 View commit details
  3. Merge pull request #1155 from reddevilmidzy/master

    fix: add a backtick
    ehuss authored Apr 22, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5bc3baa View commit details

Commits on May 5, 2025

  1. Call init in Indexer::new

    Otherwise calling `Indexer::new` as the first thing in the program will
    result in "no error" errors.
    ehuss committed May 5, 2025
    Copy the full SHA
    1774e57 View commit details
  2. Clarify Indexer::new path parameter

    This updates the docs to clarify that the path is a *directory*.
    ehuss committed May 5, 2025
    Copy the full SHA
    7f42b7a View commit details
  3. Merge pull request #1160 from ehuss/indexer-init

    Fix initialization with Indexer::new
    ehuss authored May 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    eef4592 View commit details
  4. Update version of git2 to 0.20.2

    ehuss committed May 5, 2025
    Copy the full SHA
    26bfd30 View commit details
  5. Merge pull request #1161 from ehuss/bump-version

    Update version of git2 to 0.20.2
    ehuss authored May 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1fb5f64 View commit details
Showing with 29 additions and 4 deletions.
  1. +15 −0 CHANGELOG.md
  2. +1 −1 Cargo.lock
  3. +1 −1 Cargo.toml
  4. +1 −1 README.md
  5. +5 −0 src/error.rs
  6. +3 −0 src/indexer.rs
  7. +2 −0 src/lib.rs
  8. +1 −1 src/repo.rs
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git2"
version = "0.20.1"
version = "0.20.2"
authors = ["Josh Triplett <josh@joshtriplett.org>", "Alex Crichton <alex@alexcrichton.com>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ libgit2 bindings for Rust.

```toml
[dependencies]
git2 = "0.20.1"
git2 = "0.20.2"
```

## Rust version requirements
5 changes: 5 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -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,
)
}

3 changes: 3 additions & 0 deletions src/indexer.rs
Original file line number Diff line number Diff line change
@@ -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<Self, Error> {
crate::init();
let path = path.into_c_string()?;

let odb = odb.map(Binding::raw).unwrap_or_else(ptr::null_mut);
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
@@ -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<'_>],