wip: feat: workspace tmux remove

This commit is contained in:
Waylon Walker 2025-11-26 10:55:28 -06:00
parent 0bdfb253ef
commit 7b1a33414a
2 changed files with 3 additions and 5 deletions

View file

@ -79,7 +79,7 @@ select = [
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
# "INT", # flake8-gettext
# "ARG", # flake8-unused-arguments
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PD", # pandas-vet

View file

@ -676,7 +676,7 @@ def find_repo_for_worktree(worktree_path: Path, repos_dir: Path) -> Optional[Pat
return None
def has_unpushed_commits(repo_path: Path, branch: str) -> bool:
def has_unpushed_commits(repo_path: Path) -> bool:
"""
Detect if branch has commits not on its upstream.
Uses 'git rev-list @{u}..HEAD'; if non-empty, there are unpushed commits.
@ -839,7 +839,7 @@ def remove_workspace(
# Only care about "unpushed commits" if the branch is NOT integrated into main.
if repo is not None and branch != "?" and not integrated:
if has_unpushed_commits(wt, branch):
if has_unpushed_commits(wt):
problems.append(f"{wt.name}: unpushed commits on '{branch}'")
if problems and not force:
console.print(
@ -1563,7 +1563,6 @@ def tmux_cli_attach(
@tmux_app.command("list-sessions")
def tmux_cli_list_sessions(
ctx: typer.Context,
workspace: Optional[str] = typer.Option(
None,
"--workspace",
@ -1591,7 +1590,6 @@ def tmux_cli_list_sessions(
@tmux_app.command("remove")
def tmux_cli_remove(
ctx: typer.Context,
workspace: Optional[str] = typer.Option(
None,
"--workspace",