class_docstr: Mix-in class for Runners to be used to run git and git annex commands
  
  Overloads the runner class to check & update GIT_DIR and
  GIT_WORK_TREE environment variables set to the absolute path
  if is defined and is relative path
class_docstr_tok: ["Mix-in","class","for","Runners","to","be","used","to","run","git","and","git","annex","commands","Overloads","the","runner","class","to","check","&","update","GIT_DIR","and","GIT_WORK_TREE","environment","variables","set","to","the","absolute","path","if","is","defined","and","is","relative","path"]
docstr: If using bundled git-annex, we would like to use bundled with it git
  
  Thus we will store _GIT_PATH a path to git in the same directory as annex
  if found.  If it is empty (but not None), we do nothing
docstr_tok: ["If","using","bundled","git-annex",",","we","would","like","to","use","bundled","with","it","git","Thus","we","will","store","_GIT_PATH","a","path","to","git","in","the","same","directory","as","annex","if","found",".","If","it","is","empty","(","but","not","None",")",",","we","do","nothing"]
code: def _check_git_path():
      """If using bundled git-annex, we would like to use bundled with it git
  
      Thus we will store _GIT_PATH a path to git in the same directory as annex
      if found.  If it is empty (but not None), we do nothing
      """
      if GitRunnerBase._GIT_PATH is None:
          from shutil import which
  
          # with all the nesting of config and this runner, cannot use our
          # cfg here, so will resort to dark magic of environment options
          if os.environ.get("DATALAD_USE_DEFAULT_GIT", "0").lower() in (
              "1",
              "on",
              "true",
              "yes",
          ):
              git_fpath = which("git")
              if git_fpath:
                  GitRunnerBase._GIT_PATH = ""
                  lgr.log(9, "Will use default git %s", git_fpath)
                  return  # we are done - there is a default git avail.
              # if not -- we will look for a bundled one
          GitRunnerBase._GIT_PATH = GitRunnerBase._get_bundled_path()
          lgr.log(
              9,
              "Will use git under %r (no adjustments to PATH if empty "
              "string)",
              GitRunnerBase._GIT_PATH,
          )
          assert GitRunnerBase._GIT_PATH is not None
  
imports: import logging
  import os
  import os.path
  from typing import Optional
  from datalad.dochelpers import borrowdoc
  from datalad.utils import generate_file_chunks, make_tempfile
  from .runner import GeneratorMixIn, WitlessRunner
label_desc: Use image node_id 1 for calling the GitRunnerBase obj's underlying member method code with example usage: obj._check_git_path() without return types