Fixing 80-column width for both the python and C code.
This commit is contained in:
@@ -56,16 +56,27 @@ def clone_repository(
|
||||
"""
|
||||
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".
|
||||
* **push_url** is a URL to be used for pushing. None means use the *url* parameter.
|
||||
* **fetch_spec** defines the the default fetch spec. None results in the same behavior as *GIT_REMOTE_DEFAULT_FETCH*.
|
||||
* **push_spec** is the fetch specification to be used for pushing. None means use the same spec as for *fetch_spec*.
|
||||
* **checkout_branch** gives the name of the branch to checkout. None means use the remote's *HEAD*.
|
||||
**bare** indicates whether a bare git repository should be created.
|
||||
|
||||
**remote_name** is the name given to the "origin" remote.
|
||||
The default is "origin".
|
||||
|
||||
**push_url** is a URL to be used for pushing.
|
||||
None means use the *url* parameter.
|
||||
|
||||
**fetch_spec** defines the the default fetch spec.
|
||||
None results in the same behavior as *GIT_REMOTE_DEFAULT_FETCH*.
|
||||
|
||||
**push_spec** is the fetch specification to be used for pushing.
|
||||
None means use the same spec as for *fetch_spec*.
|
||||
|
||||
**checkout_branch** gives the name of the branch to checkout.
|
||||
None means use the remote's *HEAD*.
|
||||
|
||||
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:
|
||||
If you wish to use the repo, you need to do a checkout for one of
|
||||
the available branches, like this:
|
||||
|
||||
>>> repo = repo.clone_repository("url", "path")
|
||||
>>> repo.checkout(branch) # i.e.: refs/heads/master
|
||||
|
19
src/pygit2.c
19
src/pygit2.c
@@ -98,9 +98,11 @@ init_repository(PyObject *self, PyObject *args) {
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(clone_repository__doc__,
|
||||
"clone_repository(url, path, bare, remote_name, push_url, fetch_spec, push_spec, checkout_branch)\n"
|
||||
"clone_repository(url, path, bare, remote_name, push_url,"
|
||||
"fetch_spec, push_spec, checkout_branch)\n"
|
||||
"\n"
|
||||
"Clones a Git repository in the given url to the given path with the specified options.\n"
|
||||
"Clones a Git repository in the given url to the given path "
|
||||
"with the specified options.\n"
|
||||
"\n"
|
||||
"Arguments:\n"
|
||||
"\n"
|
||||
@@ -115,11 +117,14 @@ PyDoc_STRVAR(clone_repository__doc__,
|
||||
"push_url\n"
|
||||
" URL to be used for pushing.\n"
|
||||
"fetch_spec\n"
|
||||
" The fetch specification to be used for fetching. None results in the same behavior as GIT_REMOTE_DEFAULT_FETCH.\n"
|
||||
" The fetch specification to be used for fetching. None results in "
|
||||
"the same behavior as GIT_REMOTE_DEFAULT_FETCH.\n"
|
||||
"push_spec\n"
|
||||
" The fetch specification to be used for pushing. None means use the same spec as for 'fetch_spec'\n"
|
||||
" The fetch specification to be used for pushing. None means use the "
|
||||
"same spec as for 'fetch_spec'\n"
|
||||
"checkout_branch\n"
|
||||
" The name of the branch to checkout. None means use the remote's HEAD.\n");
|
||||
" The name of the branch to checkout. None means use the remote's "
|
||||
"HEAD.\n");
|
||||
|
||||
|
||||
PyObject *
|
||||
@@ -131,7 +136,9 @@ clone_repository(PyObject *self, PyObject *args) {
|
||||
const char *remote_name, *push_url, *fetch_spec, *push_spec, *checkout_branch;
|
||||
int err;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "zzIzzzzz", &url, &path, &bare, &remote_name, &push_url, &fetch_spec, &push_spec, &checkout_branch))
|
||||
if (!PyArg_ParseTuple(args, "zzIzzzzz",
|
||||
&url, &path, &bare, &remote_name, &push_url,
|
||||
&fetch_spec, &push_spec, &checkout_branch))
|
||||
return NULL;
|
||||
|
||||
git_clone_options opts = {
|
||||
|
Reference in New Issue
Block a user