From 6d79813ddeb3ea65a0b477dc2689ba57e5dd249a Mon Sep 17 00:00:00 2001 From: Ramin Tadayon Date: Wed, 9 Aug 2023 16:56:11 -0700 Subject: [PATCH] Uses default remote for deep links when configured --- src/commands/copyDeepLink.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/copyDeepLink.ts b/src/commands/copyDeepLink.ts index 4c492c1..6d9539c 100644 --- a/src/commands/copyDeepLink.ts +++ b/src/commands/copyDeepLink.ts @@ -106,8 +106,11 @@ export class CopyDeepLinkCommand extends ActiveEditorCommand { try { let chosenRemote; const remotes = await this.container.git.getRemotes(repoPath, { sort: true }); + const defaultRemote = remotes.find(r => r.default); if (args.remote && !args.prePickRemote) { chosenRemote = remotes.find(r => r.name === args?.remote); + } else if (defaultRemote != null) { + chosenRemote = defaultRemote; } else { const pick = await showRemotePicker( `Copy Link to ${deepLinkTypeToString(type)}`,