Commit graph

6 commits

Author SHA1 Message Date
nurazon59 b9fd98e162 fix(test): run ghq rm dry-run test cases 2026-04-18 22:10:56 +09:00
nurazon59 9201500760 fix(test): add testcase and fix testcase 2026-04-16 01:13:35 +09:00
nurazon59 f6b96648d8 fix(test): Fix rm command tests to exercise command execution 2026-04-16 01:04:35 +09:00
Chris Monardo 1ce2e915fb address comments 2026-04-11 07:45:04 -04: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
Junya Okabe 3cf46d3a4f feat: add unit test 2024-01-26 17:24:59 +09:00