Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-01-27 19:19:59 +0300
committerJunio C Hamano <gitster@pobox.com>2016-01-29 00:35:56 +0300
commitfd318a941d8bb7cc832412f26a25313121cc0d21 (patch)
treebbbe827176ec39a691e9da6d1bcd58c483379fbd /t/t9402-git-cvsserver-refs.sh
parentd53c2c67380f769f91fd45cc8c63a5883245ccca (diff)
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>
Diffstat (limited to 't/t9402-git-cvsserver-refs.sh')
-rwxr-xr-xt/t9402-git-cvsserver-refs.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index d00df08731..6d2d3c8739 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -82,11 +82,11 @@ perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
}
unset GIT_DIR GIT_CONFIG
-WORKDIR=$(pwd)
-SERVERDIR=$(pwd)/gitcvs.git
+WORKDIR=$PWD
+SERVERDIR=$PWD/gitcvs.git
git_config="$SERVERDIR/config"
CVSROOT=":fork:$SERVERDIR"
-CVSWORK="$(pwd)/cvswork"
+CVSWORK="$PWD/cvswork"
CVS_SERVER=git-cvsserver
export CVSROOT CVS_SERVER