Skip to content

Commit 1b4f37d

Browse files
committed
One more
1 parent f6c70d7 commit 1b4f37d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ 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])), GHCommit.File.class);
2727
} else {
2828
endpoint = owner.root()
2929
.createRequest()
@@ -44,7 +44,7 @@ private static PaginatedEndpoint<GHCommitFilesPage, File> createEndpoint(GHRepos
4444
* the list of files initially populated
4545
*/
4646
GHCommitFileIterable(GHRepository owner, String sha, List<GHCommit.File> files) {
47-
super(createEndpoint(owner, sha, files != null ? files.toArray(new File[0]) : null));
47+
super(createEndpoint(owner, sha, files));
4848
}
4949

5050
@Override

0 commit comments

Comments
 (0)