Skip to content

Commit a53d8b2

Browse files
committed
Merge remote-tracking branch 'djmattyg007/doc_fixes'
2 parents fe5c9d6 + 21efebd commit a53d8b2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pygit2/repository.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,13 @@ def checkout(self, refname=None, **kwargs):
240240
241241
>>> checkout('HEAD')
242242
243+
This is identical to calling checkout_head().
244+
243245
If no reference is given, checkout from the index.
244246
245247
Arguments:
246248
247-
:param str refname: The reference to checkout. After checkout,
249+
:param str|Reference refname: The reference to checkout. After checkout,
248250
the current branch will be switched to this one.
249251
250252
:param int strategy: A ``GIT_CHECKOUT_`` value. The default is

src/repository.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ Repository_git_object_lookup_prefix(Repository *self, PyObject *key)
293293

294294

295295
PyDoc_STRVAR(Repository_lookup_branch__doc__,
296-
"lookup_branch(branch_name, [branch_type]) -> Object\n"
296+
"lookup_branch(branch_name, [branch_type]) -> Branch\n"
297297
"\n"
298-
"Returns the Git reference for the given branch name (local or remote).");
298+
"Returns the Git reference for the given branch name (local or remote).\n"
299+
"If branch_type is GIT_BRANCH_REMOTE, you must include the remote name\n"
300+
"in the branch name (eg 'origin/master').");
299301

300302
PyObject *
301303
Repository_lookup_branch(Repository *self, PyObject *args)
@@ -893,7 +895,7 @@ Repository_create_tag(Repository *self, PyObject *args)
893895

894896

895897
PyDoc_STRVAR(Repository_create_branch__doc__,
896-
"create_branch(name, commit, force=False) -> bytes\n"
898+
"create_branch(name, commit, force=False) -> Branch\n"
897899
"\n"
898900
"Create a new branch \"name\" which points to a commit.\n"
899901
"\n"
@@ -968,7 +970,8 @@ Repository_listall_references(Repository *self, PyObject *args)
968970
PyDoc_STRVAR(Repository_listall_branches__doc__,
969971
"listall_branches([flags]) -> [str, ...]\n"
970972
"\n"
971-
"Return a tuple with all the branches in the repository.");
973+
"Return a tuple with all the branches in the repository.\n"
974+
"By default, it returns all local branches.");
972975

973976
PyObject *
974977
Repository_listall_branches(Repository *self, PyObject *args)

0 commit comments

Comments
 (0)