diff --git a/.github/workflows/code-simplifier.lock.yml b/.github/workflows/code-simplifier.lock.yml index b7f4eac8236..f2a91d33bee 100644 --- a/.github/workflows/code-simplifier.lock.yml +++ b/.github/workflows/code-simplifier.lock.yml @@ -1126,6 +1126,12 @@ jobs: run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" + # Preserve CRLF in patches during git am mailbox parsing. + # The repo uses '* -crlf' in .gitattributes, so files retain CRLF from Windows commits. + # git format-patch preserves CRLF in diff content, but git am's mailbox parser + # strips \r from all lines, causing context mismatch with the CRLF working tree. + # am.keepcr=true tells git-mailsplit to preserve \r, so CRLF diff matches CRLF files. + git config --global am.keepcr true # Re-authenticate git with GitHub token SERVER_URL_STRIPPED="${SERVER_URL#https://}" git remote set-url origin "https://x-access-token:${GIT_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"