Przeglądaj źródła

Fixes restore of the Commit Details on load

main
Eric Amodio 1 rok temu
rodzic
commit
da8f3a1d04
2 zmienionych plików z 27 dodań i 2 usunięć
  1. +24
    -1
      src/git/gitProviderService.ts
  2. +3
    -1
      src/webviews/commitDetails/commitDetailsWebview.ts

+ 24
- 1
src/git/gitProviderService.ts Wyświetl plik

@ -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 Wyświetl plik

@ -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(
{

Ładowanie…
Anuluj
Zapisz