java.lang.Object
org.kohsuke.github.GHCompare
The model user for comparing 2 commits in the GitHub API.
- Author:
- Michael Clarke
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Compare commits had a child commit element with additional details we want to capture.static class
The type InnerCommit.static enum
The enum Status.static class
The type Tree. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets ahead by.Gets base commit.int
Gets behind by.Gets an array of commits.Gets diff url.getFiles()
Gets an array of files.Gets html url.Gets merge base commit.Gets patch url.Gets permalink url.Gets status.int
Gets total commits.getUrl()
Gets url.Iterable of commits for this comparison.
-
Constructor Details
-
GHCompare
public GHCompare()Create default GHCompare instance
-
-
Method Details
-
getUrl
Gets url.- Returns:
- the url
-
getHtmlUrl
Gets html url.- Returns:
- the html url
-
getPermalinkUrl
Gets permalink url.- Returns:
- the permalink url
-
getDiffUrl
Gets diff url.- Returns:
- the diff url
-
getPatchUrl
Gets patch url.- Returns:
- the patch url
-
getStatus
Gets status.- Returns:
- the status
-
getAheadBy
public int getAheadBy()Gets ahead by.- Returns:
- the ahead by
-
getBehindBy
public int getBehindBy()Gets behind by.- Returns:
- the behind by
-
getTotalCommits
public int getTotalCommits()Gets total commits.- Returns:
- the total commits
-
getBaseCommit
Gets base commit.- Returns:
- the base commit
-
getMergeBaseCommit
Gets merge base commit.- Returns:
- the merge base commit
-
getCommits
Gets an array of commits. By default, the commit list is limited to 250 results. Since 2021-03-22, compare supports pagination of commits. This makes the initialGHCompare
response return faster and supports comparisons with more than 250 commits. To read commits progressively using pagination, setGHRepository.setCompareUsePaginatedCommits(boolean)
to true before callingGHRepository.getCompare(String, String)
.- Returns:
- A copy of the array being stored in the class.
-
listCommits
Iterable of commits for this comparison. By default, the commit list is limited to 250 results. Since 2021-03-22, compare supports pagination of commits. This makes the initialGHCompare
response return faster and supports comparisons with more than 250 commits. To read commits progressively using pagination, setGHRepository.setCompareUsePaginatedCommits(boolean)
to true before callingGHRepository.getCompare(String, String)
.- Returns:
- iterable of commits
-
getFiles
Gets an array of files. By default, the file array is limited to 300 results. To retrieve the full list of files, iterate over each commit returned bylistCommits()
and useGHCommit.listFiles()
to get the files for each commit.- Returns:
- A copy of the array being stored in the class.
-