Class GHBranch


  • public class GHBranch
    extends Object
    A branch in a repository.
    Author:
    Yusuke Kokubo
    • Method Detail

      • getRoot

        public GitHub getRoot()
        Gets root.
        Returns:
        the root
      • getOwner

        public GHRepository getOwner()
        Gets owner.
        Returns:
        the repository that this branch is in.
      • getName

        public String getName()
        Gets name.
        Returns:
        the name
      • isProtected

        @Preview
        @Deprecated
        public boolean isProtected()
        Deprecated.
        Is protected boolean.
        Returns:
        true if the push to this branch is restricted via branch protection.
      • getProtectionUrl

        @Preview
        @Deprecated
        public URL getProtectionUrl()
        Deprecated.
        Gets protection url.
        Returns:
        API URL that deals with the protection of this branch.
      • getSHA1

        public String getSHA1()
        Gets sha 1.
        Returns:
        The SHA1 of the commit that this branch currently points to.
      • disableProtection

        public void disableProtection()
                               throws IOException
        Disables branch protection and allows anyone with push access to push changes.
        Throws:
        IOException - if disabling protection fails