Simplified #ref_to_sha! implementation to remove empty rescue clause.