org.kohsuke.github
Class GHCommit

java.lang.Object
  extended by org.kohsuke.github.GHCommit

public class GHCommit
extends Object

A commit in a repository.

Author:
Kohsuke Kawaguchi
See Also:
GHRepository.getCommit(String), GHCommitComment.getCommit()

Nested Class Summary
static class GHCommit.File
          A file that was modified.
static class GHCommit.Parent
           
static class GHCommit.Stats
           
 
Constructor Summary
GHCommit()
           
 
Method Summary
 GHCommitComment createComment(String body)
           
 GHCommitComment createComment(String body, String path, Integer line, Integer position)
          Creates a commit comment.
 GHUser getAuthor()
           
 GHUser getCommitter()
           
 List<GHCommit.File> getFiles()
          List of files changed/added/removed in this commit.
 int getLinesAdded()
          Number of lines added.
 int getLinesChanged()
          Number of lines added + removed.
 int getLinesDeleted()
          Number of lines removed.
 GHRepository getOwner()
          The repository that contains the commit.
 List<GHCommit> getParents()
          Resolves the parent commit objects and return them.
 List<String> getParentSHA1s()
          Returns the SHA1 of parent commit objects.
 String getSHA1()
          [0-9a-f]{40} SHA1 checksum.
 PagedIterable<GHCommitComment> listComments()
          Lists up all the commit comments in this repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GHCommit

public GHCommit()
Method Detail

getOwner

public GHRepository getOwner()
The repository that contains the commit.


getLinesChanged

public int getLinesChanged()
Number of lines added + removed.


getLinesAdded

public int getLinesAdded()
Number of lines added.


getLinesDeleted

public int getLinesDeleted()
Number of lines removed.


getSHA1

public String getSHA1()
[0-9a-f]{40} SHA1 checksum.


getFiles

public List<GHCommit.File> getFiles()
List of files changed/added/removed in this commit.

Returns:
Can be empty but never null.

getParentSHA1s

public List<String> getParentSHA1s()
Returns the SHA1 of parent commit objects.


getParents

public List<GHCommit> getParents()
                          throws IOException
Resolves the parent commit objects and return them.

Throws:
IOException

getAuthor

public GHUser getAuthor()
                 throws IOException
Throws:
IOException

getCommitter

public GHUser getCommitter()
                    throws IOException
Throws:
IOException

listComments

public PagedIterable<GHCommitComment> listComments()
Lists up all the commit comments in this repository.


createComment

public GHCommitComment createComment(String body,
                                     String path,
                                     Integer line,
                                     Integer position)
                              throws IOException
Creates a commit comment. I'm not sure how path/line/position parameters interact with each other.

Throws:
IOException

createComment

public GHCommitComment createComment(String body)
                              throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.