mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix module validation without base branch.
This commit is contained in:
parent
1f337b6421
commit
672e9a2f61
1 changed files with 6 additions and 2 deletions
|
@ -1002,12 +1002,16 @@ class GitCache(object):
|
||||||
def __init__(self, base_branch):
|
def __init__(self, base_branch):
|
||||||
self.base_branch = base_branch
|
self.base_branch = base_branch
|
||||||
|
|
||||||
|
if self.base_branch:
|
||||||
self.base_tree = self._git(['ls-tree', '-r', '--name-only', self.base_branch, 'lib/ansible/modules/'])
|
self.base_tree = self._git(['ls-tree', '-r', '--name-only', self.base_branch, 'lib/ansible/modules/'])
|
||||||
|
else:
|
||||||
|
self.base_tree = []
|
||||||
|
|
||||||
self.head_tree = self._git(['ls-tree', '-r', '--name-only', 'HEAD', 'lib/ansible/modules/'])
|
self.head_tree = self._git(['ls-tree', '-r', '--name-only', 'HEAD', 'lib/ansible/modules/'])
|
||||||
|
|
||||||
self.base_module_paths = dict((os.path.basename(p), p) for p in self.base_tree if os.path.splitext(p)[1] in ('.py', '.ps1'))
|
self.base_module_paths = dict((os.path.basename(p), p) for p in self.base_tree if os.path.splitext(p)[1] in ('.py', '.ps1'))
|
||||||
|
|
||||||
del self.base_module_paths['__init__.py']
|
self.base_module_paths.pop('__init__.py', None)
|
||||||
|
|
||||||
self.head_aliased_modules = set()
|
self.head_aliased_modules = set()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue