Commit 952a3692 by Will Thames Committed by Michael DeHaan

Cater for uninitialized submodules

Output a useful message if `git submodule update --init --recursive` not
yet performed

```
$ ansible --version
ansible 1.8 (submodule_ansible_version 59ae596484) last updated 2014/09/28 13:20:51 (GMT +1000)
  lib/ansible/modules/core: (detached HEAD 617a52b20d) last updated 2014/09/28 13:15:25 (GMT +1000)
  lib/ansible/modules/extras:  not found - use git submodule update --init lib/ansible/modules/extras
```
parent d1476aeb
......@@ -883,8 +883,11 @@ def _gitinfo():
for line in f:
tokens = line.strip().split(' ')
if tokens[0] == 'path':
repo_path = tokens[2]
result += "\n {0}: {1}".format(repo_path, _gitrepoinfo(os.path.join(basedir, repo_path, '.git')))
submodule_path = tokens[2]
submodule_info =_gitrepoinfo(os.path.join(basedir, submodule_path, '.git'))
if not submodule_info:
submodule_info = ' not found - use git submodule update --init ' + submodule_path
result += "\n {0}: {1}".format(submodule_path, submodule_info)
f.close()
return result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment