Skip to content

Commit df68fd6

Browse files
committed
Aligns naming to sub-providers
1 parent 4048c9b commit df68fd6

File tree

19 files changed

+625
-142
lines changed

19 files changed

+625
-142
lines changed

src/env/node/git/localGitProvider.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ import type { Git, PushForceOptions } from './git';
180180
import { getShaInLogRegex, GitErrors, gitLogDefaultConfigs, gitLogDefaultConfigsWithFiles } from './git';
181181
import type { GitLocation } from './locator';
182182
import { findGitPath, InvalidGitConfigError, UnableToFindGitError } from './locator';
183-
import { BranchesGitProvider } from './operations/branches';
184-
import { PatchGitProvider } from './operations/patch';
185-
import { RemotesGitProvider } from './operations/remotes';
186-
import { StagingGitProvider } from './operations/staging';
187-
import { StashGitProvider } from './operations/stash';
188-
import { StatusGitProvider } from './operations/status';
189-
import { TagsGitProvider } from './operations/tags';
190-
import { WorktreesGitProvider } from './operations/worktrees';
191183
import { CancelledRunError, fsExists } from './shell';
184+
import { BranchesGitSubProvider } from './sub-providers/branches';
185+
import { PatchGitSubProvider } from './sub-providers/patch';
186+
import { RemotesGitSubProvider } from './sub-providers/remotes';
187+
import { StagingGitSubProvider } from './sub-providers/staging';
188+
import { StashGitSubProvider } from './sub-providers/stash';
189+
import { StatusGitSubProvider } from './sub-providers/status';
190+
import { TagsGitSubProvider } from './sub-providers/tags';
191+
import { WorktreesGitSubProvider } from './sub-providers/worktrees';
192192

193193
const emptyArray = Object.freeze([]) as unknown as any[];
194194
const emptyPromise: Promise<GitBlame | GitDiffFile | GitLog | undefined> = Promise.resolve(undefined);
@@ -4846,42 +4846,42 @@ export class LocalGitProvider implements GitProvider, Disposable {
48464846
return (await this.git.rev_parse__verify(repoPath, ref)) != null;
48474847
}
48484848

4849-
private _branches: BranchesGitProvider | undefined;
4850-
get branches(): BranchesGitProvider {
4851-
return (this._branches ??= new BranchesGitProvider(this.container, this.git, this._cache, this));
4849+
private _branches: BranchesGitSubProvider | undefined;
4850+
get branches(): BranchesGitSubProvider {
4851+
return (this._branches ??= new BranchesGitSubProvider(this.container, this.git, this._cache, this));
48524852
}
48534853

4854-
private _patch: PatchGitProvider | undefined;
4855-
get patch(): PatchGitProvider | undefined {
4856-
return (this._patch ??= new PatchGitProvider(this.container, this.git, this));
4854+
private _patch: PatchGitSubProvider | undefined;
4855+
get patch(): PatchGitSubProvider | undefined {
4856+
return (this._patch ??= new PatchGitSubProvider(this.container, this.git, this));
48574857
}
48584858

4859-
private _remotes: RemotesGitProvider | undefined;
4860-
get remotes(): RemotesGitProvider {
4861-
return (this._remotes ??= new RemotesGitProvider(this.container, this.git, this._cache, this));
4859+
private _remotes: RemotesGitSubProvider | undefined;
4860+
get remotes(): RemotesGitSubProvider {
4861+
return (this._remotes ??= new RemotesGitSubProvider(this.container, this.git, this._cache, this));
48624862
}
4863-
private _staging: StagingGitProvider | undefined;
4864-
get staging(): StagingGitProvider | undefined {
4865-
return (this._staging ??= new StagingGitProvider(this.container, this.git));
4863+
private _staging: StagingGitSubProvider | undefined;
4864+
get staging(): StagingGitSubProvider | undefined {
4865+
return (this._staging ??= new StagingGitSubProvider(this.container, this.git));
48664866
}
48674867

4868-
private _stash: StashGitProvider | undefined;
4869-
get stash(): StashGitProvider {
4870-
return (this._stash ??= new StashGitProvider(this.container, this.git, this._cache));
4868+
private _stash: StashGitSubProvider | undefined;
4869+
get stash(): StashGitSubProvider {
4870+
return (this._stash ??= new StashGitSubProvider(this.container, this.git, this._cache));
48714871
}
48724872

4873-
private _status: StatusGitProvider | undefined;
4874-
get status(): StatusGitProvider {
4875-
return (this._status ??= new StatusGitProvider(this.container, this.git, this._cache, this));
4873+
private _status: StatusGitSubProvider | undefined;
4874+
get status(): StatusGitSubProvider {
4875+
return (this._status ??= new StatusGitSubProvider(this.container, this.git, this._cache, this));
48764876
}
48774877

4878-
private _tags: TagsGitProvider | undefined;
4879-
get tags(): TagsGitProvider {
4880-
return (this._tags ??= new TagsGitProvider(this.container, this.git, this._cache));
4878+
private _tags: TagsGitSubProvider | undefined;
4879+
get tags(): TagsGitSubProvider {
4880+
return (this._tags ??= new TagsGitSubProvider(this.container, this.git, this._cache));
48814881
}
4882-
private _worktrees: WorktreesGitProvider | undefined;
4883-
get worktrees(): WorktreesGitProvider {
4884-
return (this._worktrees ??= new WorktreesGitProvider(this.container, this.git, this._cache, this));
4882+
private _worktrees: WorktreesGitSubProvider | undefined;
4883+
get worktrees(): WorktreesGitSubProvider {
4884+
return (this._worktrees ??= new WorktreesGitSubProvider(this.container, this.git, this._cache, this));
48854885
}
48864886

48874887
private _scmGitApi: Promise<ScmGitApi | undefined> | undefined;

src/env/node/git/operations/branches.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Container } from '../../../../container';
33
import type { GitCache } from '../../../../git/cache';
44
import type {
55
BranchContributionsOverview,
6-
GitProviderBranches,
6+
GitBranchesSubProvider,
77
PagedResult,
88
PagingOptions,
99
} from '../../../../git/gitProvider';
@@ -27,7 +27,7 @@ import type { LocalGitProvider } from '../localGitProvider';
2727

2828
const emptyPagedResult: PagedResult<any> = Object.freeze({ values: [] });
2929

30-
export class BranchesGitProvider implements GitProviderBranches {
30+
export class BranchesGitSubProvider implements GitBranchesSubProvider {
3131
constructor(
3232
private readonly container: Container,
3333
private readonly git: Git,
@@ -47,7 +47,7 @@ export class BranchesGitProvider implements GitProviderBranches {
4747

4848
let branchPromise = this.cache.branch?.get(repoPath);
4949
if (branchPromise == null) {
50-
async function load(this: BranchesGitProvider): Promise<GitBranch | undefined> {
50+
async function load(this: BranchesGitSubProvider): Promise<GitBranch | undefined> {
5151
const {
5252
values: [branch],
5353
} = await this.getBranches(repoPath, { filter: b => b.current });
@@ -107,7 +107,7 @@ export class BranchesGitProvider implements GitProviderBranches {
107107

108108
let resultsPromise = this.cache.branches?.get(repoPath);
109109
if (resultsPromise == null) {
110-
async function load(this: BranchesGitProvider): Promise<PagedResult<GitBranch>> {
110+
async function load(this: BranchesGitSubProvider): Promise<PagedResult<GitBranch>> {
111111
try {
112112
const data = await this.git.for_each_ref__branch(repoPath, { all: true });
113113
// If we don't get any data, assume the repo doesn't have any commits yet so check if we have a current branch

0 commit comments

Comments
 (0)