Skip to content

Commit aef3882

Browse files
committed
cargo update (related to #1781)
1 parent 85ab9d4 commit aef3882

File tree

9 files changed

+471
-503
lines changed

9 files changed

+471
-503
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ keywords = ["git", "gui", "cli", "terminal", "ui"]
1717
anyhow = "1.0"
1818
asyncgit = { path = "./asyncgit", version = "0.24", default-features = false }
1919
backtrace = "0.3"
20-
bitflags = "1.3"
20+
bitflags = "2.4"
2121
bugreport = "0.5"
2222
bwrap = { version = "1.3.0", features = ["use_std"] }
2323
bytesize = { version = "1.3", default-features = false }
2424
chrono = { version = "0.4", default-features = false, features = ["clock"] }
2525
clap = { version = "4.1", features = ["env", "cargo"] }
2626
crossbeam-channel = "0.5"
27-
crossterm = { version = "0.26.1", features = ["serde"] }
27+
crossterm = { version = "0.27", features = ["serde"] }
2828
dirs = "5.0"
2929
easy-cast = "0.5"
3030
filetreelist = { path = "./filetreelist", version = "0.5" }
3131
fuzzy-matcher = "0.3"
3232
gh-emoji = { version = "1.0", optional = true }
33-
indexmap = "1.9"
33+
indexmap = "2.0"
3434
itertools = "0.11"
3535
log = "0.4"
36-
notify = "5.1"
37-
notify-debouncer-mini = "0.2"
36+
notify = "6.1"
37+
notify-debouncer-mini = "0.4"
3838
once_cell = "1"
39-
ratatui = { version = "0.21", default-features = false, features = ['crossterm', 'serde'] }
39+
ratatui = { version = "0.23", default-features = false, features = ['crossterm', 'serde'] }
4040
rayon-core = "1.11"
4141
ron = "0.8"
4242
scopeguard = "1.2"
4343
scopetime = { path = "./scopetime", version = "0.1" }
4444
serde = "1.0"
4545
shellexpand = "3.1"
4646
simplelog = { version = "0.12", default-features = false }
47-
struct-patch = "0.2"
48-
syntect = { version = "5.0", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
47+
struct-patch = "0.4"
48+
syntect = { version = "5.1", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] }
4949
unicode-segmentation = "1.10"
5050
unicode-truncate = "0.2"
5151
unicode-width = "0.1"

asyncgit/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ categories = ["concurrency", "asynchronous"]
1212
keywords = ["git"]
1313

1414
[dependencies]
15-
bitflags = "1"
15+
bitflags = "2"
1616
crossbeam-channel = "0.5"
1717
easy-cast = "0.5"
1818
fuzzy-matcher = "0.3"
19-
git2 = "0.17"
19+
git2 = "0.18"
2020
log = "0.4"
2121
# git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]}
2222
# git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]}
@@ -34,7 +34,7 @@ url = "2.4"
3434
env_logger = "0.10"
3535
invalidstring = { path = "../invalidstring", version = "0.1" }
3636
pretty_assertions = "1.4"
37-
serial_test = "1.0"
37+
serial_test = "2.0"
3838
tempfile = "3.4"
3939

4040
[features]

asyncgit/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
//TODO:
2828
#![allow(
2929
clippy::significant_drop_tightening,
30-
clippy::missing_panics_doc
30+
clippy::missing_panics_doc,
31+
clippy::multiple_crate_versions
3132
)]
3233

3334
pub mod asyncjob;

asyncgit/src/sync/commit_filter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pub fn diff_contains_file(file_path: String) -> SharedCommitFilterFn {
3333

3434
bitflags! {
3535
///
36+
#[derive(Debug, Clone, Copy)]
3637
pub struct SearchFields: u32 {
3738
///
3839
const MESSAGE = 1 << 0;
@@ -57,6 +58,7 @@ impl Default for SearchFields {
5758

5859
bitflags! {
5960
///
61+
#[derive(Debug, Clone, Copy)]
6062
pub struct SearchOptions: u32 {
6163
///
6264
const CASE_SENSITIVE = 1 << 0;

src/keys/key_config.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ mod tests {
163163
NamedTempFile::new_in(&app_home).unwrap();
164164
writeln!(
165165
temporary_key_list,
166-
r"
166+
r#"
167167
(
168-
move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
168+
move_down: Some(( code: Char('j'), modifiers: "CONTROL")),
169169
)
170-
"
170+
"#
171171
)
172172
.unwrap();
173173

174174
let mut temporary_key_symbols =
175175
NamedTempFile::new_in(&app_home).unwrap();
176176
writeln!(
177177
temporary_key_symbols,
178-
"
178+
r#"
179179
(
180-
esc: Some(\"Esc\"),
180+
esc: Some("Esc"),
181181
)
182-
"
182+
"#
183183
)
184184
.unwrap();
185185

src/keys/key_list.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ impl From<&GituiKeyEvent> for KeyEvent {
3434
}
3535
}
3636

37-
#[derive(Clone, Patch)]
38-
#[patch_derive(Deserialize)]
37+
#[derive(Debug, Clone, Patch)]
38+
#[patch_derive(Deserialize, Debug)]
3939
pub struct KeysList {
4040
pub tab_status: GituiKeyEvent,
4141
pub tab_log: GituiKeyEvent,
@@ -217,8 +217,11 @@ impl KeysList {
217217
pub fn init(file: PathBuf) -> Self {
218218
let mut keys_list = Self::default();
219219
if let Ok(f) = File::open(file) {
220-
if let Ok(patch) = ron::de::from_reader(f) {
221-
keys_list.apply(patch);
220+
match ron::de::from_reader(f) {
221+
Ok(patch) => keys_list.apply(patch),
222+
Err(e) => {
223+
log::error!("KeysList parse error: {e}");
224+
}
222225
}
223226
}
224227
keys_list
@@ -248,11 +251,12 @@ mod tests {
248251

249252
writeln!(
250253
file,
251-
r"
254+
r#"
252255
(
253-
move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)),
256+
move_down: Some(( code: Char('j'), modifiers: "CONTROL")),
257+
move_up: Some((code: Char('h'), modifiers: ""))
254258
)
255-
"
259+
"#
256260
)
257261
.unwrap();
258262

@@ -266,5 +270,12 @@ mod tests {
266270
KeyModifiers::CONTROL
267271
)
268272
);
273+
assert_eq!(
274+
keys.move_up,
275+
GituiKeyEvent::new(
276+
KeyCode::Char('h'),
277+
KeyModifiers::NONE
278+
)
279+
);
269280
}
270281
}

src/watcher.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::Result;
22
use crossbeam_channel::{unbounded, Sender};
3-
use notify::{Error, RecommendedWatcher, RecursiveMode, Watcher};
4-
use notify_debouncer_mini::{new_debouncer, DebouncedEvent};
3+
use notify::{RecommendedWatcher, RecursiveMode, Watcher};
4+
use notify_debouncer_mini::{new_debouncer, DebounceEventResult};
55
use scopetime::scope_time;
66
use std::{path::Path, thread, time::Duration};
77

@@ -43,9 +43,7 @@ impl RepoWatcher {
4343
}
4444

4545
fn forwarder(
46-
receiver: &std::sync::mpsc::Receiver<
47-
Result<Vec<DebouncedEvent>, Vec<Error>>,
48-
>,
46+
receiver: &std::sync::mpsc::Receiver<DebounceEventResult>,
4947
sender: &Sender<()>,
5048
) -> Result<()> {
5149
loop {
@@ -68,15 +66,13 @@ impl RepoWatcher {
6866

6967
fn create_watcher(
7068
timeout: Duration,
71-
tx: std::sync::mpsc::Sender<
72-
Result<Vec<DebouncedEvent>, Vec<Error>>,
73-
>,
69+
tx: std::sync::mpsc::Sender<DebounceEventResult>,
7470
workdir: &str,
7571
) {
7672
scope_time!("create_watcher");
7773

7874
let mut bouncer =
79-
new_debouncer(timeout, None, tx).expect("Watch create error");
75+
new_debouncer(timeout, tx).expect("Watch create error");
8076
bouncer
8177
.watcher()
8278
.watch(Path::new(&workdir), RecursiveMode::Recursive)

vim_style_key_config.ron

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66
// Note:
77
// If the default key layout is lower case,
88
// and you want to use `Shift + q` to trigger the exit event,
9-
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: ( bits: 1,),)),`
9+
// the setting should like this `exit: Some(( code: Char('Q'), modifiers: "SHIFT")),`
1010
// The Char should be upper case, and the shift modified bit should be set to 1.
1111
//
1212
// Note:
1313
// find `KeysList` type in src/keys/key_list.rs for all possible keys.
1414
// every key not overwritten via the config file will use the default specified there
1515
(
16-
open_help: Some(( code: F(1), modifiers: ( bits: 0,),)),
16+
open_help: Some(( code: F(1), modifiers: "")),
1717

18-
move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)),
19-
move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
20-
move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)),
21-
move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)),
18+
move_left: Some(( code: Char('h'), modifiers: "")),
19+
move_right: Some(( code: Char('l'), modifiers: "")),
20+
move_up: Some(( code: Char('k'), modifiers: "")),
21+
move_down: Some(( code: Char('j'), modifiers: "")),
2222

23-
popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)),
24-
popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)),
25-
page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)),
26-
page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)),
27-
home: Some(( code: Char('g'), modifiers: ( bits: 0,),)),
28-
end: Some(( code: Char('G'), modifiers: ( bits: 1,),)),
29-
shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)),
30-
shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)),
23+
popup_up: Some(( code: Char('p'), modifiers: "CONTROL")),
24+
popup_down: Some(( code: Char('n'), modifiers: "CONTROL")),
25+
page_up: Some(( code: Char('b'), modifiers: "CONTROL")),
26+
page_down: Some(( code: Char('f'), modifiers: "CONTROL")),
27+
home: Some(( code: Char('g'), modifiers: "")),
28+
end: Some(( code: Char('G'), modifiers: "SHIFT")),
29+
shift_up: Some(( code: Char('K'), modifiers: "SHIFT")),
30+
shift_down: Some(( code: Char('J'), modifiers: "SHIFT")),
3131

32-
edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)),
32+
edit_file: Some(( code: Char('I'), modifiers: "SHIFT")),
3333

34-
status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)),
34+
status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")),
3535

36-
diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)),
37-
diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)),
36+
diff_reset_lines: Some(( code: Char('u'), modifiers: "")),
37+
diff_stage_lines: Some(( code: Char('s'), modifiers: "")),
3838

39-
stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)),
40-
stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)),
39+
stashing_save: Some(( code: Char('w'), modifiers: "")),
40+
stashing_toggle_index: Some(( code: Char('m'), modifiers: "")),
4141

42-
stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)),
42+
stash_open: Some(( code: Char('l'), modifiers: "")),
4343

44-
abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)),
44+
abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")),
4545
)

0 commit comments

Comments
 (0)