bugfix: 'submodules' attribute should imply git fetch
- 'submodules' wasn't properly declared as an optional attribute for git fetcher - add it and add a test.
This commit is contained in:
parent
3f0e6d04e0
commit
3c292de6bd
3 changed files with 9 additions and 1 deletions
|
@ -596,7 +596,7 @@ class GitFetchStrategy(VCSFetchStrategy):
|
|||
"""
|
||||
enabled = True
|
||||
url_attr = 'git'
|
||||
optional_attrs = ['tag', 'branch', 'commit']
|
||||
optional_attrs = ['tag', 'branch', 'commit', 'submodules']
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
# Discards the keywords in kwargs that may conflict with the next call
|
||||
|
|
|
@ -341,6 +341,13 @@ def test_git_url_top_level_git_versions(mock_packages, config):
|
|||
assert fetcher.commit == 'abc34'
|
||||
assert fetcher.branch is None
|
||||
|
||||
fetcher = spack.fetch_strategy.for_package_version(pkg, 'submodules')
|
||||
assert isinstance(fetcher, spack.fetch_strategy.GitFetchStrategy)
|
||||
assert fetcher.url == 'https://example.com/some/git/repo'
|
||||
assert fetcher.tag is None
|
||||
assert fetcher.commit is None
|
||||
assert fetcher.branch is None
|
||||
|
||||
fetcher = spack.fetch_strategy.for_package_version(pkg, 'develop')
|
||||
assert isinstance(fetcher, spack.fetch_strategy.GitFetchStrategy)
|
||||
assert fetcher.url == 'https://example.com/some/git/repo'
|
||||
|
|
|
@ -39,6 +39,7 @@ class GitUrlTopLevel(Package):
|
|||
|
||||
# These resolve to git fetchers
|
||||
version('develop', branch='develop')
|
||||
version('submodules', submodules=True)
|
||||
version('3.4', commit='abc34')
|
||||
version('3.3', branch='releases/v3.3', commit='abc33')
|
||||
version('3.2', branch='releases/v3.2')
|
||||
|
|
Loading…
Reference in a new issue