Files
deb-python-pygit2/docs/references.rst
Nico von Geyso 6866a3aac5 Added: Reference.get_object() method
get_object() retrieves the object the current reference is pointing to
2013-05-28 11:23:26 +02:00

1.8 KiB

References

pygit2.Repository.listall_references

pygit2.Repository.lookup_reference

Example:

>>> all_refs = repo.listall_references()
>>> master_ref = repo.lookup_reference("refs/heads/master")
>>> commit = master_ref.get_object() # or repo[master_ref.target]

The Reference type

pygit2.Reference.name

pygit2.Reference.target

pygit2.Reference.type

pygit2.Reference.delete

pygit2.Reference.rename

pygit2.Reference.resolve

pygit2.Reference.log

pygit2.Reference.get_object

The HEAD

Example. These two lines are equivalent:

>>> head = repo.lookup_reference('HEAD').resolve()
>>> head = repo.head

pygit2.Repository.head

pygit2.Repository.head_is_detached

pygit2.Repository.head_is_orphaned

The reference log

Example:

>>> head = repo.lookup_reference('refs/heads/master')
>>> for entry in head.log():
...     print(entry.message)

pygit2.RefLogEntry.oid_new

pygit2.RefLogEntry.oid_old

pygit2.RefLogEntry.message

pygit2.RefLogEntry.committer

Notes

pygit2.Repository.notes

pygit2.Repository.create_note

pygit2.Repository.lookup_note

The Note type

pygit2.Note.annotated_id

pygit2.Note.oid

pygit2.Note.message

pygit2.Note.remove