# Fix project grouping for Git repo subdirectories \(\#57998\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/45afbac0a5ab0d396e316ce0247fd41330c94d88)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 45afbac0a5ab0d396e316ce0247fd41330c94d88

Requested commit: 45afbac0a5ab0d396e316ce0247fd41330c94d88

Commit: 45afbac0a5ab0d396e316ce0247fd41330c94d88

Tree: 5cea2003d1114885f470ee9a745f7440aa7119a9

Author: Alisina Bahadori

Committer: GitHub

## Message

```
Fix project grouping for Git repo subdirectories (#57998)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
  - No unsafe blocks added.
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- No new UI components; behavior better matches user intent for opened
folders.
- [x] Tests cover the new/changed behavior
  - Added sibling-subdirectory project group regression coverage.
- Extended subfolder Git-status test to ensure Git still uses the parent
repo while project identity stays at the opened folder.
- [x] Performance impact has been considered and is acceptable
- Change adds one small enum/optional field check when computing
worktree paths; no meaningful performance impact expected.

Closes #57997

Release Notes:

- Fixed project grouping for opened subdirectories that share the same
parent Git repository.

## Screenshots

### Before
<img width="334" height="224" alt="Screenshot 2026-05-28 at 5 29 55 PM"
src="https://github.com/user-attachments/assets/ad5b13c5-11a7-4fa4-a074-a519521641da"
/>
<img width="485" height="201" alt="Screenshot 2026-05-28 at 5 28 36 PM"
src="https://github.com/user-attachments/assets/9cd2c138-92f5-4ff2-bf8f-21cdbeff0b79"
/>

### After

<img width="343" height="253" alt="Screenshot 2026-05-28 at 5 29 40 PM"
src="https://github.com/user-attachments/assets/56a4dca7-f0a1-4530-8c89-3c4773b90486"
/>
<img width="420" height="206" alt="Screenshot 2026-05-28 at 5 29 22 PM"
src="https://github.com/user-attachments/assets/d118340a-955e-4483-9888-4b566f59b931"
/>

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
```

## Parents

- [fd5d42dd55fcc185c27920e88aab21c077be5738](https://git.cafe/gitcafe/zed/commit/fd5d42dd55fcc185c27920e88aab21c077be5738?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/45afbac0a5ab0d396e316ce0247fd41330c94d88?format=markdown)
