Browse Source

Renames hasRichProvider to hasRichIntegration

- Aligns with RichRemoteProvider call
main
Eric Amodio 1 year ago
parent
commit
badc322cbd
9 changed files with 10 additions and 10 deletions
  1. +1
    -1
      src/annotations/autolinks.ts
  2. +2
    -2
      src/commands/remoteProviders.ts
  3. +1
    -1
      src/env/node/git/localGitProvider.ts
  4. +1
    -1
      src/git/gitProviderService.ts
  5. +1
    -1
      src/git/models/remote.ts
  6. +1
    -1
      src/quickpicks/remoteProviderPicker.ts
  7. +1
    -1
      src/views/nodes/commitNode.ts
  8. +1
    -1
      src/views/nodes/fileRevisionAsCommitNode.ts
  9. +1
    -1
      src/views/nodes/rebaseStatusNode.ts

+ 1
- 1
src/annotations/autolinks.ts View File

@ -197,7 +197,7 @@ export class Autolinks implements Disposable {
remote: GitRemote,
options?: { autolinks?: Map<string, Autolink>; timeout?: number },
) {
if (!remote.hasRichProvider()) return undefined;
if (!remote.hasRichIntegration()) return undefined;
const { provider } = remote;
const connected = provider.maybeConnected ?? (await provider.isConnected());

+ 2
- 2
src/commands/remoteProviders.ts View File

@ -85,7 +85,7 @@ export class ConnectRemoteProviderCommand extends Command {
remotes = await this.container.git.getRemotesWithProviders(repoPath);
remote = remotes.find(r => r.name === args.remote) as GitRemote<RichRemoteProvider> | undefined;
if (!remote?.hasRichProvider()) return false;
if (!remote?.hasRichIntegration()) return false;
}
const connected = await remote.provider.connect();
@ -177,7 +177,7 @@ export class DisconnectRemoteProviderCommand extends Command {
remote = (await this.container.git.getRemotesWithProviders(repoPath)).find(r => r.name === args.remote) as
| GitRemote<RichRemoteProvider>
| undefined;
if (!remote?.hasRichProvider()) return undefined;
if (!remote?.hasRichIntegration()) return undefined;
}
return remote.provider.disconnect();

+ 1
- 1
src/env/node/git/localGitProvider.ts View File

@ -5298,7 +5298,7 @@ async function disposeRemotes(remotes: (Promise | undefined)[]) {
const remotesResults = await Promise.allSettled(remotes);
for (const remotes of remotesResults) {
for (const remote of getSettledValue(remotes) ?? []) {
if (remote.hasRichProvider()) {
if (remote.hasRichIntegration()) {
remote.provider?.dispose();
}
}

+ 1
- 1
src/git/gitProviderService.ts View File

@ -2207,7 +2207,7 @@ export class GitProviderService implements Disposable {
const includeDisconnected = options?.includeDisconnected ?? false;
for (const r of remotes) {
if (r.hasRichProvider() && (includeDisconnected || r.provider.maybeConnected === true)) {
if (r.hasRichIntegration() && (includeDisconnected || r.provider.maybeConnected === true)) {
return r;
}
}

+ 1
- 1
src/git/models/remote.ts View File

@ -106,7 +106,7 @@ export class GitRemote
return this._domain ? `${this._domain}/${this._path}` : this.path;
}
hasRichProvider(): this is GitRemote<RichRemoteProvider> {
hasRichIntegration(): this is GitRemote<RichRemoteProvider> {
return this.provider?.hasRichIntegration() ?? false;
}

+ 1
- 1
src/quickpicks/remoteProviderPicker.ts View File

@ -54,7 +54,7 @@ export class CopyOrOpenRemoteCommandQuickPickItem extends CommandQuickPickItem {
let branch = resource.base.branch;
if (branch == null) {
branch = await Container.instance.git.getDefaultBranchName(this.remote.repoPath, this.remote.name);
if (branch == null && this.remote.hasRichProvider()) {
if (branch == null && this.remote.hasRichIntegration()) {
const defaultBranch = await this.remote.provider.getDefaultBranch?.();
branch = defaultBranch?.name;
}

+ 1
- 1
src/views/nodes/commitNode.ts View File

@ -246,7 +246,7 @@ export class CommitNode extends ViewRefNode
let autolinkedIssuesOrPullRequests;
let pr;
if (remote?.hasRichProvider()) {
if (remote?.hasRichIntegration()) {
const [autolinkedIssuesOrPullRequestsResult, prResult] = await Promise.allSettled([
this.view.container.autolinks.getLinkedIssuesAndPullRequests(
this.commit.message ?? this.commit.summary,

+ 1
- 1
src/views/nodes/fileRevisionAsCommitNode.ts View File

@ -213,7 +213,7 @@ export class FileRevisionAsCommitNode extends ViewRefFileNode
let autolinkedIssuesOrPullRequests;
let pr;
if (remote?.hasRichProvider()) {
if (remote?.hasRichIntegration()) {
const [autolinkedIssuesOrPullRequestsResult, prResult] = await Promise.allSettled([
this.view.container.autolinks.getLinkedIssuesAndPullRequests(
this.commit.message ?? this.commit.summary,

+ 1
- 1
src/views/nodes/rebaseStatusNode.ts View File

@ -205,7 +205,7 @@ export class RebaseCommitNode extends ViewRefNode
let autolinkedIssuesOrPullRequests;
let pr;
if (remote?.hasRichProvider()) {
if (remote?.hasRichIntegration()) {
const [autolinkedIssuesOrPullRequestsResult, prResult] = await Promise.allSettled([
this.view.container.autolinks.getLinkedIssuesAndPullRequests(
this.commit.message ?? this.commit.summary,

Loading…
Cancel
Save