From 0a358110fab927c577a9a77db51e14f934e7d25d Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 23 Jan 2019 01:24:30 -0500 Subject: [PATCH] Uses the default remote first in issue linking --- CHANGELOG.md | 1 + src/annotations/annotations.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 445b647..0d72d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - Fixes [#631](https://github.com/eamodio/vscode-gitlens/issues/631) - Remotes fail to show in gui - Fixes [#633](https://github.com/eamodio/vscode-gitlens/issues/633) - Compare File with Previous Revision doesn't work if path contains '#' - Fixes an issue where the _Open File_, _Open File on Remote_, and _Copy Remote Url to Clipboard_ commands didn't always work on changed files in the _Repositories_ view +- Fixes an issue where the default remote wasn't used first to provide automatic issue linking ## [9.4.1] - 2019-01-08 diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index 8223605..c24b9d4 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -144,6 +144,13 @@ export class Annotations { )} "Show Commit Details")`; message = CommitFormatter.fromTemplate('${message}', commit); + + remotes.sort( + (a, b) => + (a.default ? -1 : 1) - (b.default ? -1 : 1) || + a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }) + ); + for (const r of remotes) { if (r.provider === undefined) continue;