class_docstr: PyGit class represents a git repo within a weigit repo.
  
  Args:
      parent_path (pathlib.Path)
          Has to be the full path of the parent!
      gitignore (List)
          a list of files to be added to the .gitignore
      name (str)
          Name of the author of the git repo. Optionally used if it can't be determined from user's .gitconfig.
      email (str)
          email address of the author of the git repo
docstr: git commit the staged changes to the .wgit/.git repo.
  
  Args:
      message (str)
          Commit message
docstr_tok: ["git","commit","the","staged","changes","to","the",".wgit\/.git","repo",".","Args",":","message","(","str",")","Commit","message"]
code: def commit(self, message: str) -> None:
      """
      git commit the staged changes to the .wgit/.git repo.
  
      Args:
          message (str)
              Commit message
      """
      # If .wgit is git repo, commit the staged files to git
      if self._exists:
          # if no commit exists, set ref to HEAD and parents to empty
          try:
              ref = self.repo.head.name
              parents = [self.repo.head.target]
          except pygit2.GitError:
              ref = "HEAD"
              parents = []
  
          author = pygit2.Signature(self.name, self.email)
          committer = pygit2.Signature(self.name, self.email)
          tree = self.repo.index.write_tree()
          self.repo.create_commit(
              ref, author, committer, message, tree, parents
          )
  
file_path: fairscale/fairscale/experimental/wgit/pygit.py
imports: from pathlib import Path
  import subprocess
  import sys
  from typing import Dict, List, Tuple
  import pygit2
label_desc: Use image node_id 4 for calling the PyGit obj's underlying member method code with example usage: obj.commit(message) without return types