]> git.ipfire.org Git - thirdparty/git.git/commit - t/t9402-git-cvsserver-refs.sh
mingw: work around pwd issues in the tests
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 27 Jan 2016 16:19:59 +0000 (17:19 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Jan 2016 21:35:56 +0000 (13:35 -0800)
commitfd318a941d8bb7cc832412f26a25313121cc0d21
treebbbe827176ec39a691e9da6d1bcd58c483379fbd
parentd53c2c67380f769f91fd45cc8c63a5883245ccca
mingw: work around pwd issues in the tests

In Git for Windows' SDK, the tests are run using a Bash that relies on
the POSIX emulation layer MSYS2 (itself a friendly fork of Cygwin). As
such, paths in tests can be POSIX paths. As soon as those paths are
passed to git.exe (which does *not* use the POSIX emulation layer),
those paths are converted into Windows paths, though. This happens
for command-line parameters, but not when reading, say, config variables.

To help with that, the `pwd` command is overridden to return the Windows
path of the current working directory when testing Git on Windows.

However, when talking to anything using the POSIX emulation layer, it is
really much better to use POSIX paths because Windows paths contain a
colon after the drive letter that will easily be mistaken for the common
separator in path lists.

So let's just use the $PWD variable when the POSIX path is needed.

This lets t7800-difftool.sh, t9400-git-cvsserver-server.sh,
t9402-git-cvsserver-refs.sh and t9401-git-cvsserver-crlf.sh pass in Git
for Windows' SDK.

Note: the cvsserver tests require not only the `cvs` package (install
it into Git for Windows' SDK via `pacman -S cvs`) but also the Perl
SQLite bindings (install them into Git for Windows' SDK via
`cpan DBD::SQLite`).

This patch is based on earlier work by 마누엘 and Karsten Blees.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7800-difftool.sh
t/t9400-git-cvsserver-server.sh
t/t9401-git-cvsserver-crlf.sh
t/t9402-git-cvsserver-refs.sh