]> git.ipfire.org Git - thirdparty/git.git/commit - dir.c
dir: allow a BOM at the beginning of exclude files
authorCarlos Martín Nieto <cmn@elego.de>
Thu, 16 Apr 2015 14:05:12 +0000 (16:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Apr 2015 17:17:04 +0000 (10:17 -0700)
commit245e1c196dab226675a02a8caca5a83373f5e4d4
tree16a1586a6baed9c7d4203f6a5f9ce5c8efc876c7
parentfdf96a20acf96a6ac538df8113b2aafd6ed71d50
dir: allow a BOM at the beginning of exclude files

Some text editors like Notepad or LibreOffice write an UTF-8 BOM in
order to indicate that the file is Unicode text rather than whatever the
current locale would indicate.

If someone uses such an editor to edit a gitignore file, we are left
with those three bytes at the beginning of the file. If we do not skip
them, we will attempt to match a filename with the BOM as prefix, which
won't match the files the user is expecting.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
t/t7061-wtstatus-ignore.sh