git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Seymour <jon.seymour@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH js/submodule-relative] t7400: avoid path mangling issues
Date: Thu, 14 Jun 2012 23:11:45 +1000	[thread overview]
Message-ID: <CAH3AnrpCJwXNBOL75mBkfF69RK_TVUsnPx7m8reShR2g75bAWQ@mail.gmail.com> (raw)
In-Reply-To: <4FD9D4B3.9060805@viscovery.net>

On Thu, Jun 14, 2012 at 10:10 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> From: Johannes Sixt <j6t@kdbg.org>
>
> A recently introduced test uses an absolute path. But when run on Windows
> using the MSYS bash, such a path is mangled into a Windows style path when
> it is passed to 'git config'. The subsequent 'test' then compares the
> mangled path to the unmangled version and reports a failure.
>
> A path beginning with two slashes denotes a network directory
> (//server/share path) and is not mangled. Use that trick to side-step the
> issue. Just in case that 'git submodule init' regresses in such a way that
> it accesses the URL, use a path name that is unlikely to exist on POSIX
> systems, and that cannot be a server name on Windows.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  Sorry, Jon, Junio, for the resend. Forgot to Cc the list.
>
>  t/t7400-submodule-basic.sh | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index a899e6d..c73bec9 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -510,14 +510,19 @@ test_expect_success '../subrepo works with port-qualified URL - ssh://hostname:2
>        )
>  '
>
> -test_expect_success '../subrepo path works with local path - /foo/repo' '
> +# About the choice of the path in the next test:
> +# - double-slash side-steps path mangling issues on Windows
> +# - it is still an absolute local path
> +# - there cannot be a server with a blank in its name just in case the
> +#   path is used erroneously to access a //server/share style path
> +test_expect_success '../subrepo path works with local path - //somewhere else/repo' '
>        (
>                cd reltest &&
>                cp pristine-.git-config .git/config &&
>                cp pristine-.gitmodules .gitmodules &&
> -               git config remote.origin.url /foo/repo &&
> +               git config remote.origin.url "//somewhere else/repo" &&
>                git submodule init &&
> -               test "$(git config submodule.sub.url)" = /foo/subrepo
> +               test "$(git config submodule.sub.url)" = "//somewhere else/subrepo"
>        )
>  '
>
> --
> 1.7.11.rc3.1188.ga03e3fc

Thank you for the report and the test case.

jon.

      reply	other threads:[~2012-06-14 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 12:10 [PATCH js/submodule-relative] t7400: avoid path mangling issues Johannes Sixt
2012-06-14 13:11 ` Jon Seymour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH3AnrpCJwXNBOL75mBkfF69RK_TVUsnPx7m8reShR2g75bAWQ@mail.gmail.com \
    --to=jon.seymour@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).