MCPcopy Index your code
hub / github.com/emscripten-core/emsdk / git_clone

Function git_clone

emsdk.py:793–809  ·  view source on GitHub ↗
(url, dstpath, branch, remote_name='origin')

Source from the content-addressed store, hash-verified

791
792
793def git_clone(url, dstpath, branch, remote_name='origin'):
794 debug_print(f'git_clone(url={url}, dstpath={dstpath})')
795 if os.path.isdir(os.path.join(dstpath, '.git')):
796 remotes = get_git_remotes(dstpath)
797 if remote_name in remotes:
798 debug_print(f'Repository {url} with remote "{remote_name}" already cloned to directory {dstpath}, skipping.')
799 return True
800 else:
801 debug_print(f'Repository {url} with remote "{remote_name}" already cloned to directory {dstpath}, but remote has not yet been added. Creating.')
802 return run([GIT(), 'remote', 'add', remote_name, url], cwd=dstpath) == 0
803
804 mkdir_p(dstpath)
805 git_clone_args = ['--recurse-submodules', '--branch', branch] # Do not check out a branch (installer will issue a checkout command right after)
806 if GIT_CLONE_SHALLOW:
807 git_clone_args += ['--depth', '1']
808 print(f'Cloning from {url}...')
809 return run([GIT(), 'clone', '-o', remote_name, *git_clone_args, url, dstpath]) == 0
810
811
812def git_pull(repo_path, branch_or_tag, remote_name='origin'):

Callers 1

Calls 5

debug_printFunction · 0.85
get_git_remotesFunction · 0.85
runFunction · 0.85
GITFunction · 0.85
mkdir_pFunction · 0.85

Tested by

no test coverage detected