From 5d06f24471ecc60a89c85d38276f802bc5682775 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 1 Apr 2026 11:14:02 -0400 Subject: [PATCH] Use configured worktree directory in create_fresh_worktree Use worktrees_directory_for_repo instead of hardcoded DEFAULT_WORKTREE_DIRECTORY, matching the collision path in restore_archived_worktree. --- crates/sidebar/src/sidebar.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs index 0450ec436e37e173a4a6be9b775d4157a835b01d..71e2e0705543e30bf576aee3d64ac54e689ad36e 100644 --- a/crates/sidebar/src/sidebar.rs +++ b/crates/sidebar/src/sidebar.rs @@ -2541,10 +2541,14 @@ impl Sidebar { // Generate a new branch name for the fresh worktree. let branch_name = format!("restored-{}", row.id); let worktree_path = main_repo.update(cx, |repo, _cx| { - repo.path_for_new_linked_worktree( - &branch_name, + let setting = git_store::worktrees_directory_for_repo( + &repo.snapshot().original_repo_abs_path, git::repository::DEFAULT_WORKTREE_DIRECTORY, ) + .ok() + .map(|p| p.to_string_lossy().to_string()) + .unwrap_or_default(); + repo.path_for_new_linked_worktree(&branch_name, &setting) })?; // Create the fresh worktree.