Skip to content

fix: use item.name instead of escaped_path in merge conflict check#1956

Open
dmbhatti wants to merge 1 commit into
NeogitOrg:masterfrom
dmbhatti:fix/merge-conflict-staging-escaped-path
Open

fix: use item.name instead of escaped_path in merge conflict check#1956
dmbhatti wants to merge 1 commit into
NeogitOrg:masterfrom
dmbhatti:fix/merge-conflict-staging-escaped-path

Conversation

@dmbhatti
Copy link
Copy Markdown

@dmbhatti dmbhatti commented May 8, 2026

escaped_path is fnamemodify(absolute_path, ":~:."), which is relative to Vim's CWD. Git commands run with worktree_root as CWD. When neogit is opened with cwd=%:p:h pointing to a subdirectory, is_conflicted() receives a path relative to the wrong directory, git diff --check finds nothing, exits 0, and diffview never opens — showing the staging notification instead.

Use item.name (from git status output, already relative to git root) consistent with every other is_conflicted call in this function.

Fixes d93d781

escaped_path is fnamemodify(absolute_path, ":~:."), which is relative
to Vim's CWD. Git commands run with worktree_root as CWD. When neogit
is opened with cwd=%:p:h pointing to a subdirectory, is_conflicted()
receives a path relative to the wrong directory, git diff --check finds
nothing, exits 0, and diffview never opens — showing the staging
notification instead.

Use item.name (from git status output, already relative to git root)
consistent with every other is_conflicted call in this function.
@dmbhatti dmbhatti force-pushed the fix/merge-conflict-staging-escaped-path branch from 7728ee3 to 0d69297 Compare May 16, 2026 19:20
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.

1 participant