boolean (@NotNull Map<GitRepository, GitBranchPair> updateConfig) { Collection<Pair<GitRepository, GitRemote>> remotes = ContainerUtil.mapNotNull(updateConfig.entrySet(), entry -> { GitRepository repository = entry.getKey(); GitBranch target = entry.getValue().getTarget(); if (target instanceof GitRemoteBranch) { return new Pair<>(repository, ((GitRemoteBranch)target).getRemote()); } else { return null; // No need to fetch non-remote branches. Shouldn't happen, but typesafe fix breaks binary compatibility. } }); return fetchSupport(myProject).fetchRemotes(remotes) .showNotificationIfFailed(GitBundle.message("notification.title.update.failed")); }