support giving a github repo URL with a trailing slash (#10360)

This commit is contained in:
Jacob MacDonald
2025-10-02 07:34:23 -07:00
committed by GitHub
parent aa8b2abe3d
commit ebbfcda762
2 changed files with 13 additions and 2 deletions

View File

@@ -292,13 +292,20 @@ describe('git extension helpers', () => {
expect(repo).toBe('repo');
});
it('should parse owner and repo from a full GitHub UR without .git', () => {
it('should parse owner and repo from a full GitHub URL without .git', () => {
const source = 'https://github.com/owner/repo';
const { owner, repo } = parseGitHubRepoForReleases(source);
expect(owner).toBe('owner');
expect(repo).toBe('repo');
});
it('should parse owner and repo from a full GitHub URL with a trailing slash', () => {
const source = 'https://github.com/owner/repo/';
const { owner, repo } = parseGitHubRepoForReleases(source);
expect(owner).toBe('owner');
expect(repo).toBe('repo');
});
it('should fail on a GitHub SSH URL', () => {
const source = 'git@github.com:owner/repo.git';
expect(() => parseGitHubRepoForReleases(source)).toThrow(