From 48f712b49bcb2265b61474305697f73b225027d6 Mon Sep 17 00:00:00 2001 From: feeiyu <158308373+feeiyu@users.noreply.github.com> Date: Sun, 1 Feb 2026 03:15:59 +0800 Subject: [PATCH] Fix git panel not updating after commit (#47222) Fixed git panel not update after commit or switch branch on Linux. On macOS and Windows, the watcher implementation recursively watches subdirectories. On Linux, the watcher is non-recursive. In Git worktree scenarios, only `/.git` is watched, but the actual worktree Git directory `/.git/worktrees/` is not. Therefore, Git operations such as commits or branch switches inside a worktree do not emit watcher events on Linux, causing the Git panel to stay out of sync. Release Notes: - Fixed git panel not update after commit or switch branch on Linux with git worktrees. --- crates/worktree/src/worktree.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs index 4f51019dd7443413aa01e6cfa44e6e62b02f9b8c..9031fa30574afeea4dc99f5d524005e2f0c547b2 100644 --- a/crates/worktree/src/worktree.rs +++ b/crates/worktree/src/worktree.rs @@ -3073,12 +3073,10 @@ impl BackgroundScannerState { .add(&common_dir_abs_path) .context("failed to add common directory to watcher") .log_err(); - if !repository_dir_abs_path.starts_with(&common_dir_abs_path) { - watcher - .add(&repository_dir_abs_path) - .context("failed to add repository directory to watcher") - .log_err(); - } + watcher + .add(&repository_dir_abs_path) + .context("failed to add repository directory to watcher") + .log_err(); let work_directory_id = work_dir_entry.id;