def clone(url, branch, depth, name, cwd) :
    if check_exists() :
        cmd = 'git clone --recursive'
        if branch :
            cmd += ' --branch {} --single-branch'.format(branch)
        if depth :
            cmd += ' --depth {}'.format(depth)
        cmd += ' {} {}'.format(url, name)
        res = subprocess.call(cmd, cwd=cwd, shell=True)
        return res == 0
    else :
        log.error("git not found, please run and fix './fips diag tools'")
        return False

#-------------------------------------------------------------------------------
git clone a remote git repo
dataset/ETHPy150Open floooh/fips/mod/tools/git.py/clone