Skip to content

Commit

Permalink
t9200: skip tests when $PWD contains a colon
Browse files Browse the repository at this point in the history
On Windows, the current working directory is pretty much guaranteed to
contain a colon. If we feed that path to CVS, it mistakes it for a
separator between host and port, though.

This has not been a problem so far because Git for Windows uses MSYS2's
Bash using a POSIX emulation layer that also pretends that the current
directory is a Unix path (at least as long as we're in a shell script).

However, that is rather limiting, as Git for Windows also explores other
ports of other Unix shells. One of those is BusyBox-w32's ash, which is
a native port (i.e. *not* using any POSIX emulation layer, and certainly
not emulating Unix paths).

So let's just detect if there is a colon in $PWD and punt in that case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 18, 2024
1 parent 14c9d27 commit 3c78f25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/t9200-git-cvsexportcommit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ if ! test_have_prereq PERL; then
test_done
fi

case "$PWD" in
*:*)
skip_all='cvs would get confused by the colon in `pwd`; skipping tests'
test_done
;;
esac

cvs >/dev/null 2>&1
if test $? -ne 1
then
Expand Down

0 comments on commit 3c78f25

Please sign in to comment.