Skip to content

fix: show conflict markers in status diff view#2937

Open
leno23 wants to merge 1 commit into
gitui-org:masterfrom
leno23:fix/conflict-diff-2865
Open

fix: show conflict markers in status diff view#2937
leno23 wants to merge 1 commit into
gitui-org:masterfrom
leno23:fix/conflict-diff-2865

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

When a merge leaves unmerged paths, git2 reports Delta::Conflicted for diff_index_to_workdir, but diff.print(DiffFormat::Patch) emits no hunks. The status tab therefore showed an empty diff (incorrect file size only).

This change reuses the existing untracked-file path: build a patch from the on-disk worktree file so conflict markers (<<<<<<<, =======, >>>>>>>) are visible in the diff panel.

Test plan

Fixes #2865

Made with Cursor

libgit2 reports merge conflicts as Delta::Conflicted but does not emit
patch hunks via diff.print. Treat Conflicted like untracked files by
building a patch from the on-disk worktree so conflict markers appear
in the status diff view (gitui-org#2865).

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Conflicted File Missing Diff and Content in Conflict State

1 participant