mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-04 03:13:21 +01:00
Worktree picker: search also by branch name (#66384)
## Summary In the worktree picker, can now search by both branch and worktree name instead of only by worktree name. With the current implementation whenever the worktree and a checked out branch do not share same name and the user wants to switch worktree, they have to remember the worktree name, or do some workaround like launching `zed .` from the worktree. It's not possible to switch worktree using the branch picker, as it will try to check out the branch in the current worktree (this change doesn't touch that behaviour). An example where it exists a branch named `a-random-branch` checked out in worktree `zed-deliberate-purpose` Before, when searching by `random` the worktree does not appear: <img width="696" height="197" alt="image" src="https://github.com/user-attachments/assets/cd1674c1-3ca6-4337-ad16-439f58df9e03" /> After, it is fuzzy matched because of the branch name: <img width="668" height="189" alt="image" src="https://github.com/user-attachments/assets/ed521e76-bc1b-4e4e-b662-7caba46ff91a" /> ## Testing I manually tested the change, but only on macOS. I have been using it for a few weeks with megarepos and tens of worktrees/branches. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Added the possibility to search also by branch name in the worktree picker.
This commit is contained in:
1 parent
ead5672e16
commit
9fa6fd3f44
2 files changed
+199
-21
No files matched your search
@@ -203,6 +203,7 @@ Git worktrees let you keep multiple checkouts of the same repository on disk at
|
||||
This is useful when you want to work on more than one branch or task without stashing, rebuilding, or disturbing the files in your main checkout.
|
||||
|
||||
Open the worktree picker from the title bar, next to the project picker, or by running {#action git::Worktree}.
|
||||
Search by worktree name or checked-out branch name to find an existing worktree.
|
||||
From the picker, you can:
|
||||
|
||||
- Create a new linked worktree either from the current branch or default branch
|
||||
|
||||
Reference in new issue
Block a user