257 Commits

Author SHA1 Message Date
Mark Adams
c6305a062b revert: Add support for git_revert_commit via Repository.revert_commit()
This change adds `Repository.revert_commit()` which wraps around
`git_revert_commit` which will return an `Index` with the appropriate
changes to revert the specified commit.

Fixes #710
2017-06-05 16:08:39 -05:00
Mark Adams
87beb76dcc Modify Index.write_tree() to have more robust Repository detection
Currently, Index.write_tree() relies on either the caller passing in a
`repo=` arg or the underlying `git_index` being already bound to a
`git_repository`. This ignores the case where the caller does not pass
a `repo` argument to `Index.write_tree()` but the `Index._repo`
property is populated on the index.

This change modifies Index.write_tree() to use the passed-in `repo`
argument, falls back to using `Index._repo` and then assumes that
`git_index` must be bound to a `git_repository`. This change should make
Index.write_tree() a little more robust in the most common use-case.
2017-06-05 16:02:01 -05:00
Lukas Fleischer
b88dc86842 Fix parameter passing of describe patterns
When ffi.new() is used to build a new pointer object, the returned
pointer object has ownership on the allocated memory. When it is
garbage-collected, then the memory is freed. Thus, we need to make sure
the original object survives its use, otherwise the casted pointer will
point to garbage.

This fixes one test which was failing with the latest CFFI version, see
issue #694. Thus, this commit also reverts 803b1cb (cffi 1.10 not yet
supported, 2017-03-22) where the latest CFFI version was marked as
unsupported.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
2017-05-06 21:49:47 +02:00
J. David Ibáñez
8559b2da20 Release 0.25.1 2017-04-25 19:08:10 +02:00
J. David Ibáñez
74717bed55 Merge remote-tracking branch 'tmr232/references-object' 2017-04-21 11:13:09 +02:00
Tamir Bahar
3818555e14 Added Repository.references accessor. 2017-04-21 08:51:41 +00:00
J. David Ibáñez
706c60c4ab Clean some cffi warnings
"has no values explicitly defined"
2017-04-20 22:32:03 +02:00
Tamir Bahar
320ee5e733 Added GIT_BRANCH_ALL 2017-04-19 21:10:11 +03:00
Tamir Bahar
d14438725e Added basic Repository.branches implementation. 2017-04-17 23:02:58 +03:00
Tamir Bahar
7ee851273a Added explicit check for path = None in init_repository
Closes #688.
2017-04-05 16:37:25 +03:00
Nick Hynes
9be907983f Wrap stash_pop 2017-03-27 16:42:38 -04:00
Nick Hynes
b31ac50210 Wrap stash_drop 2017-03-27 16:33:32 -04:00
Nick Hynes
da233b16c5 Wrap git_stash_apply 2017-03-27 16:31:21 -04:00
Nick Hynes
1a842ff8bd Wrap git_stash_save 2017-03-27 16:20:33 -04:00
Nick Hynes
a294655aa5 Add declarations for git-stash 2017-03-27 16:18:13 -04:00
J. David Ibáñez
354d56a95c Update copyright years 2017-03-22 21:15:34 +01:00
Matthaus Woolard
4fbc1f1c05 Add support for custom backends
Signed-off-by: Matthaus Woolard <matthaus.woolard@gmail.com>
2017-02-09 15:57:56 +00:00
Tamir Bahar
5c061cbb0a Remove unused code
Removed a chunk of code from `checkout` that did nothing, but had a bug.
When checking out from a branch-less state (like the state when a repository is first initialized) the code failed.
The failure was due to trying to get some properties of the current branch, which were never used in the code.
2017-01-03 01:17:48 +02:00
J. David Ibáñez
68817aad4f Release 0.25.0 2016-12-26 12:30:36 +01:00
J. David Ibáñez
0b513d57fa Merge remote-tracking branch 'carlos/next' 2016-12-23 21:37:58 +01:00
Szucs Krisztian
77f0585645 Added mwindow_mapped_limit, cached_memory, enable_caching, cache_max_size, cache_object_limit options 2016-12-03 13:52:19 +01:00
Carlos Martín Nieto
acdec78617 Update for v0.24+1 2016-11-14 16:40:36 +01:00
J. David Ibáñez
66280af83a Release 0.24.2 2016-11-01 20:34:50 +01:00
J. David Ibáñez
b2a34bd901 Merge remote-tracking branch 'fourplusone/master' 2016-11-01 13:41:23 +01:00
Matthias Bartelmeß
db213113f4 Fix/appveyor all (#1)
* Create python-33.yml

* Delete python-33.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Use weakref for conflicts caching

To prevent GC issues for python <= 3.3, use a weak reference for Index._conflicts

* Update index.py

* Update appveyor.yml
2016-10-30 12:52:25 +02:00
Robert Hölzl
ee28de65a0 Extend comment of Remote.push by note about push_update_reference.
As happened in support request https://github.com/libgit2/libgit2/issues/3963 it can be easily overseen,
that push returns True, when the remote has installed a hook that denies the commits.
2016-10-23 23:55:53 +02:00
Matthias Bartelmess
00dd78bf1b Fix windows tests 2016-10-21 06:06:40 +03:00
J. David Ibáñez
554f167353 Merge remote-tracking branch 'mrh/fix-non-ascii-errmsg' 2016-09-15 09:25:08 +02:00
mrh1997
54e4da837b Support non-english errors with non-ascii chars.
Libgit2 partially forwards OS error message texts.
On non-english Windows OSes these errors may contain non-ascii characters (i.e. umlauts).
To avoid that a UnicodeDecodeError is raised the error message is interpreted as UTF-8.
The solution should not be necessary on linux/osx as they return always ascii (as far as I know).
Thus this solution will not change the behaviour on linux/osx.
2016-09-13 22:31:49 +02:00
mrh1997
ffc514fa24 Ammend the doc-string of Repository.diff()
According to the old documentation, it was not clear how to compare 
working directory/index to a git object.
2016-07-11 14:41:39 +02:00
J. David Ibáñez
4416f65fe1 Release 0.24.1 2016-06-21 23:04:12 +02:00
J. David Ibáñez
d8fd2e78d8 Merge remote-tracking branch 'ignatenkobrain/gh620' 2016-04-17 20:48:56 +02:00
Igor Gnatenko
fd9a39a91b repository: decode() linkname
Reference: https://github.com/libgit2/pygit2/issues/620
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-04-15 14:13:47 +02:00
Igor Gnatenko
270dad8cd3 repository: SYMTYPE is constant in module tarfile, not in any class
Reference: https://github.com/libgit2/pygit2/issues/618
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-04-15 14:07:33 +02:00
Yu Jianjian
51915ddf0e wrong order of the args in docstring of write_archive 2016-03-23 23:33:20 +08:00
J. David Ibáñez
22021c67fc Release 0.24.0 2016-03-05 23:21:05 +01:00
Carlos Martín Nieto
c1d831c98a Update to libgit2 v0.24 2016-03-04 17:08:55 +01:00
Thom Wiggers
735510f14d
Fix repository crash if path passed is not a str
Tries to decode any non-string objects (such as bytes)

Introduces `six` as a dependency

Closes #588
2016-02-28 12:32:51 +01:00
Carlos Martín Nieto
487fb5913e Keep the describe dirty suffix string alive 2016-02-25 08:04:27 +01:00
J. David Ibáñez
fa60e2233d Release 0.23.3 2016-01-01 19:18:34 +01:00
Noah Fontes
99dfce9ab8 Add support for Repository.describe(...). 2015-12-05 23:22:37 -08:00
J. David Ibáñez
70edbf256a Update copyright years 2015-10-11 18:48:59 +02:00
J. David Ibáñez
203335bd63 Trying to fix install with pip 2015-10-11 18:42:30 +02:00
J. David Ibáñez
64150d3535 Release 0.23.2 2015-10-11 17:49:17 +02:00
J. David Ibáñez
d25a0d61de Fix error introduced accidentally in previous commit 2015-10-11 12:08:53 +02:00
J. David Ibáñez
f5aa1829ac Do not use hasattr, not robust
In Python versions older than 3.2 hasattr is not robust as it masks real
errors. And usually is not efficient as a call to hasattr is often
followed by another call to getattr. It is best to avoid using it
completely.

See https://docs.python.org/3/whatsnew/3.2.html#other-language-changes
2015-10-11 11:58:07 +02:00
J. David Ibáñez
9db8737364 Update changelog 2015-10-11 11:06:22 +02:00
Carlos Martín Nieto
563cb9018e Bring back the certificate check callback
This was implemented for clone, but not for fetch or push, so it was
deleted during the conversion, which shows why we need to unify these
callback structures.
2015-09-27 02:43:50 +02:00
Carlos Martín Nieto
ac2e363d04 Allow setting credentials and certificate in callback ctor
This allows for a less verbose way of setting one-liners as these
callbacks.
2015-09-27 02:43:50 +02:00
Carlos Martín Nieto
ab97c08f72 Make clone take the callbacks object
This lets use the same callbacks for fetch and clone; it also fills in
the callbacks which the clone function did not support.
2015-09-27 02:43:50 +02:00