mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ec4539550
commit
91ade25ba3
@@ -122,7 +122,7 @@ try:
|
||||
keep_refs = set()
|
||||
for worktree_line in worktree_data:
|
||||
if worktree_line.startswith("branch "):
|
||||
keep_refs.add(worktree_line[len("branch ") :])
|
||||
keep_refs.add(worktree_line.removeprefix("branch "))
|
||||
|
||||
delete_input = "".join(
|
||||
f"delete {refname}\n" for refname in matching_refs if refname not in keep_refs
|
||||
|
||||
Reference in New Issue
Block a user