]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
Always force LF line endings in old test .ok files
authorMuraoka Taro <koron.kaoriya@gmail.com>
Tue, 6 Jan 2026 10:30:09 +0000 (10:30 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 6 Jan 2026 10:36:03 +0000 (10:36 +0000)
Problem: When running tests on a source tree checked out with git for
Windows, the old tests fail.

The Git for Windows installer installs git with core.autocrlf=true by
default. If you check out, build, and run tests using such a git, the
old test .ok files will likely fail because they use CRLF line endings.
Tests on Windows assume that .ok files use LF line endings, and
appropriately convert the line endings of related files.  This
assumption breaks down when .ok files use CRLF.

Solution: Force LF line endings for old test .ok files in the
.gitattributes file.  Related to that, we've stopped explicitly
specifying line endings when checking out in CI, since this is no longer
necessary.

While at it, also fix a typo in the comment of the gitattributes file.

closes: #19086

Signed-off-by: Muraoka Taro <koron.kaoriya@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.gitattributes
.github/workflows/ci.yml

index bad1d9edb29c762e8f127e3f4c77bf0da49e0870..15ba03f3ebd4e46931d871959b4aca8dada2a2d0 100644 (file)
@@ -1,5 +1,12 @@
 src/testdir/test42.in diff
 
+# The old test .ok files are expected to use LF line endings, even on Windows.
+# In src/testdir/Make_mvc.mak and src/testdir/Make_ming.mak, the test result
+# files .out are converted to LF line endings before being compared.
+# Therefore, if the .ok files' line endings are not specified and are
+# converted to CRLF, the comparison between .ok and .out will fail.
+src/testdir/test*.ok text eol=lf
+
 # `vim.pot` is updated every time any of the *.c files are modified.  And as it
 # contains line numbers for strings from *.c files, inserting a line into a
 # single .c file may cause many lines in the `vim.pot` file to be updated.
@@ -24,7 +31,7 @@ src/po/vim.pot -diff
 src/po/vim.pot diff=ignore_vim_pot
 
 # GitHub reacts to the `linguist-generated` attribute, by ignoring marked files
-# for the repository's language statistics and hiddning changes in these files
+# for the repository's language statistics and hiding changes in these files
 # by default in diffs.
 #
 # https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github
index a3f2c81c9946e966240cbec2db87dd38811456f7..b1faa027370ab66ca89f9d7aea4ab540fb12628f 100644 (file)
@@ -536,8 +536,6 @@ jobs:
           # Show Windows version
           cmd /c ver
 
-          git config --global core.autocrlf input
-
           if ${{ matrix.arch == 'x64' }}; then
             cygreg=registry
             pyreg=