You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Switching to PR branches (forks) no longer works #4842
Selecting a pull request under the "Current Branch" menu used to stash changes and check out the PR locally. In the case of a PR that was opened against a fork (rather than a direct branch), GitHub Desktop used to create a new remote usually prefixed with github-desktop-xxxxx.
In the two most recent (stable) releases, the functionality to switch to PR branches silently fails with no change in the UI nor any visible errors in the logs.
Shown below is my selection of a PR hosted on GitHub (in a private repository) where the selection (via mouse click) closes the menu but results in no branch switch:
Version
GitHub Desktop: 1.2.x (occurs in 1.2.2 and 1.2.1)
Operating system: MacOS 10.13.4
Steps to Reproduce
Add a local repository
Create a pull request where the PR originates in a fork (not a branch of the repository)
Use GitHub Desktop to view and checkout this PR
Expected Behavior
PRs originating from forks are available for local checkout (pull)
Actual Behavior
PRs originating from forks are not available for local checkout (pull)
I'm getting this across all repositories -- I have tried this with multiple PRs in each repository. Switching to other local branches works as expected.
However, GitHub Desktop does several steps to check out a forked PR (thanks for that!) and none of those seem to be working any longer.
@MasterXen do you recall if this worked with 1.2.0? I ask because this PR #4240 might have been responsible for a change in behaviour.
From the details I've gleaned from your issue it's a private repository, so the PRs are probably coming from local branches, so maybe if 1.2.0 is also affected we need to revert that change and revisit it.
EDIT: one other thing to help with this theory - can run a git remote for this repository, attach the names to this issue and indicate which one is your default remote? Maybe something with our lookup code isn't handling your setup correctly.
EDIT 2: argh, I missed the mentions that these PRs are coming from forks and not local branches. Apologies.
I too am unable to pull/checkout any remote PRs on any repositories. Already pulled PRs are available for chekout in the branch tab. Also if i add fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to [remote "origin"] in .git\config to pull all PRs on fetch then all of them are available for chekout in the branch tab.
Console output:
exception_0: Uncaught (in promise) ReferenceError: i is not defined at t.AppStore._checkoutPullRequest (renderer.js:17) at t.Dispatcher.checkoutPullRequest (renderer.js:17) at Object.onPullRequestClicked.e [as onItemClick] (renderer.js:17) at Object.onItemClick.e [as onItemClick] (renderer.js:17) at Object.onRowClick.e [as onRowClick] (renderer.js:12) at Object.onRowClick (renderer.js:17) at onRowClick.e (renderer.js:17) at Object.<anonymous> (renderer.js:25) at Object.invokeGuardedCallback (renderer.js:25) at Object.invokeGuardedCallbackAndCatchFirstError (renderer.js:25)
exception_1: Uncaught (in promise) ReferenceError: i is not defined at t.AppStore._checkoutPullRequest (app-store.ts:3650) at t.Dispatcher.checkoutPullRequest (dispatcher.ts:1141) at Object.onPullRequestClicked.e [as onItemClick] (branches-container.tsx:237) at Object.onItemClick.e [as onItemClick] (pull-request-list.tsx:191) at Object.onRowClick.e [as onRowClick] (filter-list.tsx:340) at Object.onRowClick (list.tsx:909) at onRowClick.e (list-row.tsx:52) at Object.<anonymous> (react-dom.production.min.js:15) at Object.invokeGuardedCallback (react-dom.production.min.js:16) at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)
This problem was not present on version 1.2.0. I skipped over 1.2.1 so i don't know if it was also affected.
Github Desktop Version: 1.2.2
OS: Windows 10 1803 x64
do you recall if this worked with 1.2.0? I ask because this PR #4240 might have been responsible for a change in behaviour.
I'm confident that this is a recent breaking change but I was unable to find a way to download a prior version of the .DMG installer to verify. I tried to poke around central.github.com but had no luck to "guess" the older installer location :)
For the error itself:
I completely forgot about using the Developer Tools, but I can confirm that the error that @Maximilian578 reported above matches what I'm seeing onclick of a PR line item as well:
app-store.ts:3650 Uncaught (in promise) ReferenceError: i is not defined
at t.AppStore._checkoutPullRequest (app-store.ts:3650)
at t.Dispatcher.checkoutPullRequest (dispatcher.ts:1141)
at Object.onPullRequestClicked.e [as onItemClick] (branches-container.tsx:237)
at Object.onItemClick.e [as onItemClick] (pull-request-list.tsx:191)
at Object.onRowClick.e [as onRowClick] (filter-list.tsx:340)
at Object.onRowClick (list.tsx:909)
at onRowClick.e (list-row.tsx:52)
at Object.<anonymous> (react-dom.production.min.js:15)
at Object.invokeGuardedCallback (react-dom.production.min.js:16)
at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)
Activity
iAmWillShepherd commentedon May 31, 2018
Thanks for taking the time to open an issue! 🙇
Do you get this behavior on all repositories or just the one you mentioned?
MasterXen commentedon May 31, 2018
I'm getting this across all repositories -- I have tried this with multiple PRs in each repository. Switching to other local branches works as expected.
However, GitHub Desktop does several steps to check out a forked PR (thanks for that!) and none of those seem to be working any longer.
shiftkey commentedon May 31, 2018
@MasterXen do you recall if this worked with
1.2.0? I ask because this PR #4240 might have been responsible for a change in behaviour.From the details I've gleaned from your issue it's a private repository, so the PRs are probably coming from local branches, so maybe if
1.2.0is also affected we need to revert that change and revisit it.EDIT: one other thing to help with this theory - can run a
git remotefor this repository, attach the names to this issue and indicate which one is your default remote? Maybe something with our lookup code isn't handling your setup correctly.EDIT 2: argh, I missed the mentions that these PRs are coming from forks and not local branches. Apologies.
ZeeWanderer commentedon Jun 1, 2018
I too am unable to pull/checkout any remote PRs on any repositories. Already pulled PRs are available for chekout in the branch tab. Also if i add

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*to[remote "origin"]in.git\configto pull all PRs on fetch then all of them are available for chekout in the branch tab.Console output:
exception_0:
Uncaught (in promise) ReferenceError: i is not definedat t.AppStore._checkoutPullRequest (renderer.js:17)at t.Dispatcher.checkoutPullRequest (renderer.js:17)at Object.onPullRequestClicked.e [as onItemClick] (renderer.js:17)at Object.onItemClick.e [as onItemClick] (renderer.js:17)at Object.onRowClick.e [as onRowClick] (renderer.js:12)at Object.onRowClick (renderer.js:17)at onRowClick.e (renderer.js:17)at Object.<anonymous> (renderer.js:25)at Object.invokeGuardedCallback (renderer.js:25)at Object.invokeGuardedCallbackAndCatchFirstError (renderer.js:25)exception_1:
Uncaught (in promise) ReferenceError: i is not definedat t.AppStore._checkoutPullRequest (app-store.ts:3650)at t.Dispatcher.checkoutPullRequest (dispatcher.ts:1141)at Object.onPullRequestClicked.e [as onItemClick] (branches-container.tsx:237)at Object.onItemClick.e [as onItemClick] (pull-request-list.tsx:191)at Object.onRowClick.e [as onRowClick] (filter-list.tsx:340)at Object.onRowClick (list.tsx:909)at onRowClick.e (list-row.tsx:52)at Object.<anonymous> (react-dom.production.min.js:15)at Object.invokeGuardedCallback (react-dom.production.min.js:16)at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)This problem was not present on version
1.2.0. I skipped over1.2.1so i don't know if it was also affected.Github Desktop Version:
1.2.2OS:
Windows 10 1803 x64MasterXen commentedon Jun 1, 2018
@shiftkey:
I'm confident that this is a recent breaking change but I was unable to find a way to download a prior version of the .DMG installer to verify. I tried to poke around
central.github.combut had no luck to "guess" the older installer location :)For the error itself:
I completely forgot about using the Developer Tools, but I can confirm that the error that @Maximilian578 reported above matches what I'm seeing
onclickof a PR line item as well:MasterXen commentedon Jun 1, 2018
(Side note, I'm somewhat surprised that the uncaught errors in the UI are not being put into the
*.logfiles)mosinve commentedon Jun 2, 2018
Locally built
devversion works well though, whileprodversion have this bug.shiftkey commentedon Jun 4, 2018
@MasterXen @mosinve thanks for the extra support. I've opened #4859 to address this, hopefully we can get this out soon!