libgit2sharp
libgit2sharp copied to clipboard
Add support for ZDiff3
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
ZDiff3option to theCheckoutFileConflictStrategyenum to support zealous diff3 conflict file formatting. - Introduced the corresponding internal checkout and merge flags (
GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3andGIT_MERGE_FILE_STYLE_ZDIFF3) to enable the new strategy at the core level. [1] [2] - Updated the mapping logic in
CheckoutStrategyFromFileConflictStrategyto handle the newZDiff3strategy.
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
CanSpecifyMergeConflictFileStrategyinMergeFixture.csto verify that the merge conflict file strategies (Merge,Diff3,ZDiff3) produce the expected file outputs.