Skip to content

Commit

Permalink
Bump southwark version to simplify commit_changed_files
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Nov 7, 2020
1 parent 3ef34d8 commit ad9bfe0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions repo_helper/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

def commit_changed_files(
repo_path: PathLike,
managed_files: Iterable[str],
managed_files: Iterable[PathLike],
commit: Optional[bool] = None,
message: bytes = b"Updated files with 'repo_helper'.",
enable_pre_commit: bool = True,
Expand Down Expand Up @@ -91,13 +91,13 @@ def commit_changed_files(
staged_files = []

for filename in managed_files:
if filename.encode("UTF-8") in unstaged_changes or os.path.normpath(filename) in untracked_files:
r.stage(filename)
filename = PathPlus(filename)
if filename in unstaged_changes or filename in untracked_files:
r.stage(os.path.normpath(filename))
staged_files.append(filename)
elif (
os.path.normpath(filename) in stat.staged["add"]
or os.path.normpath(filename) in stat.staged["modify"]
or os.path.normpath(filename) in stat.staged["delete"]
filename in stat.staged["add"] or filename in stat.staged["modify"]
or filename in stat.staged["delete"]
):
staged_files.append(filename)

Expand All @@ -111,7 +111,7 @@ def commit_changed_files(

# Sort staged_files and put directories first
for staged_filename in sort_paths(*staged_files):
click.echo(f" {staged_filename!s}")
click.echo(f" {os.path.normpath(staged_filename)!s}")
click.echo()

if commit is None:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jinja2>=2.11.2
packaging>=20.4
pre-commit>=2.7.1
ruamel.yaml>=0.16.12
southwark>=0.3.0
southwark>=0.4.0
tomlkit>=0.7.0
trove_classifiers>=2020.10.21
typing_extensions>=3.7.4.3
Expand Down

0 comments on commit ad9bfe0

Please sign in to comment.