mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cosmetics
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user