From 1177844617d1a7ebba1535083e4ddde34cb1b425 Mon Sep 17 00:00:00 2001 From: Dmitry Zhuravlev Date: Fri, 13 Dec 2019 20:16:09 +0300 Subject: [PATCH] git: reuse the common logic in fetch action GitOrigin-RevId: 4c5762f95baf5e6db8367ea897aa8d176976d9b0 --- plugins/git4idea/src/git4idea/actions/GitFetch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/actions/GitFetch.java b/plugins/git4idea/src/git4idea/actions/GitFetch.java index 6ed7a3721557..b3e6e1380474 100644 --- a/plugins/git4idea/src/git4idea/actions/GitFetch.java +++ b/plugins/git4idea/src/git4idea/actions/GitFetch.java @@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull; import static git4idea.GitUtil.getRepositories; import static git4idea.fetch.GitFetchSupport.fetchSupport; +import static git4idea.ui.branch.GitBranchActionsUtilKt.hasRemotes; public class GitFetch extends DumbAwareAction { @@ -25,8 +26,7 @@ public class GitFetch extends DumbAwareAction { e.getPresentation().setEnabledAndVisible(false); } else { - boolean hasRemotes = getRepositories(project).stream().anyMatch(repository -> !repository.getRemotes().isEmpty()); - e.getPresentation().setEnabledAndVisible(hasRemotes); + e.getPresentation().setEnabledAndVisible(hasRemotes(project)); } }