Collection<Hash> () { Collection<Hash> branchWithHashes = myRepository.getBranches().get(myCurrentBranchName); String currentHead = myRepository.getCurrentRevision(); if (branchWithHashes == null || currentHead == null || myRepository.getState() != Repository.State.NORMAL) { // repository is fresh or branch is fresh or complex state return Collections.emptySet(); } else { Collection<Hash> bookmarkHashes = ContainerUtil.map(myRepository.getBookmarks(), info -> info.getHash()); branchWithHashes.removeAll(bookmarkHashes); branchWithHashes.remove(HashImpl.build(currentHead)); } return branchWithHashes; }