diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index fdeea01..53d5880 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -3299,8 +3299,8 @@ export class LocalGitProvider implements GitProvider, Disposable { } @log() - getVersionedFileBuffer(repoPath: string, fileName: string, ref: string): Promise { - return Git.show(repoPath, fileName, ref, { encoding: 'buffer' }); + getRevisionContent(repoPath: string, path: string, ref: string): Promise { + return Git.show(repoPath, path, ref, { encoding: 'buffer' }); } @log() diff --git a/src/git/fsProvider.ts b/src/git/fsProvider.ts index 1651bc7..95faaa9 100644 --- a/src/git/fsProvider.ts +++ b/src/git/fsProvider.ts @@ -83,10 +83,8 @@ export class GitFileSystemProvider implements FileSystemProvider, Disposable { if (ref === GitRevision.deletedOrMissing) return emptyArray; - const buffer = await this.container.git.getVersionedFileBuffer(repoPath, path, ref); - if (buffer === undefined) return emptyArray; - - return buffer; + const data = await this.container.git.getRevisionContent(repoPath, path, ref); + return data != null ? data : emptyArray; } rename(): void | Thenable { diff --git a/src/git/gitProvider.ts b/src/git/gitProvider.ts index 40f73a8..0cf73f2 100644 --- a/src/git/gitProvider.ts +++ b/src/git/gitProvider.ts @@ -339,7 +339,7 @@ export interface GitProvider { ): Promise>; getTreeEntryForRevision(repoPath: string, path: string, ref: string): Promise; getTreeForRevision(repoPath: string, ref: string): Promise; - getVersionedFileBuffer(repoPath: string, fileName: string, ref: string): Promise; + getRevisionContent(repoPath: string, path: string, ref: string): Promise; getVersionedUri(repoPath: string, fileName: string, ref: string | undefined): Promise; getWorkingUri(repoPath: string, uri: Uri): Promise; diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index c0e2a8b..326131e 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -1675,9 +1675,9 @@ export class GitProviderService implements Disposable { } @log() - getVersionedFileBuffer(repoPath: string | Uri, fileName: string, ref: string) { - const { provider, path } = this.getProvider(repoPath); - return provider.getVersionedFileBuffer(path, fileName, ref); + getRevisionContent(repoPath: string | Uri, path: string, ref: string): Promise { + const { provider, path: rp } = this.getProvider(repoPath); + return provider.getRevisionContent(rp, path, ref); } @log()