def _check_submodule_using_git(self):
cmd = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:status>', '<STR_LIT>', self.path]<EOL>try:<EOL><INDENT>log.info('<STR_LIT>'<EOL>'<STR_LIT>'.format('<STR_LIT:U+0020>'.join(cmd)))<EOL>returncode, stdout, stderr = run_cmd(cmd)<EOL><DEDENT>except _CommandNotFound:<EOL><INDENT>return False<EOL><DEDENT>stderr = stderr.strip()<EOL>if returncode != <NUM_LIT:0> and stderr:<EOL><INDENT>perl_warning = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>if not stderr.strip().endswith(perl_warning):<EOL><INDENT>log.warn('<STR_LIT>'<EOL>'<STR_LIT>'.format(stderr))<EOL>return False<EOL><DEDENT><DEDENT>_git_submodule_status_re = re.compile(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL>m = _git_submodule_status_re.match(stdout)<EOL>if m:<EOL><INDENT>self._update_submodule(m.group('<STR_LIT>'), m.group('<STR_LIT:status>'))<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>log.warn(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>stdout, self.path))<EOL>return False<EOL><DEDENT>
Check if the given path is a git submodule.  If so, attempt to initialize
and/or update the submodule if needed.

This function makes calls to the ``git`` command in subprocesses.  The
``_check_submodule_no_git`` option uses pure Python to check if the given
path looks like a git submodule, but it cannot perform updates.