@staticmethod
def clone(repo_config):
    """Clones the latest version of the repo from the git server"""
    import logging
    from .process import ProcessWrapper
    import os
    import platform
    logger = logging.getLogger()
    logger.info('Cloning repository %s' % repo_config['path'])
    if 'path' not in repo_config:
        logger.info('No local repository path configured, no clone will occure'
            )
        return 0
    commands = []
    commands.append('unset GIT_DIR')
    commands.append('git clone --recursive ' + repo_config['url'] + ' -b ' +
        repo_config['branch'] + ' ' + repo_config['path'])
    for command in commands:
        res = ProcessWrapper().call(command, shell=True)
        if res != 0:
            logger.error("Command '%s' failed with exit code %s" % (command,
                res))
            break
    if res == 0 and os.path.isdir(repo_config['path']):
        logger.info('Repository %s successfully cloned' % repo_config['url'])
    else:
        logger.error('Unable to clone repository %s' % repo_config['url'])
    return int(res)
