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
  • Method Details

    • repo

      public Repo repo()
      Description copied from interface: Branches
      Repo which the branches are in.
      Specified by:
      repo in interface Branches
      Returns:
      Repo
    • iterate

      public Iterable<Branch> iterate()
      Description copied from interface: Branches
      Iterate over all branches in the repo.
      Specified by:
      iterate in interface Branches
      Returns:
      Iterator of branches
      See Also:
    • find

      public Branch find(String name)
      Description copied from interface: Branches
      Find branches by name.
      Specified by:
      find in interface Branches
      Parameters:
      name - The name of the branch.
      Returns:
      Branch found by name
      See Also:
    • create

      public Branch create(String name, String sha) throws IOException
      Creates a new branch.
      Parameters:
      name - Name of branch
      sha - 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