提交 3a54676f 编写于 作者: J Joao Moreno

move successful push notification into repository

上级 ead170df
......@@ -1395,10 +1395,6 @@ export class CommandCenter {
try {
await repository.push(repository.HEAD);
const gitConfig = workspace.getConfiguration('git');
if (gitConfig.get<boolean>('showPushSuccessNotification')) {
window.showInformationMessage(localize('push success', "Successfully pushed."));
}
} catch (err) {
if (err.gitErrorCode !== GitErrorCodes.NoUpstreamBranch) {
throw err;
......
......@@ -557,6 +557,16 @@ export class Repository implements Disposable {
this.disposables.push(new AutoFetcher(this, globalState));
// https://github.com/Microsoft/vscode/issues/39039
const onSuccessfulPush = filterEvent(this.onDidRunOperation, e => e.operation === Operation.Push && !e.error);
onSuccessfulPush(() => {
const gitConfig = workspace.getConfiguration('git');
if (gitConfig.get<boolean>('showPushSuccessNotification')) {
window.showInformationMessage(localize('push success', "Successfully pushed."));
}
}, null, this.disposables);
const statusBar = new StatusBarCommands(this);
this.disposables.push(statusBar);
statusBar.onDidChange(() => this._sourceControl.statusBarCommands = statusBar.commands, null, this.disposables);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册