From 04041af78b4831761b02ff91b4c714154fde60cc Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Sat, 13 May 2023 02:40:22 -0700 Subject: [PATCH] Fixed bug with failing to clear git file status --- crates/project/src/worktree.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index b391ff829c..c1f5178399 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -3086,7 +3086,7 @@ impl BackgroundScanner { } let git_ptr = local_repo.repo_ptr.lock(); - git_ptr.worktree_status(&repo_path)? + git_ptr.worktree_status(&repo_path) }; let work_dir = repo.work_directory(snapshot)?; @@ -3097,7 +3097,11 @@ impl BackgroundScanner { .update(&work_dir_id, |entry| entry.scan_id = scan_id); snapshot.repository_entries.update(&work_dir, |entry| { - entry.worktree_statuses.insert(repo_path, status) + if let Some(status) = status { + entry.worktree_statuses.insert(repo_path, status); + } else { + entry.worktree_statuses.remove(&repo_path); + } }); }