Files
zed/crates/git
Sk Akram ec6a4a4b5e git: Fix both-deleted conflicts being parsed as both-added (#66648)
## Summary

Closes #66628

`FileStatus::from_bytes` parsed the `DD` porcelain status ("unmerged,
both deleted") as `Added`/`Added`, the same as `AA`. The wrong value
went into `StatusEntry::to_proto` and from there to collaborators and
the `project_repository_statuses` table.

`DD` now parses as `Deleted`/`Deleted`. No code reads these heads to
decide behavior: consumers match on `Unmerged { .. }` or pass the value
through proto and the database, so nothing depended on the old mapping
and there is no UI change.

## Testing

Added `test_parse_unmerged_status_codes` in `crates/git/src/status.rs`,
which checks all seven unmerged codes (`DD`, `AU`, `UD`, `UA`, `DU`,
`AA`, `UU`). Before the fix it fails on `DD`:

```
assertion `left == right` failed: DD
  left: Unmerged(UnmergedStatus { first_head: Added, second_head: Added })
 right: Unmerged(UnmergedStatus { first_head: Deleted, second_head: Deleted })
```

To confirm that git produces this status, I renamed one file to
different names on two branches and merged them. `git status
--porcelain=v1 -z` reported `DD original.txt`, along with `AU main.txt`
and `UA side.txt`.

Run on macOS:

- `cargo test -p git` (79 passed)
- `cargo test -p project --test integration git_store` (43 passed)
- `./script/clippy -p git`
- `cargo fmt -p git --check`

I did not test this in the running app, since the change has no visible
effect there.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [ ] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist). (No UI
changes)
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-11-11 19:35:59 +00:00
..