Am 28.04.2017 um 05:09 schrieb Junio C Hamano:
Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxxx> writes:
Commit cf9e55f494 ("submodule: prevent backslash expantion in submodule
names", 07-04-2017) added a test which creates a git repository with
some backslash characters in the name. This test cannot work on windows,
since the backslash is used as the directory separator. In order to
suppress this test on cygwin, MinGW and Git for Windows, we add the
BSLASHPSPEC prerequisite. (see also commits 6fd1106aa4 and c51c0da222).
First, let me say that meaning of BSLASHPSPEC was "keeps backslaches in
pathspec arguments" originally, but it apparently changed meaning since
then.
The prerequisite was introduced in 6fd1106aa4 because the MinGW port
rewrites backslashes in command arguments that undergo the '\'->"/"
transformation introduced for prefix_filename() in 25fe217b86. It
destroys the backslashes that could otherwise be used to escape globbing
characters. t3700 does just that.
Since Cygwin does not do this rewriting, the original CYGWIN section in
test-lib.sh had the prerequisite, just like the default (POSIX). But it
was removed by 5b5d53cbe5 (t4135-*.sh: Skip the "backslash" tests on
cygwin), and that is where BSLASHPSPEC changed meaning. That commit even
carries my Acked-by (!), even though I can't recall giving it and I
don't find it in the conversation about the patch:
https://public-inbox.org/git/4D07B977.9010502@xxxxxxxxxxxxxxxxxxx/
I built v2.13.0-rc1 and ran the test-suite on cygwin this evening and
had an additional failure, over and above the failures reported for
v2.13.0-rc0, namely t7400.20. This patch elides that test for cygwin
(and MinGW and GfW, so it would be good to hear success reports from
both Johannes).
t7400.20 does not fail for the MinGW port because the test case only
operates on the file system, but never checks whether an entry
'sub\with\backslash' is present in the index.
@@ -273,7 +273,7 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
test_cmp empty untracked
'
-test_expect_success 'submodule add with \\ in path' '
+test_expect_success BSLASHPSPEC 'submodule add with \\ in path' '
test_when_finished "rm -rf parent sub\\with\\backslash" &&
# Initialize a repo with a backslash in its name
I assume the test fails right at 'git init' under Cygwin?
BSLASHPSPEC (with its *new* meaning) would be the right prerequisite if
the check for the index entry were added. Until then, !CYGWIN is more
appropriate.
-- Hannes