I'm using JGit to extract diffs between two commits but I often face a problem that JGit throws MissingObjectException
and says missing unknown commit ID like this:
org.eclipse.jgit.errors.MissingObjectException: Missing unknown 9eae334e9492f55a841e6eb7ab302ff11d03ab21
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:168)
at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:236)
at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:890)
at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:800)
at collect.CollectTestcase.autoExtraction(CollectTestcase.java:99)*
It often happens when running the code
RevWalk walk = new RevWalk(repo);
walk.parseCommit(commitId)
Does someone knows what's wrong with it?