提交 4bff041a 编写于 作者: J Joao Moreno

💄

上级 901fef29
......@@ -634,7 +634,7 @@ workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalO
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenInEditorAction, GlobalOpenInEditorAction.ID, GlobalOpenInEditorAction.LABEL), 'Git: Open File', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PullAction, PullAction.ID, PullAction.LABEL), 'Git: Pull', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PushAction, PushAction.ID, PushAction.LABEL), 'Git: Push', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PushToRemoteAction, PushToRemoteAction.ID, PushToRemoteAction.LABEL), 'Git: Push To Remote', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PushToRemoteAction, PushToRemoteAction.ID, PushToRemoteAction.LABEL), 'Git: Push to...', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SyncAction, SyncAction.ID, SyncAction.LABEL), 'Git: Sync', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(PublishAction, PublishAction.ID, PublishAction.LABEL), 'Git: Publish', category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(StartGitBranchAction, StartGitBranchAction.ID, StartGitBranchAction.LABEL), 'Git: Branch', category);
......
......@@ -1010,7 +1010,7 @@ export class PushAction extends GitAction {
export class PushToRemoteAction extends GitAction {
static ID = 'workbench.action.git.pushToRemote';
static LABEL = nls.localize('pushToRemote', "Push To Remote");
static LABEL = nls.localize('pushToRemote', "Push to...");
constructor(
id: string = PushToRemoteAction.ID,
......@@ -1021,7 +1021,7 @@ export class PushToRemoteAction extends GitAction {
super(id, label, 'git-action publish', gitService);
}
protected isEnabled():boolean {
protected isEnabled(): boolean {
if (!super.isEnabled()) {
return false;
}
......@@ -1045,25 +1045,15 @@ export class PushToRemoteAction extends GitAction {
return true;
}
public run(context?: any):Promise {
public run(context?: any): Promise {
const model = this.gitService.getModel();
const remotes = model.getRemotes();
const branchName = model.getHEAD().name;
let promise: TPromise<string>;
const picks = remotes.map(({ name, url }) => ({
label: name,
description: url
}));
const picks = remotes.map(({ name, url }) => ({ label: name, description: url }));
const placeHolder = nls.localize('pushToRemotePickMessage', "Pick a remote to push the branch '{0}' to:", branchName);
promise = this.quickOpenService.pick(picks, { placeHolder })
.then(pick => pick && pick.label);
return promise
return this.quickOpenService.pick(picks, { placeHolder })
.then(pick => pick && pick.label)
.then(remote => remote && this.gitService.push(remote, branchName))
.then(null, err => {
if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册