diff --git a/base/utils.py b/base/utils.py index eb0e907..e2d1b11 100644 --- a/base/utils.py +++ b/base/utils.py @@ -164,8 +164,11 @@ 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): - common_git_clone_line = ['git', 'clone', '--depth=1', url] +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) subprocess.call(common_git_clone_line)