rugged 0.27.10.1 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/extconf.rb +23 -2
  3. data/ext/rugged/rugged.c +48 -2
  4. data/ext/rugged/rugged.h +5 -0
  5. data/ext/rugged/rugged_allocator.c +89 -0
  6. data/ext/rugged/rugged_blob.c +3 -3
  7. data/ext/rugged/rugged_branch.c +1 -1
  8. data/ext/rugged/rugged_commit.c +8 -8
  9. data/ext/rugged/rugged_config.c +1 -1
  10. data/ext/rugged/rugged_diff.c +24 -4
  11. data/ext/rugged/rugged_note.c +1 -1
  12. data/ext/rugged/rugged_repo.c +10 -10
  13. data/ext/rugged/rugged_settings.c +1 -1
  14. data/lib/rugged/version.rb +1 -1
  15. data/vendor/libgit2/CMakeLists.txt +69 -47
  16. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  17. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +5 -8
  18. data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
  19. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
  20. data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  21. data/vendor/libgit2/deps/regex/COPYING +502 -0
  22. data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
  23. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
  24. data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
  25. data/vendor/libgit2/deps/zlib/COPYING +27 -0
  26. data/vendor/libgit2/include/git2.h +3 -0
  27. data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
  28. data/vendor/libgit2/include/git2/apply.h +129 -0
  29. data/vendor/libgit2/include/git2/attr.h +19 -8
  30. data/vendor/libgit2/include/git2/blame.h +41 -24
  31. data/vendor/libgit2/include/git2/blob.h +1 -1
  32. data/vendor/libgit2/include/git2/branch.h +1 -1
  33. data/vendor/libgit2/include/git2/buffer.h +2 -2
  34. data/vendor/libgit2/include/git2/checkout.h +20 -19
  35. data/vendor/libgit2/include/git2/cherrypick.h +6 -4
  36. data/vendor/libgit2/include/git2/clone.h +11 -9
  37. data/vendor/libgit2/include/git2/commit.h +30 -2
  38. data/vendor/libgit2/include/git2/common.h +54 -4
  39. data/vendor/libgit2/include/git2/config.h +18 -7
  40. data/vendor/libgit2/include/git2/deprecated.h +253 -0
  41. data/vendor/libgit2/include/git2/describe.h +30 -7
  42. data/vendor/libgit2/include/git2/diff.h +193 -143
  43. data/vendor/libgit2/include/git2/errors.h +54 -46
  44. data/vendor/libgit2/include/git2/ignore.h +2 -2
  45. data/vendor/libgit2/include/git2/index.h +72 -51
  46. data/vendor/libgit2/include/git2/indexer.h +30 -4
  47. data/vendor/libgit2/include/git2/mailmap.h +115 -0
  48. data/vendor/libgit2/include/git2/merge.h +29 -8
  49. data/vendor/libgit2/include/git2/net.h +1 -1
  50. data/vendor/libgit2/include/git2/notes.h +1 -1
  51. data/vendor/libgit2/include/git2/object.h +16 -16
  52. data/vendor/libgit2/include/git2/odb.h +10 -10
  53. data/vendor/libgit2/include/git2/odb_backend.h +7 -7
  54. data/vendor/libgit2/include/git2/oid.h +1 -1
  55. data/vendor/libgit2/include/git2/pack.h +2 -2
  56. data/vendor/libgit2/include/git2/proxy.h +9 -5
  57. data/vendor/libgit2/include/git2/rebase.h +7 -4
  58. data/vendor/libgit2/include/git2/refs.h +14 -15
  59. data/vendor/libgit2/include/git2/refspec.h +17 -0
  60. data/vendor/libgit2/include/git2/remote.h +92 -16
  61. data/vendor/libgit2/include/git2/repository.h +52 -37
  62. data/vendor/libgit2/include/git2/revert.h +5 -3
  63. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  64. data/vendor/libgit2/include/git2/signature.h +2 -2
  65. data/vendor/libgit2/include/git2/stash.h +13 -10
  66. data/vendor/libgit2/include/git2/status.h +8 -4
  67. data/vendor/libgit2/include/git2/submodule.h +11 -10
  68. data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
  69. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  70. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  71. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  72. data/vendor/libgit2/include/git2/sys/index.h +3 -0
  73. data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
  74. data/vendor/libgit2/include/git2/sys/merge.h +9 -4
  75. data/vendor/libgit2/include/git2/sys/odb_backend.h +19 -19
  76. data/vendor/libgit2/include/git2/sys/path.h +64 -0
  77. data/vendor/libgit2/include/git2/sys/refdb_backend.h +19 -19
  78. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  79. data/vendor/libgit2/include/git2/sys/transport.h +127 -81
  80. data/vendor/libgit2/include/git2/tag.h +2 -2
  81. data/vendor/libgit2/include/git2/trace.h +1 -1
  82. data/vendor/libgit2/include/git2/transaction.h +1 -0
  83. data/vendor/libgit2/include/git2/transport.h +47 -18
  84. data/vendor/libgit2/include/git2/tree.h +3 -3
  85. data/vendor/libgit2/include/git2/types.h +35 -28
  86. data/vendor/libgit2/include/git2/version.h +4 -4
  87. data/vendor/libgit2/include/git2/worktree.h +47 -12
  88. data/vendor/libgit2/src/CMakeLists.txt +87 -26
  89. data/vendor/libgit2/src/alloc.c +55 -0
  90. data/vendor/libgit2/src/alloc.h +40 -0
  91. data/vendor/libgit2/src/annotated_commit.c +15 -8
  92. data/vendor/libgit2/src/apply.c +490 -14
  93. data/vendor/libgit2/src/apply.h +3 -1
  94. data/vendor/libgit2/src/array.h +2 -2
  95. data/vendor/libgit2/src/attr.c +11 -11
  96. data/vendor/libgit2/src/attr_file.c +20 -15
  97. data/vendor/libgit2/src/attrcache.c +11 -11
  98. data/vendor/libgit2/src/blame.c +30 -15
  99. data/vendor/libgit2/src/blame.h +1 -0
  100. data/vendor/libgit2/src/blame_git.c +16 -13
  101. data/vendor/libgit2/src/blob.c +50 -28
  102. data/vendor/libgit2/src/blob.h +18 -1
  103. data/vendor/libgit2/src/branch.c +38 -38
  104. data/vendor/libgit2/src/buf_text.c +7 -6
  105. data/vendor/libgit2/src/buffer.c +55 -50
  106. data/vendor/libgit2/src/buffer.h +1 -1
  107. data/vendor/libgit2/src/cache.c +16 -16
  108. data/vendor/libgit2/src/cache.h +2 -2
  109. data/vendor/libgit2/src/cc-compat.h +15 -3
  110. data/vendor/libgit2/src/checkout.c +83 -74
  111. data/vendor/libgit2/src/cherrypick.c +6 -6
  112. data/vendor/libgit2/src/clone.c +20 -20
  113. data/vendor/libgit2/src/commit.c +53 -33
  114. data/vendor/libgit2/src/commit.h +1 -0
  115. data/vendor/libgit2/src/commit_list.c +6 -10
  116. data/vendor/libgit2/src/common.h +32 -30
  117. data/vendor/libgit2/src/config.c +167 -147
  118. data/vendor/libgit2/src/config.h +1 -14
  119. data/vendor/libgit2/src/config_backend.h +84 -0
  120. data/vendor/libgit2/src/config_cache.c +7 -1
  121. data/vendor/libgit2/src/config_entries.c +259 -0
  122. data/vendor/libgit2/src/config_entries.h +23 -0
  123. data/vendor/libgit2/src/config_file.c +167 -439
  124. data/vendor/libgit2/src/config_mem.c +224 -0
  125. data/vendor/libgit2/src/config_parse.c +69 -38
  126. data/vendor/libgit2/src/config_parse.h +4 -4
  127. data/vendor/libgit2/src/crlf.c +215 -186
  128. data/vendor/libgit2/src/delta.c +25 -18
  129. data/vendor/libgit2/src/describe.c +23 -23
  130. data/vendor/libgit2/src/diff.c +12 -12
  131. data/vendor/libgit2/src/diff_driver.c +14 -15
  132. data/vendor/libgit2/src/diff_file.c +10 -10
  133. data/vendor/libgit2/src/diff_generate.c +29 -23
  134. data/vendor/libgit2/src/diff_generate.h +1 -1
  135. data/vendor/libgit2/src/diff_parse.c +3 -3
  136. data/vendor/libgit2/src/diff_print.c +17 -17
  137. data/vendor/libgit2/src/diff_stats.c +22 -7
  138. data/vendor/libgit2/src/diff_tform.c +12 -12
  139. data/vendor/libgit2/src/diff_xdiff.c +15 -3
  140. data/vendor/libgit2/src/errors.c +42 -20
  141. data/vendor/libgit2/src/features.h.in +2 -1
  142. data/vendor/libgit2/src/fetch.c +3 -3
  143. data/vendor/libgit2/src/fetchhead.c +16 -16
  144. data/vendor/libgit2/src/filebuf.c +28 -28
  145. data/vendor/libgit2/src/fileops.c +54 -54
  146. data/vendor/libgit2/src/fileops.h +1 -1
  147. data/vendor/libgit2/src/filter.c +30 -30
  148. data/vendor/libgit2/src/filter.h +0 -10
  149. data/vendor/libgit2/src/global.c +36 -23
  150. data/vendor/libgit2/src/hash.h +4 -1
  151. data/vendor/libgit2/src/hash/hash_collisiondetect.h +6 -2
  152. data/vendor/libgit2/src/hash/hash_common_crypto.h +5 -1
  153. data/vendor/libgit2/src/hash/hash_generic.h +5 -1
  154. data/vendor/libgit2/src/hash/hash_mbedtls.c +38 -0
  155. data/vendor/libgit2/src/hash/hash_mbedtls.h +24 -0
  156. data/vendor/libgit2/src/hash/hash_openssl.h +8 -4
  157. data/vendor/libgit2/src/hash/hash_win32.c +13 -13
  158. data/vendor/libgit2/src/hashsig.c +4 -4
  159. data/vendor/libgit2/src/idxmap.c +25 -5
  160. data/vendor/libgit2/src/idxmap.h +4 -18
  161. data/vendor/libgit2/src/ignore.c +9 -9
  162. data/vendor/libgit2/src/index.c +280 -198
  163. data/vendor/libgit2/src/index.h +16 -0
  164. data/vendor/libgit2/src/indexer.c +311 -139
  165. data/vendor/libgit2/src/integer.h +32 -22
  166. data/vendor/libgit2/src/iterator.c +116 -49
  167. data/vendor/libgit2/src/iterator.h +15 -0
  168. data/vendor/libgit2/src/khash.h +3 -1
  169. data/vendor/libgit2/src/mailmap.c +485 -0
  170. data/vendor/libgit2/src/mailmap.h +35 -0
  171. data/vendor/libgit2/src/merge.c +89 -59
  172. data/vendor/libgit2/src/merge_driver.c +7 -7
  173. data/vendor/libgit2/src/merge_file.c +1 -1
  174. data/vendor/libgit2/src/mwindow.c +8 -8
  175. data/vendor/libgit2/src/netops.c +22 -13
  176. data/vendor/libgit2/src/netops.h +2 -0
  177. data/vendor/libgit2/src/notes.c +15 -10
  178. data/vendor/libgit2/src/object.c +118 -67
  179. data/vendor/libgit2/src/object.h +20 -9
  180. data/vendor/libgit2/src/object_api.c +8 -8
  181. data/vendor/libgit2/src/odb.c +72 -72
  182. data/vendor/libgit2/src/odb.h +7 -7
  183. data/vendor/libgit2/src/odb_loose.c +46 -46
  184. data/vendor/libgit2/src/odb_mempack.c +14 -14
  185. data/vendor/libgit2/src/odb_pack.c +14 -10
  186. data/vendor/libgit2/src/offmap.c +30 -0
  187. data/vendor/libgit2/src/offmap.h +20 -11
  188. data/vendor/libgit2/src/oid.c +6 -6
  189. data/vendor/libgit2/src/oidmap.c +20 -0
  190. data/vendor/libgit2/src/oidmap.h +9 -12
  191. data/vendor/libgit2/src/pack-objects.c +71 -63
  192. data/vendor/libgit2/src/pack-objects.h +1 -7
  193. data/vendor/libgit2/src/pack.c +58 -58
  194. data/vendor/libgit2/src/pack.h +6 -6
  195. data/vendor/libgit2/src/parse.h +1 -1
  196. data/vendor/libgit2/src/patch.c +3 -3
  197. data/vendor/libgit2/src/patch_generate.c +18 -18
  198. data/vendor/libgit2/src/patch_parse.c +13 -13
  199. data/vendor/libgit2/src/path.c +93 -225
  200. data/vendor/libgit2/src/path.h +2 -84
  201. data/vendor/libgit2/src/pathspec.c +6 -6
  202. data/vendor/libgit2/src/posix.c +3 -3
  203. data/vendor/libgit2/src/proxy.c +1 -1
  204. data/vendor/libgit2/src/push.c +27 -26
  205. data/vendor/libgit2/src/push.h +2 -1
  206. data/vendor/libgit2/src/reader.c +265 -0
  207. data/vendor/libgit2/src/reader.h +107 -0
  208. data/vendor/libgit2/src/rebase.c +49 -52
  209. data/vendor/libgit2/src/refdb.c +3 -3
  210. data/vendor/libgit2/src/refdb_fs.c +181 -103
  211. data/vendor/libgit2/src/reflog.c +3 -3
  212. data/vendor/libgit2/src/refs.c +98 -74
  213. data/vendor/libgit2/src/refs.h +5 -3
  214. data/vendor/libgit2/src/refspec.c +47 -21
  215. data/vendor/libgit2/src/refspec.h +1 -1
  216. data/vendor/libgit2/src/remote.c +219 -166
  217. data/vendor/libgit2/src/remote.h +9 -0
  218. data/vendor/libgit2/src/repository.c +173 -133
  219. data/vendor/libgit2/src/repository.h +6 -3
  220. data/vendor/libgit2/src/reset.c +8 -8
  221. data/vendor/libgit2/src/revert.c +6 -6
  222. data/vendor/libgit2/src/revparse.c +30 -30
  223. data/vendor/libgit2/src/revwalk.c +60 -30
  224. data/vendor/libgit2/src/revwalk.h +2 -1
  225. data/vendor/libgit2/src/settings.c +42 -10
  226. data/vendor/libgit2/src/signature.c +11 -11
  227. data/vendor/libgit2/src/sortedcache.c +13 -13
  228. data/vendor/libgit2/src/stash.c +91 -45
  229. data/vendor/libgit2/src/status.c +13 -13
  230. data/vendor/libgit2/src/stdalloc.c +120 -0
  231. data/vendor/libgit2/src/{streams/curl.h → stdalloc.h} +6 -6
  232. data/vendor/libgit2/src/stream.h +17 -2
  233. data/vendor/libgit2/src/streams/mbedtls.c +483 -0
  234. data/vendor/libgit2/src/streams/mbedtls.h +23 -0
  235. data/vendor/libgit2/src/streams/openssl.c +204 -114
  236. data/vendor/libgit2/src/streams/openssl.h +4 -108
  237. data/vendor/libgit2/src/streams/registry.c +118 -0
  238. data/vendor/libgit2/src/streams/registry.h +19 -0
  239. data/vendor/libgit2/src/streams/socket.c +54 -29
  240. data/vendor/libgit2/src/streams/stransport.c +57 -32
  241. data/vendor/libgit2/src/streams/stransport.h +5 -0
  242. data/vendor/libgit2/src/streams/tls.c +50 -19
  243. data/vendor/libgit2/src/streams/tls.h +12 -4
  244. data/vendor/libgit2/src/strmap.c +22 -2
  245. data/vendor/libgit2/src/strmap.h +18 -15
  246. data/vendor/libgit2/src/submodule.c +179 -155
  247. data/vendor/libgit2/src/sysdir.c +18 -18
  248. data/vendor/libgit2/src/tag.c +31 -26
  249. data/vendor/libgit2/src/tag.h +2 -1
  250. data/vendor/libgit2/src/trace.c +1 -1
  251. data/vendor/libgit2/src/trace.h +1 -1
  252. data/vendor/libgit2/src/trailer.c +6 -6
  253. data/vendor/libgit2/src/transaction.c +23 -23
  254. data/vendor/libgit2/src/transport.c +5 -5
  255. data/vendor/libgit2/src/transports/auth.c +7 -4
  256. data/vendor/libgit2/src/transports/auth.h +1 -1
  257. data/vendor/libgit2/src/transports/auth_negotiate.c +12 -11
  258. data/vendor/libgit2/src/transports/cred.c +18 -18
  259. data/vendor/libgit2/src/transports/git.c +15 -15
  260. data/vendor/libgit2/src/transports/http.c +606 -216
  261. data/vendor/libgit2/src/transports/http.h +2 -0
  262. data/vendor/libgit2/src/transports/local.c +26 -26
  263. data/vendor/libgit2/src/transports/smart.c +54 -31
  264. data/vendor/libgit2/src/transports/smart.h +1 -2
  265. data/vendor/libgit2/src/transports/smart_pkt.c +43 -40
  266. data/vendor/libgit2/src/transports/smart_protocol.c +61 -57
  267. data/vendor/libgit2/src/transports/ssh.c +34 -33
  268. data/vendor/libgit2/src/transports/winhttp.c +99 -119
  269. data/vendor/libgit2/src/tree-cache.c +5 -5
  270. data/vendor/libgit2/src/tree.c +96 -121
  271. data/vendor/libgit2/src/tree.h +1 -12
  272. data/vendor/libgit2/src/unix/map.c +2 -2
  273. data/vendor/libgit2/src/util.c +22 -6
  274. data/vendor/libgit2/src/util.h +12 -135
  275. data/vendor/libgit2/src/vector.c +4 -4
  276. data/vendor/libgit2/src/win32/dir.c +3 -3
  277. data/vendor/libgit2/src/win32/findfile.c +3 -3
  278. data/vendor/libgit2/src/win32/map.c +6 -6
  279. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  280. data/vendor/libgit2/src/win32/path_w32.c +101 -7
  281. data/vendor/libgit2/src/win32/path_w32.h +18 -0
  282. data/vendor/libgit2/src/win32/posix_w32.c +24 -43
  283. data/vendor/libgit2/src/win32/w32_buffer.c +2 -2
  284. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +96 -2
  285. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +28 -75
  286. data/vendor/libgit2/src/win32/w32_stack.c +2 -2
  287. data/vendor/libgit2/src/win32/w32_util.c +1 -69
  288. data/vendor/libgit2/src/win32/w32_util.h +1 -19
  289. data/vendor/libgit2/src/worktree.c +75 -54
  290. data/vendor/libgit2/src/worktree.h +2 -0
  291. data/vendor/libgit2/src/xdiff/xdiffi.c +7 -5
  292. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  293. data/vendor/libgit2/src/xdiff/xmerge.c +15 -15
  294. data/vendor/libgit2/src/zstream.c +4 -4
  295. metadata +33 -7
  296. data/vendor/libgit2/src/config_file.h +0 -73
  297. data/vendor/libgit2/src/streams/curl.c +0 -385
@@ -37,11 +37,13 @@ typedef struct {
37
37
  #define GIT_CHERRYPICK_OPTIONS_INIT {GIT_CHERRYPICK_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
38
38
 
39
39
  /**
40
- * Initializes a `git_cherrypick_options` with default values. Equivalent to
41
- * creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.
40
+ * Initialize git_cherrypick_options structure
42
41
  *
43
- * @param opts the `git_cherrypick_options` struct to initialize
44
- * @param version Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`
42
+ * Initializes a `git_cherrypick_options` with default values. Equivalent to creating
43
+ * an instance with GIT_CHERRYPICK_OPTIONS_INIT.
44
+ *
45
+ * @param opts The `git_cherrypick_options` struct to initialize.
46
+ * @param version The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`.
45
47
  * @return Zero on success; -1 on failure.
46
48
  */
47
49
  GIT_EXTERN(int) git_cherrypick_init_options(
@@ -66,7 +66,7 @@ typedef enum {
66
66
  * @param payload an opaque payload
67
67
  * @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
68
68
  */
69
- typedef int (*git_remote_create_cb)(
69
+ typedef int GIT_CALLBACK(git_remote_create_cb)(
70
70
  git_remote **out,
71
71
  git_repository *repo,
72
72
  const char *name,
@@ -87,7 +87,7 @@ typedef int (*git_remote_create_cb)(
87
87
  * @param payload payload specified by the options
88
88
  * @return 0, or a negative value to indicate error
89
89
  */
90
- typedef int (*git_repository_create_cb)(
90
+ typedef int GIT_CALLBACK(git_repository_create_cb)(
91
91
  git_repository **out,
92
92
  const char *path,
93
93
  int bare,
@@ -96,9 +96,9 @@ typedef int (*git_repository_create_cb)(
96
96
  /**
97
97
  * Clone options structure
98
98
  *
99
- * Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:
99
+ * Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can
100
+ * use `git_clone_init_options`.
100
101
  *
101
- * git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
102
102
  */
103
103
  typedef struct git_clone_options {
104
104
  unsigned int version;
@@ -169,11 +169,13 @@ typedef struct git_clone_options {
169
169
  GIT_FETCH_OPTIONS_INIT }
170
170
 
171
171
  /**
172
- * Initializes a `git_clone_options` with default values. Equivalent to
173
- * creating an instance with GIT_CLONE_OPTIONS_INIT.
172
+ * Initialize git_clone_options structure
174
173
  *
175
- * @param opts The `git_clone_options` struct to initialize
176
- * @param version Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`
174
+ * Initializes a `git_clone_options` with default values. Equivalent to creating
175
+ * an instance with GIT_CLONE_OPTIONS_INIT.
176
+ *
177
+ * @param opts The `git_clone_options` struct to initialize.
178
+ * @param version The struct version; pass `GIT_CLONE_OPTIONS_VERSION`.
177
179
  * @return Zero on success; -1 on failure.
178
180
  */
179
181
  GIT_EXTERN(int) git_clone_init_options(
@@ -194,7 +196,7 @@ GIT_EXTERN(int) git_clone_init_options(
194
196
  * function works as though GIT_OPTIONS_INIT were passed.
195
197
  * @return 0 on success, any non-zero return value from a callback
196
198
  * function, or a negative value to indicate an error (use
197
- * `giterr_last` for a detailed error message)
199
+ * `git_error_last` for a detailed error message)
198
200
  */
199
201
  GIT_EXTERN(int) git_clone(
200
202
  git_repository **out,
@@ -172,6 +172,34 @@ GIT_EXTERN(const git_signature *) git_commit_committer(const git_commit *commit)
172
172
  */
173
173
  GIT_EXTERN(const git_signature *) git_commit_author(const git_commit *commit);
174
174
 
175
+ /**
176
+ * Get the committer of a commit, using the mailmap to map names and email
177
+ * addresses to canonical real names and email addresses.
178
+ *
179
+ * Call `git_signature_free` to free the signature.
180
+ *
181
+ * @param out a pointer to store the resolved signature.
182
+ * @param commit a previously loaded commit.
183
+ * @param mailmap the mailmap to resolve with. (may be NULL)
184
+ * @return 0 or an error code
185
+ */
186
+ GIT_EXTERN(int) git_commit_committer_with_mailmap(
187
+ git_signature **out, const git_commit *commit, const git_mailmap *mailmap);
188
+
189
+ /**
190
+ * Get the author of a commit, using the mailmap to map names and email
191
+ * addresses to canonical real names and email addresses.
192
+ *
193
+ * Call `git_signature_free` to free the signature.
194
+ *
195
+ * @param out a pointer to store the resolved signature.
196
+ * @param commit a previously loaded commit.
197
+ * @param mailmap the mailmap to resolve with. (may be NULL)
198
+ * @return 0 or an error code
199
+ */
200
+ GIT_EXTERN(int) git_commit_author_with_mailmap(
201
+ git_signature **out, const git_commit *commit, const git_mailmap *mailmap);
202
+
175
203
  /**
176
204
  * Get the full raw text of the commit header.
177
205
  *
@@ -268,8 +296,8 @@ GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit,
268
296
  * Extract the signature from a commit
269
297
  *
270
298
  * If the id is not for a commit, the error class will be
271
- * `GITERR_INVALID`. If the commit does not have a signature, the
272
- * error class will be `GITERR_OBJECT`.
299
+ * `GIT_ERROR_INVALID`. If the commit does not have a signature, the
300
+ * error class will be `GIT_ERROR_OBJECT`.
273
301
  *
274
302
  * @param signature the signature block; existing content will be
275
303
  * overwritten
@@ -43,11 +43,30 @@ typedef size_t size_t;
43
43
  __attribute__((visibility("default"))) \
44
44
  type
45
45
  #elif defined(_MSC_VER)
46
- # define GIT_EXTERN(type) __declspec(dllexport) type
46
+ # define GIT_EXTERN(type) __declspec(dllexport) type __cdecl
47
47
  #else
48
48
  # define GIT_EXTERN(type) extern type
49
49
  #endif
50
50
 
51
+ /** Declare a callback function for application use. */
52
+ #if defined(_MSC_VER)
53
+ # define GIT_CALLBACK(name) (__cdecl *name)
54
+ #else
55
+ # define GIT_CALLBACK(name) (*name)
56
+ #endif
57
+
58
+ /** Declare a function as deprecated. */
59
+ #if defined(__GNUC__)
60
+ # define GIT_DEPRECATED(func) \
61
+ __attribute__((deprecated)) \
62
+ __attribute__((used)) \
63
+ func
64
+ #elif defined(_MSC_VER)
65
+ # define GIT_DEPRECATED(func) __declspec(deprecated) func
66
+ #else
67
+ # define GIT_DEPRECATED(func) func
68
+ #endif
69
+
51
70
  /** Declare a function's takes printf style arguments. */
52
71
  #ifdef __GNUC__
53
72
  # define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))
@@ -183,6 +202,10 @@ typedef enum {
183
202
  GIT_OPT_GET_WINDOWS_SHAREMODE,
184
203
  GIT_OPT_SET_WINDOWS_SHAREMODE,
185
204
  GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
205
+ GIT_OPT_SET_ALLOCATOR,
206
+ GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY,
207
+ GIT_OPT_GET_PACK_MAX_OBJECTS,
208
+ GIT_OPT_SET_PACK_MAX_OBJECTS
186
209
  } git_libgit2_opt_t;
187
210
 
188
211
  /**
@@ -228,13 +251,13 @@ typedef enum {
228
251
  * > `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or
229
252
  * > `GIT_CONFIG_LEVEL_PROGRAMDATA`.
230
253
  *
231
- * * opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)
254
+ * * opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_object_t type, size_t size)
232
255
  *
233
256
  * > Set the maximum data size for the given type of object to be
234
257
  * > considered eligible for caching in memory. Setting to value to
235
258
  * > zero means that that type of object will not be cached.
236
- * > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k
237
- * > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.
259
+ * > Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k
260
+ * > for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG.
238
261
  *
239
262
  * * opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)
240
263
  *
@@ -345,6 +368,33 @@ typedef enum {
345
368
  * > additional checksum calculation on each object. This defaults
346
369
  * > to enabled.
347
370
  *
371
+ * opts(GIT_OPT_SET_ALLOCATOR, git_allocator *allocator)
372
+ *
373
+ * > Set the memory allocator to a different memory allocator. This
374
+ * > allocator will then be used to make all memory allocations for
375
+ * > libgit2 operations. If the given `allocator` is NULL, then the
376
+ * > system default will be restored.
377
+ *
378
+ * opts(GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY, int enabled)
379
+ *
380
+ * > Ensure that there are no unsaved changes in the index before
381
+ * > beginning any operation that reloads the index from disk (eg,
382
+ * > checkout). If there are unsaved changes, the instruction will
383
+ * > fail. (Using the FORCE flag to checkout will still overwrite
384
+ * > these changes.)
385
+ *
386
+ * opts(GIT_OPT_GET_PACK_MAX_OBJECTS, size_t *out)
387
+ *
388
+ * > Get the maximum number of objects libgit2 will allow in a pack
389
+ * > file when downloading a pack file from a remote. This can be
390
+ * > used to limit maximum memory usage when fetching from an untrusted
391
+ * > remote.
392
+ *
393
+ * opts(GIT_OPT_SET_PACK_MAX_OBJECTS, size_t objects)
394
+ *
395
+ * > Set the maximum number of objects libgit2 will allow in a pack
396
+ * > file when downloading a pack file from a remote.
397
+ *
348
398
  * @param option Option key
349
399
  * @param ... value to set the option
350
400
  * @return 0 on success, <0 on failure
@@ -64,8 +64,9 @@ typedef enum {
64
64
  typedef struct git_config_entry {
65
65
  const char *name; /**< Name of the entry (normalised) */
66
66
  const char *value; /**< String value of the entry */
67
+ unsigned int include_depth; /**< Depth of includes where this variable was found */
67
68
  git_config_level_t level; /**< Which config file this was found in */
68
- void (*free)(struct git_config_entry *entry); /**< Free function for this entry */
69
+ void GIT_CALLBACK(free)(struct git_config_entry *entry); /**< Free function for this entry */
69
70
  void *payload; /**< Opaque value for the free function. Do not read or write */
70
71
  } git_config_entry;
71
72
 
@@ -74,7 +75,17 @@ typedef struct git_config_entry {
74
75
  */
75
76
  GIT_EXTERN(void) git_config_entry_free(git_config_entry *);
76
77
 
77
- typedef int (*git_config_foreach_cb)(const git_config_entry *, void *);
78
+ /**
79
+ * A config enumeration callback
80
+ *
81
+ * @param entry the entry currently being enumerated
82
+ * @param payload a user-specified pointer
83
+ */
84
+ typedef int GIT_CALLBACK(git_config_foreach_cb)(const git_config_entry *entry, void *payload);
85
+
86
+ /**
87
+ * An opaque structure for a configuration iterator
88
+ */
78
89
  typedef struct git_config_iterator git_config_iterator;
79
90
 
80
91
  /**
@@ -251,7 +262,7 @@ GIT_EXTERN(int) git_config_open_level(
251
262
  * Open the global/XDG configuration file according to git's rules
252
263
  *
253
264
  * Git allows you to store your global configuration at
254
- * `$HOME/.config` or `$XDG_CONFIG_HOME/git/config`. For backwards
265
+ * `$HOME/.gitconfig` or `$XDG_CONFIG_HOME/git/config`. For backwards
255
266
  * compatability, the XDG file shouldn't be used unless the use has
256
267
  * created it explicitly. With this function you'll open the correct
257
268
  * one to write to.
@@ -580,7 +591,7 @@ GIT_EXTERN(int) git_config_iterator_glob_new(git_config_iterator **out, const gi
580
591
  /**
581
592
  * Perform an operation on each config variable matching a regular expression.
582
593
  *
583
- * This behaviors like `git_config_foreach` with an additional filter of a
594
+ * This behaves like `git_config_foreach` with an additional filter of a
584
595
  * regular expression that filters which config keys are passed to the
585
596
  * callback.
586
597
  *
@@ -710,11 +721,11 @@ GIT_EXTERN(int) git_config_parse_int64(int64_t *out, const char *value);
710
721
  GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value);
711
722
 
712
723
  /**
713
- * Perform an operation on each config variable in given config backend
724
+ * Perform an operation on each config variable in a given config backend,
714
725
  * matching a regular expression.
715
726
  *
716
- * This behaviors like `git_config_foreach_match` except instead of all config
717
- * entries it just enumerates through the given backend entry.
727
+ * This behaves like `git_config_foreach_match` except that only config
728
+ * entries from the given backend entry are enumerated.
718
729
  *
719
730
  * The regular expression is applied case-sensitively on the normalized form of
720
731
  * the variable name: the section and variable parts are lower-cased. The
@@ -0,0 +1,253 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+ #ifndef INCLUDE_git_deprecated_h__
8
+ #define INCLUDE_git_deprecated_h__
9
+
10
+ #include "common.h"
11
+ #include "buffer.h"
12
+ #include "errors.h"
13
+ #include "index.h"
14
+ #include "object.h"
15
+ #include "refs.h"
16
+
17
+ /*
18
+ * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
19
+ */
20
+ #ifndef GIT_DEPRECATE_HARD
21
+
22
+ /**
23
+ * @file git2/deprecated.h
24
+ * @brief libgit2 deprecated functions and values
25
+ * @ingroup Git
26
+ * @{
27
+ */
28
+ GIT_BEGIN_DECL
29
+
30
+ /** @name Deprecated Buffer Functions
31
+ *
32
+ * These functions and enumeration values are retained for backward
33
+ * compatibility. The newer versions of these functions should be
34
+ * preferred in all new code.
35
+ *
36
+ * There is no plan to remove these backward compatibility values at
37
+ * this time.
38
+ */
39
+ /**@{*/
40
+
41
+ /**
42
+ * Free the memory referred to by the git_buf. This is an alias of
43
+ * `git_buf_dispose` and is preserved for backward compatibility.
44
+ *
45
+ * This function is deprecated, but there is no plan to remove this
46
+ * function at this time.
47
+ *
48
+ * @deprecated Use git_buf_dispose
49
+ * @see git_buf_dispose
50
+ */
51
+ GIT_EXTERN(void) git_buf_free(git_buf *buffer);
52
+
53
+ /**@}*/
54
+
55
+ /** @name Deprecated Error Functions and Constants
56
+ *
57
+ * These functions and enumeration values are retained for backward
58
+ * compatibility. The newer versions of these functions and values
59
+ * should be preferred in all new code.
60
+ *
61
+ * There is no plan to remove these backward compatibility values at
62
+ * this time.
63
+ */
64
+ /**@{*/
65
+
66
+ #define GITERR_NONE GIT_ERROR_NONE
67
+ #define GITERR_NOMEMORY GIT_ERROR_NOMEMORY
68
+ #define GITERR_OS GIT_ERROR_OS
69
+ #define GITERR_INVALID GIT_ERROR_INVALID
70
+ #define GITERR_REFERENCE GIT_ERROR_REFERENCE
71
+ #define GITERR_ZLIB GIT_ERROR_ZLIB
72
+ #define GITERR_REPOSITORY GIT_ERROR_REPOSITORY
73
+ #define GITERR_CONFIG GIT_ERROR_CONFIG
74
+ #define GITERR_REGEX GIT_ERROR_REGEX
75
+ #define GITERR_ODB GIT_ERROR_ODB
76
+ #define GITERR_INDEX GIT_ERROR_INDEX
77
+ #define GITERR_OBJECT GIT_ERROR_OBJECT
78
+ #define GITERR_NET GIT_ERROR_NET
79
+ #define GITERR_TAG GIT_ERROR_TAG
80
+ #define GITERR_TREE GIT_ERROR_TREE
81
+ #define GITERR_INDEXER GIT_ERROR_INDEXER
82
+ #define GITERR_SSL GIT_ERROR_SSL
83
+ #define GITERR_SUBMODULE GIT_ERROR_SUBMODULE
84
+ #define GITERR_THREAD GIT_ERROR_THREAD
85
+ #define GITERR_STASH GIT_ERROR_STASH
86
+ #define GITERR_CHECKOUT GIT_ERROR_CHECKOUT
87
+ #define GITERR_FETCHHEAD GIT_ERROR_FETCHHEAD
88
+ #define GITERR_MERGE GIT_ERROR_MERGE
89
+ #define GITERR_SSH GIT_ERROR_SSH
90
+ #define GITERR_FILTER GIT_ERROR_FILTER
91
+ #define GITERR_REVERT GIT_ERROR_REVERT
92
+ #define GITERR_CALLBACK GIT_ERROR_CALLBACK
93
+ #define GITERR_CHERRYPICK GIT_ERROR_CHERRYPICK
94
+ #define GITERR_DESCRIBE GIT_ERROR_DESCRIBE
95
+ #define GITERR_REBASE GIT_ERROR_REBASE
96
+ #define GITERR_FILESYSTEM GIT_ERROR_FILESYSTEM
97
+ #define GITERR_PATCH GIT_ERROR_PATCH
98
+ #define GITERR_WORKTREE GIT_ERROR_WORKTREE
99
+ #define GITERR_SHA1 GIT_ERROR_SHA1
100
+
101
+ /**
102
+ * Return the last `git_error` object that was generated for the
103
+ * current thread. This is an alias of `git_error_last` and is
104
+ * preserved for backward compatibility.
105
+ *
106
+ * This function is deprecated, but there is no plan to remove this
107
+ * function at this time.
108
+ *
109
+ * @deprecated Use git_error_last
110
+ * @see git_error_last
111
+ */
112
+ GIT_EXTERN(const git_error *) giterr_last(void);
113
+
114
+ /**
115
+ * Clear the last error. This is an alias of `git_error_last` and is
116
+ * preserved for backward compatibility.
117
+ *
118
+ * This function is deprecated, but there is no plan to remove this
119
+ * function at this time.
120
+ *
121
+ * @deprecated Use git_error_clear
122
+ * @see git_error_clear
123
+ */
124
+ GIT_EXTERN(void) giterr_clear(void);
125
+
126
+ /**
127
+ * Sets the error message to the given string. This is an alias of
128
+ * `git_error_set_str` and is preserved for backward compatibility.
129
+ *
130
+ * This function is deprecated, but there is no plan to remove this
131
+ * function at this time.
132
+ *
133
+ * @deprecated Use git_error_set_str
134
+ * @see git_error_set_str
135
+ */
136
+ GIT_EXTERN(void) giterr_set_str(int error_class, const char *string);
137
+
138
+ /**
139
+ * Indicates that an out-of-memory situation occured. This is an alias
140
+ * of `git_error_set_oom` and is preserved for backward compatibility.
141
+ *
142
+ * This function is deprecated, but there is no plan to remove this
143
+ * function at this time.
144
+ *
145
+ * @deprecated Use git_error_set_oom
146
+ * @see git_error_set_oom
147
+ */
148
+ GIT_EXTERN(void) giterr_set_oom(void);
149
+
150
+ /**@}*/
151
+
152
+ /** @name Deprecated Index Constants
153
+ *
154
+ * These enumeration values are retained for backward compatibility.
155
+ * The newer versions of these values should be preferred in all new code.
156
+ *
157
+ * There is no plan to remove these backward compatibility values at
158
+ * this time.
159
+ */
160
+ /**@{*/
161
+
162
+ #define GIT_IDXENTRY_NAMEMASK GIT_INDEX_ENTRY_NAMEMASK
163
+ #define GIT_IDXENTRY_STAGEMASK GIT_INDEX_ENTRY_STAGEMASK
164
+ #define GIT_IDXENTRY_STAGESHIFT GIT_INDEX_ENTRY_STAGESHIFT
165
+
166
+ /* The git_indxentry_flag_t enum */
167
+ #define GIT_IDXENTRY_EXTENDED GIT_INDEX_ENTRY_EXTENDED
168
+ #define GIT_IDXENTRY_VALID GIT_INDEX_ENTRY_VALID
169
+
170
+ #define GIT_IDXENTRY_STAGE(E) GIT_INDEX_ENTRY_STAGE(E)
171
+ #define GIT_IDXENTRY_STAGE_SET(E,S) GIT_INDEX_ENTRY_STAGE_SET(E,S)
172
+
173
+ /* The git_idxentry_extended_flag_t enum */
174
+ #define GIT_IDXENTRY_INTENT_TO_ADD GIT_INDEX_ENTRY_INTENT_TO_ADD
175
+ #define GIT_IDXENTRY_SKIP_WORKTREE GIT_INDEX_ENTRY_SKIP_WORKTREE
176
+ #define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_INDEX_ENTRY_INTENT_TO_ADD | GIT_INDEX_ENTRY_SKIP_WORKTREE)
177
+ #define GIT_IDXENTRY_EXTENDED2 (1 << 15)
178
+ #define GIT_IDXENTRY_UPDATE (1 << 0)
179
+ #define GIT_IDXENTRY_REMOVE (1 << 1)
180
+ #define GIT_IDXENTRY_UPTODATE (1 << 2)
181
+ #define GIT_IDXENTRY_ADDED (1 << 3)
182
+ #define GIT_IDXENTRY_HASHED (1 << 4)
183
+ #define GIT_IDXENTRY_UNHASHED (1 << 5)
184
+ #define GIT_IDXENTRY_WT_REMOVE (1 << 6)
185
+ #define GIT_IDXENTRY_CONFLICTED (1 << 7)
186
+ #define GIT_IDXENTRY_UNPACKED (1 << 8)
187
+ #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
188
+
189
+ /* The git_index_capability_t enum */
190
+ #define GIT_INDEXCAP_IGNORE_CASE GIT_INDEX_CAPABILITY_IGNORE_CASE
191
+ #define GIT_INDEXCAP_NO_FILEMODE GIT_INDEX_CAPABILITY_NO_FILEMODE
192
+ #define GIT_INDEXCAP_NO_SYMLINKS GIT_INDEX_CAPABILITY_NO_SYMLINKS
193
+ #define GIT_INDEXCAP_FROM_OWNER GIT_INDEX_CAPABILITY_FROM_OWNER
194
+
195
+ /**@}*/
196
+
197
+ /** @name Deprecated Object Constants
198
+ *
199
+ * These enumeration values are retained for backward compatibility. The
200
+ * newer versions of these values should be preferred in all new code.
201
+ *
202
+ * There is no plan to remove these backward compatibility values at
203
+ * this time.
204
+ */
205
+ /**@{*/
206
+
207
+ #define git_otype git_object_t
208
+
209
+ #define GIT_OBJ_ANY GIT_OBJECT_ANY
210
+ #define GIT_OBJ_BAD GIT_OBJECT_INVALID
211
+ #define GIT_OBJ__EXT1 0
212
+ #define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
213
+ #define GIT_OBJ_TREE GIT_OBJECT_TREE
214
+ #define GIT_OBJ_BLOB GIT_OBJECT_BLOB
215
+ #define GIT_OBJ_TAG GIT_OBJECT_TAG
216
+ #define GIT_OBJ__EXT2 5
217
+ #define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
218
+ #define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
219
+
220
+ /**@}*/
221
+
222
+ /** @name Deprecated Reference Constants
223
+ *
224
+ * These enumeration values are retained for backward compatibility. The
225
+ * newer versions of these values should be preferred in all new code.
226
+ *
227
+ * There is no plan to remove these backward compatibility values at
228
+ * this time.
229
+ */
230
+ /**@{*/
231
+
232
+ /** Basic type of any Git reference. */
233
+ #define git_ref_t git_reference_t
234
+ #define git_reference_normalize_t git_reference_format_t
235
+
236
+ #define GIT_REF_INVALID GIT_REFERENCE_INVALID
237
+ #define GIT_REF_OID GIT_REFERENCE_DIRECT
238
+ #define GIT_REF_SYMBOLIC GIT_REFERENCE_SYMBOLIC
239
+ #define GIT_REF_LISTALL GIT_REFERENCE_ALL
240
+
241
+ #define GIT_REF_FORMAT_NORMAL GIT_REFERENCE_FORMAT_NORMAL
242
+ #define GIT_REF_FORMAT_ALLOW_ONELEVEL GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL
243
+ #define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
244
+ #define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
245
+
246
+ /**@}*/
247
+
248
+ /** @} */
249
+ GIT_END_DECL
250
+
251
+ #endif
252
+
253
+ #endif