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 class
GHRef.GHObject
The type GHObject.
-
Constructor Summary
Constructors Constructor Description GHRef()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
delete()
Deletes this ref from the repository using the GitHub API.GHRef.GHObject
getObject()
The object that this ref points to.String
getRef()
Name of the ref, such as "refs/tags/abc".GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.URL
getUrl()
The API URL of this tag, such as https://api.github.com/repos/jenkinsci/jenkins/git/refs/tags/1.312void
updateTo(String sha)
Updates this ref to the specified commit.void
updateTo(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 IOException
Deletes this ref from the repository using the GitHub API.- Throws:
IOException
- the io exception
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-