Doc fixes: change head.oid to head.target in examples

This commit is contained in:
Andrew Chin
2013-09-01 12:58:55 -04:00
parent 179c7db940
commit d5c0a23630
2 changed files with 4 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ Show HEAD commit
.. code-block:: python .. code-block:: python
>>> commit = repo[repo.head.oid] >>> commit = repo[repo.head.target]
>>> commit.message >>> commit.message
'commit message' 'commit message'
@@ -30,7 +30,7 @@ Traverse commit history
.. code-block:: python .. code-block:: python
>>> last = repo[repo.head.oid] >>> last = repo[repo.head.target]
>>> for commit in repo.walk(last.oid, pygit2.GIT_SORT_TIME): >>> for commit in repo.walk(last.oid, pygit2.GIT_SORT_TIME):
>>> print(commit.message) # or some other operation >>> print(commit.message) # or some other operation

View File

@@ -591,9 +591,9 @@ PyDoc_STRVAR(Repository_walk__doc__,
" >>> from pygit2 import Repository\n" " >>> from pygit2 import Repository\n"
" >>> from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE\n" " >>> from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE\n"
" >>> repo = Repository('.git')\n" " >>> repo = Repository('.git')\n"
" >>> for commit in repo.walk(repo.head.oid, GIT_SORT_TOPOLOGICAL):\n" " >>> for commit in repo.walk(repo.head.target, GIT_SORT_TOPOLOGICAL):\n"
" ... print commit.message\n" " ... print commit.message\n"
" >>> for commit in repo.walk(repo.head.oid, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE):\n" " >>> for commit in repo.walk(repo.head.target, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE):\n"
" ... print commit.message\n" " ... print commit.message\n"
" >>>\n"); " >>>\n");