mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-16 02:56:37 +01:00
SCM - fix treeview comparison function (#203325)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user