Skip to content

Commit c08579a

Browse files
committed
Merge pull request #159 from carlosmn/pygit2-peel
libgit2: use peel() in the pygit2 example
2 parents 05b0468 + e6a5b40 commit c08579a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

book/B-embedding-git/sections/libgit2.asc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ Our example program:
228228
[source,python]
229229
----
230230
pygit2.Repository("/path/to/repo") # open repository
231-
.head.resolve() # get a direct ref
232-
.get_object().message # get commit, read message
231+
.head # get the current branch
232+
.peel(pygit2.Commit) # walk down to the commit
233+
.message # read the message
233234
----
234235

235236

0 commit comments

Comments
 (0)