def partial_to_complete_sha_hex(self, partial_hexsha: str) -> bytes:
        """
        :return:
            Full binary 20 byte sha from the given partial hexsha

        :raise gitdb.exc.AmbiguousObjectName:

        :raise gitdb.exc.BadObject:

        :note:
            Currently we only raise :exc:`~gitdb.exc.BadObject` as git does not
            communicate ambiguous objects separately.
        """
        try:
            hexsha, _typename, _size = self._git.get_object_header(partial_hexsha)
            return hex_to_bin(hexsha)
        except (GitCommandError, ValueError) as e:
            raise BadObject(partial_hexsha) from e
        # END handle exceptions

        :return:
            Full binary 20 byte sha from the given partial hexsha

        :raise gitdb.exc.AmbiguousObjectName:

        :raise gitdb.exc.BadObject:

        :note:
            Currently we only raise :exc:`~gitdb.exc.BadObject` as git does not
            communicate ambiguous objects separately.
        
git/db.py