Johannes Sixt [off-list ref] writes:
Am 3/5/2014 1:10, schrieb Junio C Hamano:
quoted
* nd/gitignore-trailing-whitespace (2014-02-10) 2 commits
- dir: ignore trailing spaces in exclude patterns
- dir: warn about trailing spaces in exclude patterns
Warn and then ignore trailing whitespaces in .gitignore files,
unless they are quoted for fnmatch(3), e.g. "path\ ".
Will merge to 'next'.
The new test does not pass on Windows.
Thanks, will mark not to merge to 'master' yet.
From: Johannes Sixt <redacted>
The Windows API does not preserve file names with trailing spaces (and
dots), but rather strips them. Our tools (MSYS bash, git) base the POSIX
emulation on the Windows API. As a consequence, it is impossible for bash
on Windows to allocate a file whose name has trailing spaces, and for git
to stat such a file. Both operate on a file whose name has the spaces
stripped. Skip the test that needs such a file name.
Note that we do not use (another incarnation of) prerequisite FUNNYNAMES.
The reason is that FUNNYNAMES is intended to represent a property of the
file system. But the inability to have trailing spaces in a file name is
a property of the Windows API. The file system (NTFS) does not have this
limitation.
Signed-off-by: Johannes Sixt <redacted>
---
t/t0008-ignores.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index bbaf6b5..63beb99 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -793,7 +793,7 @@ EOF
test_cmp err.expect err
'
-test_expect_success 'quoting allows trailing whitespace' '
+test_expect_success !MINGW 'quoting allows trailing whitespace' '
rm -rf whitespace &&
mkdir whitespace &&
>"whitespace/trailing " &&
--
1.9.0.1534.ga05fa03