1363 Commits

Author SHA1 Message Date
W. Trevor King
149bb1e9e2 index: Add missing 'tree' entry to diff_to_tree docstring argspec
It's been missing since the original argspec was added with 5ed9eb4
(Add documentation for conflicts and fixup Index, 2014-07-10).
2014-10-26 15:37:15 -07:00
Carlos Martín Nieto
b8efdde626 Merge pull request #434 from carlosmn/diff-refactor
Repository: make use of peel for diff()
2014-10-10 11:57:18 +02:00
Carlos Martín Nieto
5d4c955d25 Reference: deprecate get_object() in favour of peel()
Let Reference.peel()'s argument be optional, and default to GIT_OBJ_ANY,
which mirrors the behaviour of get_object().

Since we reimplement the get_object() behaviour, change it to call
peel() which makes sure we can keep using the old tests for this aspect.
2014-10-10 11:46:02 +02:00
Carlos Martín Nieto
fa20589fe9 Merge pull request #424 from kyriakosoikonomakos/ssh-agent
authenticate using ssh agent
2014-10-10 11:44:05 +02:00
Carlos Martín Nieto
59da03476e Repository: make use of peel for diff()
Instead of trying to reimplement parts of it, make use of Object.peel()
and Reference.peel() to get to a Blob or Tree.
2014-10-07 20:27:01 +02:00
Carlos Martín Nieto
b98e9e85de Reference: implement peel()
This makes both objects and references peelable via the same interface,
simplifying how to get to the wanted type.
2014-10-07 20:27:01 +02:00
J. David Ibáñez
510f6174f1 Fix Repository.diff for references an empty trees
This should fix issue #432

By the way make the code a little more robust.
2014-10-07 18:59:04 +02:00
Ash Berlin
9aa39aafbc Use ssh_agent when pub+priv key are None, not based on the class 2014-10-07 09:48:47 +01:00
J. David Ibáñez
6831983a26 docs: now "pip install pygit2" installs cffi first
This was fixed in PR#407
2014-09-24 09:33:25 +02:00
Soasme
8bb263559d Fix typo pìp to pip 2014-09-24 09:53:39 +08:00
Alexander Bayandin
548ba1ab84 Fix typo 2014-09-16 18:37:45 +04:00
Kyriakos Oikonomakos
3e87adaccd authenticate using ssh agent 2014-09-15 18:14:20 +01:00
J. David Ibáñez
c997037c7b Get ready for 0.21.3 release v0.21.3 2014-09-15 12:39:27 +02:00
Carlos Martín Nieto
5bc6a98004 Merge pull request #426 from carlosmn/checkout-init-options
Properly initialize the clone options
2014-09-13 23:27:38 +02:00
Carlos Martín Nieto
7d34d2bb27 Use the initializer for repository init options 2014-09-13 18:58:36 +02:00
Carlos Martín Nieto
63377aad78 Properly initialize the clone options
libgit2 provides an initialization function to set sane defaults. Use
that instead of setting the version by hand, as that's not the only
thing it does.

Using C.git_clone_init_options() sets the checkout strategy to SAFE,
which will checkout the files after the clone, instead of the implicit
NONE which we're setting by hand.

This fixes #425,
2014-09-13 18:58:36 +02:00
J. David Ibáñez
51da3b767d Merge remote-tracking branch 'carlos/archive' 2014-09-08 10:03:57 +02:00
Carlos Martín Nieto
81104d4df2 pypy3 does not have the AttributeError/TypeError difference 2014-09-06 19:38:16 +02:00
Carlos Martín Nieto
ab730cb1d4 Provide a method to write a tree to an archive
Add Repository.write_archive() to write a given tree to an archive. As
there are many customisation options, we only provide a method to write
to an archive which is created by the user.
2014-09-06 18:59:15 +02:00
Carlos Martín Nieto
ae00fe4522 Add pypy3 to Travis 2014-09-06 18:37:08 +02:00
J. David Ibáñez
82167827bc Merge remote-tracking branch 'carlos/reference-update' 2014-09-05 17:11:32 +02:00
Carlos Martín Nieto
a3e7a115f4 Provide method for deleting a remote
Fixes #418
2014-09-04 15:57:05 +02:00
J. David Ibáñez
5d8c108fe7 Merge remote-tracking branch 'carlos/clean-handle' 2014-09-04 09:25:36 +02:00
J. David Ibáñez
7c350bdd7c Merge remote-tracking branch 'carlos/merge-checkout-safe' 2014-09-04 09:21:39 +02:00
Carlos Martín Nieto
747e7c2136 Repository: make head read-only and introduce set_head()
Following from the previous commits, make 'head' read-only and provide a
method to update head while providing a message.

The checkout() codepath which switches branches has been updated to
provide a reflog entry which mimics git's.
2014-09-04 01:58:05 +02:00
Carlos Martín Nieto
70256d1a00 remote: clear self handle only on error
When setting the callbacks fails, we want to clear self._self_handle so
we don't leak a pointer to ourselves.

The current code used a 'finally' clause which clears it
unconditionally, which means that by the time the fetch starts, we have
no guarantee that the handle will be valid.

Replace that with an except and re-raise to make sure we only clear it
here if there was an error.
2014-09-03 19:06:34 +02:00
Carlos Martín Nieto
718c7f790c merge: set the checkout strategy to SAFE_CREATE
The expectation is set with Repository.checkout()'s default strategy and
the documentation text that we will write the merged content of the
files to the workdir. We however fail to override the default checkout
strategy when calling git_merge() which results in a DRY_RUN strategy
and no files being changed.

Set the checkout strategy to SAFE_CREATE to match expectations and text.
2014-09-03 15:53:21 +02:00
Carlos Martín Nieto
cd08425927 Move blame to cffi
This requires fairly little work on the pygit2 side to kick off all the
searching on the libgit2 side, so it's a fairly good candidate.

This changes the return value for the commit ids to Oid instead of
strings, which is what we generally try to return.
2014-08-31 22:35:32 +02:00
Carlos Martín Nieto
70410349ff Update reference documentation 2014-08-28 01:25:21 +02:00
Carlos Martín Nieto
4d053cf066 Get rid of a settable Reference.target
Updating the target of a reference is not like setting a property. It
involves appending to the reflog under the same lock, so we must do it
all the same time. Thus setting the target becomes a function which
takes the new target and what the use would like to add to the reflog.
2014-08-28 01:25:21 +02:00
Carlos Martín Nieto
f35f58ca45 Get rid of Reference.append_log()
We do not want this as it is riddled with race conditions.
2014-08-28 01:25:21 +02:00
Carlos Martín Nieto
ae495444a6 Implement Reference.target= as a method
This new method is Reference.set_target() which in addition lets you
specify what to use in the reflog.
2014-08-28 01:25:21 +02:00
J. David Ibáñez
a53d8b2213 Merge remote-tracking branch 'djmattyg007/doc_fixes' 2014-08-26 10:31:53 +02:00
J. David Ibáñez
fe5c9d68c3 Merge remote-tracking branch 'djmattyg007/branches_are_references' 2014-08-26 10:15:33 +02:00
J. David Ibáñez
617dd34f5e Merge remote-tracking branch 'carlos/checkout-branch' 2014-08-26 10:09:32 +02:00
J. David Ibáñez
dad9bc3612 Merge remote-tracking branch 'mduggan/remote-refcount-fix' 2014-08-26 10:02:07 +02:00
Matthew Duggan
2f2d4005c7 Ensure self handle stays alive - keeping it in callbacks is not enough. 2014-08-25 22:39:16 +09:00
Carlos Martín Nieto
b550027234 Fix cloning a repository with a particular branch to checkout
We were missing a cast to bytes. Add a test for this option as well and
remove the old commented-out test for checkout_branch, which is
superseded by this one and whose last bit seemed confused about what the
option means.

This fixes #399
2014-08-25 13:58:41 +02:00
djmattyg007
14bcce0dcf Add test for checking out local branches with a Branch object.
This differs from the only other test which uses a Reference object.
This test only succeeds because of the previous commit.
2014-08-23 11:52:58 +10:00
djmattyg007
21efebd305 Clarify return types from Repository.{create,lookup}_branch() 2014-08-23 11:29:27 +10:00
djmattyg007
629eea01e9 Allow objects of type Branch to be passed to Repository.checkout()
Branch inherits from Reference, so there's no reason why we shouldn't be
able to pass a Branch object.
2014-08-23 11:23:17 +10:00
djmattyg007
4a53b2c8ae Add note about including remote name when looking up remote branch 2014-08-23 11:15:49 +10:00
djmattyg007
e4315aa0a5 Add note about default behaviour of Repository.listall_branches() 2014-08-23 10:56:48 +10:00
djmattyg007
9718fd8c32 Add note about checkout('HEAD') being identical to checkout_head() 2014-08-23 01:08:32 +10:00
djmattyg007
2bd73f3bdf Clear up confusion regarding accepted types for Repository.checkout() refname parameter 2014-08-23 01:06:30 +10:00
J. David Ibáñez
82b342937f Merge remote-tracking branch 'opebeat/cffi-install-fix' 2014-08-21 19:31:10 +02:00
Ron Cohen
acca2726df BuildWithDLLs now inherits from CFFIBuild to *theoretically* fix windows. 2014-08-21 18:42:27 +02:00
Ron Cohen
a459712fde Forgot the setup_requires argument. 2014-08-21 16:00:40 +02:00
Ron Cohen
4056ebf53b Fixed the chicked-and-egg problem with CFFI in setup.
This still needs some work in order to fix the problem
under windows. I have no windows machine here to test it.
2014-08-21 15:48:25 +02:00
J. David Ibáñez
99f295e2e8 docs: fix reST errors 2014-08-20 17:00:33 +02:00