Cleanup RevWalk.parseCommit, parseTree to not throw ClassCastException
Throwing ClassCastException here for non-commits is really difficult
to work with at the caller level because we may catch the wrong sort
of ClassCastException and may mask a bug deep inside of RevWalk's
parsing code. It is cleaner to throw IncorrectObjectTypeException
and catch that. Besides, the method javadoc says that is what gets
thrown if either method is given the wrong type.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>