From 84005195662ac3152cc03ead72ed5abcd282fbdf Mon Sep 17 00:00:00 2001 From: MsfPablo Date: Mon, 17 Aug 2026 22:45:49 +0200 Subject: [PATCH] fix(revlog): log fetch errors instead of aborting the process The unfiltered Log tab spawns a rayon worker that calls fetch_helper(...).expect("failed to fetch"). When gix discovery fails the panic happens on a rayon worker thread, and rayon re-aborts the whole process. The most reachable trigger is the process cwd being deleted (e.g. stashing untracked files from inside the now- removed subdirectory): gix discovery reads the process cwd unconditionally (gix/src/discover.rs::discover_opts sets options.current_dir from gix_fs::current_dir), so even passing an absolute repo root does not help, and the git2-based paths that do not consult the cwd keep working while the unfiltered Log tab dies. Replace the .expect with the same error-logging idiom already used by asyncgit::status, asyncgit::blame and asyncgit::diff: log the fetch error and let the worker degrade the tab instead of aborting the process. This addresses the escalation the issue calls out as worth handling regardless of the cwd question. Fixes #3017 --- asyncgit/src/revlog.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/asyncgit/src/revlog.rs b/asyncgit/src/revlog.rs index 774d5140ef..a106c49d51 100644 --- a/asyncgit/src/revlog.rs +++ b/asyncgit/src/revlog.rs @@ -176,14 +176,25 @@ impl AsyncLog { rayon_core::spawn(move || { scope_time!("async::revlog"); - Self::fetch_helper( + if let Err(e) = Self::fetch_helper( &repo_path, &arc_current, &arc_background, &sender, filter, - ) - .expect("failed to fetch"); + ) { + // The log walker runs on a rayon worker thread. A + // panic here aborts the whole process (rayon panics + // are unwound, then re-aborted). The most reachable + // trigger is the unfiltered Log tab when the process + // cwd has been deleted (e.g. stashing untracked files + // from inside the now-removed subdirectory), where + // `gix` discovery reads the cwd unconditionally and + // fails with `CurrentDir(NotFound)`. Log the fetch + // error and degrade the tab instead of aborting, in + // line with `asyncgit::status`, `blame` and `diff`. + log::error!("fetch_helper revlog: {e}"); + } arc_pending.store(false, Ordering::Relaxed);