From 22705370100e36bfcd8252290d56b2c06c5e7346 Mon Sep 17 00:00:00 2001 From: Ulysse McConnell Date: Thu, 2 Apr 2020 23:40:53 +0200 Subject: [PATCH] Disable git initialize repository when no open workspace Fixes #7487 Signed-off-by: Ulysse McConnell --- packages/git/src/browser/git-contribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/git/src/browser/git-contribution.ts b/packages/git/src/browser/git-contribution.ts index 8e2b3140338d7..62b986e08653e 100644 --- a/packages/git/src/browser/git-contribution.ts +++ b/packages/git/src/browser/git-contribution.ts @@ -439,8 +439,8 @@ export class GitContribution implements CommandContribution, MenuContribution, T }); registry.registerCommand(GIT_COMMANDS.INIT_REPOSITORY, { execute: () => this.quickOpenService.initRepository(), - isEnabled: widget => (!widget || widget instanceof ScmWidget) && !this.repositoryProvider.selectedRepository, - isVisible: widget => (!widget || widget instanceof ScmWidget) && !this.repositoryProvider.selectedRepository + isEnabled: widget => this.workspaceService.opened && (!widget || widget instanceof ScmWidget) && !this.repositoryProvider.selectedRepository, + isVisible: widget => this.workspaceService.opened && (!widget || widget instanceof ScmWidget) && !this.repositoryProvider.selectedRepository }); } async amend(): Promise {