Fix pofiles discovering logic in '--modified' option when files are renamed. (#86)
This commit is contained in:
parent
bed7e11f1e
commit
6eff8b9160
|
@ -121,14 +121,16 @@ def main():
|
||||||
"""Powrap main entrypoint (parsing command line and all)."""
|
"""Powrap main entrypoint (parsing command line and all)."""
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
if args.modified:
|
if args.modified:
|
||||||
git_status = check_output(["git", "status", "--porcelain"], encoding="utf-8")
|
git_status = check_output(
|
||||||
|
["git", "status", "--porcelain", "--no-renames"], encoding="utf-8"
|
||||||
|
)
|
||||||
git_status_lines = [
|
git_status_lines = [
|
||||||
line.split(maxsplit=2) for line in git_status.split("\n") if line
|
line.split(maxsplit=2) for line in git_status.split("\n") if line
|
||||||
]
|
]
|
||||||
args.po_files.extend(
|
args.po_files.extend(
|
||||||
Path(filename)
|
Path(filename)
|
||||||
for status, filename in git_status_lines
|
for status, filename in git_status_lines
|
||||||
if filename.endswith(".po")
|
if filename.endswith(".po") and status != "D"
|
||||||
)
|
)
|
||||||
if not args.po_files:
|
if not args.po_files:
|
||||||
print("Nothing to do, exiting.")
|
print("Nothing to do, exiting.")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user