Open active file on GitLab does not resolve from git repository root
Summary
When opening a subfolder of a git repository in VS Code Open active file on GitLab
resolves to the wrong path on GitLab.
Steps to reproduce
- Clone this repository (or any other that has a subfolder): https://gitlab.com/hffmnn/open-active-file-issue
- Open subfolder as VS Code root folder:
cd app && code helloWorld.txt
- Trigger the
Open active file on GitLab
action
What is the current bug behavior?
The GitLab page opens up and reads: "helloWorld.txt" did not exist on "main"
The URL tried to open reads: https://gitlab.com/hffmnn/open-active-file-issue/-/tree/main#L1
What is the expected correct behavior?
The file should be opened on GitLab with the selected line highlighted.
Possible fixes
I guess this line of code returns the wrong path: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/src/openers.js#L46. Instead of returning sth. like app/helloWorld.txt
it only returns helloWorld.txt
.