Package com.jcabi.github.mock
Class MkBranches
- java.lang.Object
-
- com.jcabi.github.mock.MkBranches
-
- All Implemented Interfaces:
Branches
@Immutable @Loggable(1) public final class MkBranches extends Object implements Branches
Mock Git branches.- Since:
- 0.24
- Version:
- $Id: 012d908e66a346bf5a14708406a31627f81c9097 $
- Author:
- Chris Rebert (github@rebertia.com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Branch
create(String name, String sha)
Creates a new branch.Branch
find(String name)
Find branches by name.Branch
get(String name)
Gets a branch by name.Iterable<Branch>
iterate()
Iterate over all branches in the repo.Repo
repo()
Repo which the branches are in.
-
-
-
Method Detail
-
iterate
public Iterable<Branch> iterate()
Description copied from interface:Branches
Iterate over all branches in the repo.- Specified by:
iterate
in interfaceBranches
- Returns:
- Iterator of branches
- See Also:
- List Branches API
-
find
public Branch find(String name)
Description copied from interface:Branches
Find branches by name.- Specified by:
find
in 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
-
-