Add doc comment to ArchivedGitWorktree and rename misleading variable

Richard Feldman created

- 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.

Change summary

crates/agent_ui/src/thread_metadata_store.rs | 2 ++
crates/sidebar/src/sidebar.rs                | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)

Detailed changes

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,

crates/sidebar/src/sidebar.rs 🔗

@@ -2899,7 +2899,6 @@ impl Sidebar {
         let fs = <dyn fs::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,
                         )