Skip to content

Commit 0ed8ba3

Browse files
koronchrisbra
authored andcommitted
Always force LF line endings in old test .ok files
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>
1 parent 77a59be commit 0ed8ba3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.gitattributes

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
src/testdir/test42.in diff
22

3+
# The old test .ok files are expected to use LF line endings, even on Windows.
4+
# In src/testdir/Make_mvc.mak and src/testdir/Make_ming.mak, the test result
5+
# files .out are converted to LF line endings before being compared.
6+
# Therefore, if the .ok files' line endings are not specified and are
7+
# converted to CRLF, the comparison between .ok and .out will fail.
8+
src/testdir/test*.ok text eol=lf
9+
310
# `vim.pot` is updated every time any of the *.c files are modified. And as it
411
# contains line numbers for strings from *.c files, inserting a line into a
512
# single .c file may cause many lines in the `vim.pot` file to be updated.
@@ -24,7 +31,7 @@ src/po/vim.pot -diff
2431
src/po/vim.pot diff=ignore_vim_pot
2532

2633
# GitHub reacts to the `linguist-generated` attribute, by ignoring marked files
27-
# for the repository's language statistics and hiddning changes in these files
34+
# for the repository's language statistics and hiding changes in these files
2835
# by default in diffs.
2936
#
3037
# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,6 @@ jobs:
536536
# Show Windows version
537537
cmd /c ver
538538
539-
git config --global core.autocrlf input
540-
541539
if ${{ matrix.arch == 'x64' }}; then
542540
cygreg=registry
543541
pyreg=

0 commit comments

Comments
 (0)