@@ -114,6 +114,7 @@ import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
114
114
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate' ;
115
115
import { IWorkbenchLayoutService , Position } from 'vs/workbench/services/layout/browser/layoutService' ;
116
116
import { fromNow } from 'vs/base/common/date' ;
117
+ import { equals } from 'vs/base/common/arrays' ;
117
118
118
119
// type SCMResourceTreeNode = IResourceNode<ISCMResource, ISCMResourceGroup>;
119
120
// type SCMHistoryItemChangeResourceTreeNode = IResourceNode<SCMHistoryItemChangeTreeElement, SCMHistoryItemTreeElement>;
@@ -4124,6 +4125,23 @@ class SCMTreeHistoryProviderDataSource extends Disposable {
4124
4125
} ) ;
4125
4126
}
4126
4127
4128
+ // If we only have one history item that contains all the
4129
+ // labels (current, remote, base), we don't need to show it
4130
+ if ( historyItemsElement . length === 1 ) {
4131
+ const currentHistoryItemGroupLabels = [
4132
+ currentHistoryItemGroup . name ,
4133
+ ...currentHistoryItemGroup . remote ? [ currentHistoryItemGroup . remote . name ] : [ ] ,
4134
+ ...currentHistoryItemGroup . base ? [ currentHistoryItemGroup . base . name ] : [ ] ,
4135
+ ] ;
4136
+
4137
+ const labels = ( historyItemsElement [ 0 ] . labels ?? [ ] )
4138
+ . map ( l => l . title ) ;
4139
+
4140
+ if ( equals ( currentHistoryItemGroupLabels . sort ( ) , labels . sort ( ) ) ) {
4141
+ return [ ] ;
4142
+ }
4143
+ }
4144
+
4127
4145
// Create the color map
4128
4146
const colorMap = new Map < string , ColorIdentifier > ( [
4129
4147
[ currentHistoryItemGroup . name , historyItemGroupLocal ]
0 commit comments