subtree: performance improvement for finding unexpected parent commits