Skip to content

fix(status): recognize all unmerged modes when staging/discarding, not just UU#1980

Merged
CKolkey merged 1 commit into
NeogitOrg:masterfrom
dmbhatti:fix/stage-unmerged-conflict-modes
Jul 9, 2026
Merged

fix(status): recognize all unmerged modes when staging/discarding, not just UU#1980
CKolkey merged 1 commit into
NeogitOrg:masterfrom
dmbhatti:fix/stage-unmerged-conflict-modes

Conversation

@dmbhatti

@dmbhatti dmbhatti commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Staging (s) or discarding a conflicted file only routed to the conflict resolver when the file's status mode was exactly "UU" (both modified). Other unmerged modes were missed -- most notably "AA" (add/add, produced whenever two branches independently add the same path) and the modify/delete modes "UD"/"DU". For those, s fell through to the plain "stage this file" branch and staged the file with its conflict markers intact, so leftover <<<<<<</=======/>>>>>>> markers could be committed unnoticed.

Add a single git.status.is_unmerged(mode) helper covering the full set of unmerged porcelain codes (UU, AA, DU, UD, AU, UA, DD) and route every conflict-detection site through it: normal stage, visual-selection stage, discard hunk/section/file, the diffview conflicting/working split (which was also missing DD), and any_unmerged.

…t just UU

Staging (`s`) or discarding a conflicted file only routed to the conflict
resolver when the file's status mode was exactly "UU" (both modified).
Other unmerged modes were missed -- most notably "AA" (add/add, produced
whenever two branches independently add the same path) and the
modify/delete modes "UD"/"DU". For those, `s` fell through to the plain
"stage this file" branch and staged the file with its conflict markers
intact, so leftover `<<<<<<<`/`=======`/`>>>>>>>` markers could be
committed unnoticed.

Add a single `git.status.is_unmerged(mode)` helper covering the full set
of unmerged porcelain codes (UU, AA, DU, UD, AU, UA, DD) and route every
conflict-detection site through it: normal stage, visual-selection stage,
discard hunk/section/file, the diffview conflicting/working split (which
was also missing DD), and any_unmerged.
@CKolkey CKolkey merged commit 2408e39 into NeogitOrg:master Jul 9, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants