Skip to content

wt switch pr:xx on a fork does not look at the default repo #2002

Closed

Description

@JustinPierce

Gist

Diagnostic Log

Description

As of v0.35, worktrunk now provides a more helpful message when a PR is not found, suggesting that the user set the default for the repository. However, even if this default is set, worktrunk will not actually make use of it. The logs suggest that worktrunk identifies the potential issue when it cannot find the PR, but doesn't check the default repo after that.

Activity

  1. added a commit that references this issue on Apr 8, 2026
    e18ad67
  2. worktrunk-bot commented on Apr 8, 2026

    @worktrunk-bot
    Collaborator

    Thanks for reporting this! I was able to reproduce the issue and identified the root cause: fetch_pr_info only queried the primary remote (origin) for the PR, ignoring the gh repo set-default configuration entirely — the hint in the error message was misleading.

    I've opened #2004 with a fix. wt switch pr:N now checks gh repo set-default --view first and uses that repo for the API call, falling back to the primary remote when no default is set. A maintainer will review it shortly.

  3. max-sixty commented on Apr 8, 2026

    @max-sixty
    Owner

    thanks a lot @JustinPierce ! sorry for the trouble

  4. JustinPierce commented on Apr 8, 2026

    @JustinPierce
    Author

    thanks a lot @JustinPierce ! sorry for the trouble

    Don't apologize for making my team's adjustment to worktrees easier! We really appreciate the work you've done, here.

  5. max-sixty commented on Apr 8, 2026

    @max-sixty
    Owner

    anytime! keep the issues coming!

  6. JustinPierce commented on Apr 9, 2026

    @JustinPierce
    Author

    Got the update. Confirmed working. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions