Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows fixes #231

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/filter-repo-demos/lint-history
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def lint_with_real_filenames(commit, metadata):
f.write(contents_plus_newline[:-1])

# Lint the file
subprocess.check_call(lint_args.command + [filename])
subprocess.check_call(lint_args.command + [filename.decode('utf-8')])

# Get the new contents
with open(filename, "rb") as f:
Expand Down
7 changes: 5 additions & 2 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,10 @@ class FilteringOptions(object):
if suffix.startswith('rename'):
mod_type = 'rename'
match_type = option_string[len('--path-rename-'):] or 'match'
values = values.split(b':', 1)
values = values.split(b':')
if len(values) != 2:
raise SystemExit(_("Error: --path-rename expects one colon in its"
" argument: <old_name:new_name>."))
if values[0] and values[1] and not (
values[0].endswith(b'/') == values[1].endswith(b'/')):
raise SystemExit(_("Error: With --path-rename, if OLD_NAME and "
Expand Down Expand Up @@ -1862,7 +1865,7 @@ EXAMPLES
"part of git history, historical versions of the file will "
"be ignored; only the current contents are consulted."))
people.add_argument('--use-mailmap', dest='mailmap',
action='store_const', const='.mailmap',
action='store_const', const=b'.mailmap',
help=_("Same as: '--mailmap .mailmap' "))

parents = parser.add_argument_group(title=_("Parent rewriting"))
Expand Down
9 changes: 8 additions & 1 deletion t/t9391-filter-repo-lib-usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ test_description='Usage of git-filter-repo as a library'
. ./test-lib.sh

# for git_filter_repo.py import
export PYTHONPATH=$(dirname $TEST_DIRECTORY):$PYTHONPATH
case "$(uname -s)" in
MINGW*|MSYS)
export PYTHONPATH=$(cygpath -am $TEST_DIRECTORY/..)\;$PYTHONPATH
;;
*)
export PYTHONPATH=$(dirname $TEST_DIRECTORY):$PYTHONPATH
;;
esac
# Avoid writing git_filter_repo.pyc file
export PYTHONDONTWRITEBYTECODE=1
export CONTRIB_DIR=$TEST_DIRECTORY/../contrib/filter-repo-demos
Expand Down