Optmize git clone.

A step to improve #2999 

@ussuri 
This was calculating sha for intermediate obejcts, which was never used.