From 2bbd5699583d9a5fa3608f54991bd32a76490029 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 1 Apr 2026 10:53:26 -0400 Subject: [PATCH] Add doc comment to ArchivedGitWorktree and rename misleading variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add doc comment explaining why ArchivedGitWorktree lives in the thread_metadata_store module (shared SQLite database). - Remove misleading branch_name_clone rename — it was a move, not a clone. --- crates/agent_ui/src/thread_metadata_store.rs | 2 ++ crates/sidebar/src/sidebar.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/agent_ui/src/thread_metadata_store.rs b/crates/agent_ui/src/thread_metadata_store.rs index 29eb4e9b524b9d78a508c2c3e83d543afbe26f6b..1ba41cceb04cf9f6bd304ba49b7f87cd4153eab6 100644 --- a/crates/agent_ui/src/thread_metadata_store.rs +++ b/crates/agent_ui/src/thread_metadata_store.rs @@ -142,6 +142,8 @@ impl From<&ThreadMetadata> for acp_thread::AgentSessionInfo { } } +/// Record of a git worktree that was archived (deleted from disk) when its last thread was archived. +/// Lives in this module because it shares the same SQLite database as thread metadata. pub struct ArchivedGitWorktree { pub id: i64, pub worktree_path: PathBuf, diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 3758cc61457007d586f3249bbd8df2fa2c660784..602f60d70d8d2f30ebfd3296708d0974fd48a2af 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -2899,7 +2899,6 @@ impl Sidebar { let fs = ::global(cx); let worktree_path_str = worktree_path.to_string_lossy().to_string(); let main_repo_path_str = main_repo_path.to_string_lossy().to_string(); - let branch_name_clone = branch_name; cx.spawn_in(window, async move |_this, cx| { if !is_last_thread { @@ -3117,7 +3116,7 @@ impl Sidebar { store.create_archived_worktree( worktree_path_str, main_repo_path_str, - branch_name_clone, + branch_name, commit_hash.clone(), cx, )