void (@NotNull Project project, @NotNull List<? extends GitRepository> repositories, @NotNull String remoteBranchName, @NotNull String suggestedLocalName, @Nullable Runnable callInAwtLater) { // can have remote conflict if git-svn is used - suggested local name will be equal to selected remote if (BRANCH_NAME_HASHING_STRATEGY.equals(remoteBranchName, suggestedLocalName)) { askNewBranchNameAndCheckout(project, repositories, remoteBranchName, suggestedLocalName, callInAwtLater); return; } Map<GitRepository, GitLocalBranch> conflictingLocalBranches = map2MapNotNull(repositories, r -> { GitLocalBranch local = r.getBranches().findLocalBranch(suggestedLocalName); return local != null ? Pair.create(r, local) : null; }); if (hasTrackingConflicts(conflictingLocalBranches, remoteBranchName)) { askNewBranchNameAndCheckout(project, repositories, remoteBranchName, suggestedLocalName, callInAwtLater); return; } new GitBranchCheckoutOperation(project, repositories) .perform(remoteBranchName, new GitNewBranchOptions(suggestedLocalName, true, true), callInAwtLater); }