cosmetics

This commit is contained in:
Kirill Likhodedov
2012-02-13 17:54:46 +04:00
parent 11a8d966e6
commit 2f4df6f3cb
@@ -152,19 +152,20 @@ public class GitMultiRootBranchConfig {
@NotNull
private Collection<String> getCommonBranches(boolean local) {
Collection<String> commonLocal = null;
Collection<String> commonBranches = null;
for (GitRepository repository : myRepositories) {
GitBranchesCollection branchesCollection = repository.getBranches();
Collection<GitBranch> branches = local ? branchesCollection.getLocalBranches() : branchesCollection.getRemoteBranches();
if (commonLocal == null) {
commonLocal = GitUtil.getBranchNames(branches);
} else {
commonLocal.retainAll(GitUtil.getBranchNames(branches));
if (commonBranches == null) {
commonBranches = GitUtil.getBranchNames(branches);
}
else {
commonBranches.retainAll(GitUtil.getBranchNames(branches));
}
}
if (commonLocal != null) {
ArrayList<String> common = new ArrayList<String>(commonLocal);
if (commonBranches != null) {
ArrayList<String> common = new ArrayList<String>(commonBranches);
Collections.sort(common);
return common;
}