Skip to content

Fix CRLF handling in Windows merge operations#10

Merged
ardiloot merged 1 commit intomainfrom
win-fix
Mar 21, 2026
Merged

Fix CRLF handling in Windows merge operations#10
ardiloot merged 1 commit intomainfrom
win-fix

Conversation

@ardiloot
Copy link
Copy Markdown
Owner

This pull request addresses newline normalization issues, particularly around CRLF/LF mismatches on Windows, by ensuring files are always read from git objects rather than the working copy. It also removes tests that specifically checked CRLF preservation, as this is now handled by the new approach. Additionally, test setup code is updated for consistency in newline handling.

The most important changes are:

Core logic improvements (newline normalization):

  • In pubgate/absorb.py, both _apply_absorb_changes and _merge_file now read "ours" content directly from git objects instead of the working copy, preventing CRLF/LF mismatches during merges on Windows. This ensures consistent behavior regardless of platform. [1] [2]

Test suite updates:

  • Test utility and fixture code in tests/conftest.py now consistently specifies newline="" when writing text files, ensuring test repositories have predictable line endings. [1] [2] [3]
  • CRLF-specific tests (TestAbsorbCRLF in tests/test_absorb.py and TestPublishCRLF in tests/test_publish.py) are removed, as the new implementation makes these tests redundant. [1] [2]…ge operations

@ardiloot ardiloot merged commit 41feb44 into main Mar 21, 2026
5 of 7 checks passed
@ardiloot ardiloot deleted the win-fix branch March 21, 2026 18:42
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