mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix module validation without base branch.
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
self.base_tree = self._git(['ls-tree', '-r', '--name-only', self.base_branch, 'lib/ansible/modules/'])
|
if self.base_branch:
|
||||||
|
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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user