Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLadislau Szomoru <3372902+lszomoru@users.noreply.github.com>2022-07-18 17:55:41 +0300
committerGitHub <noreply@github.com>2022-07-18 17:55:41 +0300
commitb3218963c4819162c87ff90606eec5294e32d28d (patch)
treeb1ba7daf28f94b07ef6b5f8249415e3cf801893c /extensions
parent8bada27fdd5b7e7d601a435961a24c2b41cb4cfe (diff)
Git - Do not show SmartCommit dialog when using "Commit All" (#155486)
Do not show SmartCommit dialog when using "Commit All"
Diffstat (limited to 'extensions')
-rw-r--r--extensions/git/src/commands.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts
index 7ebe8bdc606..83d13150603 100644
--- a/extensions/git/src/commands.ts
+++ b/extensions/git/src/commands.ts
@@ -1452,7 +1452,7 @@ export class CommandCenter {
private async smartCommit(
repository: Repository,
getCommitMessage: () => Promise<string | undefined>,
- opts?: CommitOptions
+ opts: CommitOptions
): Promise<boolean> {
const config = workspace.getConfiguration('git', Uri.file(repository.root));
let promptToSaveFilesBeforeCommit = config.get<'always' | 'staged' | 'never'>('promptToSaveFilesBeforeCommit');
@@ -1498,14 +1498,8 @@ export class CommandCenter {
}
}
- if (!opts) {
- opts = { all: noStagedChanges };
- } else if (!opts.all && noStagedChanges && !opts.empty) {
- opts = { ...opts, all: true };
- }
-
// no changes, and the user has not configured to commit all in this case
- if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.empty) {
+ if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.empty && !opts.all) {
const suggestSmartCommit = config.get<boolean>('suggestSmartCommit') === true;
if (!suggestSmartCommit) {
@@ -1529,6 +1523,12 @@ export class CommandCenter {
}
}
+ if (opts.all === undefined) {
+ opts = { all: noStagedChanges };
+ } else if (!opts.all && noStagedChanges && !opts.empty) {
+ opts = { ...opts, all: true };
+ }
+
// enable signing of commits if configured
opts.signCommit = enableCommitSigning;
@@ -1642,7 +1642,7 @@ export class CommandCenter {
return true;
}
- private async commitWithAnyInput(repository: Repository, opts?: CommitOptions): Promise<void> {
+ private async commitWithAnyInput(repository: Repository, opts: CommitOptions): Promise<void> {
const message = repository.inputBox.value;
const root = Uri.file(repository.root);
const config = workspace.getConfiguration('git', root);