Patch Set 2: I would prefer that you didn't submit this

(1 inline comment)

hashCode() seems okay but equals(Object) looks incorrect to me.

Also, why is 'ancestorCommit' being ignored? As a third party reading the code, I would expect it to be considered. If there is a reason why it is ignored, please inline comments into the two methods.