@@ -1812,6 +1812,7 @@ class SCMInputWidgetToolbar extends WorkbenchToolBar {
18121812
18131813 constructor (
18141814 container : HTMLElement ,
1815+ input : ISCMInput ,
18151816 menuId : MenuId ,
18161817 options : IMenuWorkbenchToolBarOptions | undefined ,
18171818 @IMenuService menuService : IMenuService ,
@@ -1824,7 +1825,13 @@ class SCMInputWidgetToolbar extends WorkbenchToolBar {
18241825 ) {
18251826 super ( container , { resetMenu : menuId , ...options } , menuService , contextKeyService , contextMenuService , keybindingService , telemetryService ) ;
18261827
1827- const menu = this . _store . add ( menuService . createMenu ( menuId , contextKeyService , { emitEventsForSubmenuChanges : true } ) ) ;
1828+ const contextKeyServiceWithOverlay = contextKeyService . createOverlay ( [
1829+ [ 'scmProvider' , input . repository . provider . contextValue ] ,
1830+ [ 'scmProviderRootUri' , input . repository . provider . rootUri ?. toString ( ) ] ,
1831+ [ 'scmProviderHasRootUri' , ! ! input . repository . provider . rootUri ]
1832+ ] ) ;
1833+
1834+ const menu = this . _store . add ( menuService . createMenu ( menuId , contextKeyServiceWithOverlay , { emitEventsForSubmenuChanges : true } ) ) ;
18281835
18291836 const cancelAction = new MenuItemAction ( {
18301837 id : SCMInputCommandId . CancelAction ,
@@ -2095,7 +2102,7 @@ class SCMInputWidget {
20952102 const actionRunner = instantiationService2 . createInstance ( SCMInputWidgetActionRunner , input ) ;
20962103 this . repositoryDisposables . add ( actionRunner ) ;
20972104
2098- const toolbar : SCMInputWidgetToolbar = instantiationService2 . createInstance ( SCMInputWidgetToolbar , this . toolbarContainer , MenuId . SCMInputBox , {
2105+ const toolbar : SCMInputWidgetToolbar = instantiationService2 . createInstance ( SCMInputWidgetToolbar , this . toolbarContainer , input , MenuId . SCMInputBox , {
20992106 actionRunner,
21002107 actionViewItemProvider : action => {
21012108 if ( action instanceof MenuItemAction && toolbar . dropdownActions . length > 1 ) {
0 commit comments