Class 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 Detail

      • repo

        public Repo repo()
        Description copied from interface: Branches
        Repo which the branches are in.
        Specified by:
        repo in interface Branches
        Returns:
        Repo
      • 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:
        Get Branch API
      • 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