question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some features don't work on branches with slashes

See original GitHub issue

Any feature that makes use of pathnameParts[4] or getReference don’t support branch names that contain /.

The problem with extracting the branch from the URL is that branch/folder/folder/folder is indistinguishable from branch/still/branch/folder, so the branch cannot be safely determined from the URL.

fix-view-file-link-in-pr and link-to-file-in-file-history both have solutions for it, but I think they’re not easily copy-able.

For example getReference could be changed to:

// Tested on the Code tab
return select('#branch-select-menu summary .css-truncate-target').textContent

Originally discussed in https://github.com/sindresorhus/refined-github/pull/2998#issuecomment-613125320 cc @yakov116

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
yakov116commented, May 12, 2020

@fregante we are doing a select.last. That will give you .atom

1reaction
fregantecommented, May 11, 2020

Can you also add every route where getReference is expected to work? e.g.

/** Should work on isCommitList, isSingleFile, blah blah */
function getCurrentBranch() {……..}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Some features don't work on branches with slashes #3004
Any feature that makes use of pathnameParts[4] or getReference don't support branch names that contain /. The problem with extracting the ...
Read more >
Using the slash character in Git branch name - Stack Overflow
I've no idea how this could have happened, but it means that your attempt to create a branch called foo/bar based off it,...
Read more >
Web IDE doesn't work for branches with slashes - GitLab
Presumably similar to #45412 (closed), Web IDE currently doesn't work when starting from a branch with a slash in it, eg. "features/test".
Read more >
Git branch names support forward slashes
Branch names must conform to a few simple rules. You can use the forward slash (/) to create a hierarchical name scheme. However,...
Read more >
Get commit/{revision} API does not accept branch names ... - Jira
BCLOUD-15358 - REST API 2.0 to get raw content of an individual file on fails in case of slash in the branch name....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found