diff --git a/reframe/utility/osext.py b/reframe/utility/osext.py index 6c1894b1f1..1b231c3567 100644 --- a/reframe/utility/osext.py +++ b/reframe/utility/osext.py @@ -415,10 +415,11 @@ def is_url(s): return parsed.scheme != '' and parsed.netloc != '' -def git_clone(url, targetdir=None, timeout=5): +def git_clone(url, targetdir=None, opts=None, timeout=5): '''Clone a git repository from a URL. :arg url: The URL to clone from. + :arg opts: List of options to be passed to the `git clone` command :arg timeout: Timeout in seconds when checking if the url is a valid repository. :arg targetdir: The directory where the repository will be cloned to. If @@ -429,7 +430,8 @@ def git_clone(url, targetdir=None, timeout=5): raise ReframeError('git repository does not exist') targetdir = targetdir or '' - run_command(f'git clone {url} {targetdir}', check=True) + opts = ' '.join(opts) if opts is not None else '' + run_command(f'git clone {opts} {url} {targetdir}', check=True) def git_repo_exists(url, timeout=5):