ソースを参照

Sorts remotes with default first

main
Eric Amodio 6年前
コミット
c4d418c4d7
2個のファイルの変更9行の追加1行の削除
  1. +4
    -0
      CHANGELOG.md
  2. +5
    -1
      src/views/nodes/remotesNode.ts

+ 4
- 0
CHANGELOG.md ファイルの表示

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
### Changed
- Changes the sorting of remotes in the _Repositories_ view to sort the default remote first
### Fixed
- Fixes [#591](https://github.com/eamodio/vscode-gitlens/issues/591) - GitLens Error: Unable to open

+ 5
- 1
src/views/nodes/remotesNode.ts ファイルの表示

@ -28,7 +28,11 @@ export class RemotesNode extends ViewNode {
return [new MessageNode(this.view, this, 'No remotes could be found')];
}
remotes.sort((a, b) => a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }));
remotes.sort(
(a, b) =>
(a.default ? -1 : 1) - (b.default ? -1 : 1) ||
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' })
);
return [...Iterables.map(remotes, r => new RemoteNode(this.uri, this.view, this, r, this.repo))];
}

読み込み中…
キャンセル
保存