diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-08-24 11:45:35 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-08-25 10:20:39 -0700 |
commit | 3c292de6bdfe4c058201afe4fdb34cf9a4da8da8 (patch) | |
tree | 7609be170c8d135c78f4af314363ff71c4dff13e /lib/spack | |
parent | 3f0e6d04e048ff54882e9426500bd375cf590fe0 (diff) | |
download | spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.gz spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.bz2 spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.tar.xz spack-3c292de6bdfe4c058201afe4fdb34cf9a4da8da8.zip |
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.
Diffstat (limited to 'lib/spack')
-rw-r--r-- | lib/spack/spack/fetch_strategy.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/test/packages.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 38b837b659..f5425d6bbd 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -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 diff --git a/lib/spack/spack/test/packages.py b/lib/spack/spack/test/packages.py index 464e37a8d2..296a263479 100644 --- a/lib/spack/spack/test/packages.py +++ b/lib/spack/spack/test/packages.py @@ -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' |