Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Diagnostics does not show GitHub details when cloned via HTTPS #3007

Merged
merged 1 commit into from
Sep 17, 2018
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,17 @@ export class DiagnosticsPageComponent implements OnInit {
}

private getGitHubProject(prj: string): string {
const parts = prj.split(':');
if (parts.length === 2 && parts[0].indexOf('@github.com') >= 0) {
return parts[1];
let projectUrl = prj;
// Remove trailing .git if it is there
if (projectUrl.endsWith('.git')) {
projectUrl = projectUrl.substr(0, projectUrl.length - 4);
}

// Handle either SSH or HTTPS GitHub URLs
if (projectUrl.toLowerCase().startsWith('git@github.com:')) {
return projectUrl.substr(15);
} else if (projectUrl.toLowerCase().startsWith('https://github.com/')) {
return projectUrl.substr(19);
}
return '';
}
Expand Down