Skip to content

Commit f6a942b

Browse files
committed
Adds remote to provider connection command
Ensures the remote name is passed to the connect remote provider command. This allows the command to correctly identify the remote when connecting to the provider.
1 parent ba55b58 commit f6a942b

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

src/commands/remoteProviders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { CommandContext } from './commandContext';
1313
import { isCommandContextViewNodeHasRemote } from './commandContext.utils';
1414

1515
export interface ConnectRemoteProviderCommandArgs {
16-
remote?: string;
16+
remote: string;
1717
repoPath: string;
1818
}
1919

src/git/models/repositoryShape.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ export interface RepositoryShape {
1414
integration?: { id: SupportedCloudIntegrationIds; connected: boolean };
1515
supportedFeatures: RemoteProviderSupportedFeatures;
1616
url?: string;
17+
remoteName: string;
1718
};
1819
}

src/git/utils/-webview/repository.utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export async function toRepositoryShapeWithProvider(
9494
: undefined,
9595
supportedFeatures: remote.provider.supportedFeatures,
9696
url: await remote.provider.url({ type: RemoteResourceType.Repo }),
97+
remoteName: remote.name,
9798
};
9899
if (provider.integration?.id == null) {
99100
provider.integration = undefined;

src/webviews/apps/shared/components/repo-button-group.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class GlRepoButtonGroup extends GlElement {
200200
<a
201201
href=${createCommandLink<ConnectRemoteProviderCommandArgs>(
202202
'gitlens.connectRemoteProvider',
203-
{ repoPath: repo.path },
203+
{ repoPath: repo.path, remote: provider.remoteName },
204204
)}
205205
>
206206
Connect to ${repo.provider!.name}
@@ -229,6 +229,7 @@ export class GlRepoButtonGroup extends GlElement {
229229
appearance="toolbar"
230230
href=${createCommandLink<ConnectRemoteProviderCommandArgs>('gitlens.connectRemoteProvider', {
231231
repoPath: repo.path,
232+
remote: provider.remoteName,
232233
})}
233234
>
234235
<code-icon icon="plug" style="color: var(--titlebar-fg)"></code-icon>

0 commit comments

Comments
 (0)