Skip to content

Commit cf5e1c2

Browse files
committed
Removes unused code
1 parent 6f4791a commit cf5e1c2

File tree

3 files changed

+3
-69
lines changed

3 files changed

+3
-69
lines changed

src/env/node/git/localGitProvider.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {
2626
import { configuration } from '../../../configuration';
2727
import { CoreGitConfiguration, GlyphChars, Schemes } from '../../../constants';
2828
import type { Container } from '../../../container';
29-
import { Features, PlusFeatures } from '../../../features';
29+
import { Features } from '../../../features';
3030
import {
3131
StashApplyError,
3232
StashApplyErrorReason,
@@ -108,7 +108,6 @@ import { SearchPattern } from '../../../git/search';
108108
import { LogCorrelationContext, Logger } from '../../../logger';
109109
import { Messages } from '../../../messages';
110110
import { WorkspaceStorageKeys } from '../../../storage';
111-
import { SubscriptionPlanId } from '../../../subscription';
112111
import { countStringLength, filterMap } from '../../../system/array';
113112
import { gate } from '../../../system/decorators/gate';
114113
import { debug, log } from '../../../system/decorators/log';
@@ -404,36 +403,6 @@ export class LocalGitProvider implements GitProvider, Disposable {
404403
};
405404
}
406405

407-
private _allowedFeatures = new Map<string, Map<PlusFeatures, boolean>>();
408-
async allows(feature: PlusFeatures, plan: SubscriptionPlanId, repoPath?: string): Promise<boolean> {
409-
if (plan === SubscriptionPlanId.Free) return false;
410-
if (plan === SubscriptionPlanId.Pro) return true;
411-
412-
if (repoPath == null) {
413-
const repositories = [...this.container.git.getOpenRepositories(this.descriptor.id)];
414-
415-
for await (const result of fastestSettled(repositories.map(r => this.allows(feature, plan, r.path)))) {
416-
if (result.status !== 'fulfilled' || !result.value) return false;
417-
}
418-
return true;
419-
}
420-
421-
let allowedByRepo = this._allowedFeatures.get(repoPath);
422-
let allowed = allowedByRepo?.get(feature);
423-
if (allowed != null) return allowed;
424-
425-
allowed = GitProviderService.previewFeatures?.get(feature)
426-
? true
427-
: (await this.visibility(repoPath)) !== RepositoryVisibility.Private;
428-
if (allowedByRepo == null) {
429-
allowedByRepo = new Map<PlusFeatures, boolean>();
430-
this._allowedFeatures.set(repoPath, allowedByRepo);
431-
}
432-
433-
allowedByRepo.set(feature, allowed);
434-
return allowed;
435-
}
436-
437406
private _supportedFeatures = new Map<Features, boolean>();
438407
async supports(feature: Features): Promise<boolean> {
439408
let supported = this._supportedFeatures.get(feature);

src/git/gitProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Disposable, Event, Range, TextDocument, Uri, WorkspaceFolder } from 'vscode';
22
import type { Commit, InputBox } from '../@types/vscode.git';
3-
import { Features, PlusFeatures } from '../features';
4-
import type { SubscriptionPlanId } from '../subscription';
3+
import { Features } from '../features';
54
import type { GitUri } from './gitUri';
65
import type {
76
BranchSortOptions,
@@ -116,7 +115,6 @@ export interface GitProvider extends Disposable {
116115
): Repository;
117116
openRepositoryInitWatcher?(): RepositoryInitWatcher;
118117

119-
allows(feature: PlusFeatures, plan: SubscriptionPlanId, repoPath?: string): Promise<boolean>;
120118
supports(feature: Features): Promise<boolean>;
121119
visibility(repoPath: string): Promise<RepositoryVisibility>;
122120

src/plus/github/githubGitProvider.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
OpenVirtualRepositoryError,
2626
OpenVirtualRepositoryErrorReason,
2727
} from '../../errors';
28-
import { Features, PlusFeatures } from '../../features';
28+
import { Features } from '../../features';
2929
import {
3030
GitProvider,
3131
GitProviderId,
@@ -38,7 +38,6 @@ import {
3838
RepositoryVisibility,
3939
ScmRepository,
4040
} from '../../git/gitProvider';
41-
import { GitProviderService } from '../../git/gitProviderService';
4241
import { GitUri } from '../../git/gitUri';
4342
import {
4443
BranchSortOptions,
@@ -82,12 +81,10 @@ import { RemoteProviderFactory, RemoteProviders } from '../../git/remotes/factor
8281
import { RemoteProvider, RichRemoteProvider } from '../../git/remotes/provider';
8382
import { SearchPattern } from '../../git/search';
8483
import { LogCorrelationContext, Logger } from '../../logger';
85-
import { SubscriptionPlanId } from '../../subscription';
8684
import { gate } from '../../system/decorators/gate';
8785
import { debug, log } from '../../system/decorators/log';
8886
import { filterMap, some } from '../../system/iterable';
8987
import { isAbsolute, isFolderGlob, maybeUri, normalizePath, relative } from '../../system/path';
90-
import { fastestSettled } from '../../system/promise';
9188
import { CachedBlame, CachedLog, GitDocumentState } from '../../trackers/gitDocumentTracker';
9289
import { TrackedDocument } from '../../trackers/trackedDocument';
9390
import { getRemoteHubApi, GitHubAuthorityMetadata, Metadata, RemoteHubApi } from '../remotehub';
@@ -189,36 +186,6 @@ export class GitHubGitProvider implements GitProvider, Disposable {
189186
);
190187
}
191188

192-
private _allowedFeatures = new Map<string, Map<PlusFeatures, boolean>>();
193-
async allows(feature: PlusFeatures, plan: SubscriptionPlanId, repoPath?: string): Promise<boolean> {
194-
if (plan === SubscriptionPlanId.Free) return false;
195-
if (plan === SubscriptionPlanId.Pro) return true;
196-
197-
if (repoPath == null) {
198-
const repositories = [...this.container.git.getOpenRepositories(this.descriptor.id)];
199-
200-
for await (const result of fastestSettled(repositories.map(r => this.allows(feature, plan, r.path)))) {
201-
if (result.status !== 'fulfilled' || !result.value) return false;
202-
}
203-
return true;
204-
}
205-
206-
let allowedByRepo = this._allowedFeatures.get(repoPath);
207-
let allowed = allowedByRepo?.get(feature);
208-
if (allowed != null) return allowed;
209-
210-
allowed = GitProviderService.previewFeatures?.get(feature)
211-
? true
212-
: (await this.visibility(repoPath)) === RepositoryVisibility.Public;
213-
if (allowedByRepo == null) {
214-
allowedByRepo = new Map<PlusFeatures, boolean>();
215-
this._allowedFeatures.set(repoPath, allowedByRepo);
216-
}
217-
218-
allowedByRepo.set(feature, allowed);
219-
return allowed;
220-
}
221-
222189
// private _supportedFeatures = new Map<Features, boolean>();
223190
async supports(feature: Features): Promise<boolean> {
224191
// const supported = this._supportedFeatures.get(feature);

0 commit comments

Comments
 (0)