Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fixes [#3218](https://github.com/gitkraken/vscode-gitlens/issues/3218) - Bitbucket Server remote - "scm/" path prefix not removed (regression)
- Fixes avoid eagerly getting "full" commit details for inline blame ([#4115])(https://github.com/gitkraken/vscode-gitlens/issues/4115))
- Fixes large commit messages work poorly on Commit Graph ([#4100](https://github.com/gitkraken/vscode-gitlens/issues/4100))
- Fixes _Show \* View_ commands fail intermittently ([#4127](https://github.com/gitkraken/vscode-gitlens/issues/4127))
Expand Down
4 changes: 2 additions & 2 deletions src/git/remotes/bitbucket-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export class BitbucketServerRemote extends RemoteProvider {
}

protected override splitPath(): [string, string] {
if (this.path.startsWith('scm/')) {
if (this.path.startsWith('scm/') && this.path.indexOf('/') !== this.path.lastIndexOf('/')) {
const path = this.path.replace('scm/', '');
Copy link
Member Author

@sergeibbb sergeibbb Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericf-axosoft , @axosoft-ramint

const path = this.path.replace('scm/', '');

The biggest problem here is if project name is scm. Can I assume that normally repo path can be either org/repo, where repo part cannot contain slashes?

I'm trying to create a repo name with slashes and Bitbucket replaces it with dashes:
image

Therefore I can check if the path is started with scm/ and look for the second /. If the second / does not exist, then scm is just a project name.

Agree?

const index = path.indexOf('/');
return [this.path.substring(0, index), this.path.substring(index + 1)];
return [path.substring(0, index), path.substring(index + 1)];
}

return super.splitPath();
Expand Down