Repository navigation
Conversation
Forks display the default branch as `original-repo:original-repos-branch` We can't reliably detect the forks' default branch but in most cases it should match the original repo.
Uhhh... the branch name was being cached without any reference to the repo's itself, so all repos would point to that branch for the current session
f8fa9db to
ca342fd
Compare
7443cb2 to
ca342fd
Compare
|
It turns out that the links are completely wrong, sadly. On forks, GitHub compares each branch to respective branches on the origin's… unless they don't exist. Examples:New branch on fork: https://github.com/stivaugoin/refined-github/tree/add_pull-request_hotkey
Pre-existing branch on fork: https://github.com/stivaugoin/refined-github/tree/github-follow
Sadly, there's no way to determine when GitHub refers to the default branch and when it just points to the origin's same-branch. So we have to remove these buttons from forks altogether. |
|
Could we request the data we need by fetching it from a different page or even using the API? |
|
It looks like it: |
|
Cool. Let's use the API then. |
|
Open a new issue? 😄 Not sure I'll implement it |
|
Done: #1173 |
Forks display the default branch as
original-repo:original-repos-branch.This would break the old code.
We can't reliably detect the forks' default branch but in most cases it should match the original repo.
I thought we could support both the current repo's and the original repo's default branch.
Live example: https://github.com/jamiebuilds/refined-github/tree/tooltips/source