Skip to content

Commit

Permalink
fix: Bitbucket repo branch link (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmevladik authored and SergK committed Dec 18, 2024
1 parent 515df03 commit 2df5479
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/services/link-creation/git/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ describe('testing link-creation GitURLService', () => {
GitURLService.createRepoBranchLink(
GIT_PROVIDERS.BITBUCKET,
'https://git.test.com/test-project/test-repo',
'test-branch'
'feature/test-branch'
)
).toEqual('https://git.test.com/test-project/test-repo/src/test-branch');
).toEqual('https://git.test.com/test-project/test-repo/src/HEAD/?at=feature%2Ftest-branch');
});
});
3 changes: 2 additions & 1 deletion src/services/link-creation/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const GitURLService = {
updatedUrl.pathname += `/-/tree/${branch}`;
break;
case GIT_PROVIDERS.BITBUCKET:
updatedUrl.pathname += `/src/${branch}`;
updatedUrl.pathname += `/src/HEAD/`;
updatedUrl.search = `?at=${encodeURIComponent(branch)}`;
break;
default:
throw new Error(`Unsupported git server: ${gitServer}`);
Expand Down

0 comments on commit 2df5479

Please sign in to comment.