1
0
Fork 0
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:
Matt Clay 2017-03-15 19:43:25 -07:00
parent 1f337b6421
commit 672e9a2f61

View file

@ -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()