rmuslimov / browse-at-remote

Browse target page on github/bitbucket from emacs buffers
233 stars 54 forks source link

refs%2Fheads%2F is added to URL for type stash, resulting in broken link #85

Closed mstorus closed 2 years ago

mstorus commented 2 years ago

Context

I have a stash repo, for which I ran git config --add browseAtRemote.type "stash". I then open a file, app/file.js, within the repo in emacs and run M-x browse-at-remote on the first line of code.

Expected behavior:

I expected a URL to be opened of the format:

https://stash...com/projects/org/repos/repo/browse/app/file.js?at=abcdef1234567890abcdef01234567890abcdef0#1

Actual behavior:

A URL is opened wit the format:

https://stash...com/projects/org/repos/repo/browse/app/file.js?at=refs%2Fheads%2Fabcdef1234567890abcdef01234567890abcdef0#1

(note that refs%2Fheads%2F is prepended to the value of the at URL parameter)

which results in a broken webpage in Stash with the error

The path "app" does not exist at revision "refs/heads/abcdef1234567890abcdef01234567890abcdef0"

Comment

How can I prevent refs%2Fheads%2F from being erroneously added to the at URL parameter?