use of git4idea.ui.branch.GitMultiRootBranchConfig in project intellij-community by JetBrains.
the class GitBranchUtil method getCurrentBranchOrRev.
@NotNull
static String getCurrentBranchOrRev(@NotNull Collection<GitRepository> repositories) {
if (repositories.size() > 1) {
GitMultiRootBranchConfig multiRootBranchConfig = new GitMultiRootBranchConfig(repositories);
String currentBranch = multiRootBranchConfig.getCurrentBranch();
LOG.assertTrue(currentBranch != null, "Repositories have unexpectedly diverged. " + multiRootBranchConfig);
return currentBranch;
} else {
assert !repositories.isEmpty() : "No repositories passed to GitBranchOperationsProcessor.";
GitRepository repository = repositories.iterator().next();
return getBranchNameOrRev(repository);
}
}
Aggregations