mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
💄
This commit is contained in:
parent
1d18ebe47e
commit
13f9f73353
|
@ -2068,11 +2068,11 @@
|
|||
"default": true,
|
||||
"description": "%config.terminalAuthentication%"
|
||||
},
|
||||
"git.defaultStashMessage": {
|
||||
"git.useCommitInputAsStashMessage": {
|
||||
"type": "boolean",
|
||||
"scope": "resource",
|
||||
"default": false,
|
||||
"description": "%config.defaultStashMessage%"
|
||||
"description": "%config.useCommitInputAsStashMessage%"
|
||||
},
|
||||
"git.githubAuthentication": {
|
||||
"deprecationMessage": "This setting is now deprecated, please use `github.gitAuthentication` instead."
|
||||
|
|
|
@ -179,7 +179,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",
|
||||
"config.useCommitInputAsStashMessage": "Controls whether to use the message from the commit input box as the default stash message.",
|
||||
"submenu.explorer": "Git",
|
||||
"submenu.commit": "Commit",
|
||||
"submenu.commit.amend": "Amend",
|
||||
|
|
|
@ -2606,16 +2606,17 @@ export class CommandCenter {
|
|||
}
|
||||
}
|
||||
|
||||
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, '');
|
||||
}
|
||||
let message: string | undefined;
|
||||
|
||||
if (config.get<boolean>('useCommitInputAsStashMessage') && (!repository.sourceControl.commitTemplate || repository.inputBox.value !== repository.sourceControl.commitTemplate)) {
|
||||
message = repository.inputBox.value;
|
||||
}
|
||||
const message = await this.getStashMessage(defaultStashMessage);
|
||||
|
||||
message = await window.showInputBox({
|
||||
value: message,
|
||||
prompt: localize('provide stash message', "Optionally provide a stash message"),
|
||||
placeHolder: localize('stash message', "Stash message")
|
||||
});
|
||||
|
||||
if (typeof message === 'undefined') {
|
||||
return;
|
||||
|
@ -2624,14 +2625,6 @@ export class CommandCenter {
|
|||
await repository.createStash(message, includeUntracked);
|
||||
}
|
||||
|
||||
private async getStashMessage(defaultStashMessage: string): Promise<string | undefined> {
|
||||
return await window.showInputBox({
|
||||
value: defaultStashMessage,
|
||||
prompt: localize('provide stash message', "Optionally provide a stash message"),
|
||||
placeHolder: localize('stash message', "Stash message")
|
||||
});
|
||||
}
|
||||
|
||||
@command('git.stash', { repository: true })
|
||||
stash(repository: Repository): Promise<void> {
|
||||
return this._stash(repository);
|
||||
|
|
Loading…
Reference in a new issue