Pygit2

Latest version: v1.16.0

Safety actively analyzes 714772 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 12

1.1.1

- Fix crash in tree iteration
[984](https://github.com/libgit2/pygit2/pull/984)
[980](https://github.com/libgit2/pygit2/issues/980)
- Do not include the docs in dist files, so they\'re much smaller now

1.1.0

- Upgrade to libgit2 0.99
[959](https://github.com/libgit2/pygit2/pull/959)
- Continued work on custom odb backends
[948](https://github.com/libgit2/pygit2/pull/948)
- New `Diff.patchid` getter
[960](https://github.com/libgit2/pygit2/pull/960)
[877](https://github.com/libgit2/pygit2/issues/877)
- New `settings.disable_pack_keep_file_checks(...)`
[908](https://github.com/libgit2/pygit2/pull/908)
- New `GIT_DIFF_` and `GIT_DELTA_` constants
[738](https://github.com/libgit2/pygit2/issues/738)
- Fix crash in iteration of config entries
[970](https://github.com/libgit2/pygit2/issues/970)
- Travis: fix printing features when building Linux wheels
[977](https://github.com/libgit2/pygit2/pull/977)
- Move `_pygit2` to `pygit2._pygit2`
[978](https://github.com/libgit2/pygit2/pull/978)

Requirements changes:

- Now libgit2 0.99 is required
- New requirement: cached-property

Breaking changes:

- In the rare case you\'re directly importing the low level `_pygit2`,
the import has changed:

Before
import _pygit2

Now
from pygit2 import _pygit2

1.0.3

- Fix memory leak in DiffFile
[943](https://github.com/libgit2/pygit2/issues/943)

1.0.2

- Fix enumerating tree entries with submodules
[967](https://github.com/libgit2/pygit2/issues/967)

1.0.1

- Fix build in Mac OS
[963](https://github.com/libgit2/pygit2/issues/963)

1.0.0

- Drop Python 2.7 and 3.4 support, six no longer required
[941](https://github.com/libgit2/pygit2/issues/941)
- Add Python 3.8 support
[918](https://github.com/libgit2/pygit2/issues/918)
- New support for `/` operator to traverse trees
[903](https://github.com/libgit2/pygit2/pull/903)
[924](https://github.com/libgit2/pygit2/issues/924)
- New `Branch.raw_branch_name`
[954](https://github.com/libgit2/pygit2/pull/954)
- New `Index.remove_all()`
[920](https://github.com/libgit2/pygit2/pull/920)
- New `Remote.ls_remotes(..)`
[935](https://github.com/libgit2/pygit2/pull/935)
[936](https://github.com/libgit2/pygit2/issues/936)
- New `Repository.lookup_reference_dwim(..)` and
`Repository.resolve_refish(..)`
[922](https://github.com/libgit2/pygit2/issues/922)
[923](https://github.com/libgit2/pygit2/pull/923)
- New `Repository.odb` returns new `Odb` type instance. And new
`OdbBackend` type.
[940](https://github.com/libgit2/pygit2/pull/940)
[942](https://github.com/libgit2/pygit2/pull/942)
- New `Repository.references.compress()`
[961](https://github.com/libgit2/pygit2/pull/961)
- Optimization: Load notes lazily
[958](https://github.com/libgit2/pygit2/pull/958)
- Fix spurious exception in config
[916](https://github.com/libgit2/pygit2/issues/916)
[917](https://github.com/libgit2/pygit2/pull/917)
- Minor documentation and cosmetic changes
[919](https://github.com/libgit2/pygit2/pull/919)
[921](https://github.com/libgit2/pygit2/pull/921)
[946](https://github.com/libgit2/pygit2/pull/946)
[950](https://github.com/libgit2/pygit2/pull/950)

Breaking changes:

- Now the Repository has a new attribue `odb` for object database:

Before
repository.read(...)
repository.write(...)

Now
repository.odb.read(...)
repository.odb.write(...)

- Now `Tree[x]` returns a `Object` instance instead of a `TreeEntry`;
`Object.type` returns an integer while `TreeEntry.type` returned a
string:

Before
if tree[x].type == 'tree':

Now
if tree[x].type == GIT_OBJ_TREE:
if tree[x].type_str == 'tree':

- Renamed `TreeEntry._name` to `Object.raw_name`:

Before
tree[x]._name

Now
tree[x].raw_name

- Object comparison is done by id. In the rare case you need to do
tree-entry comparison or sorting:

Before
tree[x] < tree[y]
sorted(list(tree))

Now
pygit2.tree_entry_cmp(x, y) < 0
sorted(list(tree), key=pygit2.tree_entry_key)

Page 6 of 12

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.