pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Repository.notes KeyError when empty

Open qaqland opened this issue 1 year ago • 0 comments

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

qaqland avatar May 22 '24 05:05 qaqland