Skip to content

Commit e0a3df8

Browse files
dschonewren
authored andcommitted
Fix the Python path on Windows
On Windows, we want to run with a native Python, i.e. the separator is a semicolon, and the paths should be Windows paths (although they're allowed to have forward slashes instead of backslashes). Since we're most likely running this in an MSYS2 Bash, allow for `$TEST_DIRECTORY` to pretend to be a Unix path, and translate it via `cygpath` into a Windows path. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent cf84943 commit e0a3df8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/t9391-filter-repo-lib-usage.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ test_description='Usage of git-filter-repo as a library'
44
. ./test-lib.sh
55

66
# for git_filter_repo.py import
7-
export PYTHONPATH=$(dirname $TEST_DIRECTORY):$PYTHONPATH
7+
case "$(uname -s)" in
8+
MINGW*|MSYS)
9+
export PYTHONPATH=$(cygpath -am $TEST_DIRECTORY/..)\;$PYTHONPATH
10+
;;
11+
*)
12+
export PYTHONPATH=$(dirname $TEST_DIRECTORY):$PYTHONPATH
13+
;;
14+
esac
815
# Avoid writing git_filter_repo.pyc file
916
export PYTHONDONTWRITEBYTECODE=1
1017
export CONTRIB_DIR=$TEST_DIRECTORY/../contrib/filter-repo-demos

0 commit comments

Comments
 (0)