def _clone(config, location, tag, shadow=False):
    if shadow:
        cmd = '/usr/bin/git clone --reference {0} {1}/.git {2}'
        cmd = cmd.format(config['location'], config['url'], location)
    else:
        cmd = '/usr/bin/git clone {0}/.git {1}'.format(config['url'], location)
    status = __salt__['cmd.retcode'](cmd)
    if status != 0:
        return status
    status = _fetch_location(config, location, shadow=shadow)
    if status != 0:
        return status
    status = _checkout_location(config, location, tag,
                                reset=True, shadow=shadow)
    if status != 0:
        return status
    return 0
Perform a clone of a repo at a specified location, and
dataset/ETHPy150Open trebuchet-deploy/trebuchet/modules/deploy.py/_clone