mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-22 02:12:58 +03:00
fix some potentials for errors to bubble up (#547)
* fix some potentials for errors to bubble up (#490) * fix async diff failing panic
This commit is contained in:
parent
4a0e671197
commit
546c7f3072
@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
![charcount](assets/char_count.gif)
|
||||
|
||||
### Fixed
|
||||
- fix some potential errors when deleting files while they are being diffed ([#490](https://github.com/extrawurst/gitui/issues/490))
|
||||
- push defaults to 'origin' remote if it exists ([#494](https://github.com/extrawurst/gitui/issues/494))
|
||||
- support missing pageUp/down support in branchlist ([#519](https://github.com/extrawurst/gitui/issues/519))
|
||||
- don't hide branch name while in commit dialog ([#529](https://github.com/extrawurst/gitui/issues/529))
|
||||
|
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ profile:
|
||||
cargo run --features=timing,pprof -- -l
|
||||
|
||||
debug:
|
||||
cargo run --features=timing -- -l
|
||||
RUST_BACKTRACE=true cargo run --features=timing -- -l
|
||||
|
||||
build-release:
|
||||
cargo build --release
|
||||
|
@ -118,8 +118,14 @@ impl AsyncDiff {
|
||||
arc_last,
|
||||
arc_current,
|
||||
hash,
|
||||
)
|
||||
.expect("error getting diff");
|
||||
);
|
||||
|
||||
let notify = if let Err(err) = notify {
|
||||
log::error!("get_diff_helper error: {}", err);
|
||||
true
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
||||
|
||||
|
@ -518,6 +518,16 @@ impl DiffComponent {
|
||||
);
|
||||
}
|
||||
|
||||
fn stage_unstage_hunk(&mut self) -> Result<()> {
|
||||
if self.current.is_stage {
|
||||
self.unstage_hunk()?;
|
||||
} else {
|
||||
self.stage_hunk()?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
const fn is_stage(&self) -> bool {
|
||||
self.current.is_stage
|
||||
}
|
||||
@ -659,11 +669,12 @@ impl Component for DiffComponent {
|
||||
} else if e == self.key_config.enter
|
||||
&& !self.is_immutable
|
||||
{
|
||||
if self.current.is_stage {
|
||||
self.unstage_hunk()?;
|
||||
} else {
|
||||
self.stage_hunk()?;
|
||||
}
|
||||
try_or_popup!(
|
||||
self,
|
||||
"hunk error:",
|
||||
self.stage_unstage_hunk()
|
||||
);
|
||||
|
||||
Ok(true)
|
||||
} else if e == self.key_config.status_reset_item
|
||||
&& !self.is_immutable
|
||||
|
Loading…
Reference in New Issue
Block a user