Skip to content

Commit obtained by queryCommits does not contain files #230

@SaintDubious

Description

@SaintDubious

If I use queryCommits to get a list of commits and then call getFiles() on any of the commits in the list, it will return 0 files. However if I instead directly get a commit by sha1 and then call getFiles() it will return the appropriate file count. Both commit objects represent the same commit, they should have the same file count:

PagedIterable<GHCommit> commits = ghRepo.queryCommits().path( fullPath + "/" + fileName ).list();
for (GHCommit commit : commits) {
    GHCommit testing = ghRepo.getCommit( commit.getSHA1() );
    System.out.println( "FileCount = " + commit.getFiles().size() );
    System.out.println( "FileCount = " + testing.getFiles().size() );
}

This will print out:

FileCount = 0
FileCount = 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions