Skip to content

Commit ad9bfe0

Browse files
committed
Bump southwark version to simplify commit_changed_files
1 parent 3ef34d8 commit ad9bfe0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

repo_helper/cli/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
def commit_changed_files(
6161
repo_path: PathLike,
62-
managed_files: Iterable[str],
62+
managed_files: Iterable[PathLike],
6363
commit: Optional[bool] = None,
6464
message: bytes = b"Updated files with 'repo_helper'.",
6565
enable_pre_commit: bool = True,
@@ -91,13 +91,13 @@ def commit_changed_files(
9191
staged_files = []
9292

9393
for filename in managed_files:
94-
if filename.encode("UTF-8") in unstaged_changes or os.path.normpath(filename) in untracked_files:
95-
r.stage(filename)
94+
filename = PathPlus(filename)
95+
if filename in unstaged_changes or filename in untracked_files:
96+
r.stage(os.path.normpath(filename))
9697
staged_files.append(filename)
9798
elif (
98-
os.path.normpath(filename) in stat.staged["add"]
99-
or os.path.normpath(filename) in stat.staged["modify"]
100-
or os.path.normpath(filename) in stat.staged["delete"]
99+
filename in stat.staged["add"] or filename in stat.staged["modify"]
100+
or filename in stat.staged["delete"]
101101
):
102102
staged_files.append(filename)
103103

@@ -111,7 +111,7 @@ def commit_changed_files(
111111

112112
# Sort staged_files and put directories first
113113
for staged_filename in sort_paths(*staged_files):
114-
click.echo(f" {staged_filename!s}")
114+
click.echo(f" {os.path.normpath(staged_filename)!s}")
115115
click.echo()
116116

117117
if commit is None:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jinja2>=2.11.2
1212
packaging>=20.4
1313
pre-commit>=2.7.1
1414
ruamel.yaml>=0.16.12
15-
southwark>=0.3.0
15+
southwark>=0.4.0
1616
tomlkit>=0.7.0
1717
trove_classifiers>=2020.10.21
1818
typing_extensions>=3.7.4.3

0 commit comments

Comments
 (0)