Small speed improvement for larger repositories
Last commit from ancestors algorithm optimization