You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix[apply-patch]: preserve original CRLF/LF line endings on text updates
Context:
* Windows edits sometimes flipped CRLF files to LF or created mixed endings.
Change:
* Detect the original file EOL (treat any \r\n as CRLF; else LF) and normalize the final text to match only for Update File writes.
* Added small helper (detect_eol/normalize_to_eol) and a single call at the final write site.
* Added focused tests to verify CRLF/LF preservation.
Risk:
* Minimal and localized. Only affects the text update write path; binary paths and new-file adds are unchanged.
Tests:
* cargo fmt
* cargo clippy -p codex-apply-patch -- -D warnings (clean)
* cargo test -p codex-apply-patch (all tests passed; includes new EOL tests)
Verification:
* Verified on local runs that updating CRLF files preserves CRLF and LF files preserve LF. New-file behavior remains unchanged.
0 commit comments