zed/crates/git_ui
Anthony Eid b830524713
git: Fix create worktree hook tasks running when switching worktrees (#54612)
This PR fixes a regression that was likely caused by:
https://github.com/zed-industries/zed/pull/54183 and wasn't caught
because I didn't add a regression test when I originally created the
feature.

The fix was only running the hooks when the worktree was just created,
and I added an integration test to prevent regressions from occurring
again in the future.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #54598

Release Notes:

- git: Fix create worktree hook tasks running when switching worktrees
2026-04-23 11:05:54 +00:00
..
src git: Fix create worktree hook tasks running when switching worktrees (#54612) 2026-04-23 11:05:54 +00:00
Cargo.toml git: Fix create worktree hook tasks running when switching worktrees (#54612) 2026-04-23 11:05:54 +00:00
LICENSE-GPL Add placeholder git panel (#21894) 2024-12-11 22:13:52 -05:00