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
code: def __init__(
      self,
      parent_path: Path,
      gitignore: List = list(),
      name: str = "user",
      email: str = "user@email.com",
  ) -> None:
      # Find if a git repo exists within .wgit repo:
      # If exists: then discover it and set the self.gitrepo path to its path
      self._parent_path = parent_path
      git_repo_found = pygit2.discover_repository(self._parent_path)
  
      # If gitconfig file exists use the name and email from the file
      self.name, self.email = self._set_author_config(name, email)
  
      if git_repo_found:
          # grab the parent dir of this git repo
          git_repo = Path(pygit2.discover_repository(self._parent_path))
          pygit_parent_p = git_repo.parent.absolute()
  
          # Check If the parent dir is a .wgit dir. If the .wgit is a git repo
          # just wrap the existing git repo with pygit2.Repository class
          if pygit_parent_p == self._parent_path:
              self.repo = pygit2.Repository(str(self._parent_path))
              self.path = self._parent_path.joinpath(".git")
          else:
              # if the parent is not a .wgit repo,
              # then the found-repo is a different git repo. Init new .wgit/.git
              self._init_wgit_git(gitignore)
      else:
          # no git repo found, make .wgit a git repo
          self._init_wgit_git(gitignore)
  
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 1 to create a new PyGit object  with example: obj = PyGit(parent_path, gitignore, name, email)