Fix IncorrectObjectTypeException on initial commit
On the initial commit of a project, "a" is the empty tree, not a commit object, in order to show all initial files as new files. To cast it into a RevTree we must use parseTree() and not parseCommit().getTree(). For all subsequent changes, "a" will be a commit and parseTree() will automatically deference to the commit's root tree. Bug: issue 442 Change-Id: I9302b6e3d6e9117159e32e96119b6563ac8e26c1 Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -174,7 +174,7 @@ public class PatchListCacheImpl implements PatchListCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RevTree aTree = a != null ? rw.parseCommit(a).getTree() : null;
|
RevTree aTree = a != null ? rw.parseTree(a) : null;
|
||||||
RevTree bTree = b.getTree();
|
RevTree bTree = b.getTree();
|
||||||
|
|
||||||
final int cnt = p.getFiles().size();
|
final int cnt = p.getFiles().size();
|
||||||
|
|||||||
Reference in New Issue
Block a user