libgit2 / pygit2

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

Repository.notes KeyError when empty #1291

Open qaqland opened 1 month ago

qaqland commented 1 month ago
repo = pygit2.Repository("xxx-repo")
try:
    repo.notes()
except KeyError as e:
    print(e)

get:

"reference 'refs/notes/commits' not found"

when refs/notes or other note-name not fount, it means note is empty and should return None


pygit2: 1.15.0