mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
904e03f963
It appears that in addition to Windows requiring cwd be a string (and not a bytestring), it also requires the command line arguments to be unicode strings. This appears to be a python-on-Windows issue at the surface (attempts to quote things that assumes the arguments are all strings), but whether it's solely a python-on-Windows issue or there is also a deeper Windows issue, we can workaround this brain-damage by extending the SubprocessWrapper slightly. As with the cwd changes, only apply this on Windows and not elsewhere because there are perfectly legitimate reasons to pass non-unicode parameters (e.g. filenames that are not valid unicode). Signed-off-by: Elijah Newren <newren@gmail.com>
32 lines
735 B
Bash
Executable File
32 lines
735 B
Bash
Executable File
#!/bin/bash
|
|
|
|
orig_dir=$(cd $(dirname $0) && pwd -P)
|
|
tmpdir=$(mktemp -d)
|
|
|
|
cat <<EOF >$tmpdir/.coveragerc
|
|
[run]
|
|
parallel=true
|
|
data_file=$tmpdir/.coverage
|
|
EOF
|
|
|
|
cat <<EOF >$tmpdir/sitecustomize.py
|
|
import coverage
|
|
coverage.process_startup()
|
|
EOF
|
|
|
|
export COVERAGE_PROCESS_START=$tmpdir/.coveragerc
|
|
export PYTHONPATH=$tmpdir:
|
|
# We pretend filenames are unicode for two reasons: (1) because it exercises
|
|
# more code, and (2) this setting will detect accidental use of unicode strings
|
|
# for file/directory names when it should always be bytestrings.
|
|
export PRETEND_UNICODE_ARGS=1
|
|
|
|
ls t939*.sh | xargs -n 1 bash
|
|
|
|
cd $tmpdir
|
|
python3-coverage combine
|
|
python3-coverage html -d $orig_dir/report
|
|
python3-coverage report -m
|
|
cd $orig_dir
|
|
rm -rf $tmpdir
|