mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
fix(commit_files): avoid panic when async fetch fails
Log fetch and notification errors instead of unwrapping in the background worker, consistent with revlog and status. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8619c07f3f
commit
2c8b3744ba
1 changed files with 10 additions and 5 deletions
|
|
@ -108,14 +108,19 @@ impl AsyncCommitFiles {
|
||||||
self.pending.fetch_add(1, Ordering::Relaxed);
|
self.pending.fetch_add(1, Ordering::Relaxed);
|
||||||
|
|
||||||
rayon_core::spawn(move || {
|
rayon_core::spawn(move || {
|
||||||
Self::fetch_helper(&repo, params, &arc_current)
|
if let Err(e) =
|
||||||
.expect("failed to fetch");
|
Self::fetch_helper(&repo, params, &arc_current)
|
||||||
|
{
|
||||||
|
log::error!("commit_files fetch_helper: {e}");
|
||||||
|
}
|
||||||
|
|
||||||
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
arc_pending.fetch_sub(1, Ordering::Relaxed);
|
||||||
|
|
||||||
sender
|
if let Err(e) =
|
||||||
.send(AsyncGitNotification::CommitFiles)
|
sender.send(AsyncGitNotification::CommitFiles)
|
||||||
.expect("error sending");
|
{
|
||||||
|
log::error!("commit_files notify error: {e}");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue