From d317e4384acd5646f2ba44197a531c129b26b57e Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Wed, 2 Nov 2005 14:05:45 +0100 Subject: remove CR/LF from .gitignore For everyone cursed by dos/windows line endings (aka CRLF): The code reading the .gitignore files (excludes and excludes per directory) leaves \r in the patterns, which causes fnmatch to fail for no obvious reason. Just remove a "\r" preceding a "\n" unconditionally. Signed-off-by: Junio C Hamano --- t/t3001-ls-files-others-exclude.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh index 5beaaa3375..fde2bb25fa 100755 --- a/t/t3001-ls-files-others-exclude.sh +++ b/t/t3001-ls-files-others-exclude.sh @@ -67,4 +67,16 @@ test_expect_success \ >output && diff -u expect output' +# Test \r\n (MSDOS-like systems) +echo -ne '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore + +test_expect_success \ + 'git-ls-files --others with \r\n line endings.' \ + 'git-ls-files --others \ + --exclude=\*.6 \ + --exclude-per-directory=.gitignore \ + --exclude-from=.git/ignore \ + >output && + diff -u expect output' + test_done -- cgit v1.2.3