Sfoglia il codice sorgente

Moves getRevisionContent

main
Eric Amodio 3 anni fa
parent
commit
8d29a1c2dc
2 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. +7
    -5
      src/env/node/git/localGitProvider.ts
  2. +1
    -1
      src/git/gitProvider.ts

+ 7
- 5
src/env/node/git/localGitProvider.ts Vedi File

@ -2904,6 +2904,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
return remotes.filter(r => r.provider != null) as GitRemote<RemoteProvider>[];
}
@debug({ args: { 1: false } })
async getRemotesCore(
repoPath: string | undefined,
providers?: RemoteProviders,
@ -3049,6 +3050,12 @@ export class LocalGitProvider implements GitProvider, Disposable {
@gate()
@log()
getRevisionContent(repoPath: string, path: string, ref: string): Promise<Uint8Array | undefined> {
return Git.show<Buffer>(repoPath, path, ref, { encoding: 'buffer' });
}
@gate()
@log()
async getStash(repoPath: string | undefined): Promise<GitStash | undefined> {
if (repoPath == null) return undefined;
@ -3194,11 +3201,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
}
@log()
getRevisionContent(repoPath: string, path: string, ref: string): Promise<Uint8Array | undefined> {
return Git.show<Buffer>(repoPath, path, ref, { encoding: 'buffer' });
}
@log()
async getVersionedUri(repoPath: string, fileName: string, ref: string | undefined): Promise<Uri | undefined> {
if (ref === GitRevision.deletedOrMissing) return undefined;

+ 1
- 1
src/git/gitProvider.ts Vedi File

@ -322,6 +322,7 @@ export interface GitProvider {
options?: { sort?: boolean | undefined },
): Promise<GitRemote<RemoteProvider | RichRemoteProvider | undefined>[]>;
getRepoPath(filePath: string, isDirectory?: boolean): Promise<string | undefined>;
getRevisionContent(repoPath: string, path: string, ref: string): Promise<Uint8Array | undefined>;
getStash(repoPath: string | undefined): Promise<GitStash | undefined>;
getStatusForFile(repoPath: string, fileName: string): Promise<GitStatusFile | undefined>;
getStatusForFiles(repoPath: string, pathOrGlob: string): Promise<GitStatusFile[] | undefined>;
@ -332,7 +333,6 @@ export interface GitProvider {
): Promise<PagedResult<GitTag>>;
getTreeEntryForRevision(repoPath: string, path: string, ref: string): Promise<GitTreeEntry | undefined>;
getTreeForRevision(repoPath: string, ref: string): Promise<GitTreeEntry[]>;
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>;

||||||
x
 
000:0
Caricamento…
Annulla
Salva