Browse Source

Sorts master & develop to top of branches

main
Eric Amodio 4 years ago
parent
commit
26c16367a7
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/git/models/branch.ts

+ 4
- 0
src/git/models/branch.ts View File

@ -58,6 +58,8 @@ export class GitBranch implements GitReference {
(a, b) =>
(a.current ? -1 : 1) - (b.current ? -1 : 1) ||
(a.starred ? -1 : 1) - (b.starred ? -1 : 1) ||
(a.name === 'master' ? -1 : 0) ||
(a.name === 'develop' ? (b.name === 'master' ? 0 : -1) : 0) ||
(b.remote ? -1 : 1) - (a.remote ? -1 : 1) ||
b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' })
);
@ -66,6 +68,8 @@ export class GitBranch implements GitReference {
(a, b) =>
(a.current ? -1 : 1) - (b.current ? -1 : 1) ||
(a.starred ? -1 : 1) - (b.starred ? -1 : 1) ||
(a.name === 'master' ? -1 : 0) ||
(a.name === 'develop' ? (b.name === 'master' ? 0 : -1) : 0) ||
(b.remote ? -1 : 1) - (a.remote ? -1 : 1) ||
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' })
);

||||||
x
 
000:0
Loading…
Cancel
Save