Uses current branch when opening remote file

Adds current branch name to quick pick description
This commit is contained in:
Eric Amodio
2017-03-24 13:32:32 -04:00
parent e906bfcb9e
commit e859f697ec
7 changed files with 60 additions and 45 deletions

View File

@@ -19,8 +19,9 @@ export class GitHubService extends RemoteProvider {
return `${this.baseUrl}/commit/${sha}`;
}
protected getUrlForFile(fileName: string, sha?: string): string {
protected getUrlForFile(fileName: string, branch?: string, sha?: string): string {
if (sha) return `${this.baseUrl}/blob/${sha}/${fileName}`;
if (branch) return `${this.baseUrl}/blob/${branch}/${fileName}`;
return `${this.baseUrl}?path=${fileName}`;
}
}