|
@ -23,7 +23,7 @@ export class ConnectRemoteProviderCommand extends Command { |
|
|
let args: ConnectRemoteProviderCommandArgs | GitCommit; |
|
|
let args: ConnectRemoteProviderCommandArgs | GitCommit; |
|
|
if (GitRemote.is(argsOrRemote)) { |
|
|
if (GitRemote.is(argsOrRemote)) { |
|
|
args = { |
|
|
args = { |
|
|
remote: argsOrRemote.id, |
|
|
|
|
|
|
|
|
remote: argsOrRemote.name, |
|
|
repoPath: argsOrRemote.repoPath, |
|
|
repoPath: argsOrRemote.repoPath, |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
@ -39,7 +39,7 @@ export class ConnectRemoteProviderCommand extends Command { |
|
|
|
|
|
|
|
|
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) { |
|
|
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) { |
|
|
if (isCommandContextViewNodeHasRemote(context)) { |
|
|
if (isCommandContextViewNodeHasRemote(context)) { |
|
|
args = { ...args, remote: context.node.remote.id, repoPath: context.node.remote.repoPath }; |
|
|
|
|
|
|
|
|
args = { ...args, remote: context.node.remote.name, repoPath: context.node.remote.repoPath }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return this.execute(args); |
|
|
return this.execute(args); |
|
@ -84,7 +84,7 @@ export class ConnectRemoteProviderCommand extends Command { |
|
|
repoPath = args.repoPath; |
|
|
repoPath = args.repoPath; |
|
|
|
|
|
|
|
|
remotes = await this.container.git.getRemotesWithProviders(repoPath); |
|
|
remotes = await this.container.git.getRemotesWithProviders(repoPath); |
|
|
remote = remotes.find(r => r.id === args.remote) as GitRemote<RichRemoteProvider> | undefined; |
|
|
|
|
|
|
|
|
remote = remotes.find(r => r.name === args.remote) as GitRemote<RichRemoteProvider> | undefined; |
|
|
if (!remote?.hasRichProvider()) return false; |
|
|
if (!remote?.hasRichProvider()) return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -112,7 +112,7 @@ export class DisconnectRemoteProviderCommand extends Command { |
|
|
let args: DisconnectRemoteProviderCommandArgs | GitCommit; |
|
|
let args: DisconnectRemoteProviderCommandArgs | GitCommit; |
|
|
if (GitRemote.is(argsOrRemote)) { |
|
|
if (GitRemote.is(argsOrRemote)) { |
|
|
args = { |
|
|
args = { |
|
|
remote: argsOrRemote.id, |
|
|
|
|
|
|
|
|
remote: argsOrRemote.name, |
|
|
repoPath: argsOrRemote.repoPath, |
|
|
repoPath: argsOrRemote.repoPath, |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
@ -131,7 +131,7 @@ export class DisconnectRemoteProviderCommand extends Command { |
|
|
|
|
|
|
|
|
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) { |
|
|
protected override preExecute(context: CommandContext, args?: ConnectRemoteProviderCommandArgs) { |
|
|
if (isCommandContextViewNodeHasRemote(context)) { |
|
|
if (isCommandContextViewNodeHasRemote(context)) { |
|
|
args = { ...args, remote: context.node.remote.id, repoPath: context.node.remote.repoPath }; |
|
|
|
|
|
|
|
|
args = { ...args, remote: context.node.remote.name, repoPath: context.node.remote.repoPath }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return this.execute(args); |
|
|
return this.execute(args); |
|
@ -174,7 +174,7 @@ export class DisconnectRemoteProviderCommand extends Command { |
|
|
} else { |
|
|
} else { |
|
|
repoPath = args.repoPath; |
|
|
repoPath = args.repoPath; |
|
|
|
|
|
|
|
|
remote = (await this.container.git.getRemotesWithProviders(repoPath)).find(r => r.id === args.remote) as |
|
|
|
|
|
|
|
|
remote = (await this.container.git.getRemotesWithProviders(repoPath)).find(r => r.name === args.remote) as |
|
|
| GitRemote<RichRemoteProvider> |
|
|
| GitRemote<RichRemoteProvider> |
|
|
| undefined; |
|
|
| undefined; |
|
|
if (!remote?.hasRichProvider()) return undefined; |
|
|
if (!remote?.hasRichProvider()) return undefined; |
|
|