Adding memoization to :clone_into method in commits and trees