ben-gibson / GitLink

A Jetbrains plugin that opens a local file under Git version control in its remote host using the default browser.
https://plugins.jetbrains.com/plugin/8183-gitlink
MIT License
671 stars 58 forks source link

Bitbucket cloud generates links to HEAD #239

Open l0co opened 1 year ago

l0co commented 1 year ago

I've recently noticed that all links to bitbucket cloud are generated to /HEAD (eg. https://bitbucket.org/context_name/project_name/src/HEAD/...) what is reported by bitbucket as non existing link. The appropriate link should include commit number instead of /HEAD (eg. https://bitbucket.org/context_name/project_name/src/aca04252a8f8b96e7e3a38bd280385462b0b05fb/...)

The git environment is not dirty and there are no commits which weren't pushed to remote.

ben-gibson commented 1 year ago

That's strange, I'm not sure where it's getting HEAD from. The template doesn't mention it here and the tests look good here. Could there be a redirect happening? What URL do you see if you use the copy to clipboard action instead?

l0co commented 1 year ago

The copied link is also with HEAD but I've found the culprit - it's Check commit on remote feature. If this feature is enabled, the link is appropriate, if disabled, HEAD link is generated. At least for Bitbucket cloud.