boolean (@NotNull Map<GitRepository, GitPushRepoResult> rejected) { boolean pushingToNotTrackedBranch = ContainerUtil.exists(rejected.entrySet(), entry -> { GitRepository repository = entry.getKey(); GitLocalBranch currentBranch = repository.getCurrentBranch(); if (currentBranch == null) return true; GitBranchTrackInfo trackInfo = GitBranchUtil.getTrackInfoForBranch(repository, currentBranch); return trackInfo == null || !trackInfo.getRemoteBranch().getFullName().equals(entry.getValue().getTargetBranch()); }); LOG.debug("Pushing to not tracked branch condition is [" + pushingToNotTrackedBranch + "]"); return pushingToNotTrackedBranch; }