libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Add support for ZDiff3

Open DustinTheDev opened this issue 3 months ago • 0 comments

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 avatar Sep 25 '25 12:09 DustinTheDev