code: def _to_relative_path(self, path):
          
          if not osp.isabs(path):
              return path
          if self.repo.bare:
              raise InvalidGitRepositoryError("require non-bare repository")
          if not path.startswith(self.repo.working_tree_dir):
              raise ValueError("Absolute path %r is not in git repository at %r" % (path, self.repo.working_tree_dir))
          return os.path.relpath(path, self.repo.working_tree_dir)
docs: :return: Version of path relative to our git directory or raise ValueError
          if it is not within our git direcotory