From f4e3de89a324167e93a5c97be5d98b24f7dd19bc Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Tue, 14 Feb 2017 17:20:17 +0000 Subject: [PATCH] Hide the create branch action if there are no Git repositories Follow-up to 4724801 --- .../git4idea/src/git4idea/actions/GitCreateNewBranchAction.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git4idea/src/git4idea/actions/GitCreateNewBranchAction.kt b/plugins/git4idea/src/git4idea/actions/GitCreateNewBranchAction.kt index e98c97057f01..7663e516d961 100644 --- a/plugins/git4idea/src/git4idea/actions/GitCreateNewBranchAction.kt +++ b/plugins/git4idea/src/git4idea/actions/GitCreateNewBranchAction.kt @@ -63,6 +63,7 @@ internal class GitCreateNewBranchAction : DumbAwareAction() { private fun collectData(e: AnActionEvent): Data { val project = e.project ?: return Data.Invisible() val manager = getRepositoryManager(project) + if (manager.repositories.isEmpty()) return Data.Invisible() val log = e.getData(VcsLogDataKeys.VCS_LOG) if (log != null) {