Skip to content

Gracefully handle when linked worktree .git path is outside worktree root (#53443) (cherry-pick to preview)#53565

Merged
zed-zippy[bot] merged 1 commit intov0.232.xfrom
cherry-pick-v0.232.x-fb949ae8
Apr 9, 2026
Merged

Gracefully handle when linked worktree .git path is outside worktree root (#53443) (cherry-pick to preview)#53565
zed-zippy[bot] merged 1 commit intov0.232.xfrom
cherry-pick-v0.232.x-fb949ae8

Conversation

@zed-zippy
Copy link
Copy Markdown
Contributor

@zed-zippy zed-zippy bot commented Apr 9, 2026

Cherry-pick of #53443 to preview


In update_git_repositories, a .git path outside the worktree root
can occur legitimately when .git is a gitfile (as in linked worktrees
and submodules) pointing to a directory in the parent repo. Previously
this triggered a debug_panic!, crashing debug builds.

Now we skip the path with a debug_assert! that it is indeed a file
(not a directory), so a genuine .git directory outside the worktree
root would still be caught in debug builds.

(No release notes because this is extremely hard to encounter until
#53215 lands)

Release Notes:

  • N/A

…root (#53443)

In `update_git_repositories`, a `.git` path outside the worktree root
can occur legitimately when `.git` is a gitfile (as in linked worktrees
and submodules) pointing to a directory in the parent repo. Previously
this triggered a `debug_panic!`, crashing debug builds.

Now we skip the path with a `debug_assert!` that it is indeed a file
(not a directory), so a genuine `.git` directory outside the worktree
root would still be caught in debug builds.

(No release notes because this is extremely hard to encounter until
#53215 lands)

Release Notes:

- N/A
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Apr 9, 2026
@zed-community-bot zed-community-bot bot added the bot Pull requests authored by a bot label Apr 9, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, cameron1024 and eholk and removed request for a team April 9, 2026 21:20
@zed-zippy zed-zippy bot merged commit 4c47798 into v0.232.x Apr 9, 2026
41 checks passed
@zed-zippy zed-zippy bot deleted the cherry-pick-v0.232.x-fb949ae8 branch April 9, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot Pull requests authored by a bot cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants