mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
SCM - fix treeview comparison function (#203325)
This commit is contained in:
parent
c75ad1fd11
commit
fa7c021a82
|
@ -1171,28 +1171,16 @@ export class SCMTreeSorter implements ITreeSorter<TreeElement> {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (isSCMViewSeparator(one)) {
|
||||
if (!isSCMHistoryItemGroupTreeElement(other) && !isSCMResourceGroup(other)) {
|
||||
throw new Error('Invalid comparison');
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (isSCMResourceGroup(one)) {
|
||||
return isSCMResourceGroup(other) ? 0 : -1;
|
||||
}
|
||||
|
||||
if (isSCMResourceGroup(one)) {
|
||||
if (!isSCMResourceGroup(other)) {
|
||||
throw new Error('Invalid comparison');
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (isSCMViewSeparator(one)) {
|
||||
return isSCMResourceGroup(other) ? 1 : -1;
|
||||
}
|
||||
|
||||
if (isSCMHistoryItemGroupTreeElement(one)) {
|
||||
if (!isSCMHistoryItemGroupTreeElement(other) && !isSCMResourceGroup(other) && !isSCMViewSeparator(other)) {
|
||||
throw new Error('Invalid comparison');
|
||||
}
|
||||
|
||||
return 0;
|
||||
return isSCMHistoryItemGroupTreeElement(other) ? 0 : 1;
|
||||
}
|
||||
|
||||
if (isSCMHistoryItemTreeElement(one)) {
|
||||
|
|
Loading…
Reference in a new issue