mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
This reverts commit 5422f5f940
.
This commit is contained in:
parent
85f13f93f1
commit
64c1b1cc60
|
@ -2103,38 +2103,36 @@ export class CommandCenter {
|
|||
}
|
||||
}
|
||||
|
||||
if (!opts.amend) {
|
||||
// no changes, and the user has not configured to commit all in this case
|
||||
if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.all) {
|
||||
const suggestSmartCommit = config.get<boolean>('suggestSmartCommit') === true;
|
||||
// no changes, and the user has not configured to commit all in this case
|
||||
if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.all) {
|
||||
const suggestSmartCommit = config.get<boolean>('suggestSmartCommit') === true;
|
||||
|
||||
if (!suggestSmartCommit) {
|
||||
return;
|
||||
}
|
||||
|
||||
// prompt the user if we want to commit all or not
|
||||
const message = l10n.t('There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?');
|
||||
const yes = l10n.t('Yes');
|
||||
const always = l10n.t('Always');
|
||||
const never = l10n.t('Never');
|
||||
const pick = await window.showWarningMessage(message, { modal: true }, yes, always, never);
|
||||
|
||||
if (pick === always) {
|
||||
config.update('enableSmartCommit', true, true);
|
||||
} else if (pick === never) {
|
||||
config.update('suggestSmartCommit', false, true);
|
||||
return;
|
||||
} else if (pick !== yes) {
|
||||
return; // do not commit on cancel
|
||||
}
|
||||
if (!suggestSmartCommit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (opts.all === undefined) {
|
||||
opts = { ...opts, all: noStagedChanges };
|
||||
} else if (!opts.all && noStagedChanges) {
|
||||
opts = { ...opts, all: true };
|
||||
// prompt the user if we want to commit all or not
|
||||
const message = l10n.t('There are no staged changes to commit.\n\nWould you like to stage all your changes and commit them directly?');
|
||||
const yes = l10n.t('Yes');
|
||||
const always = l10n.t('Always');
|
||||
const never = l10n.t('Never');
|
||||
const pick = await window.showWarningMessage(message, { modal: true }, yes, always, never);
|
||||
|
||||
if (pick === always) {
|
||||
config.update('enableSmartCommit', true, true);
|
||||
} else if (pick === never) {
|
||||
config.update('suggestSmartCommit', false, true);
|
||||
return;
|
||||
} else if (pick !== yes) {
|
||||
return; // do not commit on cancel
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.all === undefined) {
|
||||
opts = { ...opts, all: noStagedChanges };
|
||||
} else if (!opts.all && noStagedChanges) {
|
||||
opts = { ...opts, all: true };
|
||||
}
|
||||
}
|
||||
|
||||
// enable signing of commits if configured
|
||||
|
|
Loading…
Reference in a new issue