Add Entire Trail Checkout Command

similar to https://entire.io/gh/entireio/cli/trails/604/add-entire-trail-merge-subcommand: add a new entire trail checkout command which checks out a specified trail - since this by definition requires some trail name, id, branch etc. this should have the --trail parameter or first argument after "checkout" as specifier of which trail to check out - it shall try to find the branch name of the trail in the repo and check it out.
the command should only work from within a clone of the repo that the trail belongs to naturally
PR created: https://github.com/entireio/cli/pull/1483
I committed only the two feature files (trail_cmd.go and the new trail_checkout_cmd_test.go) and deliberately left the unrelated .claude/settings.json churn out of the commit — it was already modified at session start and isn't part of this feature. It remains uncommitted in your working tree.
The PR adds entire trail checkout with the --trail/first-arg specifier (number, id, or branch), naturally scoped to the current clone's repo via the origin remote, reusing the existing branch-switch helper and the extracted resolveTrailBySelector.
Pushed to PR #1483. I addressed all three findings from the Cursor and Copilot reviews:
-
Empty-branch error misidentifies trail (Cursor + Copilot) — changed the error to use
describeTrailRef(found)instead offound.Title, so a numbered trail with no title now readstrail #575 has no branch to check outrather thantrail "" has no branch to check out. -
Silent exit on declined fetch (Copilot) — split the
err/!proceedhandling so that when the user declines fetching a remote-only branch, the command now prints an explicitCheckout of branch X cancelled.line, instead of leaving the earlier "Checking out …" line looking like a successful switch. -
Parallel subtest loop-variable capture (Copilot) — this was technically a false positive under Go 1.26's per-iteration loop semantics, but I copied the input into a local (
in := tc.in) before taking its address, removing any ambiguity. Note I deliberately used a field copy rather thantc := tc, which thecopyloopvarlinter would have rejected as redundant.
mise run fmt, mise run lint (0 issues), and the scoped tests all pass.