Commit graph

6 commits

Author SHA1 Message Date
Chris Monardo 1ce2e915fb address comments 2026-04-11 07:45:04 -04:00
Masayuki Matsuki 8506f1f526
Return an error instead of logging it when failing to delete the worktree.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-11 16:59:05 +09:00
Chris Monardo 8a99bf1670 Make ghq rm worktree-aware
ghq rm previously used os.RemoveAll with no worktree awareness, which
caused two problems: removing a linked worktree left a dangling entry
in the parent repo's .git/worktrees/, and removing a repo that had
linked worktrees orphaned all of them.

Now ghq rm detects both scenarios:
- If the target is a linked worktree, use git worktree remove to
  properly unregister it from the parent repo.
- If the target repo has linked worktrees, prune each one before
  removing the main repo.

Extract shared worktree helpers into worktree.go so both cmd_rm.go
and cmd_migrate.go can reuse them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 02:57:37 -04:00
Zhizhen He 7dff4b0aa8 Update urfave/cli/v2 to v3 2026-03-19 14:16:12 +08:00
Songmu 913d312801 ghq rm to support bare option 2024-04-04 11:28:15 +09:00
Junya Okabe 6296da685a feat: impl cmd_rm.go 2024-01-26 09:45:07 +09:00