From b92338bfb71aa39a37dd70ea6510fa60b9aff41c Mon Sep 17 00:00:00 2001 From: KellyMichels Date: Sun, 26 Jul 2026 13:00:29 -0500 Subject: [PATCH] fix(gitattributes): keep .bats files LF so 'bats tests/bash' works on a Windows checkout The LF rule was scoped to 'bash/**', which does not match tests/bash/. With core.autocrlf a Windows working copy got CRLF .bats files, and bats fails on them - so the command the README documents would not run on the machine the suite was written on without stripping \r first. Adds tests/bash/** and *.bats to the same eol=lf rule and renormalises. Verified by running 'bats tests/bash' with no sed preprocessing: 50/50. --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index 4dc0456..7ae3d52 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,12 @@ # Bash scripts must stay LF — CRLF breaks the shebang on Linux/macOS/WSL. bash/** text eol=lf +# The bats suites are bash too, and they live outside bash/ — without this a +# Windows checkout gets CRLF and `bats tests/bash` fails there (including when +# run through WSL against the Windows working copy). +tests/bash/** text eol=lf +*.bats text eol=lf + # PowerShell/cmd are happiest with CRLF on Windows. *.ps1 text eol=crlf *.cmd text eol=crlf