Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] parents array not set correctly in a RevCommit


how can it happen that the parents array in a RevCommit is null even if the commit does indeed have parents (the EGit history view shows them correctly). Do I have to resolve those parents by hand or what could be the problem here? I haven't found any methods in RevCommit that allow me to resolve its parents.

The commit was aquired by first parsing a commit from a rev walk ( revWalk.parseCommit(ref.getObjectId()) ) and then following the parents hierarchy. The first parents array is not empty. But after taking the parent commit, its parents are empty. This leads me to believe that the parents fields are only set correctly if the commit was acquired via parseCommit. How can I resolve those parents? Take the commit's object id and let the revWalk parse it?

best regards, thanks in advance,
Jan Finis

Back to the top