Fix module validation without base branch.

pull/22679/head
Matt Clay 8 years ago
parent 1f337b6421
commit 672e9a2f61

@ -1002,12 +1002,16 @@ class GitCache(object):
def __init__(self, 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.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()

Loading…
Cancel
Save