Fix .gitattributes to only change line terminators on actual text files

This commit is contained in:
Yoann Rodière 2024-11-13 08:20:40 +01:00 committed by Steve Ebersole
parent b5221e2ec6
commit 70b85d5b4f
1 changed files with 17 additions and 1 deletions

18
.gitattributes vendored
View File

@ -1 +1,17 @@
* text eol=lf
# By default, detect text files automatically, and use whatever line terminators make sense for the OS
* text=auto
# Java files are text, and we want Java-friendly readable hunk headers for diff
*.java text diff=java
# Force LF/CRLF format for files that are known to require it.
*.sh text eol=lf
*.bat text eol=crlf
# For some reason the above is not enough, in particular for gradlew.bat,
# as some commands (git status, git add --renormalize) will still change its line endings to LF.
# So, we explicitly tell git not to mess with *.bat line endings.
# It's annoying as git won't show diffs for these files anymore,
# but that's the best I could come up with after an hour of head-scratching.
*.bat binary