implement push success notification for issue #39039

This commit is contained in:
Ivor Huang 2018-04-12 20:48:31 -04:00
parent 7c62e560a2
commit ee748ab5c8
3 changed files with 11 additions and 1 deletions

View file

@ -966,6 +966,11 @@
"default": true,
"description": "%config.showInlineOpenFileAction%"
},
"git.showPushSuccessNotification": {
"type": "boolean",
"description": "%config.showPushSuccessNotification%",
"default": false
},
"git.inputValidation": {
"type": "string",
"enum": [

View file

@ -68,6 +68,7 @@
"config.decorations.enabled": "Controls if Git contributes colors and badges to the explorer and the open editors view.",
"config.promptToSaveFilesBeforeCommit": "Controls whether Git should check for unsaved files before committing.",
"config.showInlineOpenFileAction": "Controls whether to show an inline Open File action in the Git changes view.",
"config.showPushSuccessNotification": "Controls whether to show a notification when a push is successful.",
"config.inputValidation": "Controls when to show commit message input validation.",
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
"config.detectSubmodulesLimit": "Controls the limit of git submodules detected.",
@ -77,4 +78,4 @@
"colors.ignored": "Color for ignored resources.",
"colors.conflict": "Color for resources with conflicts.",
"colors.submodule": "Color for submodule resources."
}
}

View file

@ -1376,6 +1376,10 @@ 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;