Skip to content

Commit ffb03f5

Browse files
Combined conditionals
1 parent 3adbc48 commit ffb03f5

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/commands/generateCommitMessage.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ export class GenerateCommitMessageCommand extends ActiveEditorCommand {
7474
progress: { location: ProgressLocation.Notification, title: 'Generating commit message...' },
7575
},
7676
);
77-
if (result === 'cancelled') return;
78-
79-
if (result == null) return;
77+
if (result == null || result === 'cancelled') return;
8078

8179
void executeCoreCommand('workbench.view.scm');
8280
scmRepo.inputBox.value = `${currentMessage ? `${currentMessage}\n\n` : ''}${result.parsed.summary}${

src/commands/generateRebase.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,7 @@ export async function generateRebase(
343343

344344
const repo = svc.getRepository()!;
345345
const result = await container.ai.generateRebase(repo, base.ref, head.ref, source, aiOptions);
346-
if (result === 'cancelled') return;
347-
348-
if (result == null) return;
346+
if (result == null || result === 'cancelled') return;
349347

350348
try {
351349
// Extract the diff information from the reorganized commits

src/env/node/git/commitMessageProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ class AICommitMessageProvider implements CommitMessageProvider, Disposable {
6262
},
6363
);
6464

65-
if (result === 'cancelled') return;
66-
67-
if (result == null) return;
65+
if (result == null || result === 'cancelled') return;
6866

6967
return `${currentMessage ? `${currentMessage}\n\n` : ''}${result.parsed.summary}${
7068
result.parsed.body ? `\n\n${result.parsed.body}` : ''

0 commit comments

Comments
 (0)