diff --git a/docs/recipes.rst b/docs/recipes.rst index 019f863..14f31c0 100644 --- a/docs/recipes.rst +++ b/docs/recipes.rst @@ -17,7 +17,6 @@ Main porcelain commands .. toctree:: :maxdepth: 1 - git-branch (List, create, or delete branches.) git-init (Create an empty git repository or reinitialize an existing one.) git-log (Show commit logs.) git-show (Show various types of objects.) diff --git a/docs/recipes/git-branch.rst b/docs/recipes/git-branch.rst deleted file mode 100644 index 5db822b..0000000 --- a/docs/recipes/git-branch.rst +++ /dev/null @@ -1,30 +0,0 @@ -********************************************************************** -git-branch -********************************************************************** - ----------------------------------------------------------------------- -Listing branches ----------------------------------------------------------------------- - -====================================================================== -List all branches -====================================================================== - -.. code-block:: bash - - $> git branch - -.. code-block:: python - - >>> regex = re.compile('^refs/heads/') - >>> branches = filter(lambda r: regex.match(r), repo.listall_references()) - -`Note that the next release will probably allow` ``repo.listall_branches()``. - ----------------------------------------------------------------------- -References ----------------------------------------------------------------------- - -- git-branch_. - -.. _git-branch: https://www.kernel.org/pub/software/scm/git/docs/git-branch.html diff --git a/src/repository.c b/src/repository.c index 31075c2..1920438 100644 --- a/src/repository.c +++ b/src/repository.c @@ -936,10 +936,15 @@ out: PyDoc_STRVAR(Repository_listall_branches__doc__, - "listall_branches([flags]) -> [str, ...]\n" + "listall_branches([flag]) -> [str, ...]\n" "\n" - "Return a tuple with all the branches in the repository.\n" - "By default, it returns all local branches."); + "Return a list with all the branches in the repository.\n" + "\n" + "The *flag* may be:\n" + "\n" + "- GIT_BRANCH_LOCAL - return all local branches (set by default)\n" + "- GIT_BRANCH_REMOTE - return all remote-tracking branches\n" + "- GIT_BRANCH_ALL - return local branches and remote-tracking branches"); PyObject * Repository_listall_branches(Repository *self, PyObject *args)