Skip to content

Commit

Permalink
Update example to use peel() instead of get_object().
Browse files Browse the repository at this point in the history
According to http://www.pygit2.org/references.html get_object() is deprecated, and we should be using peel() instead. Update the example at the top of the page to follow this advice.
  • Loading branch information
pwagland authored Oct 19, 2017
1 parent 24d385a commit cead4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Example::
>>> all_refs = list(repo.references)

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

# Create a reference
>>> ref = repo.references.create('refs/tags/version1', LAST_COMMIT)
Expand Down

0 comments on commit cead4c1

Please sign in to comment.