pygit2 1.14.1__tar.gz → 1.15.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. {pygit2-1.14.1 → pygit2-1.15.0}/AUTHORS.md +5 -0
  2. {pygit2-1.14.1 → pygit2-1.15.0}/CHANGELOG.md +70 -9
  3. {pygit2-1.14.1 → pygit2-1.15.0}/Makefile +1 -1
  4. {pygit2-1.14.1 → pygit2-1.15.0}/PKG-INFO +1 -4
  5. {pygit2-1.14.1 → pygit2-1.15.0}/README.md +0 -2
  6. {pygit2-1.14.1 → pygit2-1.15.0}/build.sh +4 -4
  7. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/__init__.py +21 -13
  8. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/_build.py +2 -2
  9. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/_pygit2.pyi +172 -52
  10. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/_run.py +2 -2
  11. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/blame.py +14 -7
  12. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/blob.py +3 -3
  13. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/branches.py +3 -2
  14. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/callbacks.py +59 -30
  15. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/config.py +18 -23
  16. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/config.h +5 -3
  17. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/remote.h +2 -1
  18. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/strarray.h +1 -1
  19. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/enums.py +138 -170
  20. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/errors.py +4 -2
  21. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/filter.py +3 -9
  22. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/index.py +34 -35
  23. pygit2-1.15.0/pygit2/legacyenums.py +113 -0
  24. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/packbuilder.py +0 -2
  25. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/references.py +4 -3
  26. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/refspec.py +1 -2
  27. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/remotes.py +50 -55
  28. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/repository.py +147 -147
  29. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/settings.py +0 -1
  30. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/submodules.py +28 -20
  31. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/utils.py +48 -13
  32. {pygit2-1.14.1 → pygit2-1.15.0}/pyproject.toml +17 -4
  33. {pygit2-1.14.1 → pygit2-1.15.0}/setup.py +20 -21
  34. {pygit2-1.14.1 → pygit2-1.15.0}/src/blob.c +1 -0
  35. {pygit2-1.14.1 → pygit2-1.15.0}/src/filter.c +1 -0
  36. {pygit2-1.14.1 → pygit2-1.15.0}/src/object.c +2 -25
  37. {pygit2-1.14.1 → pygit2-1.15.0}/src/odb.c +8 -5
  38. {pygit2-1.14.1 → pygit2-1.15.0}/src/odb_backend.c +6 -4
  39. {pygit2-1.14.1 → pygit2-1.15.0}/src/oid.c +16 -16
  40. {pygit2-1.14.1 → pygit2-1.15.0}/src/options.c +6 -4
  41. {pygit2-1.14.1 → pygit2-1.15.0}/src/pygit2.c +2 -16
  42. {pygit2-1.14.1 → pygit2-1.15.0}/src/reference.c +9 -7
  43. {pygit2-1.14.1 → pygit2-1.15.0}/src/repository.c +31 -34
  44. {pygit2-1.14.1 → pygit2-1.15.0}/src/tree.c +6 -4
  45. {pygit2-1.14.1 → pygit2-1.15.0}/src/treebuilder.c +6 -4
  46. {pygit2-1.14.1 → pygit2-1.15.0}/src/types.h +2 -2
  47. {pygit2-1.14.1 → pygit2-1.15.0}/src/utils.c +10 -96
  48. {pygit2-1.14.1 → pygit2-1.15.0}/src/utils.h +1 -3
  49. {pygit2-1.14.1 → pygit2-1.15.0}/test/__init__.py +1 -0
  50. {pygit2-1.14.1 → pygit2-1.15.0}/test/conftest.py +6 -4
  51. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_apply_diff.py +11 -0
  52. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_archive.py +3 -0
  53. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_attributes.py +1 -1
  54. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_blame.py +34 -14
  55. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_blob.py +28 -12
  56. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_branch.py +51 -33
  57. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_branch_empty.py +18 -12
  58. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_cherrypick.py +11 -5
  59. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_commit.py +84 -49
  60. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_commit_gpg.py +16 -16
  61. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_config.py +38 -33
  62. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_credentials.py +44 -34
  63. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_describe.py +22 -6
  64. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_diff.py +45 -18
  65. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_diff_binary.py +1 -0
  66. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_filter.py +21 -24
  67. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_index.py +53 -27
  68. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_mailmap.py +20 -20
  69. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_merge.py +86 -76
  70. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_note.py +24 -14
  71. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_object.py +23 -15
  72. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_odb.py +7 -3
  73. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_odb_backend.py +11 -5
  74. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_oid.py +24 -12
  75. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_options.py +29 -15
  76. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_packbuilder.py +3 -2
  77. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_patch.py +18 -10
  78. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_patch_encoding.py +2 -0
  79. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_refdb_backend.py +13 -6
  80. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_refs.py +187 -115
  81. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_remote.py +99 -31
  82. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_remote_prune.py +4 -0
  83. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_remote_utf8.py +1 -0
  84. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_repository.py +174 -99
  85. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_repository_bare.py +51 -24
  86. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_repository_custom.py +5 -2
  87. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_repository_empty.py +2 -0
  88. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_revparse.py +15 -16
  89. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_revwalk.py +17 -8
  90. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_signature.py +22 -8
  91. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_status.py +15 -18
  92. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_submodule.py +25 -15
  93. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_tag.py +17 -8
  94. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_tree.py +19 -7
  95. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_treebuilder.py +1 -1
  96. {pygit2-1.14.1 → pygit2-1.15.0}/test/utils.py +16 -22
  97. pygit2-1.14.1/pygit2/legacyenums.py +0 -109
  98. {pygit2-1.14.1 → pygit2-1.15.0}/COPYING +0 -0
  99. {pygit2-1.14.1 → pygit2-1.15.0}/SPONSORS.md +1 -1
  100. {pygit2-1.14.1 → pygit2-1.15.0}/build_tag.py +0 -0
  101. {pygit2-1.14.1 → pygit2-1.15.0}/mypy-stubtest.ini +0 -0
  102. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/credentials.py +0 -0
  103. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/attr.h +0 -0
  104. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/blame.h +0 -0
  105. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/buffer.h +0 -0
  106. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/callbacks.h +0 -0
  107. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/checkout.h +0 -0
  108. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/clone.h +0 -0
  109. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/commit.h +0 -0
  110. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/common.h +0 -0
  111. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/describe.h +0 -0
  112. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/diff.h +0 -0
  113. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/errors.h +0 -0
  114. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/graph.h +0 -0
  115. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/index.h +0 -0
  116. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/indexer.h +0 -0
  117. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/merge.h +0 -0
  118. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/net.h +0 -0
  119. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/oid.h +0 -0
  120. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/pack.h +0 -0
  121. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/proxy.h +0 -0
  122. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/refspec.h +0 -0
  123. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/repository.h +0 -0
  124. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/revert.h +0 -0
  125. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/stash.h +0 -0
  126. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/submodule.h +0 -0
  127. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/transport.h +0 -0
  128. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/decl/types.h +0 -0
  129. {pygit2-1.14.1 → pygit2-1.15.0}/pygit2/ffi.py +0 -0
  130. {pygit2-1.14.1 → pygit2-1.15.0}/pytest.ini +0 -0
  131. {pygit2-1.14.1 → pygit2-1.15.0}/requirements-test.txt +0 -0
  132. {pygit2-1.14.1 → pygit2-1.15.0}/requirements.txt +0 -0
  133. {pygit2-1.14.1 → pygit2-1.15.0}/setup.cfg +0 -0
  134. {pygit2-1.14.1 → pygit2-1.15.0}/src/branch.c +0 -0
  135. {pygit2-1.14.1 → pygit2-1.15.0}/src/branch.h +0 -0
  136. {pygit2-1.14.1 → pygit2-1.15.0}/src/commit.c +0 -0
  137. {pygit2-1.14.1 → pygit2-1.15.0}/src/diff.c +0 -0
  138. {pygit2-1.14.1 → pygit2-1.15.0}/src/diff.h +0 -0
  139. {pygit2-1.14.1 → pygit2-1.15.0}/src/error.c +0 -0
  140. {pygit2-1.14.1 → pygit2-1.15.0}/src/error.h +0 -0
  141. {pygit2-1.14.1 → pygit2-1.15.0}/src/filter.h +0 -0
  142. {pygit2-1.14.1 → pygit2-1.15.0}/src/mailmap.c +0 -0
  143. {pygit2-1.14.1 → pygit2-1.15.0}/src/mailmap.h +0 -0
  144. {pygit2-1.14.1 → pygit2-1.15.0}/src/note.c +0 -0
  145. {pygit2-1.14.1 → pygit2-1.15.0}/src/note.h +0 -0
  146. {pygit2-1.14.1 → pygit2-1.15.0}/src/object.h +0 -0
  147. {pygit2-1.14.1 → pygit2-1.15.0}/src/odb.h +0 -0
  148. {pygit2-1.14.1 → pygit2-1.15.0}/src/odb_backend.h +0 -0
  149. {pygit2-1.14.1 → pygit2-1.15.0}/src/oid.h +0 -0
  150. {pygit2-1.14.1 → pygit2-1.15.0}/src/options.h +0 -0
  151. {pygit2-1.14.1 → pygit2-1.15.0}/src/patch.c +0 -0
  152. {pygit2-1.14.1 → pygit2-1.15.0}/src/patch.h +0 -0
  153. {pygit2-1.14.1 → pygit2-1.15.0}/src/refdb.c +0 -0
  154. {pygit2-1.14.1 → pygit2-1.15.0}/src/refdb.h +0 -0
  155. {pygit2-1.14.1 → pygit2-1.15.0}/src/refdb_backend.c +0 -0
  156. {pygit2-1.14.1 → pygit2-1.15.0}/src/refdb_backend.h +0 -0
  157. {pygit2-1.14.1 → pygit2-1.15.0}/src/reference.h +0 -0
  158. {pygit2-1.14.1 → pygit2-1.15.0}/src/repository.h +0 -0
  159. {pygit2-1.14.1 → pygit2-1.15.0}/src/revspec.c +0 -0
  160. {pygit2-1.14.1 → pygit2-1.15.0}/src/revspec.h +0 -0
  161. {pygit2-1.14.1 → pygit2-1.15.0}/src/signature.c +0 -0
  162. {pygit2-1.14.1 → pygit2-1.15.0}/src/signature.h +0 -0
  163. {pygit2-1.14.1 → pygit2-1.15.0}/src/stash.c +0 -0
  164. {pygit2-1.14.1 → pygit2-1.15.0}/src/tag.c +0 -0
  165. {pygit2-1.14.1 → pygit2-1.15.0}/src/tree.h +0 -0
  166. {pygit2-1.14.1 → pygit2-1.15.0}/src/treebuilder.h +0 -0
  167. {pygit2-1.14.1 → pygit2-1.15.0}/src/walker.c +0 -0
  168. {pygit2-1.14.1 → pygit2-1.15.0}/src/walker.h +0 -0
  169. {pygit2-1.14.1 → pygit2-1.15.0}/src/wildmatch.c +0 -0
  170. {pygit2-1.14.1 → pygit2-1.15.0}/src/wildmatch.h +0 -0
  171. {pygit2-1.14.1 → pygit2-1.15.0}/src/worktree.c +0 -0
  172. {pygit2-1.14.1 → pygit2-1.15.0}/src/worktree.h +0 -0
  173. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/barerepo.zip +0 -0
  174. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/binaryfilerepo.zip +0 -0
  175. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/blameflagsrepo.zip +0 -0
  176. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/dirtyrepo.zip +0 -0
  177. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/emptyrepo.zip +0 -0
  178. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/encoding.zip +0 -0
  179. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/gpgsigned.zip +0 -0
  180. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/submodulerepo.zip +0 -0
  181. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/testrepo.zip +0 -0
  182. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/testrepoformerging.zip +0 -0
  183. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/testrepopacked.zip +0 -0
  184. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/trailerrepo.zip +0 -0
  185. {pygit2-1.14.1 → pygit2-1.15.0}/test/data/utf8branchrepo.zip +0 -0
  186. {pygit2-1.14.1 → pygit2-1.15.0}/test/keys/pygit2_empty +0 -0
  187. {pygit2-1.14.1 → pygit2-1.15.0}/test/keys/pygit2_empty.pub +0 -0
  188. {pygit2-1.14.1 → pygit2-1.15.0}/test/test_commit_trailer.py +0 -0
@@ -72,6 +72,7 @@ Authors:
72
72
  Jason Ziglar
73
73
  Leonardo Rhodes
74
74
  Mark Adams
75
+ Michał Kępień
75
76
  Nika Layzell
76
77
  Peter-Yi Zhang
77
78
  Petr Viktorin
@@ -81,6 +82,7 @@ Authors:
81
82
  Sukhman Bhuller
82
83
  Thomas Kluyver
83
84
  Tyler Cipriani
85
+ WANG Xuerui
84
86
  Alex Chamberlain
85
87
  Alexander Bayandin
86
88
  Amit Bakshi
@@ -185,10 +187,12 @@ Authors:
185
187
  Mathieu Parent
186
188
  Mathieu Pillard
187
189
  Matthaus Woolard
190
+ Maxwell G
188
191
  Michał Górny
189
192
  Nicolás Sanguinetti
190
193
  Nikita Kartashov
191
194
  Nikolai Zujev
195
+ Nils Philippsen
192
196
  Noah Fontes
193
197
  Óscar San José
194
198
  Patrick Lühne
@@ -212,6 +216,7 @@ Authors:
212
216
  Tad Hardesty
213
217
  Timo Röhling
214
218
  Vladimir Rutsky
219
+ Wim Jeantine-Glenn
215
220
  Yu Jianjian
216
221
  buhl
217
222
  chengyuhang
@@ -1,3 +1,61 @@
1
+ # 1.15.0 (2024-05-18)
2
+
3
+ - Many deprecated features have been removed, see below
4
+
5
+ - Upgrade to libgit2 v1.8.1
6
+
7
+ - New `push_options` optional argument in `Repository.push(...)`
8
+ [#1282](https://github.com/libgit2/pygit2/pull/1282)
9
+
10
+ - New support comparison of `Oid` with text string
11
+
12
+ - Fix `CheckoutNotify.IGNORED`
13
+ [#1288](https://github.com/libgit2/pygit2/issues/1288)
14
+
15
+ - Use default error handler when decoding/encoding paths
16
+ [#537](https://github.com/libgit2/pygit2/issues/537)
17
+
18
+ - Remove setuptools runtime dependency
19
+ [#1281](https://github.com/libgit2/pygit2/pull/1281)
20
+
21
+ - Coding style with ruff
22
+ [#1280](https://github.com/libgit2/pygit2/pull/1280)
23
+
24
+ - Add wheels for ppc64le
25
+ [#1279](https://github.com/libgit2/pygit2/pull/1279)
26
+
27
+ - Fix tests on EPEL8 builds for s390x
28
+ [#1283](https://github.com/libgit2/pygit2/pull/1283)
29
+
30
+ Deprecations:
31
+
32
+ - Deprecate `IndexEntry.hex`, use `str(IndexEntry.id)`
33
+
34
+ Breaking changes:
35
+
36
+ - Remove deprecated `oid.hex`, use `str(oid)`
37
+ - Remove deprecated `object.hex`, use `str(object.id)`
38
+ - Remove deprecated `object.oid`, use `object.id`
39
+
40
+ - Remove deprecated `Repository.add_submodule(...)`, use `Repository.submodules.add(...)`
41
+ - Remove deprecated `Repository.lookup_submodule(...)`, use `Repository.submodules[...]`
42
+ - Remove deprecated `Repository.init_submodules(...)`, use `Repository.submodules.init(...)`
43
+ - Remove deprecated `Repository.update_submodule(...)`, use `Repository.submodules.update(...)`
44
+
45
+ - Remove deprecated constants `GIT_OBJ_XXX`, use `ObjectType`
46
+ - Remove deprecated constants `GIT_REVPARSE_XXX`, use `RevSpecFlag`
47
+ - Remove deprecated constants `GIT_REF_XXX`, use `ReferenceType`
48
+ - Remove deprecated `ReferenceType.OID`, use instead `ReferenceType.DIRECT`
49
+ - Remove deprecated `ReferenceType.LISTALL`, use instead `ReferenceType.ALL`
50
+
51
+ - Remove deprecated support for passing dicts to repository\'s `merge(...)`,
52
+ `merge_commits(...)` and `merge_trees(...)`. Instead pass `MergeFlag` for `flags`, and
53
+ `MergeFileFlag` for `file_flags`.
54
+
55
+ - Remove deprecated support for passing a string for the favor argument to repository\'s
56
+ `merge(...)`, `merge_commits(...)` and `merge_trees(...)`. Instead pass `MergeFavor`.
57
+
58
+
1
59
  # 1.14.1 (2024-02-10)
2
60
 
3
61
  - Update wheels to libgit2 v1.7.2
@@ -49,15 +107,18 @@ Breaking changes:
49
107
 
50
108
  Deprecations:
51
109
 
52
- - Deprecate `Repository.add_submodule(...)`, use `Repository.submodules.add(...)`
53
- - Deprecate `Repository.lookup_submodule(...)`, use `Repository.submodules[...]`
54
- - Deprecate `Repository.init_submodules(...)`, use `Repository.submodules.init(...)`
55
- - Deprecate `Repository.update_submodule(...)`, use `Repository.submodules.update(...)`
56
- - Deprecate `GIT_*` constants, use `pygit2.enums`
57
- - Passign dicts to repository\'s `merge(...)`, `merge_commits(...)`
58
- and `merge_trees(...)` is deprecated. Instead pass `MergeFavor` for
59
- the `favor` argument, `MergeFlag` for `flags`, and `MergeFileFlag`
60
- for `file_flags`.
110
+ - Deprecate `Repository.add_submodule(...)`, use `Repository.submodules.add(...)`
111
+ - Deprecate `Repository.lookup_submodule(...)`, use `Repository.submodules[...]`
112
+ - Deprecate `Repository.init_submodules(...)`, use `Repository.submodules.init(...)`
113
+ - Deprecate `Repository.update_submodule(...)`, use `Repository.submodules.update(...)`
114
+ - Deprecate `GIT_*` constants, use `pygit2.enums`
115
+
116
+ - Passing dicts to repository\'s `merge(...)`, `merge_commits(...)` and `merge_trees(...)`
117
+ is deprecated. Instead pass `MergeFlag` for the `flags` argument, and `MergeFileFlag` for
118
+ `file_flags`.
119
+
120
+ - Passing a string for the favor argument to repository\'s `merge(...)`, `merge_commits(...)`
121
+ and `merge_trees(...)` is deprecated. Instead pass `MergeFavor`.
61
122
 
62
123
  # 1.13.3 (2023-11-21)
63
124
 
@@ -1,7 +1,7 @@
1
1
  .PHONY: build html
2
2
 
3
3
  build:
4
- OPENSSL_VERSION=3.1.5 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 sh build.sh
4
+ OPENSSL_VERSION=3.1.5 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.1 sh build.sh
5
5
 
6
6
  html: build
7
7
  make -C docs html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygit2
3
- Version: 1.14.1
3
+ Version: 1.15.0
4
4
  Summary: Python bindings for libgit2.
5
5
  Home-page: https://github.com/libgit2/pygit2
6
6
  Maintainer: J. David Ibáñez
@@ -26,7 +26,6 @@ Description-Content-Type: text/markdown
26
26
  License-File: COPYING
27
27
  License-File: AUTHORS.md
28
28
  Requires-Dist: cffi>=1.16.0
29
- Requires-Dist: setuptools; python_version >= "3.12"
30
29
 
31
30
  # pygit2 - libgit2 bindings in Python
32
31
 
@@ -48,8 +47,6 @@ Supports Python 3.9 to 3.12 and PyPy3 7.3+
48
47
 
49
48
  ## Sponsors
50
49
 
51
- - [Iterative](https://iterative.ai/)
52
-
53
50
  Add your name and link here, [become a
54
51
  sponsor](https://github.com/sponsors/jdavid).
55
52
 
@@ -18,8 +18,6 @@ Supports Python 3.9 to 3.12 and PyPy3 7.3+
18
18
 
19
19
  ## Sponsors
20
20
 
21
- - [Iterative](https://iterative.ai/)
22
-
23
21
  Add your name and link here, [become a
24
22
  sponsor](https://github.com/sponsors/jdavid).
25
23
 
@@ -22,14 +22,14 @@
22
22
  #
23
23
  # sh build.sh
24
24
  #
25
- # Build libgit2 1.7.2 (will use libssh2 if available), then build pygit2
25
+ # Build libgit2 1.8.1 (will use libssh2 if available), then build pygit2
26
26
  # inplace:
27
27
  #
28
- # LIBGIT2_VERSION=1.7.2 sh build.sh
28
+ # LIBGIT2_VERSION=1.8.1 sh build.sh
29
29
  #
30
- # Build libssh2 1.11.0 and libgit2 1.7.2, then build pygit2 inplace:
30
+ # Build libssh2 1.11.0 and libgit2 1.8.1, then build pygit2 inplace:
31
31
  #
32
- # LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.2 sh build.sh
32
+ # LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.8.1 sh build.sh
33
33
  #
34
34
  # Build inplace and run the tests:
35
35
  #
@@ -66,15 +66,17 @@ _cache_enums()
66
66
 
67
67
 
68
68
  def init_repository(
69
- path: typing.Union[str, bytes, PathLike, None],
70
- bare: bool = False,
71
- flags: enums.RepositoryInitFlag = enums.RepositoryInitFlag.MKPATH,
72
- mode: typing.Union[int, enums.RepositoryInitMode] = enums.RepositoryInitMode.SHARED_UMASK,
73
- workdir_path: typing.Optional[str] = None,
74
- description: typing.Optional[str] = None,
75
- template_path: typing.Optional[str] = None,
76
- initial_head: typing.Optional[str] = None,
77
- origin_url: typing.Optional[str] = None
69
+ path: typing.Union[str, bytes, PathLike, None],
70
+ bare: bool = False,
71
+ flags: enums.RepositoryInitFlag = enums.RepositoryInitFlag.MKPATH,
72
+ mode: typing.Union[
73
+ int, enums.RepositoryInitMode
74
+ ] = enums.RepositoryInitMode.SHARED_UMASK,
75
+ workdir_path: typing.Optional[str] = None,
76
+ description: typing.Optional[str] = None,
77
+ template_path: typing.Optional[str] = None,
78
+ initial_head: typing.Optional[str] = None,
79
+ origin_url: typing.Optional[str] = None,
78
80
  ) -> Repository:
79
81
  """
80
82
  Creates a new Git repository in the given *path*.
@@ -108,8 +110,7 @@ def init_repository(
108
110
 
109
111
  # Options
110
112
  options = ffi.new('git_repository_init_options *')
111
- C.git_repository_init_options_init(options,
112
- C.GIT_REPOSITORY_INIT_OPTIONS_VERSION)
113
+ C.git_repository_init_options_init(options, C.GIT_REPOSITORY_INIT_OPTIONS_VERSION)
113
114
  options.flags = int(flags)
114
115
  options.mode = mode
115
116
 
@@ -143,8 +144,15 @@ def init_repository(
143
144
 
144
145
 
145
146
  def clone_repository(
146
- url, path, bare=False, repository=None, remote=None,
147
- checkout_branch=None, callbacks=None, depth=0):
147
+ url,
148
+ path,
149
+ bare=False,
150
+ repository=None,
151
+ remote=None,
152
+ checkout_branch=None,
153
+ callbacks=None,
154
+ depth=0,
155
+ ):
148
156
  """
149
157
  Clones a new Git repository from *url* in the given *path*.
150
158
 
@@ -34,7 +34,7 @@ from pathlib import Path
34
34
  #
35
35
  # The version number of pygit2
36
36
  #
37
- __version__ = '1.14.1'
37
+ __version__ = '1.15.0'
38
38
 
39
39
 
40
40
  #
@@ -70,5 +70,5 @@ def get_libgit2_paths():
70
70
  'libraries': ['git2'],
71
71
  'include_dirs': [str(x) for x in include_dirs],
72
72
  'library_dirs': [str(x) for x in library_dirs],
73
- }
73
+ },
74
74
  )
@@ -42,18 +42,18 @@ class Object:
42
42
  oid: Oid
43
43
  raw_name: bytes | None
44
44
  short_id: str
45
- type: "Literal[GIT_OBJ_COMMIT] | Literal[GIT_OBJ_TREE] | Literal[GIT_OBJ_TAG] | Literal[GIT_OBJ_BLOB]"
45
+ type: 'Literal[GIT_OBJ_COMMIT] | Literal[GIT_OBJ_TREE] | Literal[GIT_OBJ_TAG] | Literal[GIT_OBJ_BLOB]'
46
46
  type_str: "Literal['commit'] | Literal['tree'] | Literal['tag'] | Literal['blob']"
47
47
  @overload
48
- def peel(self, target_type: "Literal[GIT_OBJ_COMMIT]") -> "Commit": ...
48
+ def peel(self, target_type: 'Literal[GIT_OBJ_COMMIT]') -> 'Commit': ...
49
49
  @overload
50
- def peel(self, target_type: "Literal[GIT_OBJ_TREE]") -> "Tree": ...
50
+ def peel(self, target_type: 'Literal[GIT_OBJ_TREE]') -> 'Tree': ...
51
51
  @overload
52
- def peel(self, target_type: "Literal[GIT_OBJ_TAG]") -> "Tag": ...
52
+ def peel(self, target_type: 'Literal[GIT_OBJ_TAG]') -> 'Tag': ...
53
53
  @overload
54
- def peel(self, target_type: "Literal[GIT_OBJ_BLOB]") -> "Blob": ...
54
+ def peel(self, target_type: 'Literal[GIT_OBJ_BLOB]') -> 'Blob': ...
55
55
  @overload
56
- def peel(self, target_type: "None") -> "Commit|Tree|Blob": ...
56
+ def peel(self, target_type: 'None') -> 'Commit|Tree|Blob': ...
57
57
  def read_raw(self) -> bytes: ...
58
58
  def __eq__(self, other) -> bool: ...
59
59
  def __ge__(self, other) -> bool: ...
@@ -75,15 +75,15 @@ class Reference:
75
75
  def delete(self) -> None: ...
76
76
  def log(self) -> Iterator[RefLogEntry]: ...
77
77
  @overload
78
- def peel(self, type: "Literal[GIT_OBJ_COMMIT]") -> "Commit": ...
78
+ def peel(self, type: 'Literal[GIT_OBJ_COMMIT]') -> 'Commit': ...
79
79
  @overload
80
- def peel(self, type: "Literal[GIT_OBJ_TREE]") -> "Tree": ...
80
+ def peel(self, type: 'Literal[GIT_OBJ_TREE]') -> 'Tree': ...
81
81
  @overload
82
- def peel(self, type: "Literal[GIT_OBJ_TAG]") -> "Tag": ...
82
+ def peel(self, type: 'Literal[GIT_OBJ_TAG]') -> 'Tag': ...
83
83
  @overload
84
- def peel(self, type: "Literal[GIT_OBJ_BLOB]") -> "Blob": ...
84
+ def peel(self, type: 'Literal[GIT_OBJ_BLOB]') -> 'Blob': ...
85
85
  @overload
86
- def peel(self, type: "None") -> "Commit|Tree|Blob": ...
86
+ def peel(self, type: 'None') -> 'Commit|Tree|Blob': ...
87
87
  def rename(self, new_name: str) -> None: ...
88
88
  def resolve(self) -> Reference: ...
89
89
  def set_target(self, target: _OidArg, message: str = ...) -> None: ...
@@ -100,8 +100,20 @@ class Blob(Object):
100
100
  data: bytes
101
101
  is_binary: bool
102
102
  size: int
103
- def diff(self, blob: Blob = ..., flag: int = ..., old_as_path: str = ..., new_as_path: str = ...) -> Patch: ...
104
- def diff_to_buffer(self, buffer: Optional[bytes] = None, flag: DiffOption = DiffOption.NORMAL, old_as_path: str = ..., buffer_as_path: str = ...) -> Patch: ...
103
+ def diff(
104
+ self,
105
+ blob: Blob = ...,
106
+ flag: int = ...,
107
+ old_as_path: str = ...,
108
+ new_as_path: str = ...,
109
+ ) -> Patch: ...
110
+ def diff_to_buffer(
111
+ self,
112
+ buffer: Optional[bytes] = None,
113
+ flag: DiffOption = DiffOption.NORMAL,
114
+ old_as_path: str = ...,
115
+ buffer_as_path: str = ...,
116
+ ) -> Patch: ...
105
117
 
106
118
  class Branch(Reference):
107
119
  branch_name: str
@@ -134,7 +146,15 @@ class Diff:
134
146
  patch: str | None
135
147
  patchid: Oid
136
148
  stats: DiffStats
137
- def find_similar(self, flags: DiffFind = DiffFind.FIND_BY_CONFIG, rename_threshold : int = 50, copy_threshold : int = 50, rename_from_rewrite_threshold: int = 50, break_rewrite_threshold: int = 60, rename_limit: int = 1000) -> None: ...
149
+ def find_similar(
150
+ self,
151
+ flags: DiffFind = DiffFind.FIND_BY_CONFIG,
152
+ rename_threshold: int = 50,
153
+ copy_threshold: int = 50,
154
+ rename_from_rewrite_threshold: int = 50,
155
+ break_rewrite_threshold: int = 60,
156
+ rename_limit: int = 1000,
157
+ ) -> None: ...
138
158
  def merge(self, diff: Diff) -> None: ...
139
159
  @staticmethod
140
160
  def from_c(diff, repo) -> Diff: ...
@@ -188,24 +208,31 @@ class DiffStats:
188
208
  def format(self, format: DiffStatsFormat, width: int) -> str: ...
189
209
 
190
210
  class GitError(Exception): ...
191
-
192
211
  class InvalidSpecError(ValueError): ...
193
212
 
194
213
  class Mailmap:
195
214
  def __init__(self, *args) -> None: ...
196
- def add_entry(self, real_name: str = ..., real_email: str = ..., replace_name: str = ..., replace_email: str = ...) -> None: ...
215
+ def add_entry(
216
+ self,
217
+ real_name: str = ...,
218
+ real_email: str = ...,
219
+ replace_name: str = ...,
220
+ replace_email: str = ...,
221
+ ) -> None: ...
197
222
  @staticmethod
198
223
  def from_buffer(buffer: str | bytes) -> Mailmap: ...
199
224
  @staticmethod
200
225
  def from_repository(repository: Repository) -> Mailmap: ...
201
- def resolve(self, name: str, email: str) -> tuple[str,str]: ...
226
+ def resolve(self, name: str, email: str) -> tuple[str, str]: ...
202
227
  def resolve_signature(self, sig: Signature) -> Signature: ...
203
228
 
204
229
  class Note:
205
230
  annotated_id: Oid
206
231
  id: Oid
207
232
  message: str
208
- def remove(self, author: Signature, committer: Signature, ref: str = "refs/notes/commits") -> None: ...
233
+ def remove(
234
+ self, author: Signature, committer: Signature, ref: str = 'refs/notes/commits'
235
+ ) -> None: ...
209
236
 
210
237
  class Odb:
211
238
  backends: Iterator[OdbBackend]
@@ -255,13 +282,13 @@ class Patch:
255
282
 
256
283
  @staticmethod
257
284
  def create_from(
258
- old: Blob | bytes | None,
259
- new: Blob | bytes | None,
260
- old_as_path: str = ...,
261
- new_as_path: str = ...,
262
- flag: DiffOption = DiffOption.NORMAL,
263
- context_lines: int = 3,
264
- interhunk_lines: int = 0
285
+ old: Blob | bytes | None,
286
+ new: Blob | bytes | None,
287
+ old_as_path: str = ...,
288
+ new_as_path: str = ...,
289
+ flag: DiffOption = DiffOption.NORMAL,
290
+ context_lines: int = 3,
291
+ interhunk_lines: int = 0,
265
292
  ) -> Patch: ...
266
293
 
267
294
  class RefLogEntry:
@@ -288,8 +315,18 @@ class RefdbBackend:
288
315
  def exists(self, refname: str) -> bool: ...
289
316
  def has_log(self, ref_name: str) -> bool: ...
290
317
  def lookup(self, refname: str) -> Reference: ...
291
- def rename(self, old_name: str, new_name: str, force: bool, who: Signature, message: str) -> Reference: ...
292
- def write(self, ref: Reference, force: bool, who: Signature, message: str, old: _OidArg, old_target: str) -> None: ...
318
+ def rename(
319
+ self, old_name: str, new_name: str, force: bool, who: Signature, message: str
320
+ ) -> Reference: ...
321
+ def write(
322
+ self,
323
+ ref: Reference,
324
+ force: bool,
325
+ who: Signature,
326
+ message: str,
327
+ old: _OidArg,
328
+ old_target: str,
329
+ ) -> None: ...
293
330
 
294
331
  class RefdbFsBackend(RefdbBackend):
295
332
  def __init__(self, *args, **kwargs) -> None: ...
@@ -312,22 +349,62 @@ class Repository:
312
349
  def _disown(self, *args, **kwargs) -> None: ...
313
350
  def _from_c(self, *args, **kwargs) -> None: ...
314
351
  def add_worktree(self, name: str, path: str, ref: Reference = ...) -> Worktree: ...
315
- def applies(self, diff: Diff, location: ApplyLocation = ApplyLocation.INDEX, raise_error: bool = False) -> bool: ...
316
- def apply(self, diff: Diff, location: ApplyLocation = ApplyLocation.WORKDIR) -> None: ...
352
+ def applies(
353
+ self,
354
+ diff: Diff,
355
+ location: ApplyLocation = ApplyLocation.INDEX,
356
+ raise_error: bool = False,
357
+ ) -> bool: ...
358
+ def apply(
359
+ self, diff: Diff, location: ApplyLocation = ApplyLocation.WORKDIR
360
+ ) -> None: ...
317
361
  def cherrypick(self, id: _OidArg) -> None: ...
318
362
  def compress_references(self) -> None: ...
319
363
  def create_blob(self, data: bytes) -> Oid: ...
320
364
  def create_blob_fromdisk(self, path: str) -> Oid: ...
321
365
  def create_blob_fromiobase(self, iobase: IOBase) -> Oid: ...
322
366
  def create_blob_fromworkdir(self, path: str) -> Oid: ...
323
- def create_branch(self, name: str, commit: Commit, force = False) -> Branch: ...
324
- def create_commit(self, reference_name: Optional[str], author: Signature, committer: Signature, message: str | bytes, tree: _OidArg, parents: list[_OidArg], encoding: str = ...) -> Oid: ...
325
- def create_commit_string(self, author: Signature, committer: Signature, message: str | bytes, tree: _OidArg, parents: list[_OidArg], encoding: str = ...) -> Oid: ...
326
- def create_commit_with_signature(self, content: str, signature: str, signature_field: Optional[str] = None) -> Oid: ...
327
- def create_note(self, message: str, author: Signature, committer: Signature, annotated_id: str, ref: str = "refs/notes/commits", force: bool = False) -> Oid: ...
328
- def create_reference_direct(self, name: str, target: _OidArg, force: bool, message: Optional[str] = None) -> Reference: ...
329
- def create_reference_symbolic(self, name: str, target: str, force: bool, message: Optional[str] = None) -> Reference: ...
330
- def create_tag(self, name: str, oid: _OidArg, type: ObjectType, tagger: Signature, message: str) -> Oid: ...
367
+ def create_branch(self, name: str, commit: Commit, force=False) -> Branch: ...
368
+ def create_commit(
369
+ self,
370
+ reference_name: Optional[str],
371
+ author: Signature,
372
+ committer: Signature,
373
+ message: str | bytes,
374
+ tree: _OidArg,
375
+ parents: list[_OidArg],
376
+ encoding: str = ...,
377
+ ) -> Oid: ...
378
+ def create_commit_string(
379
+ self,
380
+ author: Signature,
381
+ committer: Signature,
382
+ message: str | bytes,
383
+ tree: _OidArg,
384
+ parents: list[_OidArg],
385
+ encoding: str = ...,
386
+ ) -> Oid: ...
387
+ def create_commit_with_signature(
388
+ self, content: str, signature: str, signature_field: Optional[str] = None
389
+ ) -> Oid: ...
390
+ def create_note(
391
+ self,
392
+ message: str,
393
+ author: Signature,
394
+ committer: Signature,
395
+ annotated_id: str,
396
+ ref: str = 'refs/notes/commits',
397
+ force: bool = False,
398
+ ) -> Oid: ...
399
+ def create_reference_direct(
400
+ self, name: str, target: _OidArg, force: bool, message: Optional[str] = None
401
+ ) -> Reference: ...
402
+ def create_reference_symbolic(
403
+ self, name: str, target: str, force: bool, message: Optional[str] = None
404
+ ) -> Reference: ...
405
+ def create_tag(
406
+ self, name: str, oid: _OidArg, type: ObjectType, tagger: Signature, message: str
407
+ ) -> Oid: ...
331
408
  def descendant_of(self, oid1: _OidArg, oid2: _OidArg) -> bool: ...
332
409
  def expand_id(self, hex: str) -> Oid: ...
333
410
  def free(self) -> None: ...
@@ -337,30 +414,46 @@ class Repository:
337
414
  def listall_mergeheads(self) -> list[Oid]: ...
338
415
  def listall_stashes(self) -> list[Stash]: ...
339
416
  def listall_submodules(self) -> list[str]: ...
340
- def lookup_branch(self, branch_name: str, branch_type: BranchType = BranchType.LOCAL) -> Branch: ...
341
- def lookup_note(self, annotated_id: str, ref: str = "refs/notes/commits") -> Note: ...
417
+ def lookup_branch(
418
+ self, branch_name: str, branch_type: BranchType = BranchType.LOCAL
419
+ ) -> Branch: ...
420
+ def lookup_note(
421
+ self, annotated_id: str, ref: str = 'refs/notes/commits'
422
+ ) -> Note: ...
342
423
  def lookup_reference(self, name: str) -> Reference: ...
343
424
  def lookup_reference_dwim(self, name: str) -> Reference: ...
344
425
  def lookup_worktree(self, name: str) -> Worktree: ...
345
- def merge_analysis(self, their_head: _OidArg, our_ref: str = "HEAD") -> tuple[MergeAnalysis, MergePreference]: ...
426
+ def merge_analysis(
427
+ self, their_head: _OidArg, our_ref: str = 'HEAD'
428
+ ) -> tuple[MergeAnalysis, MergePreference]: ...
346
429
  def merge_base(self, oid1: _OidArg, oid2: _OidArg) -> Oid: ...
347
430
  def merge_base_many(self, oids: list[_OidArg]) -> Oid: ...
348
431
  def merge_base_octopus(self, oids: list[_OidArg]) -> Oid: ...
349
432
  def notes(self) -> Iterator[Note]: ...
350
433
  def path_is_ignored(self, path: str) -> bool: ...
351
- def raw_listall_branches(self, flag: BranchType = BranchType.LOCAL) -> list[bytes]: ...
434
+ def raw_listall_branches(
435
+ self, flag: BranchType = BranchType.LOCAL
436
+ ) -> list[bytes]: ...
352
437
  def raw_listall_references(self) -> list[bytes]: ...
353
438
  def references_iterator_init(self) -> Iterator[Reference]: ...
354
- def references_iterator_next(self, iter: Iterator, references_return_type: ReferenceFilter = ReferenceFilter.ALL) -> Reference: ...
439
+ def references_iterator_next(
440
+ self,
441
+ iter: Iterator,
442
+ references_return_type: ReferenceFilter = ReferenceFilter.ALL,
443
+ ) -> Reference: ...
355
444
  def reset(self, oid: _OidArg, reset_type: ResetMode) -> None: ...
356
445
  def revparse(self, revspec: str) -> RevSpec: ...
357
- def revparse_ext(self, revision: str) -> tuple[Object,Reference]: ...
446
+ def revparse_ext(self, revision: str) -> tuple[Object, Reference]: ...
358
447
  def revparse_single(self, revision: str) -> Object: ...
359
448
  def set_odb(self, odb: Odb) -> None: ...
360
449
  def set_refdb(self, refdb: Refdb) -> None: ...
361
- def status(self, untracked_files: str = "all", ignored: bool = False) -> dict[str,int]: ...
450
+ def status(
451
+ self, untracked_files: str = 'all', ignored: bool = False
452
+ ) -> dict[str, int]: ...
362
453
  def status_file(self, path: str) -> int: ...
363
- def walk(self, oid: _OidArg | None, sort_mode: SortMode = SortMode.NONE) -> Walker: ...
454
+ def walk(
455
+ self, oid: _OidArg | None, sort_mode: SortMode = SortMode.NONE
456
+ ) -> Walker: ...
364
457
 
365
458
  class RevSpec:
366
459
  flags: int
@@ -376,7 +469,14 @@ class Signature:
376
469
  raw_email: bytes
377
470
  raw_name: bytes
378
471
  time: int
379
- def __init__(self, name: str, email: str, time: int = -1, offset: int = 0, encoding: Optional[str] = None) -> None: ...
472
+ def __init__(
473
+ self,
474
+ name: str,
475
+ email: str,
476
+ time: int = -1,
477
+ offset: int = 0,
478
+ encoding: Optional[str] = None,
479
+ ) -> None: ...
380
480
  def __eq__(self, other) -> bool: ...
381
481
  def __ge__(self, other) -> bool: ...
382
482
  def __gt__(self, other) -> bool: ...
@@ -405,9 +505,27 @@ class Tag(Object):
405
505
  def get_object(self) -> Object: ...
406
506
 
407
507
  class Tree(Object):
408
- def diff_to_index(self, index: Index, flags: DiffOption = DiffOption.NORMAL, context_lines: int = 3, interhunk_lines: int = 0) -> Diff: ...
409
- def diff_to_tree(self, tree: Tree = ..., flags: DiffOption = DiffOption.NORMAL, context_lines: int = 3, interhunk_lines: int = 3, swap: bool = False) -> Diff: ...
410
- def diff_to_workdir(self, flags: DiffOption = DiffOption.NORMAL, context_lines: int = 3, interhunk_lines: int = 0) -> Diff: ...
508
+ def diff_to_index(
509
+ self,
510
+ index: Index,
511
+ flags: DiffOption = DiffOption.NORMAL,
512
+ context_lines: int = 3,
513
+ interhunk_lines: int = 0,
514
+ ) -> Diff: ...
515
+ def diff_to_tree(
516
+ self,
517
+ tree: Tree = ...,
518
+ flags: DiffOption = DiffOption.NORMAL,
519
+ context_lines: int = 3,
520
+ interhunk_lines: int = 3,
521
+ swap: bool = False,
522
+ ) -> Diff: ...
523
+ def diff_to_workdir(
524
+ self,
525
+ flags: DiffOption = DiffOption.NORMAL,
526
+ context_lines: int = 3,
527
+ interhunk_lines: int = 0,
528
+ ) -> Diff: ...
411
529
  def __contains__(self, other: str) -> bool: ... # Tree_contains
412
530
  def __getitem__(self, index: str | int) -> Object: ... # Tree_subscript
413
531
  def __iter__(self) -> Iterator[Object]: ...
@@ -429,16 +547,18 @@ class Walker:
429
547
  def reset(self) -> None: ...
430
548
  def simplify_first_parent(self) -> None: ...
431
549
  def sort(self, mode: SortMode) -> None: ...
432
- def __iter__(self) -> Iterator[Commit]: ... #Walker: ...
550
+ def __iter__(self) -> Iterator[Commit]: ... # Walker: ...
433
551
  def __next__(self) -> Commit: ...
434
552
 
435
553
  class Worktree:
436
554
  is_prunable: bool
437
555
  name: str
438
556
  path: str
439
- def prune(self, force = False) -> None: ...
557
+ def prune(self, force=False) -> None: ...
440
558
 
441
- def discover_repository(path: str, across_fs: bool = False, ceiling_dirs: str = ...) -> str: ...
559
+ def discover_repository(
560
+ path: str, across_fs: bool = False, ceiling_dirs: str = ...
561
+ ) -> str: ...
442
562
  def hash(data: bytes) -> Oid: ...
443
563
  def hashfile(path: str) -> Oid: ...
444
564
  def init_file_backend(path: str, flags: int = 0) -> object: ...
@@ -81,7 +81,7 @@ h_files = [
81
81
  'revert.h',
82
82
  'stash.h',
83
83
  'submodule.h',
84
- 'callbacks.h', # Bridge from libgit2 to Python
84
+ 'callbacks.h', # Bridge from libgit2 to Python
85
85
  ]
86
86
  h_source = []
87
87
  for h_file in h_files:
@@ -99,7 +99,7 @@ C_PREAMBLE = """\
99
99
  # ffi
100
100
  _, libgit2_kw = get_libgit2_paths()
101
101
  ffi = FFI()
102
- ffi.set_source("pygit2._libgit2", C_PREAMBLE, **libgit2_kw)
102
+ ffi.set_source('pygit2._libgit2', C_PREAMBLE, **libgit2_kw)
103
103
  ffi.cdef(C_HEADER_SRC)
104
104
 
105
105