Package com.jcabi.github.mock
Class MkBranches
- java.lang.Object
-
- com.jcabi.github.mock.MkBranches
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Branchcreate(String name, String sha)Creates a new branch.Branchfind(String name)Find branches by name.Branchget(String name)Gets a branch by name.Iterable<Branch>iterate()Iterate over all branches in the repo.Reporepo()Repo which the branches are in.
-
-
-
Method Detail
-
iterate
public Iterable<Branch> iterate()
Description copied from interface:BranchesIterate over all branches in the repo.- Specified by:
iteratein interfaceBranches- Returns:
- Iterator of branches
- See Also:
- List Branches API
-
find
public Branch find(String name)
Description copied from interface:BranchesFind branches by name.- Specified by:
findin interfaceBranches- Parameters:
name- The name of the branch.- Returns:
- Branch found by name
- See Also:
- Get Branch API
-
create
public Branch create(String name, String sha) throws IOException
Creates a new branch.- Parameters:
name- Name of branchsha- Commit SHA- Returns:
- New branch
- Throws:
IOException- if there is an I/O problem
-
get
public Branch get(String name) throws IOException
Gets a branch by name.- Parameters:
name- Name of branch.- Returns:
- The branch with the given name
- Throws:
IOException- If there is an I/O problem
-
-