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: 4 additions & 0 deletions docs/remotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ This class contains the data which is available to us during a fetch.
The Refspec type
===================

Refspecs objects are not constructed directly, but returned by
:meth:`pygit2.Remote.get_refspec`. To create a new a refspec on a Remote, use
:meth:`pygit2.Remote.add_fetch` or :meth:`pygit2.Remote.add_push`.

.. autoclass:: pygit2.refspec.Refspec
:members:

Expand Down
3 changes: 2 additions & 1 deletion pygit2/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class Keypair(object):
remote server
:param str pubkey: the path to the user's public key file
:param str privkey: the path to the user's private key file
:param str passphrase: the password used to decrypt the private key file
:param str passphrase: the password used to decrypt the private key file,
or empty string if no passphrase is required.

"""

Expand Down
3 changes: 2 additions & 1 deletion pygit2/refspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@


class Refspec(object):
"""The constructor is for internal use only"""
def __init__(self, owner, ptr):
self._owner = owner
self._refspec = ptr
Expand Down Expand Up @@ -95,7 +96,7 @@ def transform(self, ref):
return self._transform(ref, C.git_refspec_transform)

def rtransform(self, ref):
"""transform(str) -> str
"""rtransform(str) -> str

Transform a reference name according to this refspec from the lhs
to the rhs"""
Expand Down
4 changes: 2 additions & 2 deletions pygit2/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ def push_refspecs(self, l):
def add_fetch(self, spec):
"""add_fetch(refspec)

Add a fetch refspec to the remote"""
Add a fetch refspec (str) to the remote"""

err = C.git_remote_add_fetch(self._remote, to_bytes(spec))
check_error(err)

def add_push(self, spec):
"""add_push(refspec)

Add a push refspec to the remote"""
Add a push refspec (str) to the remote"""

err = C.git_remote_add_push(self._remote, to_bytes(spec))
check_error(err)
Expand Down