libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

Can not fetch of HEAD of repository #1292

Open HonakerM opened 1 month ago

HonakerM commented 1 month ago

Hello, when accessing the .head property of a Repository object I am getting the following error:

    @property
    def head(self) -> str:
        """Get a reference to the current HEAD"""
>       return self.repo.head.target.hex
E       AttributeError: '_pygit2.Oid' object has no attribute 'hex'

This did not happen on 1.14.1

jorio commented 4 weeks ago

Oid.hex is among the deprecated features that were removed in 1.15.0. You can use str(oid) instead.