parameters: (self, git_worktree_path, version)
docstring: If the crypto submodule is present, initialize it.
          if version.crypto_revision exists, update it to that revision,
          otherwise update it to the default revision
docstring_summary: If the crypto submodule is present, initialize it.
          if version.crypto_revision exists, update it to that revision,
          otherwise update it to the default revision
docstring_tokens: If the crypto submodule is present initialize it . if version . crypto_revision exists update it to that revision otherwise update it to the default revision
function: def _update_git_submodules(self, git_worktree_path, version):
          """If the crypto submodule is present, initialize it.
          if version.crypto_revision exists, update it to that revision,
          otherwise update it to the default revision"""
          update_output = subprocess.check_output(
              [self.git_command, "submodule", "update", "--init", '--recursive'],
              cwd=git_worktree_path,
              stderr=subprocess.STDOUT
          )
          self.log.debug(update_output.decode("utf-8"))
          if not (os.path.exists(os.path.join(git_worktree_path, "crypto"))
                  and version.crypto_revision):
              return
  
          if version.crypto_repository:
              fetch_output = subprocess.check_output(
                  [self.git_command, "fetch", version.crypto_repository,
                   version.crypto_revision],
                  cwd=os.path.join(git_worktree_path, "crypto"),
                  stderr=subprocess.STDOUT
              )
              self.log.debug(fetch_output.decode("utf-8"))
              crypto_rev = "FETCH_HEAD"
          else:
              crypto_rev = version.crypto_revision
  
          checkout_output = subprocess.check_output(
              [self.git_command, "checkout", crypto_rev],
              cwd=os.path.join(git_worktree_path, "crypto"),
              stderr=subprocess.STDOUT
          )
          self.log.debug(checkout_output.decode("utf-8"))
function_tokens: def _update_git_submodules ( self , git_worktree_path , version ) : update_output = subprocess . check_output ( [ self . git_command , "submodule" , "update" , "--init" , '--recursive' ] , cwd = git_worktree_path , stderr = subprocess . STDOUT ) self . log . debug ( update_output . decode ( "utf-8" ) ) if not ( os . path . exists ( os . path . join ( git_worktree_path , "crypto" ) ) and version . crypto_revision ) : return if version . crypto_repository : fetch_output = subprocess . check_output ( [ self . git_command , "fetch" , version . crypto_repository , version . crypto_revision ] , cwd = os . path . join ( git_worktree_path , "crypto" ) , stderr = subprocess . STDOUT ) self . log . debug ( fetch_output . decode ( "utf-8" ) ) crypto_rev = "FETCH_HEAD" else : crypto_rev = version . crypto_revision checkout_output = subprocess . check_output ( [ self . git_command , "checkout" , crypto_rev ] , cwd = os . path . join ( git_worktree_path , "crypto" ) , stderr = subprocess . STDOUT ) self . log . debug ( checkout_output . decode ( "utf-8" ) )