From 8af212e7853f88bd193d27e334f94bfc8d8bc5d1 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Wed, 27 Aug 2025 18:34:14 -0600 Subject: [PATCH] Fix watching of Git repo in presence of scanner restarts (#37052) The scanner is restarted after loading initial settings, and there was an optimization to not re-discover and re-watch git repositories if they already exist in the snapshot. #35865 added cleanup of watches that occurred when the scanner restarts, and so in some cases repos were no longer watched. Release Notes: - Linux: Fixed a case where Git repositories might not be watched for changes, causing branch switching to not update the UI. Co-authored-by: Julia --- crates/worktree/src/worktree.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index cf61ee2669663f172fa1238db4d359970e23e4bc..845af538021326a0e609c9f6098ebf20ed1dc704 100644 --- a/crates/worktree/src/worktree.rs +++ b/crates/worktree/src/worktree.rs @@ -3151,16 +3151,6 @@ impl BackgroundScannerState { .work_directory_abs_path(&work_directory) .log_err()?; - if self - .snapshot - .git_repositories - .get(&work_dir_entry.id) - .is_some() - { - log::trace!("existing git repository for {work_directory:?}"); - return None; - } - let dot_git_abs_path: Arc = self .snapshot .abs_path