def _store_path(self, filepath: PathLike, fprogress: Callable) -> BaseIndexEntry:
        """Store file at filepath in the database and return the base index entry.

        :note:
            This needs the :func:`~git.index.util.git_working_dir` decorator active!
            This must be ensured in the calling code.
        """
        st = os.lstat(filepath)  # Handles non-symlinks as well.

        if S_ISLNK(st.st_mode):
            # In PY3, readlink is a string, but we need bytes.
            # In PY2, it was just OS encoded bytes, we assumed UTF-8.
            def open_stream() -> BinaryIO:
                return BytesIO(force_bytes(os.readlink(filepath), encoding=defenc))
        else:

            def open_stream() -> BinaryIO:
                return open(filepath, "rb")

        with open_stream() as stream:
            fprogress(filepath, False, filepath)
            istream = self.repo.odb.store(IStream(Blob.type, st.st_size, stream))
            fprogress(filepath, True, filepath)
        return BaseIndexEntry(
            (
                stat_mode_to_index_mode(st.st_mode),
                istream.binsha,
                0,
                to_native_path_linux(filepath),
            )
        )
Store file at filepath in the database and return the base index entry.

        :note:
            This needs the :func:`~git.index.util.git_working_dir` decorator active!
            This must be ensured in the calling code.
        
git/index/base.py