Skip to content

Commit 0a3cc9f

Browse files
author
GitHub Almighty
committed
Apply "unix2dos" to patch files on Windows when applying
Apparently git is touchy to line endings on Windows while applying patches, so we will just modify them in place on windows to guarantee correct ending
1 parent d073ee3 commit 0a3cc9f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/tools/apply-patches

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ git config --global user.name "GitHub Almighty"
1717
find "$patches_dir" -type f '!' -name '.*' -print | sort | while read -r patchfile
1818
do
1919
echo "[INFO] Applying patch $patchfile"
20+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then # Check if on Windows (adjust as needed)
21+
unix2dos "$1" # Convert to CRLF on Windows
22+
fi
2023
# Test whether the patch has already been applied by seeing if it can be
2124
# applied in reverse
2225
if git apply -R --check "$patchfile"

0 commit comments

Comments
 (0)