Support reusing known sha during object creation.

This results in > 10% performance improvement during operations like rev-list.