Skip to content

Implement staging of conflict markers during merge operations#21

Merged
roble merged 3 commits into
mainfrom
dev
Jun 12, 2026
Merged

Implement staging of conflict markers during merge operations#21
roble merged 3 commits into
mainfrom
dev

Conversation

@roble

@roble roble commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces improved handling of merge conflicts by integrating Git index staging for conflicted files, ensuring that conflicts are properly surfaced in developer tools. It also adds comprehensive tests for this new behavior.

Merge conflict handling improvements:

  • Added a new protected method stageConflictInIndex to Installer.php that stages the three-way merge conflict versions (ours, base, theirs) in Git’s index, so conflicts are recognized by git status and editors like VSCode. This method degrades gracefully if Git is unavailable or the path is not in a repository.
  • Updated the merge logic in mergeStash to call stageConflictInIndex when a conflict is detected, ensuring the index is updated automatically.

Testing enhancements:

  • Added a public test shim callStageConflictInIndex to the test installer class for direct testing of the new method.
  • Introduced a new test test_stage_conflict_in_index_registers_git_conflict_stages that verifies all three conflict stages are correctly registered in the Git index during a merge conflict.
  • Added the necessary Process import to the test file.

@roble roble merged commit 7bb5728 into main Jun 12, 2026
2 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.

1 participant