From 21838f76d3c456c70915068e85738987560db07c Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Fri, 12 Jul 2024 14:54:49 +1000 Subject: [PATCH] feat: prefer "origin" or "upstream" remote if exists --- src/extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 519a624..78d2cfe 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -59,7 +59,9 @@ export function activate(context: vscode.ExtensionContext) { return; } - const fetchUrl = repository.state.remotes[0].fetchUrl; + const remote = repository.state.remotes.find((r) => ['origin', 'upstream'].includes(r.name)) || + repository.state.remotes[0] + const fetchUrl = remote.fetchUrl; const httpsUrl = normalize(fetchUrl!); const upperPath = repository.rootUri.fsPath;