sindresorhus/refined-github

Master branch links are broken for branches with a `/` in the branch name #2049

simonkotwicz posted onGitHub

Master branch links are broken for branches with a / in the branch name.

eg. branch sk/dev links to [repo]/tree/master/dev

bug is here: https://github.com/sindresorhus/refined-github/blob/master/source/features/branch-buttons.tsx#L78 and here: https://github.com/sindresorhus/refined-github/blob/master/source/libs/page-detect.ts#L84


I think the special branch formatting inside links is a little strange as well

I don't: commits, branches, tags, are all just git references, so https://github.com/bfred-it/shorten-repo-url tries to treat them all the same.

simonkotwicz/refined-github:branch/still-branch/.travis.yml#L6 is still hard to parse compared to:

https://github.com/simonkotwicz/refined-github/blob/branch/still-branch/.travis.yml#L6

At most I'd try:

simonkotwicz/refined-github/branch/still-branch/.travis.yml#L6

PR welcome on https://github.com/bfred-it/shorten-repo-url for this change


If anyone wants to pick this up, (the fixable bug part) change this line to use the URL from the branch selector instead of location.pathname. This would fix the master button on https://github.com/simonkotwicz/refined-github/blob/branch/still-branch/.travis.yml#L6

posted by bfred-it over 5 years ago

@bfred-it I would love to help! Maybe I can find time doing it later today.

posted by kevin940726 over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests