Selaa lähdekoodia

Moves getOldestUnpushedRefForFile location

main
Eric Amodio 1 vuosi sitten
vanhempi
commit
1c80e54992
4 muutettua tiedostoa jossa 30 lisäystä ja 24 poistoa
  1. +17
    -17
      src/env/node/git/localGitProvider.ts
  2. +1
    -1
      src/git/gitProvider.ts
  3. +6
    -0
      src/git/gitProviderService.ts
  4. +6
    -6
      src/plus/github/githubGitProvider.ts

+ 17
- 17
src/env/node/git/localGitProvider.ts Näytä tiedosto

@ -2134,23 +2134,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
}
@log()
async getOldestUnpushedRefForFile(repoPath: string, uri: Uri): Promise<string | undefined> {
const [relativePath, root] = splitPath(uri, repoPath);
const data = await this.git.log__file(root, relativePath, '@{push}..', {
argsOrFormat: ['-z', '--format=%H'],
fileMode: 'none',
ordering: configuration.get('advanced.commitOrdering'),
renames: true,
});
if (!data) return undefined;
// -2 to skip the ending null
const index = data.lastIndexOf('\0', data.length - 2);
return index === -1 ? undefined : data.slice(index + 1, data.length - 2);
}
@log()
async getContributors(
repoPath: string,
options?: { all?: boolean; ref?: string; stats?: boolean },
@ -3411,6 +3394,23 @@ export class LocalGitProvider implements GitProvider, Disposable {
}
@log()
async getOldestUnpushedRefForFile(repoPath: string, uri: Uri): Promise<string | undefined> {
const [relativePath, root] = splitPath(uri, repoPath);
const data = await this.git.log__file(root, relativePath, '@{push}..', {
argsOrFormat: ['-z', '--format=%H'],
fileMode: 'none',
ordering: configuration.get('advanced.commitOrdering'),
renames: true,
});
if (!data) return undefined;
// -2 to skip the ending null
const index = data.lastIndexOf('\0', data.length - 2);
return index === -1 ? undefined : data.slice(index + 1, data.length - 2);
}
@log()
async getPreviousComparisonUris(
repoPath: string,
uri: Uri,

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

@ -236,7 +236,6 @@ export interface GitProvider extends Disposable {
ref?: string;
},
): Promise<GitGraph>;
getOldestUnpushedRefForFile(repoPath: string, uri: Uri): Promise<string | undefined>;
getContributors(
repoPath: string,
options?: { all?: boolean | undefined; ref?: string | undefined; stats?: boolean | undefined },
@ -335,6 +334,7 @@ export interface GitProvider extends Disposable {
ref: string | undefined,
skip?: number,
): Promise<NextComparisonUrisResult | undefined>;
getOldestUnpushedRefForFile(repoPath: string, uri: Uri): Promise<string | undefined>;
getPreviousComparisonUris(
repoPath: string,
uri: Uri,

+ 6
- 0
src/git/gitProviderService.ts Näytä tiedosto

@ -1611,6 +1611,12 @@ export class GitProviderService implements Disposable {
}
@log()
async getOldestUnpushedRefForFile(repoPath: string | Uri, uri: Uri): Promise<string | undefined> {
const { provider, path } = this.getProvider(repoPath);
return provider.getOldestUnpushedRefForFile(path, uri);
}
@log()
getPreviousComparisonUris(
repoPath: string | Uri,
uri: Uri,

+ 6
- 6
src/plus/github/githubGitProvider.ts Näytä tiedosto

@ -1371,12 +1371,6 @@ export class GitHubGitProvider implements GitProvider, Disposable {
}
@log()
async getOldestUnpushedRefForFile(_repoPath: string, _uri: Uri): Promise<string | undefined> {
// TODO@eamodio until we have access to the RemoteHub change store there isn't anything we can do here
return undefined;
}
@log()
async getContributors(
repoPath: string,
_options?: { all?: boolean; ref?: string; stats?: boolean },
@ -2152,6 +2146,12 @@ export class GitHubGitProvider implements GitProvider, Disposable {
}
@log()
async getOldestUnpushedRefForFile(_repoPath: string, _uri: Uri): Promise<string | undefined> {
// TODO@eamodio until we have access to the RemoteHub change store there isn't anything we can do here
return undefined;
}
@log()
async getPreviousComparisonUris(
repoPath: string,
uri: Uri,

Ladataan…
Peruuta
Tallenna