更新时间:2023-01-12 16:19:27
首先将字符串转换为 ObjectId
然后让 RevWalk
查看它可能更容易
It is probably easier to first convert the string into an ObjectId
and then have the RevWalk
look it up.
ObjectId commitId = ObjectId.fromString("ab434...");
try (RevWalk revWalk = new RevWalk(repository)) {
RevCommit commit = revWalk.parseCommit(commitId);
}