Package com.google.gerrit.server
Class BranchUtil
java.lang.Object
com.google.gerrit.server.BranchUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
branchExists
(GitRepositoryManager repoManager, BranchNameKey branch) Checks whether the specified branch exists.
-
Constructor Details
-
BranchUtil
public BranchUtil()
-
-
Method Details
-
branchExists
public static boolean branchExists(GitRepositoryManager repoManager, BranchNameKey branch) throws org.eclipse.jgit.errors.RepositoryNotFoundException, IOException Checks whether the specified branch exists.- Parameters:
repoManager
- Git repository manager to open the git repositorybranch
- the branch for which it should be checked if it exists- Returns:
true
if the specified branch exists or ifHEAD
points to this branch, otherwisefalse
- Throws:
org.eclipse.jgit.errors.RepositoryNotFoundException
- the repository of the branch's project does not exist.IOException
- error while retrieving the branch from the repository.
-