Skip to content

Add support for ZDiff3 - #2171

Open
DustinTheDev wants to merge 1 commit into
libgit2:masterfrom
DustinTheDev:add-zdiff3
Open

Add support for ZDiff3#2171
DustinTheDev wants to merge 1 commit into
libgit2:masterfrom
DustinTheDev:add-zdiff3

Conversation

@DustinTheDev

@DustinTheDev DustinTheDev commented Sep 25, 2025

Copy link
Copy Markdown

This pull request adds support for the new ZDiff3 merge conflict file strategy in LibGit2Sharp addressing #1976, alongside updates to enable and test this functionality. The changes include extending enums and internal flags, updating the mapping logic, and introducing a new test repository and test case to verify the behavior.

Feature: ZDiff3 Conflict File Strategy Support

  • Added ZDiff3 option to the CheckoutFileConflictStrategy enum to support zealous diff3 conflict file formatting.
  • Introduced the corresponding internal checkout and merge flags (GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3 and GIT_MERGE_FILE_STYLE_ZDIFF3) to enable the new strategy at the core level. [1] [2]
  • Updated the mapping logic in CheckoutStrategyFromFileConflictStrategy to handle the new ZDiff3 strategy.

Testing: New Repository and Test Case

  • Added a new test repository (mergeconflict_testrepo_wd) and supporting files to facilitate testing of merge conflict scenarios with different file strategies.
  • Implemented a new test method CanSpecifyMergeConflictFileStrategy in MergeFixture.cs to verify that the merge conflict file strategies (Merge, Diff3, ZDiff3) produce the expected file outputs.
@DustinTheDev DustinTheDev changed the title Add support for ZDiff3 (#1976) Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant