Recover cloneRepository code