浏览代码

Fixes restore of the Commit Details on load

main
Eric Amodio 1年前
父节点
当前提交
da8f3a1d04
共有 2 个文件被更改,包括 27 次插入2 次删除
  1. +24
    -1
      src/git/gitProviderService.ts
  2. +3
    -1
      src/webviews/commitDetails/commitDetailsWebview.ts

+ 24
- 1
src/git/gitProviderService.ts 查看文件

@ -2358,13 +2358,36 @@ export class GitProviderService implements Disposable {
);
}
getOrOpenRepository(
uri: Uri,
options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean },
): Promise<Repository | undefined>;
getOrOpenRepository(
path: string,
options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean },
): Promise<Repository | undefined>;
getOrOpenRepository(
pathOrUri: string | Uri,
options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean },
): Promise<Repository | undefined>;
@log({ exit: true })
async getOrOpenRepository(
uri: Uri,
pathOrUri?: string | Uri,
options?: { closeOnOpen?: boolean; detectNested?: boolean; force?: boolean },
): Promise<Repository | undefined> {
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);

+ 3
- 1
src/webviews/commitDetails/commitDetailsWebview.ts 查看文件

@ -574,7 +574,8 @@ export class CommitDetailsWebviewProvider implements WebviewProvider
}
if (commit?.isUncommitted) {
const repository = this.container.git.getRepository(commit.repoPath)!;
const repository = await this.container.git.getOrOpenRepository(commit.repoPath);
if (repository != null) {
this._commitDisposable = Disposable.from(
repository.startWatchingFileSystem(),
repository.onDidChangeFileSystem(() => {
@ -584,6 +585,7 @@ export class CommitDetailsWebviewProvider implements WebviewProvider
}),
);
}
}
this.updatePendingContext(
{

正在加载...
取消
保存