VcsRef (@NotNull Collection<? extends VcsRef> givenBranches) { Comparator<VcsRef> comparator = new GitRefManager(myProject, repositoryManager).getBranchLayoutComparator(); return ContainerUtil.sorted(givenBranches, comparator).get(0); }