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>
The documentation recommends adding the ffi code as an extension so it
gets built at the right time.
Make use of the LIBGIT2 environment variable to build and link the ffi
module the same way the C extension does so the user doesn't have to
export CFLAGS.
I build libgit2 in a `build/` subdirectory of a Git checkout, and
never bother installing it. I'd like to link pygit2 against it there,
but LIBGIT2 assumes libgit2.so will be in the default library search
path or $LIBGIT/lib. This patch adds LIBGIT2_LIB, a new environment
variable for overriding the additional library search paths.
An alternative to this patch is to set LDFLAGS="-L..." explicitly
before building pygit2. I've avoided that approach here minimize the
difference between configuring this library path explicitly, and
configuring implicitly via LIBGIT2.
Moved the hardcoded version from setup.py to pygit2/version.py so
client software can figure out which version of pygit2 it's using.
Having setup.py import pygit2.version.__version__ removes duplication,
and also means that setup.py will always use the local version (and
not the version of a previously installed pygit2).
New features:
- Support for diffs
- Support for reflog
- Support for config files
- Add shortcut 'Repository.head'
Other changes:
- Improved support for Windows
- Improved documentation
- Refactoring: split the code into smaller files
- Refactoring: allow to add helper code written in Python
- Use Travis Continous-Integration service
http://travis-ci.org/#!/libgit2/pygit2
Thanks to András Veres-Szentkirályi, Christian Boos, Martin Lenders,
Nico von Geyso, Petr Hosek and pistacchio.
Highlights:
- Fix serious memory bug
- Change signature of 'TreeBuilder.insert'
- Improve support of Windows
Thanks to Benjamin Kircher, Han-Wen Nienhuys and Yonggang Luo.