From f9da5fb15533ddf27a422bcb307f8e693bccee87 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 1 Apr 2026 13:20:50 -0400 Subject: [PATCH] Document test coverage gap for restore reset logic The fake git implementation doesn't create .git gitfiles in worktree directories, so the project scanner never discovers a Repository entity for restored worktrees. This means the two-reset staging-restoration logic is not exercised by the existing test. --- crates/sidebar/src/sidebar_tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/sidebar/src/sidebar_tests.rs b/crates/sidebar/src/sidebar_tests.rs index d466e4cfb6585276c49dfcd8b2cc20f5cfe099fd..cfa5cb111d57115c93108814a296864d25e51780 100644 --- a/crates/sidebar/src/sidebar_tests.rs +++ b/crates/sidebar/src/sidebar_tests.rs @@ -5034,6 +5034,13 @@ async fn test_archive_and_restore_single_worktree(cx: &mut TestAppContext) { // project scan, reset, branch switch, DB cleanup. cx.run_until_parked(); + // NOTE: The FakeGitRepository::create_worktree implementation does not + // create a `.git` gitfile inside the worktree directory, so the project + // scanner does not discover a Repository entity for the restored worktree. + // This means the two-reset staging-restoration logic (mixed reset HEAD~, + // then soft reset HEAD~) is not exercised by this test. An integration + // test with a real git repo would be needed to cover that path. + // 1. The thread should no longer be archived. cx.update(|_, cx| { let store = ThreadMetadataStore::global(cx);