Pārlūkot izejas kodu

Changes to use UInt8Array

Renames content method for clarity
main
Eric Amodio pirms 2 gadiem
vecāks
revīzija
39aa720464
4 mainītis faili ar 8 papildinājumiem un 10 dzēšanām
  1. +2
    -2
      src/env/node/git/localGitProvider.ts
  2. +2
    -4
      src/git/fsProvider.ts
  3. +1
    -1
      src/git/gitProvider.ts
  4. +3
    -3
      src/git/gitProviderService.ts

+ 2
- 2
src/env/node/git/localGitProvider.ts Parādīt failu

@ -3299,8 +3299,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
}
@log()
getVersionedFileBuffer(repoPath: string, fileName: string, ref: string): Promise<Buffer | undefined> {
return Git.show<Buffer>(repoPath, fileName, ref, { encoding: 'buffer' });
getRevisionContent(repoPath: string, path: string, ref: string): Promise<Uint8Array | undefined> {
return Git.show<Buffer>(repoPath, path, ref, { encoding: 'buffer' });
}
@log()

+ 2
- 4
src/git/fsProvider.ts Parādīt failu

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

+ 1
- 1
src/git/gitProvider.ts Parādīt failu

@ -339,7 +339,7 @@ export interface GitProvider {
): Promise<PagedResult<GitTag>>;
getTreeEntryForRevision(repoPath: string, path: string, ref: string): Promise<GitTreeEntry | undefined>;
getTreeForRevision(repoPath: string, ref: string): Promise<GitTreeEntry[]>;
getVersionedFileBuffer(repoPath: string, fileName: string, ref: string): Promise<Buffer | undefined>;
getRevisionContent(repoPath: string, path: string, ref: string): Promise<Uint8Array | undefined>;
getVersionedUri(repoPath: string, fileName: string, ref: string | undefined): Promise<Uri | undefined>;
getWorkingUri(repoPath: string, uri: Uri): Promise<Uri | undefined>;

+ 3
- 3
src/git/gitProviderService.ts Parādīt failu

@ -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<Uint8Array | undefined> {
const { provider, path: rp } = this.getProvider(repoPath);
return provider.getRevisionContent(rp, path, ref);
}
@log()

Notiek ielāde…
Atcelt
Saglabāt