mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
git clone branch
This commit is contained in:
parent
4ec5a987aa
commit
34f6a30d20
1 changed files with 5 additions and 2 deletions
|
@ -164,7 +164,10 @@ def build_from_sources(url, compiler_flags: CompileInfo, source_dir_path, prefix
|
|||
shutil.rmtree(extracted_folder)
|
||||
|
||||
|
||||
def git_clone(url: str, current_dir: str, remove_dot_git=True):
|
||||
def git_clone(url: str, current_dir: str, branch=None, remove_dot_git=True):
|
||||
if branch:
|
||||
common_git_clone_line = ['git', 'clone', '--branch', branch, '--single-branch', url]
|
||||
else:
|
||||
common_git_clone_line = ['git', 'clone', '--depth=1', url]
|
||||
cloned_dir = os.path.splitext(url.rsplit('/', 1)[-1])[0]
|
||||
common_git_clone_line.append(cloned_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue