Selaa lähdekoodia

Fixes restore of the Commit Details on load

main
Eric Amodio 1 vuosi sitten
vanhempi
commit
da8f3a1d04
2 muutettua tiedostoa jossa 27 lisäystä ja 2 poistoa
  1. +24
    -1
      src/git/gitProviderService.ts
  2. +3
    -1
      src/webviews/commitDetails/commitDetailsWebview.ts

+ 24
- 1
src/git/gitProviderService.ts Näytä tiedosto

@ -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 Näytä tiedosto

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

Ladataan…
Peruuta
Tallenna