Skip to content

Commit 8b81765

Browse files
committed
One more
1 parent f6c70d7 commit 8b81765

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/kohsuke/github/GHCommitFileIterable.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ class GHCommitFileIterable extends PagedIterable<GHCommit.File> {
1919

2020
private static PaginatedEndpoint<GHCommitFilesPage, File> createEndpoint(GHRepository owner,
2121
String sha,
22-
GHCommit.File[] files) {
22+
List<GHCommit.File> files) {
2323
PaginatedEndpoint<GHCommitFilesPage, File> endpoint;
24-
if (files != null && files.length < GH_FILE_LIMIT_PER_COMMIT_PAGE) {
24+
if (files != null && files.size() < GH_FILE_LIMIT_PER_COMMIT_PAGE) {
2525
// create an endpoint that only reads one already loaded page
26-
endpoint = PaginatedEndpoint.fromSinglePage(new GHCommitFilesPage(files), GHCommit.File.class);
26+
endpoint = PaginatedEndpoint.fromSinglePage(new GHCommitFilesPage(files.toArray(new File[0])),
27+
GHCommit.File.class);
2728
} else {
2829
endpoint = owner.root()
2930
.createRequest()
@@ -44,7 +45,7 @@ private static PaginatedEndpoint<GHCommitFilesPage, File> createEndpoint(GHRepos
4445
* the list of files initially populated
4546
*/
4647
GHCommitFileIterable(GHRepository owner, String sha, List<GHCommit.File> files) {
47-
super(createEndpoint(owner, sha, files != null ? files.toArray(new File[0]) : null));
48+
super(createEndpoint(owner, sha, files));
4849
}
4950

5051
@Override

0 commit comments

Comments
 (0)