feat: add setting for default stash message
This commit is contained in:
parent
109d9984c1
commit
024df33553
3 changed files with 15 additions and 6 deletions
|
@ -2012,6 +2012,12 @@
|
|||
"default": true,
|
||||
"description": "%config.terminalAuthentication%"
|
||||
},
|
||||
"git.defaultStashMessage": {
|
||||
"type": "boolean",
|
||||
"scope": "resource",
|
||||
"default": false,
|
||||
"description": "%config.defaultStashMessage%"
|
||||
},
|
||||
"git.githubAuthentication": {
|
||||
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
|
||||
},
|
||||
|
|
|
@ -176,6 +176,7 @@
|
|||
"config.timeline.date": "Controls which date to use for items in the Timeline view",
|
||||
"config.timeline.date.committed": "Use the committed date",
|
||||
"config.timeline.date.authored": "Use the authored date",
|
||||
"config.defaultStashMessage": "Controls whether to use message from commit input box (if populated) as default stash messages",
|
||||
"submenu.commit": "Commit",
|
||||
"submenu.commit.amend": "Amend",
|
||||
"submenu.commit.signoff": "Sign Off",
|
||||
|
|
|
@ -2506,12 +2506,14 @@ export class CommandCenter {
|
|||
}
|
||||
}
|
||||
|
||||
let defaultStashMessage: string;
|
||||
const commitTemplate = repository.sourceControl.commitTemplate;
|
||||
if (commitTemplate === undefined) {
|
||||
defaultStashMessage = repository.inputBox.value;
|
||||
} else {
|
||||
defaultStashMessage = repository.inputBox.value.replace(commitTemplate, '');
|
||||
let defaultStashMessage = '';
|
||||
if (config.get<boolean>('defaultStashMessage')) {
|
||||
const commitTemplate = repository.sourceControl.commitTemplate;
|
||||
if (commitTemplate === undefined) {
|
||||
defaultStashMessage = repository.inputBox.value;
|
||||
} else {
|
||||
defaultStashMessage = repository.inputBox.value.replace(commitTemplate, '');
|
||||
}
|
||||
}
|
||||
const message = await this.getStashMessage(defaultStashMessage);
|
||||
|
||||
|
|
Loading…
Reference in a new issue