Skip to content

Commit 66bd400

Browse files
authored
feat: add missing wt_unreaddable field in status by upgrading git2-rs v0.20.2 (#144)
1 parent bff0b65 commit 66bd400

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
99
[dependencies]
1010
bitflags = "2.1.0"
1111
chrono = "0.4"
12-
git2 = { version = "0.20.1", features = ["vendored-libgit2", "vendored-openssl"] }
12+
git2 = { version = "0.20.2", features = ["vendored-libgit2", "vendored-openssl"] }
1313
napi = { version = "2.16.17", default-features = false, features = ["napi6", "chrono_date"] }
1414
napi-derive = "2.16.13"
1515
thiserror = "2.0.3"

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,7 @@ export interface Status {
18201820
wtDeleted: boolean
18211821
wtTypechange: boolean
18221822
wtRenamed: boolean
1823+
wtUnreadable: boolean
18231824
ignored: boolean
18241825
conflicted: boolean
18251826
}

src/status.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ pub struct Status {
1818
pub wt_deleted: bool,
1919
pub wt_typechange: bool,
2020
pub wt_renamed: bool,
21-
// TODO: Field does not exist on current `git2-rs` version.
22-
// Wait for updates (https://github.com/rust-lang/git2-rs/pull/1151)
23-
// pub wt_unreadable: bool,
21+
pub wt_unreadable: bool,
2422
pub ignored: bool,
2523
pub conflicted: bool,
2624
}
@@ -38,6 +36,7 @@ impl From<git2::Status> for Status {
3836
let wt_deleted = value.contains(git2::Status::WT_DELETED);
3937
let wt_typechange = value.contains(git2::Status::WT_TYPECHANGE);
4038
let wt_renamed = value.contains(git2::Status::WT_RENAMED);
39+
let wt_unreadable = value.contains(git2::Status::WT_UNREADABLE);
4140
let ignored = value.contains(git2::Status::IGNORED);
4241
let conflicted = value.contains(git2::Status::CONFLICTED);
4342
Self {
@@ -52,6 +51,7 @@ impl From<git2::Status> for Status {
5251
wt_deleted,
5352
wt_typechange,
5453
wt_renamed,
54+
wt_unreadable,
5555
ignored,
5656
conflicted,
5757
}

0 commit comments

Comments
 (0)