Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions reframe/utility/osext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down