code: def find_git_repository(self, path):
          
          while path is not None:
              git_path = os.path.join(path,'.git')
              if os.path.exists(git_path) and os.path.isdir(git_path):
                  return path
              path = os.path.dirname(path)
          return None
docs: Tries to find a directory with a .git repository