mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
feat(git): Added remote url type option (#146124)
* feat(git): Added remote url type option * Modify extension configuration * Simplified code Co-authored-by: Joao Moreno <joao.moreno@microsoft.com>
This commit is contained in:
@@ -73,7 +73,9 @@ async function handlePushError(repository: Repository, remote: Remote, refspec:
|
||||
await repository.renameRemote(remote.name, 'upstream');
|
||||
|
||||
// Issue: what if there's already another `origin` repo?
|
||||
await repository.addRemote('origin', ghRepository.clone_url);
|
||||
const protocol = workspace.getConfiguration('github').get<'https' | 'ssh'>('gitProtocol');
|
||||
const remoteUrl = protocol === 'https' ? ghRepository.clone_url : ghRepository.ssh_url;
|
||||
await repository.addRemote('origin', remoteUrl);
|
||||
|
||||
try {
|
||||
await repository.fetch('origin', remoteName);
|
||||
|
||||
Reference in New Issue
Block a user