From 75f9f883352b1ad8cff069a538607adf79bd7fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 26 Mar 2014 14:19:38 +0100 Subject: [PATCH] Update clone_repository's docs It claims you need to checkout a branch after clone, which is not the case currently (the clone function will do it for you). While here, format the docstring for sphinx to make it pretty. --- pygit2/__init__.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pygit2/__init__.py b/pygit2/__init__.py index 60e8942..f4f471e 100644 --- a/pygit2/__init__.py +++ b/pygit2/__init__.py @@ -52,24 +52,20 @@ def init_repository(path, bare=False): def clone_repository( url, path, bare=False, ignore_cert_errors=False, remote_name="origin", checkout_branch=None): - """ - Clones a new Git repository from *url* in the given *path*. - - **bare** indicates whether a bare git repository should be created. - - **remote_name** is the name given to the "origin" remote. - The default is "origin". - - **checkout_branch** gives the name of the branch to checkout. - None means use the remote's *HEAD*. + """Clones a new Git repository from *url* in the given *path*. Returns a Repository class pointing to the newly cloned repository. - If you wish to use the repo, you need to do a checkout for one of - the available branches, like this: + :param str url: URL of the repository to clone - >>> repo = repo.clone_repository("url", "path") - >>> repo.checkout(branch) # i.e.: refs/heads/master + :param str path: Local path to clone into + + :param bool bare: Whether the local repository should be bare + + :param str remote_name: Name to give the remote at *url*. + + :param str checkout_branch: Branch to checkout after the + clone. The default is to use the remote's default branch. """