Skip to content

Commit fc9757e

Browse files
suekaeamodio
authored andcommitted
Fixes #1357 - Corrects the compare functions
1 parent 85fe438 commit fc9757e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/git/models/branch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class GitBranch implements GitBranchReference {
6363
(a.name === 'master' ? -1 : 1) - (b.name === 'master' ? -1 : 1) ||
6464
(a.name === 'develop' ? -1 : 1) - (b.name === 'develop' ? -1 : 1) ||
6565
(b.remote ? -1 : 1) - (a.remote ? -1 : 1) ||
66-
b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' }),
66+
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }),
6767
);
6868
default:
6969
return branches.sort(
@@ -74,7 +74,7 @@ export class GitBranch implements GitBranchReference {
7474
(a.name === 'master' ? -1 : 1) - (b.name === 'master' ? -1 : 1) ||
7575
(a.name === 'develop' ? -1 : 1) - (b.name === 'develop' ? -1 : 1) ||
7676
(b.remote ? -1 : 1) - (a.remote ? -1 : 1) ||
77-
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }),
77+
b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' }),
7878
);
7979
}
8080
}

src/git/models/tag.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export class GitTag implements GitTagReference {
3232
return tags.sort((a, b) => b.date.getTime() - a.date.getTime());
3333
case TagSorting.NameAsc:
3434
return tags.sort((a, b) =>
35-
b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' }),
35+
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }),
3636
);
3737
default:
3838
return tags.sort((a, b) =>
39-
a.name.localeCompare(b.name, undefined, { numeric: true, sensitivity: 'base' }),
39+
b.name.localeCompare(a.name, undefined, { numeric: true, sensitivity: 'base' }),
4040
);
4141
}
4242
}

0 commit comments

Comments
 (0)