mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-16 09:35:40 -05:00
Uses current branch when opening remote file
Adds current branch name to quick pick description
This commit is contained in:
@@ -18,10 +18,11 @@ export class OpenFileInRemoteCommand extends ActiveEditorCommand {
|
||||
}
|
||||
|
||||
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||
const branch = await this.git.getBranch(gitUri.repoPath || this.repoPath);
|
||||
|
||||
try {
|
||||
const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.repoPath), _ => _.url, _ => !!_.provider);
|
||||
return commands.executeCommand(Commands.OpenInRemote, uri, remotes, 'file', [gitUri.getRelativePath(), gitUri.sha]);
|
||||
return commands.executeCommand(Commands.OpenInRemote, uri, remotes, 'file', [gitUri.getRelativePath(), branch.name, gitUri.sha]);
|
||||
}
|
||||
catch (ex) {
|
||||
Logger.error('[GitLens.OpenFileInRemoteCommand]', ex);
|
||||
|
||||
Reference in New Issue
Block a user