Skip to content

Commit 93ed959

Browse files
committed
Fixes #4035 adds repo context
1 parent fde18b2 commit 93ed959

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/commands/generateCommitMessage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getCommandUri } from './commandBase.utils';
1313
import type { CommandContext } from './commandContext';
1414

1515
export interface GenerateCommitMessageCommandArgs {
16-
repoPath?: string;
16+
repoPath?: string | Uri;
1717
source?: Sources;
1818
}
1919

@@ -27,6 +27,9 @@ export class GenerateCommitMessageCommand extends ActiveEditorCommand {
2727
let source: Sources | undefined = args?.source;
2828
if (source == null && context.command === GlCommand.GenerateCommitMessageScm) {
2929
source = 'scm-input';
30+
if (context.type === 'scm' && context.scm.rootUri != null) {
31+
args = { ...args, repoPath: context.scm.rootUri };
32+
}
3033
}
3134

3235
return this.execute(context.editor, context.uri, { ...args, source: source });

0 commit comments

Comments
 (0)