boolean (@NotNull String branchName, @NotNull Collection<? extends GitRepository> repositories) { Couple<String> pair = splitNameOfRemoteBranch(branchName); String remoteName = pair.getFirst(); String branch = pair.getSecond(); GitCompoundResult result = new GitCompoundResult(myProject); for (GitRepository repository : repositories) { GitCommandResult res; GitRemote remote = getRemoteByName(repository, remoteName); if (remote == null) { LOG.error("Couldn't find remote by name: " + remoteName); res = GitCommandResult.error(GitBundle.message("delete.remote.branch.operation.couldn.t.find.remote.by.name", remoteName)); } else { res = pushDeletion(repository, remote, branch); if (!res.success() && isAlreadyDeletedError(res.getErrorOutputAsJoinedString())) { res = myGit.remotePrune(repository, remote); } } result.append(repository, res); repository.update(); } if (!result.totalSuccess()) { VcsNotifier.getInstance(myProject).notifyError( REMOTE_BRANCH_DELETION_ERROR, GitBundle.message("delete.remote.branch.operation.failed.to.delete.remote.branch", branchName), result.getErrorOutputWithReposIndication(), true); } return result.totalSuccess(); }