From d5c0a23630d2471e4fe3772d39343201f7cd130a Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Sun, 1 Sep 2013 12:58:55 -0400 Subject: [PATCH] Doc fixes: change head.oid to head.target in examples --- docs/recipes/git-log.rst | 4 ++-- src/repository.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/recipes/git-log.rst b/docs/recipes/git-log.rst index e9c10b7..b234e0f 100644 --- a/docs/recipes/git-log.rst +++ b/docs/recipes/git-log.rst @@ -16,7 +16,7 @@ Show HEAD commit .. code-block:: python - >>> commit = repo[repo.head.oid] + >>> commit = repo[repo.head.target] >>> commit.message 'commit message' @@ -30,7 +30,7 @@ Traverse commit history .. code-block:: python - >>> last = repo[repo.head.oid] + >>> last = repo[repo.head.target] >>> for commit in repo.walk(last.oid, pygit2.GIT_SORT_TIME): >>> print(commit.message) # or some other operation diff --git a/src/repository.c b/src/repository.c index 935c166..2ce42ab 100644 --- a/src/repository.c +++ b/src/repository.c @@ -591,9 +591,9 @@ PyDoc_STRVAR(Repository_walk__doc__, " >>> from pygit2 import Repository\n" " >>> from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE\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" - " >>> 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" " >>>\n");