mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
git: reuse the common logic in fetch action
GitOrigin-RevId: 4c5762f95baf5e6db8367ea897aa8d176976d9b0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
789cbf5102
commit
1177844617
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user