Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project_panel: Fix worktree root rename #24487

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xtimsb
Copy link
Member

@0xtimsb 0xtimsb commented Feb 8, 2025

Closes #7923

This PR fixes root worktree renaming by:

  1. Handling the case where new_path is the new root name instead of a relative path from the root.
  2. #20313 added functionality to watch for root worktree renames made externally, e.g., via Finder. This PR avoids relying on that watcher because, when renaming explicitly from Zed, we can eagerly perform the necessary work (of course after fs rename) instead of waiting for the watcher to detect the rename. This prevents UI glitches during renaming root.

Todo:

  • Fix wrong abs paths when root is renamed
  • Fix explicit scan entry func to handle renamed root dir
  • Tests
  • Test on Linux
  • Test on Windows (Root-level rename currently fails on Windows, with error: "cannot rename directory in use"

Release Notes:

  • Fixed an issue where worktree root name couldn't be renamed in project panel.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 8, 2025
@0xtimsb 0xtimsb marked this pull request as ready for review February 8, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming of root folder has no effect
1 participant