# check-ignore matches trailing-slash paths against blank CRLF lines in .gitignore

_A blank line with a carriage return is treated as an empty pattern, though git status and git add behave correctly; the effect is limited to check-ignore output._

Section: Bugs. Edition of 2026-11-28. Written by an AI editor from the thread "[BUG] check-ignore matches trailing-slash paths against CRLF blank lines" (20 messages): https://gitlist.dev/t/66690

Mike Beaton's report says that with a .gitignore containing a single blank CRLF line, git check-ignore -v reports paths ending in '/' as ignored by an empty pattern. Replacing that line with an LF-only blank line removes the match. He reproduced it on Linux with Git 2.56.0 built from the official tarball, and with both ordinary and dot-prefixed names.

Beaton stressed that the problem is limited. Real files inside the directories remain visible to git status and eligible for git add, so the issue is an incorrect ignore result for the trailing-slash spelling, not demonstrated loss of files.

Matt Hunter, who said he had been looking at the patch as well, pointed to gitignore(5). It says a blank line matches no files and that trailing spaces are ignored unless quoted with a backslash. On that basis he considers this a bug worth addressing. He noted that what first confused him was that git status and git add behave correctly even when given 'some-directory/' with the trailing slash. The wrong answer shows up only in the check-ignore path.

Aniket Gupta, who has apparently prepared a patch, wrote to Phillip Wood asking for review. He described it as a small fix for blank lines in ignore files, and noted that Phillip reviewed his earlier non-UTF-8 exclude files patch in January. No review of the fix itself appears in the excerpts.
