diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index e1ee276..95e6328 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -2358,13 +2358,36 @@ export class GitProviderService implements Disposable { ); } + getOrOpenRepository( + uri: Uri, + options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean }, + ): Promise; + getOrOpenRepository( + path: string, + options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean }, + ): Promise; + getOrOpenRepository( + pathOrUri: string | Uri, + options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean }, + ): Promise; @log({ exit: true }) async getOrOpenRepository( - uri: Uri, + pathOrUri?: string | Uri, options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean }, ): Promise { + if (pathOrUri == null) return undefined; + const scope = getLogScope(); + let uri: Uri; + if (typeof pathOrUri === 'string') { + if (!pathOrUri) return undefined; + + uri = this.getAbsoluteUri(pathOrUri); + } else { + uri = pathOrUri; + } + const path = getBestPath(uri); let repository: Repository | undefined; repository = this.getRepository(uri); diff --git a/src/webviews/commitDetails/commitDetailsWebview.ts b/src/webviews/commitDetails/commitDetailsWebview.ts index 425cd6c..1b6fd48 100644 --- a/src/webviews/commitDetails/commitDetailsWebview.ts +++ b/src/webviews/commitDetails/commitDetailsWebview.ts @@ -574,7 +574,8 @@ export class CommitDetailsWebviewProvider implements WebviewProvider { @@ -584,6 +585,7 @@ export class CommitDetailsWebviewProvider implements WebviewProvider