Skip to content

Commit fac9106

Browse files
committed
Merge branch 'js/perl-path-workaround-in-tests'
* js/perl-path-workaround-in-tests: mingw: handle GITPERLLIB in t0021 in a Windows-compatible way
2 parents a466ef0 + 3306f65 commit fac9106

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

t/t0021/rot13-filter.pl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,22 @@
3131
#
3232

3333
use 5.008;
34-
use lib (split(/:/, $ENV{GITPERLLIB}));
34+
sub gitperllib {
35+
# Git assumes that all path lists are Unix-y colon-separated ones. But
36+
# when the Git for Windows executes the test suite, its MSYS2 Bash
37+
# calls git.exe, and colon-separated path lists are converted into
38+
# Windows-y semicolon-separated lists of *Windows* paths (which
39+
# naturally contain a colon after the drive letter, so splitting by
40+
# colons simply does not cut it).
41+
#
42+
# Detect semicolon-separated path list and handle them appropriately.
43+
44+
if ($ENV{GITPERLLIB} =~ /;/) {
45+
return split(/;/, $ENV{GITPERLLIB});
46+
}
47+
return split(/:/, $ENV{GITPERLLIB});
48+
}
49+
use lib (gitperllib());
3550
use strict;
3651
use warnings;
3752
use IO::File;

0 commit comments

Comments
 (0)