git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] t7400: add !CYGWIN prerequisite to 'add with \\ in path'
@ 2017-04-30 17:29 Ramsay Jones
  2017-05-01  2:03 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2017-04-30 17:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, Johannes Schindelin, GIT Mailing-list


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. On windows, where the backslash
character is a directory separator, it is not possible to create a
repository with the name 'sub\with\backslash'. (The NTFS filesystem would
probably allow it, but the win32 api does not). The MinGW and Git for
Windows versions of git actually create a repository called 'backslash'
in the sub-directory 'sub/with'.

On cygwin, however, due to the slightly schizophrenic treatment of the
backslash character by cygwin-git, this test fails at the 'git init'
stage. The git-init command does not recognise the directory separators
in the input path (eg. is_dir_sep('\\') is false), so it does not
attempt to create the leading directories 'sub/with'. (The call to
mkdir('sub\\with\\backslash') actually does recognise the directory
separators, but fails because the 'sub/with' directory doesn't exist).

In order to suppress the test failure (for now), add the !CYGWIN test
prerequisite.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Junio,

This is the 'v2' re-roll of the 'BSLASHPSEC' patch. :-D

ATB,
Ramsay Jones

 t/t7400-submodule-basic.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index c2706fe47..d0357f1d8 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -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 !CYGWIN 'submodule add with \\ in path' '
 	test_when_finished "rm -rf parent sub\\with\\backslash" &&
 
 	# Initialize a repo with a backslash in its name
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] t7400: add !CYGWIN prerequisite to 'add with \\ in path'
  2017-04-30 17:29 [PATCH v2] t7400: add !CYGWIN prerequisite to 'add with \\ in path' Ramsay Jones
@ 2017-05-01  2:03 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-05-01  2:03 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Johannes Sixt, Johannes Schindelin, GIT Mailing-list

Ramsay Jones <ramsay@ramsayjones.plus.com> 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. On windows, where the backslash
> character is a directory separator, it is not possible to create a
> repository with the name 'sub\with\backslash'. (The NTFS filesystem would
> probably allow it, but the win32 api does not). The MinGW and Git for
> Windows versions of git actually create a repository called 'backslash'
> in the sub-directory 'sub/with'.
>
> On cygwin, however, due to the slightly schizophrenic treatment of the
> backslash character by cygwin-git, this test fails at the 'git init'
> stage. The git-init command does not recognise the directory separators
> in the input path (eg. is_dir_sep('\\') is false), so it does not
> attempt to create the leading directories 'sub/with'. (The call to
> mkdir('sub\\with\\backslash') actually does recognise the directory
> separators, but fails because the 'sub/with' directory doesn't exist).
>
> In order to suppress the test failure (for now), add the !CYGWIN test
> prerequisite.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Junio,
>
> This is the 'v2' re-roll of the 'BSLASHPSEC' patch. :-D
>

Thanks.


> ATB,
> Ramsay Jones
>
>  t/t7400-submodule-basic.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index c2706fe47..d0357f1d8 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -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 !CYGWIN 'submodule add with \\ in path' '
>  	test_when_finished "rm -rf parent sub\\with\\backslash" &&
>  
>  	# Initialize a repo with a backslash in its name

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-01  2:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-30 17:29 [PATCH v2] t7400: add !CYGWIN prerequisite to 'add with \\ in path' Ramsay Jones
2017-05-01  2:03 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).