Package org.kohsuke.github
Class GHRef
- java.lang.Object
-
- org.kohsuke.github.GHRef
-
public class GHRef extends Object
Provides information on a Git ref from GitHub.- Author:
- Michael Clarke
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHRef.GHObjectThe type GHObject.
-
Constructor Summary
Constructors Constructor Description GHRef()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete()Deletes this ref from the repository using the GitHub API.GHRef.GHObjectgetObject()The object that this ref points to.StringgetRef()Name of the ref, such as "refs/tags/abc".GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.URLgetUrl()The API URL of this tag, such as https://api.github.com/repos/jenkinsci/jenkins/git/refs/tags/1.312voidupdateTo(String sha)Updates this ref to the specified commit.voidupdateTo(String sha, Boolean force)Updates this ref to the specified commit.
-
-
-
Method Detail
-
getRef
public String getRef()
Name of the ref, such as "refs/tags/abc".- Returns:
- the ref
-
getUrl
public URL getUrl()
The API URL of this tag, such as https://api.github.com/repos/jenkinsci/jenkins/git/refs/tags/1.312- Returns:
- the url
-
getObject
public GHRef.GHObject getObject()
The object that this ref points to.- Returns:
- the object
-
updateTo
public void updateTo(String sha) throws IOException
Updates this ref to the specified commit.- Parameters:
sha- The SHA1 value to set this reference to- Throws:
IOException- the io exception
-
updateTo
public void updateTo(String sha, Boolean force) throws IOException
Updates this ref to the specified commit.- Parameters:
sha- The SHA1 value to set this reference toforce- Whether or not to force this ref update.- Throws:
IOException- the io exception
-
delete
public void delete() throws IOExceptionDeletes this ref from the repository using the GitHub API.- Throws:
IOException- the io exception
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-