Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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