Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pygit2/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,13 @@ def checkout(self, refname=None, **kwargs):

>>> checkout('HEAD')

This is identical to calling checkout_head().

If no reference is given, checkout from the index.

Arguments:

:param str refname: The reference to checkout. After checkout,
:param str|Reference refname: The reference to checkout. After checkout,
the current branch will be switched to this one.

:param int strategy: A ``GIT_CHECKOUT_`` value. The default is
Expand Down
11 changes: 7 additions & 4 deletions src/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,11 @@ Repository_git_object_lookup_prefix(Repository *self, PyObject *key)


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

PyObject *
Repository_lookup_branch(Repository *self, PyObject *args)
Expand Down Expand Up @@ -893,7 +895,7 @@ Repository_create_tag(Repository *self, PyObject *args)


PyDoc_STRVAR(Repository_create_branch__doc__,
"create_branch(name, commit, force=False) -> bytes\n"
"create_branch(name, commit, force=False) -> Branch\n"
"\n"
"Create a new branch \"name\" which points to a commit.\n"
"\n"
Expand Down Expand Up @@ -968,7 +970,8 @@ Repository_listall_references(Repository *self, PyObject *args)
PyDoc_STRVAR(Repository_listall_branches__doc__,
"listall_branches([flags]) -> [str, ...]\n"
"\n"
"Return a tuple with all the branches in the repository.");
"Return a tuple with all the branches in the repository.\n"
"By default, it returns all local branches.");

PyObject *
Repository_listall_branches(Repository *self, PyObject *args)
Expand Down