Skip to content

fix: skip worktree listing in pure prune mode#3

Merged
rokuosan merged 2 commits into
masterfrom
fix-prune
Jun 15, 2026
Merged

fix: skip worktree listing in pure prune mode#3
rokuosan merged 2 commits into
masterfrom
fix-prune

Conversation

@rokuosan

@rokuosan rokuosan commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Overview

Make git wtclean --prune (without a delete option) only clean stale worktree metadata, instead of also listing active worktrees.

Previously, pure prune mode ran git worktree list and printed Would remove: <path> for every active worktree before pruning. Those entries were never actually removed, so the dry-run-style output was misleading next to the real git worktree prune action.

Changes

  • internal/wtclean/app.go
    • Skip listing active worktrees when --prune is used without -d/-D; only git worktree prune runs in that case.
    • Drop the unused found count from the prune summary (Done. prune_checked=… failed=…).
  • README.md
    • Document that --prune by itself does not inspect or remove active linked worktrees.

Notes

  • Other modes are unchanged: bare dry run, -d/-D, and -d --prune still list (and remove) worktrees as before.

Validation

  • go test ./...

@rokuosan rokuosan self-assigned this Jun 15, 2026
@rokuosan rokuosan merged commit b089792 into master Jun 15, 2026
2 checks passed
@rokuosan rokuosan deleted the fix-prune branch June 15, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant