diff --git a/extensions/git/package.json b/extensions/git/package.json index 410fb6f0aa9a87ad369fe4d49f353d641e8c4dd4..eb99282e7081076f94e7857ed5a1e447b7101557 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1156,4 +1156,4 @@ "@types/which": "^1.0.28", "mocha": "^3.2.0" } -} +} \ No newline at end of file diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 3eb6f857899d5244a4e8239003f1499cf175f7c5..9d60c38e16a555c8c9b98a868c8e6e14bace8177 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1395,10 +1395,6 @@ export class CommandCenter { try { await repository.push(repository.HEAD); - const gitConfig = workspace.getConfiguration('git'); - if (gitConfig.get('showPushSuccessNotification')) { - window.showInformationMessage(localize('push success', "Successfully pushed.")); - } } catch (err) { if (err.gitErrorCode !== GitErrorCodes.NoUpstreamBranch) { throw err; diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index 6051cc3cb48ab59a36bce998d9d530f94285a9f1..4908ddac81fd9d1ea995edf2a41ffa443cd04ef5 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -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('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);