`gh pr status` shows 'no pull request associated' on a branch pulled via `gh pr checkout` from a fork
Describe the bug
gh pr status seems to have trouble identifying PR if current branch is from a fork.
Steps to reproduce the behavior
I was trying to review and merge Frederick888/external-editor-revived#37 locally.
$ gh pr checkout 37 From https://github.com/Frederick888/external-editor-revived * [new ref] refs/pull/37/head -> rlcintra/master Switched to branch 'rlcintra/master' $ git remote -v origin https://github.com/Frederick888/external-editor-revived.git (fetch) origin git@github.com:Frederick888/external-editor-revived.git (push) $ cat .git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://github.com/Frederick888/external-editor-revived.git fetch = +refs/heads/*:refs/remotes/origin/* gh-resolved = base pushurl = git@github.com:Frederick888/external-editor-revived.git [branch "master"] remote = origin merge = refs/heads/master [branch "rlcintra/master"] remote = git@github.com:rlcintra/external-editor-revived.git pushRemote = git@github.com:rlcintra/external-editor-revived.git merge = refs/heads/master
^ All these looked normal, but
$ gh pr status Relevant pull requests in Frederick888/external-editor-revived Current branch There is no pull request associated with [rlcintra:rlcintra/master] Created by you You have no open pull requests Requesting a code review from you You have no pull requests to review $ gh pr status --json number,baseRefName,headRefName,headRepositoryOwner { "createdBy": [], "needsReview": [] }
Expected vs actual behavior
gh pr status returns info about Frederick888/external-editor-revived#37
Perhaps if a user adds a remote for the fork then fetches everything manually, it's ok for gh-cli to not be able to identify such branches; but if it's pulled via gh pr checkout, I'd expect gh pr status to report correct info.