fix: 解决 commit diff 接口重复获取 commitId 信息导致对比信息有误
This commit is contained in:
@@ -385,12 +385,6 @@ public class GitServiceImpl implements IGitService {
|
||||
RevCommit oldCommit = revWalk.parseCommit(repository.resolve(oldCommitId));
|
||||
RevCommit newCommit = revWalk.parseCommit(repository.resolve(newCommitId));
|
||||
|
||||
if (newCommit.getParentCount() > 0) {
|
||||
final RevWalk rw = new RevWalk(repository);
|
||||
oldCommit = rw.parseCommit(newCommit.getParent(0).getId());
|
||||
rw.dispose();
|
||||
}
|
||||
|
||||
// oldTree
|
||||
CanonicalTreeParser oldTree = new CanonicalTreeParser();
|
||||
oldTree.reset(repository.newObjectReader(), oldCommit.getTree());
|
||||
|
||||
Reference in New Issue
Block a user