From b0adc3b058e69f9ccdea3c15a633bf0e8af13c2f Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 10 Feb 2025 15:02:26 -0500 Subject: [PATCH] Fixes #4035 adds repo context --- src/commands/generateCommitMessage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/generateCommitMessage.ts b/src/commands/generateCommitMessage.ts index 0d39ca9c3ea06..a1e7169a27ee7 100644 --- a/src/commands/generateCommitMessage.ts +++ b/src/commands/generateCommitMessage.ts @@ -13,7 +13,7 @@ import { getCommandUri } from './commandBase.utils'; import type { CommandContext } from './commandContext'; export interface GenerateCommitMessageCommandArgs { - repoPath?: string; + repoPath?: string | Uri; source?: Sources; } @@ -27,6 +27,9 @@ export class GenerateCommitMessageCommand extends ActiveEditorCommand { let source: Sources | undefined = args?.source; if (source == null && context.command === GlCommand.GenerateCommitMessageScm) { source = 'scm-input'; + if (context.type === 'scm' && context.scm.rootUri != null) { + args = { ...args, repoPath: context.scm.rootUri }; + } } return this.execute(context.editor, context.uri, { ...args, source: source });