瀏覽代碼

Adds repoPath support to show quick commit command

main
Eric Amodio 4 年之前
父節點
當前提交
0e548f2427
共有 1 個檔案被更改,包括 6 行新增5 行删除
  1. +6
    -5
      src/commands/showQuickCommit.ts

+ 6
- 5
src/commands/showQuickCommit.ts 查看文件

@ -16,6 +16,7 @@ import { Logger } from '../logger';
import { Messages } from '../messages';
export interface ShowQuickCommitCommandArgs {
repoPath?: string;
sha?: string;
commit?: GitCommit | GitLogCommit;
repoLog?: GitLog;
@ -24,10 +25,10 @@ export interface ShowQuickCommitCommandArgs {
@command()
export class ShowQuickCommitCommand extends ActiveEditorCachedCommand {
static getMarkdownCommandArgs(sha: string): string;
static getMarkdownCommandArgs(sha: string, repoPath?: string): string;
static getMarkdownCommandArgs(args: ShowQuickCommitCommandArgs): string;
static getMarkdownCommandArgs(argsOrSha: ShowQuickCommitCommandArgs | string): string {
const args = typeof argsOrSha === 'string' ? { sha: argsOrSha } : argsOrSha;
static getMarkdownCommandArgs(argsOrSha: ShowQuickCommitCommandArgs | string, repoPath?: string): string {
const args = typeof argsOrSha === 'string' ? { sha: argsOrSha, repoPath: repoPath } : argsOrSha;
return super.getMarkdownCommandArgsCore<ShowQuickCommitCommandArgs>(Commands.ShowQuickCommit, args);
}
@ -55,9 +56,9 @@ export class ShowQuickCommitCommand extends ActiveEditorCachedCommand {
async execute(editor?: TextEditor, uri?: Uri, args?: ShowQuickCommitCommandArgs) {
uri = getCommandUri(uri, editor);
if (uri == null) return;
if (uri == null && args?.repoPath == null) return;
const gitUri = await GitUri.fromUri(uri);
const gitUri = uri != null ? await GitUri.fromUri(uri) : GitUri.fromRepoPath(args!.repoPath!);
let repoPath = gitUri.repoPath;

Loading…
取消
儲存