aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-01-10 14:01:31 -0800
committerJunio C Hamano <gitster@pobox.com>2018-01-10 14:01:31 -0800
commitfac910641a3795a7a6a5b5d4fb51719ea96d159c (patch)
tree49e34be9c5015fc6ccff85cebe28540b64c34d7e
parenta466ef018ee9106f6e5b6247f32e7f1fb6a25577 (diff)
parent3306f6524d32e90d2e71648fea7c6e156250f903 (diff)
downloadgit-fac910641a3795a7a6a5b5d4fb51719ea96d159c.tar.gz
git-fac910641a3795a7a6a5b5d4fb51719ea96d159c.tar.xz
Merge branch 'js/perl-path-workaround-in-tests'
* js/perl-path-workaround-in-tests: mingw: handle GITPERLLIB in t0021 in a Windows-compatible way
-rw-r--r--t/t0021/rot13-filter.pl17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index f1678851d..470107248 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -31,7 +31,22 @@
#
use 5.008;
-use lib (split(/:/, $ENV{GITPERLLIB}));
+sub gitperllib {
+ # Git assumes that all path lists are Unix-y colon-separated ones. But
+ # when the Git for Windows executes the test suite, its MSYS2 Bash
+ # calls git.exe, and colon-separated path lists are converted into
+ # Windows-y semicolon-separated lists of *Windows* paths (which
+ # naturally contain a colon after the drive letter, so splitting by
+ # colons simply does not cut it).
+ #
+ # Detect semicolon-separated path list and handle them appropriately.
+
+ if ($ENV{GITPERLLIB} =~ /;/) {
+ return split(/;/, $ENV{GITPERLLIB});
+ }
+ return split(/:/, $ENV{GITPERLLIB});
+}
+use lib (gitperllib());
use strict;
use warnings;
use IO::File;