rugged 0.27.9 → 0.27.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +1 -0
  4. data/vendor/libgit2/CMakeLists.txt +98 -54
  5. data/vendor/libgit2/COPYING +28 -0
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  7. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
  8. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  9. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  10. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
  11. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
  12. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
  13. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  14. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
  15. data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
  16. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
  17. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
  18. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
  19. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
  20. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
  21. data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  22. data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
  23. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
  24. data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
  25. data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
  26. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
  27. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
  28. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
  29. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
  30. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
  31. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
  32. data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
  33. data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
  34. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
  35. data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
  36. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
  37. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
  38. data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
  39. data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
  40. data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
  42. data/vendor/libgit2/deps/pcre/COPYING +5 -0
  43. data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
  44. data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
  45. data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
  46. data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
  47. data/vendor/libgit2/deps/pcre/config.h.in +57 -0
  48. data/vendor/libgit2/deps/pcre/pcre.h +641 -0
  49. data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
  50. data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
  51. data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
  52. data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
  53. data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
  54. data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
  55. data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
  56. data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
  57. data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
  58. data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
  59. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
  60. data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
  61. data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
  62. data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
  63. data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
  64. data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
  65. data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
  66. data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
  67. data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
  68. data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
  69. data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
  70. data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
  71. data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
  72. data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
  73. data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
  74. data/vendor/libgit2/deps/pcre/ucp.h +224 -0
  75. data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
  76. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
  77. data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
  78. data/vendor/libgit2/deps/zlib/COPYING +27 -0
  79. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  80. data/vendor/libgit2/deps/zlib/crc32.c +0 -7
  81. data/vendor/libgit2/include/git2.h +5 -0
  82. data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
  83. data/vendor/libgit2/include/git2/apply.h +149 -0
  84. data/vendor/libgit2/include/git2/attr.h +38 -20
  85. data/vendor/libgit2/include/git2/blame.h +42 -25
  86. data/vendor/libgit2/include/git2/blob.h +45 -13
  87. data/vendor/libgit2/include/git2/branch.h +1 -1
  88. data/vendor/libgit2/include/git2/buffer.h +22 -16
  89. data/vendor/libgit2/include/git2/cert.h +135 -0
  90. data/vendor/libgit2/include/git2/checkout.h +65 -32
  91. data/vendor/libgit2/include/git2/cherrypick.h +9 -7
  92. data/vendor/libgit2/include/git2/clone.h +12 -10
  93. data/vendor/libgit2/include/git2/commit.h +53 -3
  94. data/vendor/libgit2/include/git2/common.h +60 -8
  95. data/vendor/libgit2/include/git2/config.h +30 -19
  96. data/vendor/libgit2/include/git2/cred.h +308 -0
  97. data/vendor/libgit2/include/git2/deprecated.h +493 -0
  98. data/vendor/libgit2/include/git2/describe.h +32 -9
  99. data/vendor/libgit2/include/git2/diff.h +208 -156
  100. data/vendor/libgit2/include/git2/errors.h +54 -46
  101. data/vendor/libgit2/include/git2/filter.h +8 -0
  102. data/vendor/libgit2/include/git2/ignore.h +2 -2
  103. data/vendor/libgit2/include/git2/index.h +74 -52
  104. data/vendor/libgit2/include/git2/indexer.h +76 -6
  105. data/vendor/libgit2/include/git2/mailmap.h +115 -0
  106. data/vendor/libgit2/include/git2/merge.h +35 -18
  107. data/vendor/libgit2/include/git2/net.h +0 -5
  108. data/vendor/libgit2/include/git2/notes.h +1 -1
  109. data/vendor/libgit2/include/git2/object.h +17 -29
  110. data/vendor/libgit2/include/git2/odb.h +12 -11
  111. data/vendor/libgit2/include/git2/odb_backend.h +10 -9
  112. data/vendor/libgit2/include/git2/oid.h +2 -2
  113. data/vendor/libgit2/include/git2/pack.h +14 -3
  114. data/vendor/libgit2/include/git2/proxy.h +14 -8
  115. data/vendor/libgit2/include/git2/rebase.h +53 -6
  116. data/vendor/libgit2/include/git2/refs.h +33 -15
  117. data/vendor/libgit2/include/git2/refspec.h +17 -0
  118. data/vendor/libgit2/include/git2/remote.h +123 -24
  119. data/vendor/libgit2/include/git2/repository.h +76 -39
  120. data/vendor/libgit2/include/git2/revert.h +6 -4
  121. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  122. data/vendor/libgit2/include/git2/signature.h +2 -2
  123. data/vendor/libgit2/include/git2/stash.h +15 -12
  124. data/vendor/libgit2/include/git2/status.h +33 -20
  125. data/vendor/libgit2/include/git2/submodule.h +30 -12
  126. data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
  127. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  128. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  129. data/vendor/libgit2/include/git2/sys/cred.h +90 -0
  130. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  131. data/vendor/libgit2/include/git2/sys/index.h +3 -0
  132. data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
  133. data/vendor/libgit2/include/git2/sys/merge.h +9 -4
  134. data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
  135. data/vendor/libgit2/include/git2/sys/path.h +64 -0
  136. data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
  137. data/vendor/libgit2/include/git2/sys/repository.h +5 -1
  138. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  139. data/vendor/libgit2/include/git2/sys/transport.h +129 -83
  140. data/vendor/libgit2/include/git2/tag.h +13 -4
  141. data/vendor/libgit2/include/git2/trace.h +2 -2
  142. data/vendor/libgit2/include/git2/transaction.h +1 -0
  143. data/vendor/libgit2/include/git2/transport.h +11 -311
  144. data/vendor/libgit2/include/git2/tree.h +4 -4
  145. data/vendor/libgit2/include/git2/types.h +33 -111
  146. data/vendor/libgit2/include/git2/version.h +4 -4
  147. data/vendor/libgit2/include/git2/worktree.h +48 -13
  148. data/vendor/libgit2/src/CMakeLists.txt +96 -164
  149. data/vendor/libgit2/src/alloc.c +43 -0
  150. data/vendor/libgit2/src/alloc.h +40 -0
  151. data/vendor/libgit2/src/allocators/stdalloc.c +119 -0
  152. data/vendor/libgit2/src/{streams/curl.h → allocators/stdalloc.h} +5 -5
  153. data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
  154. data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
  155. data/vendor/libgit2/src/annotated_commit.c +15 -8
  156. data/vendor/libgit2/src/apply.c +537 -31
  157. data/vendor/libgit2/src/apply.h +3 -1
  158. data/vendor/libgit2/src/array.h +2 -2
  159. data/vendor/libgit2/src/attr.c +81 -75
  160. data/vendor/libgit2/src/attr_file.c +207 -121
  161. data/vendor/libgit2/src/attr_file.h +9 -9
  162. data/vendor/libgit2/src/attrcache.c +51 -53
  163. data/vendor/libgit2/src/attrcache.h +2 -1
  164. data/vendor/libgit2/src/blame.c +47 -20
  165. data/vendor/libgit2/src/blame.h +2 -1
  166. data/vendor/libgit2/src/blame_git.c +37 -20
  167. data/vendor/libgit2/src/blob.c +128 -42
  168. data/vendor/libgit2/src/blob.h +19 -2
  169. data/vendor/libgit2/src/branch.c +67 -43
  170. data/vendor/libgit2/src/buf_text.c +7 -6
  171. data/vendor/libgit2/src/buffer.c +69 -57
  172. data/vendor/libgit2/src/buffer.h +1 -1
  173. data/vendor/libgit2/src/cache.c +38 -45
  174. data/vendor/libgit2/src/cache.h +3 -3
  175. data/vendor/libgit2/src/cc-compat.h +20 -3
  176. data/vendor/libgit2/src/checkout.c +109 -90
  177. data/vendor/libgit2/src/cherrypick.c +15 -9
  178. data/vendor/libgit2/src/clone.c +49 -27
  179. data/vendor/libgit2/src/clone.h +4 -0
  180. data/vendor/libgit2/src/commit.c +117 -49
  181. data/vendor/libgit2/src/commit.h +7 -0
  182. data/vendor/libgit2/src/commit_list.c +30 -78
  183. data/vendor/libgit2/src/commit_list.h +2 -2
  184. data/vendor/libgit2/src/common.h +27 -91
  185. data/vendor/libgit2/src/config.c +194 -176
  186. data/vendor/libgit2/src/config.h +8 -20
  187. data/vendor/libgit2/src/config_backend.h +96 -0
  188. data/vendor/libgit2/src/config_cache.c +41 -35
  189. data/vendor/libgit2/src/config_entries.c +229 -0
  190. data/vendor/libgit2/src/config_entries.h +24 -0
  191. data/vendor/libgit2/src/config_file.c +439 -753
  192. data/vendor/libgit2/src/config_mem.c +220 -0
  193. data/vendor/libgit2/src/config_parse.c +114 -63
  194. data/vendor/libgit2/src/config_parse.h +17 -16
  195. data/vendor/libgit2/src/config_snapshot.c +206 -0
  196. data/vendor/libgit2/src/crlf.c +219 -190
  197. data/vendor/libgit2/src/delta.c +25 -18
  198. data/vendor/libgit2/src/describe.c +42 -41
  199. data/vendor/libgit2/src/diff.c +53 -68
  200. data/vendor/libgit2/src/diff.h +2 -1
  201. data/vendor/libgit2/src/diff_driver.c +47 -49
  202. data/vendor/libgit2/src/diff_file.c +19 -17
  203. data/vendor/libgit2/src/diff_file.h +1 -1
  204. data/vendor/libgit2/src/diff_generate.c +162 -106
  205. data/vendor/libgit2/src/diff_generate.h +3 -3
  206. data/vendor/libgit2/src/diff_parse.c +4 -4
  207. data/vendor/libgit2/src/diff_print.c +42 -30
  208. data/vendor/libgit2/src/diff_stats.c +22 -7
  209. data/vendor/libgit2/src/diff_tform.c +16 -16
  210. data/vendor/libgit2/src/diff_xdiff.c +15 -3
  211. data/vendor/libgit2/src/errors.c +51 -39
  212. data/vendor/libgit2/src/errors.h +81 -0
  213. data/vendor/libgit2/src/features.h.in +11 -3
  214. data/vendor/libgit2/src/fetch.c +10 -5
  215. data/vendor/libgit2/src/fetchhead.c +17 -17
  216. data/vendor/libgit2/src/filebuf.c +32 -36
  217. data/vendor/libgit2/src/filebuf.h +2 -2
  218. data/vendor/libgit2/src/filter.c +46 -38
  219. data/vendor/libgit2/src/filter.h +0 -10
  220. data/vendor/libgit2/src/{fileops.c → futils.c} +80 -73
  221. data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
  222. data/vendor/libgit2/src/global.c +48 -63
  223. data/vendor/libgit2/src/global.h +0 -2
  224. data/vendor/libgit2/src/hash.c +61 -0
  225. data/vendor/libgit2/src/hash.h +20 -19
  226. data/vendor/libgit2/src/hash/sha1.h +38 -0
  227. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
  228. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
  229. data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
  230. data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
  231. data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
  232. data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
  233. data/vendor/libgit2/src/hash/sha1/mbedtls.c +46 -0
  234. data/vendor/libgit2/src/hash/sha1/mbedtls.h +19 -0
  235. data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
  236. data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
  237. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
  238. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
  239. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
  240. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
  241. data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
  242. data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
  243. data/vendor/libgit2/src/hashsig.c +5 -5
  244. data/vendor/libgit2/src/idxmap.c +107 -61
  245. data/vendor/libgit2/src/idxmap.h +153 -31
  246. data/vendor/libgit2/src/ignore.c +43 -47
  247. data/vendor/libgit2/src/index.c +337 -232
  248. data/vendor/libgit2/src/index.h +17 -1
  249. data/vendor/libgit2/src/indexer.c +346 -175
  250. data/vendor/libgit2/src/integer.h +71 -26
  251. data/vendor/libgit2/src/iterator.c +142 -70
  252. data/vendor/libgit2/src/iterator.h +15 -0
  253. data/vendor/libgit2/src/khash.h +3 -1
  254. data/vendor/libgit2/src/mailmap.c +485 -0
  255. data/vendor/libgit2/src/mailmap.h +35 -0
  256. data/vendor/libgit2/src/map.h +1 -1
  257. data/vendor/libgit2/src/merge.c +144 -100
  258. data/vendor/libgit2/src/merge_driver.c +11 -11
  259. data/vendor/libgit2/src/merge_file.c +2 -2
  260. data/vendor/libgit2/src/mwindow.c +24 -29
  261. data/vendor/libgit2/src/mwindow.h +4 -4
  262. data/vendor/libgit2/src/net.c +184 -0
  263. data/vendor/libgit2/src/net.h +36 -0
  264. data/vendor/libgit2/src/netops.c +55 -156
  265. data/vendor/libgit2/src/netops.h +3 -23
  266. data/vendor/libgit2/src/notes.c +16 -11
  267. data/vendor/libgit2/src/object.c +120 -69
  268. data/vendor/libgit2/src/object.h +22 -9
  269. data/vendor/libgit2/src/object_api.c +8 -8
  270. data/vendor/libgit2/src/odb.c +116 -93
  271. data/vendor/libgit2/src/odb.h +8 -7
  272. data/vendor/libgit2/src/odb_loose.c +62 -55
  273. data/vendor/libgit2/src/odb_mempack.c +21 -34
  274. data/vendor/libgit2/src/odb_pack.c +18 -14
  275. data/vendor/libgit2/src/offmap.c +53 -35
  276. data/vendor/libgit2/src/offmap.h +108 -21
  277. data/vendor/libgit2/src/oid.c +12 -7
  278. data/vendor/libgit2/src/oidmap.c +49 -47
  279. data/vendor/libgit2/src/oidmap.h +101 -24
  280. data/vendor/libgit2/src/pack-objects.c +88 -87
  281. data/vendor/libgit2/src/pack-objects.h +2 -8
  282. data/vendor/libgit2/src/pack.c +99 -101
  283. data/vendor/libgit2/src/pack.h +17 -19
  284. data/vendor/libgit2/src/parse.c +10 -0
  285. data/vendor/libgit2/src/parse.h +3 -3
  286. data/vendor/libgit2/src/patch.c +4 -4
  287. data/vendor/libgit2/src/patch_generate.c +20 -20
  288. data/vendor/libgit2/src/patch_parse.c +151 -63
  289. data/vendor/libgit2/src/path.c +169 -125
  290. data/vendor/libgit2/src/path.h +3 -71
  291. data/vendor/libgit2/src/pathspec.c +19 -19
  292. data/vendor/libgit2/src/pool.c +26 -22
  293. data/vendor/libgit2/src/pool.h +7 -7
  294. data/vendor/libgit2/src/posix.c +10 -10
  295. data/vendor/libgit2/src/posix.h +12 -1
  296. data/vendor/libgit2/src/proxy.c +8 -3
  297. data/vendor/libgit2/src/push.c +37 -31
  298. data/vendor/libgit2/src/push.h +2 -1
  299. data/vendor/libgit2/src/reader.c +265 -0
  300. data/vendor/libgit2/src/reader.h +107 -0
  301. data/vendor/libgit2/src/rebase.c +115 -59
  302. data/vendor/libgit2/src/refdb.c +15 -3
  303. data/vendor/libgit2/src/refdb_fs.c +381 -254
  304. data/vendor/libgit2/src/reflog.c +13 -15
  305. data/vendor/libgit2/src/refs.c +118 -88
  306. data/vendor/libgit2/src/refs.h +5 -3
  307. data/vendor/libgit2/src/refspec.c +56 -37
  308. data/vendor/libgit2/src/refspec.h +1 -1
  309. data/vendor/libgit2/src/regexp.c +221 -0
  310. data/vendor/libgit2/src/regexp.h +97 -0
  311. data/vendor/libgit2/src/remote.c +266 -215
  312. data/vendor/libgit2/src/remote.h +11 -2
  313. data/vendor/libgit2/src/repository.c +280 -225
  314. data/vendor/libgit2/src/repository.h +52 -40
  315. data/vendor/libgit2/src/reset.c +8 -8
  316. data/vendor/libgit2/src/revert.c +14 -9
  317. data/vendor/libgit2/src/revparse.c +47 -48
  318. data/vendor/libgit2/src/revwalk.c +120 -57
  319. data/vendor/libgit2/src/revwalk.h +22 -1
  320. data/vendor/libgit2/src/settings.c +47 -10
  321. data/vendor/libgit2/src/signature.c +11 -11
  322. data/vendor/libgit2/src/sortedcache.c +22 -36
  323. data/vendor/libgit2/src/sortedcache.h +1 -1
  324. data/vendor/libgit2/src/stash.c +125 -99
  325. data/vendor/libgit2/src/status.c +28 -22
  326. data/vendor/libgit2/src/stream.h +17 -2
  327. data/vendor/libgit2/src/streams/mbedtls.c +483 -0
  328. data/vendor/libgit2/src/streams/mbedtls.h +23 -0
  329. data/vendor/libgit2/src/streams/openssl.c +224 -114
  330. data/vendor/libgit2/src/streams/openssl.h +4 -108
  331. data/vendor/libgit2/src/streams/registry.c +118 -0
  332. data/vendor/libgit2/src/streams/registry.h +19 -0
  333. data/vendor/libgit2/src/streams/socket.c +55 -30
  334. data/vendor/libgit2/src/streams/stransport.c +57 -32
  335. data/vendor/libgit2/src/streams/stransport.h +5 -0
  336. data/vendor/libgit2/src/streams/tls.c +50 -19
  337. data/vendor/libgit2/src/streams/tls.h +12 -4
  338. data/vendor/libgit2/src/strmap.c +47 -74
  339. data/vendor/libgit2/src/strmap.h +108 -33
  340. data/vendor/libgit2/src/submodule.c +272 -216
  341. data/vendor/libgit2/src/submodule.h +1 -1
  342. data/vendor/libgit2/src/sysdir.c +29 -19
  343. data/vendor/libgit2/src/tag.c +41 -28
  344. data/vendor/libgit2/src/tag.h +2 -1
  345. data/vendor/libgit2/src/trace.c +2 -2
  346. data/vendor/libgit2/src/trace.h +3 -3
  347. data/vendor/libgit2/src/trailer.c +52 -38
  348. data/vendor/libgit2/src/transaction.c +30 -29
  349. data/vendor/libgit2/src/transport.c +5 -5
  350. data/vendor/libgit2/src/transports/auth.c +15 -11
  351. data/vendor/libgit2/src/transports/auth.h +10 -3
  352. data/vendor/libgit2/src/transports/auth_negotiate.c +33 -18
  353. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  354. data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
  355. data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
  356. data/vendor/libgit2/src/transports/cred.c +24 -24
  357. data/vendor/libgit2/src/transports/git.c +26 -31
  358. data/vendor/libgit2/src/transports/http.c +881 -348
  359. data/vendor/libgit2/src/transports/http.h +2 -0
  360. data/vendor/libgit2/src/transports/local.c +35 -35
  361. data/vendor/libgit2/src/transports/smart.c +70 -47
  362. data/vendor/libgit2/src/transports/smart.h +3 -4
  363. data/vendor/libgit2/src/transports/smart_pkt.c +43 -40
  364. data/vendor/libgit2/src/transports/smart_protocol.c +96 -116
  365. data/vendor/libgit2/src/transports/ssh.c +77 -66
  366. data/vendor/libgit2/src/transports/winhttp.c +318 -314
  367. data/vendor/libgit2/src/tree-cache.c +19 -12
  368. data/vendor/libgit2/src/tree.c +103 -142
  369. data/vendor/libgit2/src/tree.h +1 -12
  370. data/vendor/libgit2/src/unix/map.c +3 -3
  371. data/vendor/libgit2/src/unix/posix.h +1 -11
  372. data/vendor/libgit2/src/userdiff.h +3 -1
  373. data/vendor/libgit2/src/util.c +70 -56
  374. data/vendor/libgit2/src/util.h +28 -156
  375. data/vendor/libgit2/src/vector.c +4 -4
  376. data/vendor/libgit2/src/wildmatch.c +320 -0
  377. data/vendor/libgit2/src/wildmatch.h +23 -0
  378. data/vendor/libgit2/src/win32/dir.c +3 -3
  379. data/vendor/libgit2/src/win32/findfile.c +3 -3
  380. data/vendor/libgit2/src/win32/map.c +9 -11
  381. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  382. data/vendor/libgit2/src/win32/path_w32.c +113 -9
  383. data/vendor/libgit2/src/win32/path_w32.h +18 -29
  384. data/vendor/libgit2/src/win32/posix.h +1 -4
  385. data/vendor/libgit2/src/win32/posix_w32.c +70 -45
  386. data/vendor/libgit2/src/win32/precompiled.h +0 -2
  387. data/vendor/libgit2/src/win32/thread.c +5 -10
  388. data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
  389. data/vendor/libgit2/src/win32/w32_common.h +39 -0
  390. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +3 -2
  391. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +26 -75
  392. data/vendor/libgit2/src/win32/w32_stack.c +6 -11
  393. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  394. data/vendor/libgit2/src/win32/w32_util.c +27 -64
  395. data/vendor/libgit2/src/win32/w32_util.h +5 -49
  396. data/vendor/libgit2/src/worktree.c +95 -60
  397. data/vendor/libgit2/src/worktree.h +2 -0
  398. data/vendor/libgit2/src/xdiff/xdiffi.c +7 -5
  399. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  400. data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
  401. data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
  402. data/vendor/libgit2/src/zstream.c +4 -4
  403. metadata +122 -33
  404. data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
  405. data/vendor/libgit2/deps/regex/config.h +0 -7
  406. data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
  407. data/vendor/libgit2/deps/regex/regex.c +0 -92
  408. data/vendor/libgit2/deps/regex/regex.h +0 -582
  409. data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
  410. data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
  411. data/vendor/libgit2/deps/regex/regexec.c +0 -4369
  412. data/vendor/libgit2/include/git2/inttypes.h +0 -309
  413. data/vendor/libgit2/include/git2/sys/time.h +0 -31
  414. data/vendor/libgit2/libgit2.pc.in +0 -13
  415. data/vendor/libgit2/src/config_file.h +0 -73
  416. data/vendor/libgit2/src/fnmatch.c +0 -248
  417. data/vendor/libgit2/src/fnmatch.h +0 -48
  418. data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
  419. data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
  420. data/vendor/libgit2/src/streams/curl.c +0 -385
@@ -36,10 +36,9 @@ typedef enum {
36
36
  /**
37
37
  * Describe options structure
38
38
  *
39
- * Initialize with `GIT_DESCRIBE_OPTIONS_INIT` macro to correctly set
40
- * the `version` field. E.g.
39
+ * Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can
40
+ * use `git_describe_options_init`.
41
41
  *
42
- * git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;
43
42
  */
44
43
  typedef struct git_describe_options {
45
44
  unsigned int version;
@@ -70,10 +69,24 @@ typedef struct git_describe_options {
70
69
  GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS, \
71
70
  }
72
71
 
73
- GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
72
+ /**
73
+ * Initialize git_describe_options structure
74
+ *
75
+ * Initializes a `git_describe_options` with default values. Equivalent to creating
76
+ * an instance with GIT_DESCRIBE_OPTIONS_INIT.
77
+ *
78
+ * @param opts The `git_describe_options` struct to initialize.
79
+ * @param version The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`.
80
+ * @return Zero on success; -1 on failure.
81
+ */
82
+ GIT_EXTERN(int) git_describe_options_init(git_describe_options *opts, unsigned int version);
74
83
 
75
84
  /**
76
- * Options for formatting the describe string
85
+ * Describe format options structure
86
+ *
87
+ * Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can
88
+ * use `git_describe_format_options_init`.
89
+ *
77
90
  */
78
91
  typedef struct {
79
92
  unsigned int version;
@@ -103,7 +116,17 @@ typedef struct {
103
116
  GIT_DESCRIBE_DEFAULT_ABBREVIATED_SIZE, \
104
117
  }
105
118
 
106
- GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
119
+ /**
120
+ * Initialize git_describe_format_options structure
121
+ *
122
+ * Initializes a `git_describe_format_options` with default values. Equivalent to creating
123
+ * an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT.
124
+ *
125
+ * @param opts The `git_describe_format_options` struct to initialize.
126
+ * @param version The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`.
127
+ * @return Zero on success; -1 on failure.
128
+ */
129
+ GIT_EXTERN(int) git_describe_format_options_init(git_describe_format_options *opts, unsigned int version);
107
130
 
108
131
  /**
109
132
  * A struct that stores the result of a describe operation.
@@ -118,7 +141,7 @@ typedef struct git_describe_result git_describe_result;
118
141
  * @param result pointer to store the result. You must free this once
119
142
  * you're done with it.
120
143
  * @param committish a committish to describe
121
- * @param opts the lookup options
144
+ * @param opts the lookup options (or NULL for defaults)
122
145
  */
123
146
  GIT_EXTERN(int) git_describe_commit(
124
147
  git_describe_result **result,
@@ -135,7 +158,7 @@ GIT_EXTERN(int) git_describe_commit(
135
158
  * @param out pointer to store the result. You must free this once
136
159
  * you're done with it.
137
160
  * @param repo the repository in which to perform the describe
138
- * @param opts the lookup options
161
+ * @param opts the lookup options (or NULL for defaults)
139
162
  */
140
163
  GIT_EXTERN(int) git_describe_workdir(
141
164
  git_describe_result **out,
@@ -148,7 +171,7 @@ GIT_EXTERN(int) git_describe_workdir(
148
171
  * @param out The buffer to store the result
149
172
  * @param result the result from `git_describe_commit()` or
150
173
  * `git_describe_workdir()`.
151
- * @param opts the formatting options
174
+ * @param opts the formatting options (or NULL for defaults)
152
175
  */
153
176
  GIT_EXTERN(int) git_describe_format(
154
177
  git_buf *out,
@@ -16,50 +16,6 @@
16
16
  /**
17
17
  * @file git2/diff.h
18
18
  * @brief Git tree and file differencing routines.
19
- *
20
- * Overview
21
- * --------
22
- *
23
- * Calculating diffs is generally done in two phases: building a list of
24
- * diffs then traversing it. This makes is easier to share logic across
25
- * the various types of diffs (tree vs tree, workdir vs index, etc.), and
26
- * also allows you to insert optional diff post-processing phases,
27
- * such as rename detection, in between the steps. When you are done with
28
- * a diff object, it must be freed.
29
- *
30
- * Terminology
31
- * -----------
32
- *
33
- * To understand the diff APIs, you should know the following terms:
34
- *
35
- * - A `diff` represents the cumulative list of differences between two
36
- * snapshots of a repository (possibly filtered by a set of file name
37
- * patterns). This is the `git_diff` object.
38
- *
39
- * - A `delta` is a file pair with an old and new revision. The old version
40
- * may be absent if the file was just created and the new version may be
41
- * absent if the file was deleted. A diff is mostly just a list of deltas.
42
- *
43
- * - A `binary` file / delta is a file (or pair) for which no text diffs
44
- * should be generated. A diff can contain delta entries that are
45
- * binary, but no diff content will be output for those files. There is
46
- * a base heuristic for binary detection and you can further tune the
47
- * behavior with git attributes or diff flags and option settings.
48
- *
49
- * - A `hunk` is a span of modified lines in a delta along with some stable
50
- * surrounding context. You can configure the amount of context and other
51
- * properties of how hunks are generated. Each hunk also comes with a
52
- * header that described where it starts and ends in both the old and new
53
- * versions in the delta.
54
- *
55
- * - A `line` is a range of characters inside a hunk. It could be a context
56
- * line (i.e. in both old and new versions), an added line (i.e. only in
57
- * the new version), or a removed line (i.e. only in the old version).
58
- * Unfortunately, we don't know anything about the encoding of data in the
59
- * file being diffed, so we cannot tell you much about the line content.
60
- * Line data will not be NUL-byte terminated, however, because it will be
61
- * just a span of bytes inside the larger file.
62
- *
63
19
  * @ingroup Git
64
20
  * @{
65
21
  */
@@ -163,7 +119,7 @@ typedef enum {
163
119
 
164
120
  /** Include unreadable files in the diff */
165
121
  GIT_DIFF_INCLUDE_UNREADABLE = (1u << 16),
166
-
122
+
167
123
  /** Include unreadable files in the diff */
168
124
  GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED = (1u << 17),
169
125
 
@@ -171,6 +127,12 @@ typedef enum {
171
127
  * Options controlling how output will be generated
172
128
  */
173
129
 
130
+ /** Use a heuristic that takes indentation and whitespace into account
131
+ * which generally can produce better diffs when dealing with ambiguous
132
+ * diff hunks.
133
+ */
134
+ GIT_DIFF_INDENT_HEURISTIC = (1u << 18),
135
+
174
136
  /** Treat all files as text, disabling binary attributes & detection */
175
137
  GIT_DIFF_FORCE_TEXT = (1u << 20),
176
138
  /** Treat all files as binary, disabling text diffs */
@@ -206,21 +168,27 @@ typedef enum {
206
168
  * can apply given diff information to binary files.
207
169
  */
208
170
  GIT_DIFF_SHOW_BINARY = (1u << 30),
209
-
210
- /** Use a heuristic that takes indentation and whitespace into account
211
- * which generally can produce better diffs when dealing with ambiguous
212
- * diff hunks.
213
- */
214
- GIT_DIFF_INDENT_HEURISTIC = (1u << 31),
215
171
  } git_diff_option_t;
216
172
 
217
173
  /**
218
174
  * The diff object that contains all individual file deltas.
219
175
  *
176
+ * A `diff` represents the cumulative list of differences between two
177
+ * snapshots of a repository (possibly filtered by a set of file name
178
+ * patterns).
179
+ *
180
+ * Calculating diffs is generally done in two phases: building a list of
181
+ * diffs then traversing it. This makes is easier to share logic across
182
+ * the various types of diffs (tree vs tree, workdir vs index, etc.), and
183
+ * also allows you to insert optional diff post-processing phases,
184
+ * such as rename detection, in between the steps. When you are done with
185
+ * a diff object, it must be freed.
186
+ *
220
187
  * This is an opaque structure which will be allocated by one of the diff
221
- * generator functions below (such as `git_diff_tree_to_tree`). You are
188
+ * generator functions below (such as `git_diff_tree_to_tree`). You are
222
189
  * responsible for releasing the object memory when done, using the
223
190
  * `git_diff_free()` function.
191
+ *
224
192
  */
225
193
  typedef struct git_diff git_diff;
226
194
 
@@ -290,17 +258,21 @@ typedef enum {
290
258
  * abbreviated to something reasonable, like 7 characters.
291
259
  */
292
260
  typedef struct {
293
- git_oid id;
294
- const char *path;
295
- git_off_t size;
296
- uint32_t flags;
297
- uint16_t mode;
298
- uint16_t id_abbrev;
261
+ git_oid id;
262
+ const char *path;
263
+ git_object_size_t size;
264
+ uint32_t flags;
265
+ uint16_t mode;
266
+ uint16_t id_abbrev;
299
267
  } git_diff_file;
300
268
 
301
269
  /**
302
270
  * Description of changes to one entry.
303
271
  *
272
+ * A `delta` is a file pair with an old and new revision. The old version
273
+ * may be absent if the file was just created and the new version may be
274
+ * absent if the file was deleted. A diff is mostly just a list of deltas.
275
+ *
304
276
  * When iterating over a diff, this will be passed to most callbacks and
305
277
  * you can use the contents to understand exactly what has changed.
306
278
  *
@@ -346,7 +318,7 @@ typedef struct {
346
318
  /**
347
319
  * Diff notification callback function.
348
320
  *
349
- * The callback will be called for each file, just before the `git_delta_t`
321
+ * The callback will be called for each file, just before the `git_diff_delta`
350
322
  * gets inserted into the diff.
351
323
  *
352
324
  * When the callback:
@@ -356,7 +328,7 @@ typedef struct {
356
328
  * - returns 0, the delta is inserted into the diff, and the diff process
357
329
  * continues.
358
330
  */
359
- typedef int (*git_diff_notify_cb)(
331
+ typedef int GIT_CALLBACK(git_diff_notify_cb)(
360
332
  const git_diff *diff_so_far,
361
333
  const git_diff_delta *delta_to_add,
362
334
  const char *matched_pathspec,
@@ -372,7 +344,7 @@ typedef int (*git_diff_notify_cb)(
372
344
  * @param new_path The path to the new file or NULL.
373
345
  * @return Non-zero to abort the diff.
374
346
  */
375
- typedef int (*git_diff_progress_cb)(
347
+ typedef int GIT_CALLBACK(git_diff_progress_cb)(
376
348
  const git_diff *diff_so_far,
377
349
  const char *old_path,
378
350
  const char *new_path,
@@ -385,46 +357,79 @@ typedef int (*git_diff_progress_cb)(
385
357
  * values. Similarly, passing NULL for the options structure will
386
358
  * give the defaults. The default values are marked below.
387
359
  *
388
- * - `flags` is a combination of the `git_diff_option_t` values above
389
- * - `context_lines` is the number of unchanged lines that define the
390
- * boundary of a hunk (and to display before and after)
391
- * - `interhunk_lines` is the maximum number of unchanged lines between
392
- * hunk boundaries before the hunks will be merged into a one.
393
- * - `old_prefix` is the virtual "directory" to prefix to old file names
394
- * in hunk headers (default "a")
395
- * - `new_prefix` is the virtual "directory" to prefix to new file names
396
- * in hunk headers (default "b")
397
- * - `pathspec` is an array of paths / fnmatch patterns to constrain diff
398
- * - `max_size` is a file size (in bytes) above which a blob will be marked
399
- * as binary automatically; pass a negative value to disable.
400
- * - `notify_cb` is an optional callback function, notifying the consumer of
401
- * changes to the diff as new deltas are added.
402
- * - `progress_cb` is an optional callback function, notifying the consumer of
403
- * which files are being examined as the diff is generated.
404
- * - `payload` is the payload to pass to the callback functions.
405
- * - `ignore_submodules` overrides the submodule ignore setting for all
406
- * submodules in the diff.
407
360
  */
408
361
  typedef struct {
409
362
  unsigned int version; /**< version for the struct */
410
- uint32_t flags; /**< defaults to GIT_DIFF_NORMAL */
363
+
364
+ /**
365
+ * A combination of `git_diff_option_t` values above.
366
+ * Defaults to GIT_DIFF_NORMAL
367
+ */
368
+ uint32_t flags;
411
369
 
412
370
  /* options controlling which files are in the diff */
413
371
 
414
- git_submodule_ignore_t ignore_submodules; /**< submodule ignore rule */
415
- git_strarray pathspec; /**< defaults to include all paths */
372
+ /** Overrides the submodule ignore setting for all submodules in the diff. */
373
+ git_submodule_ignore_t ignore_submodules;
374
+
375
+ /**
376
+ * An array of paths / fnmatch patterns to constrain diff.
377
+ * All paths are included by default.
378
+ */
379
+ git_strarray pathspec;
380
+
381
+ /**
382
+ * An optional callback function, notifying the consumer of changes to
383
+ * the diff as new deltas are added.
384
+ */
416
385
  git_diff_notify_cb notify_cb;
386
+
387
+ /**
388
+ * An optional callback function, notifying the consumer of which files
389
+ * are being examined as the diff is generated.
390
+ */
417
391
  git_diff_progress_cb progress_cb;
392
+
393
+ /** The payload to pass to the callback functions. */
418
394
  void *payload;
419
395
 
420
396
  /* options controlling how to diff text is generated */
421
397
 
422
- uint32_t context_lines; /**< defaults to 3 */
423
- uint32_t interhunk_lines; /**< defaults to 0 */
424
- uint16_t id_abbrev; /**< default 'core.abbrev' or 7 if unset */
425
- git_off_t max_size; /**< defaults to 512MB */
426
- const char *old_prefix; /**< defaults to "a" */
427
- const char *new_prefix; /**< defaults to "b" */
398
+ /**
399
+ * The number of unchanged lines that define the boundary of a hunk
400
+ * (and to display before and after). Defaults to 3.
401
+ */
402
+ uint32_t context_lines;
403
+ /**
404
+ * The maximum number of unchanged lines between hunk boundaries before
405
+ * the hunks will be merged into one. Defaults to 0.
406
+ */
407
+ uint32_t interhunk_lines;
408
+
409
+ /**
410
+ * The abbreviation length to use when formatting object ids.
411
+ * Defaults to the value of 'core.abbrev' from the config, or 7 if unset.
412
+ */
413
+ uint16_t id_abbrev;
414
+
415
+ /**
416
+ * A size (in bytes) above which a blob will be marked as binary
417
+ * automatically; pass a negative value to disable.
418
+ * Defaults to 512MB.
419
+ */
420
+ git_off_t max_size;
421
+
422
+ /**
423
+ * The virtual "directory" prefix for old file names in hunk headers.
424
+ * Default is "a".
425
+ */
426
+ const char *old_prefix;
427
+
428
+ /**
429
+ * The virtual "directory" prefix for new file names in hunk headers.
430
+ * Defaults to "b".
431
+ */
432
+ const char *new_prefix;
428
433
  } git_diff_options;
429
434
 
430
435
  /* The current version of the diff options structure */
@@ -437,14 +442,16 @@ typedef struct {
437
442
  {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3}
438
443
 
439
444
  /**
440
- * Initializes a `git_diff_options` with default values. Equivalent to
441
- * creating an instance with GIT_DIFF_OPTIONS_INIT.
445
+ * Initialize git_diff_options structure
446
+ *
447
+ * Initializes a `git_diff_options` with default values. Equivalent to creating
448
+ * an instance with GIT_DIFF_OPTIONS_INIT.
442
449
  *
443
- * @param opts The `git_diff_options` struct to initialize
444
- * @param version Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`
450
+ * @param opts The `git_diff_options` struct to initialize.
451
+ * @param version The struct version; pass `GIT_DIFF_OPTIONS_VERSION`.
445
452
  * @return Zero on success; -1 on failure.
446
453
  */
447
- GIT_EXTERN(int) git_diff_init_options(
454
+ GIT_EXTERN(int) git_diff_options_init(
448
455
  git_diff_options *opts,
449
456
  unsigned int version);
450
457
 
@@ -455,7 +462,7 @@ GIT_EXTERN(int) git_diff_init_options(
455
462
  * @param progress Goes from 0 to 1 over the diff
456
463
  * @param payload User-specified pointer from foreach function
457
464
  */
458
- typedef int (*git_diff_file_cb)(
465
+ typedef int GIT_CALLBACK(git_diff_file_cb)(
459
466
  const git_diff_delta *delta,
460
467
  float progress,
461
468
  void *payload);
@@ -494,12 +501,21 @@ typedef struct {
494
501
  size_t inflatedlen;
495
502
  } git_diff_binary_file;
496
503
 
497
- /** Structure describing the binary contents of a diff. */
504
+ /**
505
+ * Structure describing the binary contents of a diff.
506
+ *
507
+ * A `binary` file / delta is a file (or pair) for which no text diffs
508
+ * should be generated. A diff can contain delta entries that are
509
+ * binary, but no diff content will be output for those files. There is
510
+ * a base heuristic for binary detection and you can further tune the
511
+ * behavior with git attributes or diff flags and option settings.
512
+ */
498
513
  typedef struct {
499
514
  /**
500
- * Whether there is data in this binary structure or not. If this
501
- * is `1`, then this was produced and included binary content. If
502
- * this is `0` then this was generated knowing only that a binary
515
+ * Whether there is data in this binary structure or not.
516
+ *
517
+ * If this is `1`, then this was produced and included binary content.
518
+ * If this is `0` then this was generated knowing only that a binary
503
519
  * file changed but without providing the data, probably from a patch
504
520
  * that said `Binary files a/file.txt and b/file.txt differ`.
505
521
  */
@@ -509,16 +525,22 @@ typedef struct {
509
525
  } git_diff_binary;
510
526
 
511
527
  /**
512
- * When iterating over a diff, callback that will be made for
513
- * binary content within the diff.
514
- */
515
- typedef int(*git_diff_binary_cb)(
528
+ * When iterating over a diff, callback that will be made for
529
+ * binary content within the diff.
530
+ */
531
+ typedef int GIT_CALLBACK(git_diff_binary_cb)(
516
532
  const git_diff_delta *delta,
517
533
  const git_diff_binary *binary,
518
534
  void *payload);
519
535
 
520
536
  /**
521
537
  * Structure describing a hunk of a diff.
538
+ *
539
+ * A `hunk` is a span of modified lines in a delta along with some stable
540
+ * surrounding context. You can configure the amount of context and other
541
+ * properties of how hunks are generated. Each hunk also comes with a
542
+ * header that described where it starts and ends in both the old and new
543
+ * versions in the delta.
522
544
  */
523
545
  typedef struct {
524
546
  int old_start; /**< Starting line number in old_file */
@@ -532,7 +554,7 @@ typedef struct {
532
554
  /**
533
555
  * When iterating over a diff, callback that will be made per hunk.
534
556
  */
535
- typedef int (*git_diff_hunk_cb)(
557
+ typedef int GIT_CALLBACK(git_diff_hunk_cb)(
536
558
  const git_diff_delta *delta,
537
559
  const git_diff_hunk *hunk,
538
560
  void *payload);
@@ -566,6 +588,14 @@ typedef enum {
566
588
 
567
589
  /**
568
590
  * Structure describing a line (or data span) of a diff.
591
+ *
592
+ * A `line` is a range of characters inside a hunk. It could be a context
593
+ * line (i.e. in both old and new versions), an added line (i.e. only in
594
+ * the new version), or a removed line (i.e. only in the old version).
595
+ * Unfortunately, we don't know anything about the encoding of data in the
596
+ * file being diffed, so we cannot tell you much about the line content.
597
+ * Line data will not be NUL-byte terminated, however, because it will be
598
+ * just a span of bytes inside the larger file.
569
599
  */
570
600
  typedef struct {
571
601
  char origin; /**< A git_diff_line_t value */
@@ -585,7 +615,7 @@ typedef struct {
585
615
  * of text. This uses some extra GIT_DIFF_LINE_... constants for output
586
616
  * of lines of file and hunk headers.
587
617
  */
588
- typedef int (*git_diff_line_cb)(
618
+ typedef int GIT_CALLBACK(git_diff_line_cb)(
589
619
  const git_diff_delta *delta, /**< delta that contains this data */
590
620
  const git_diff_hunk *hunk, /**< hunk containing this data */
591
621
  const git_diff_line *line, /**< line data */
@@ -669,14 +699,14 @@ typedef enum {
669
699
  * Pluggable similarity metric
670
700
  */
671
701
  typedef struct {
672
- int (*file_signature)(
702
+ int GIT_CALLBACK(file_signature)(
673
703
  void **out, const git_diff_file *file,
674
704
  const char *fullpath, void *payload);
675
- int (*buffer_signature)(
705
+ int GIT_CALLBACK(buffer_signature)(
676
706
  void **out, const git_diff_file *file,
677
707
  const char *buf, size_t buflen, void *payload);
678
- void (*free_signature)(void *sig, void *payload);
679
- int (*similarity)(int *score, void *siga, void *sigb, void *payload);
708
+ void GIT_CALLBACK(free_signature)(void *sig, void *payload);
709
+ int GIT_CALLBACK(similarity)(int *score, void *siga, void *sigb, void *payload);
680
710
  void *payload;
681
711
  } git_diff_similarity_metric;
682
712
 
@@ -684,21 +714,6 @@ typedef struct {
684
714
  * Control behavior of rename and copy detection
685
715
  *
686
716
  * These options mostly mimic parameters that can be passed to git-diff.
687
- *
688
- * - `rename_threshold` is the same as the -M option with a value
689
- * - `copy_threshold` is the same as the -C option with a value
690
- * - `rename_from_rewrite_threshold` matches the top of the -B option
691
- * - `break_rewrite_threshold` matches the bottom of the -B option
692
- * - `rename_limit` is the maximum number of matches to consider for
693
- * a particular file. This is a little different from the `-l` option
694
- * to regular Git because we will still process up to this many matches
695
- * before abandoning the search.
696
- *
697
- * The `metric` option allows you to plug in a custom similarity metric.
698
- * Set it to NULL for the default internal metric which is based on sampling
699
- * hashes of ranges of data in the file. The default metric is a pretty
700
- * good similarity approximation that should work fairly well for both text
701
- * and binary data, and is pretty fast with fixed memory overhead.
702
717
  */
703
718
  typedef struct {
704
719
  unsigned int version;
@@ -710,21 +725,49 @@ typedef struct {
710
725
  */
711
726
  uint32_t flags;
712
727
 
713
- /** Similarity to consider a file renamed (default 50) */
728
+ /**
729
+ * Threshold above which similar files will be considered renames.
730
+ * This is equivalent to the -M option. Defaults to 50.
731
+ */
714
732
  uint16_t rename_threshold;
715
- /** Similarity of modified to be eligible rename source (default 50) */
733
+
734
+ /**
735
+ * Threshold below which similar files will be eligible to be a rename source.
736
+ * This is equivalent to the first part of the -B option. Defaults to 50.
737
+ */
716
738
  uint16_t rename_from_rewrite_threshold;
717
- /** Similarity to consider a file a copy (default 50) */
739
+
740
+ /**
741
+ * Threshold above which similar files will be considered copies.
742
+ * This is equivalent to the -C option. Defaults to 50.
743
+ */
718
744
  uint16_t copy_threshold;
719
- /** Similarity to split modify into delete/add pair (default 60) */
745
+
746
+ /**
747
+ * Treshold below which similar files will be split into a delete/add pair.
748
+ * This is equivalent to the last part of the -B option. Defaults to 60.
749
+ */
720
750
  uint16_t break_rewrite_threshold;
721
751
 
722
- /** Maximum similarity sources to examine for a file (somewhat like
723
- * git-diff's `-l` option or `diff.renameLimit` config) (default 200)
752
+ /**
753
+ * Maximum number of matches to consider for a particular file.
754
+ *
755
+ * This is a little different from the `-l` option from Git because we
756
+ * will still process up to this many matches before abandoning the search.
757
+ * Defaults to 200.
724
758
  */
725
759
  size_t rename_limit;
726
760
 
727
- /** Pluggable similarity metric; pass NULL to use internal metric */
761
+ /**
762
+ * The `metric` option allows you to plug in a custom similarity metric.
763
+ *
764
+ * Set it to NULL to use the default internal metric.
765
+ *
766
+ * The default metric is based on sampling hashes of ranges of data in
767
+ * the file, which is a pretty good similarity approximation that should
768
+ * work fairly well for both text and binary data while still being
769
+ * pretty fast with a fixed memory overhead.
770
+ */
728
771
  git_diff_similarity_metric *metric;
729
772
  } git_diff_find_options;
730
773
 
@@ -732,14 +775,16 @@ typedef struct {
732
775
  #define GIT_DIFF_FIND_OPTIONS_INIT {GIT_DIFF_FIND_OPTIONS_VERSION}
733
776
 
734
777
  /**
735
- * Initializes a `git_diff_find_options` with default values. Equivalent to
736
- * creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.
778
+ * Initialize git_diff_find_options structure
779
+ *
780
+ * Initializes a `git_diff_find_options` with default values. Equivalent to creating
781
+ * an instance with GIT_DIFF_FIND_OPTIONS_INIT.
737
782
  *
738
- * @param opts The `git_diff_find_options` struct to initialize
739
- * @param version Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`
783
+ * @param opts The `git_diff_find_options` struct to initialize.
784
+ * @param version The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`.
740
785
  * @return Zero on success; -1 on failure.
741
786
  */
742
- GIT_EXTERN(int) git_diff_find_init_options(
787
+ GIT_EXTERN(int) git_diff_find_options_init(
743
788
  git_diff_find_options *opts,
744
789
  unsigned int version);
745
790
 
@@ -778,7 +823,7 @@ GIT_EXTERN(int) git_diff_tree_to_tree(
778
823
  git_repository *repo,
779
824
  git_tree *old_tree,
780
825
  git_tree *new_tree,
781
- const git_diff_options *opts); /**< can be NULL for defaults */
826
+ const git_diff_options *opts);
782
827
 
783
828
  /**
784
829
  * Create a diff between a tree and repository index.
@@ -804,7 +849,7 @@ GIT_EXTERN(int) git_diff_tree_to_index(
804
849
  git_repository *repo,
805
850
  git_tree *old_tree,
806
851
  git_index *index,
807
- const git_diff_options *opts); /**< can be NULL for defaults */
852
+ const git_diff_options *opts);
808
853
 
809
854
  /**
810
855
  * Create a diff between the repository index and the workdir directory.
@@ -830,7 +875,7 @@ GIT_EXTERN(int) git_diff_index_to_workdir(
830
875
  git_diff **diff,
831
876
  git_repository *repo,
832
877
  git_index *index,
833
- const git_diff_options *opts); /**< can be NULL for defaults */
878
+ const git_diff_options *opts);
834
879
 
835
880
  /**
836
881
  * Create a diff between a tree and the working directory.
@@ -859,7 +904,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir(
859
904
  git_diff **diff,
860
905
  git_repository *repo,
861
906
  git_tree *old_tree,
862
- const git_diff_options *opts); /**< can be NULL for defaults */
907
+ const git_diff_options *opts);
863
908
 
864
909
  /**
865
910
  * Create a diff between a tree and the working directory using index data
@@ -878,7 +923,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
878
923
  git_diff **diff,
879
924
  git_repository *repo,
880
925
  git_tree *old_tree,
881
- const git_diff_options *opts); /**< can be NULL for defaults */
926
+ const git_diff_options *opts);
882
927
 
883
928
  /**
884
929
  * Create a diff with the difference between two index objects.
@@ -897,7 +942,7 @@ GIT_EXTERN(int) git_diff_index_to_index(
897
942
  git_repository *repo,
898
943
  git_index *old_index,
899
944
  git_index *new_index,
900
- const git_diff_options *opts); /**< can be NULL for defaults */
945
+ const git_diff_options *opts);
901
946
 
902
947
  /**
903
948
  * Merge one diff into another.
@@ -1048,6 +1093,7 @@ typedef enum {
1048
1093
  GIT_DIFF_FORMAT_RAW = 3u, /**< like git diff --raw */
1049
1094
  GIT_DIFF_FORMAT_NAME_ONLY = 4u, /**< like git diff --name-only */
1050
1095
  GIT_DIFF_FORMAT_NAME_STATUS = 5u, /**< like git diff --name-status */
1096
+ GIT_DIFF_FORMAT_PATCH_ID = 6u, /**< git diff as used by git patch-id */
1051
1097
  } git_diff_format_t;
1052
1098
 
1053
1099
  /**
@@ -1333,7 +1379,8 @@ typedef enum {
1333
1379
  typedef struct {
1334
1380
  unsigned int version;
1335
1381
 
1336
- git_diff_format_email_flags_t flags;
1382
+ /** see `git_diff_format_email_flags_t` above */
1383
+ uint32_t flags;
1337
1384
 
1338
1385
  /** This patch number */
1339
1386
  size_t patch_no;
@@ -1390,27 +1437,29 @@ GIT_EXTERN(int) git_diff_commit_as_email(
1390
1437
  git_commit *commit,
1391
1438
  size_t patch_no,
1392
1439
  size_t total_patches,
1393
- git_diff_format_email_flags_t flags,
1440
+ uint32_t flags,
1394
1441
  const git_diff_options *diff_opts);
1395
1442
 
1396
1443
  /**
1397
- * Initializes a `git_diff_format_email_options` with default values.
1444
+ * Initialize git_diff_format_email_options structure
1398
1445
  *
1399
- * Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
1446
+ * Initializes a `git_diff_format_email_options` with default values. Equivalent
1447
+ * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
1400
1448
  *
1401
- * @param opts The `git_diff_format_email_options` struct to initialize
1402
- * @param version Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`
1449
+ * @param opts The `git_blame_options` struct to initialize.
1450
+ * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
1403
1451
  * @return Zero on success; -1 on failure.
1404
1452
  */
1405
- GIT_EXTERN(int) git_diff_format_email_init_options(
1453
+ GIT_EXTERN(int) git_diff_format_email_options_init(
1406
1454
  git_diff_format_email_options *opts,
1407
1455
  unsigned int version);
1408
1456
 
1409
1457
  /**
1410
1458
  * Patch ID options structure
1411
1459
  *
1412
- * Initialize with `GIT_DIFF_PATCHID_OPTIONS_INIT` macro to
1413
- * correctly set the default values and version.
1460
+ * Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can
1461
+ * use `git_diff_patchid_options_init`.
1462
+ *
1414
1463
  */
1415
1464
  typedef struct git_diff_patchid_options {
1416
1465
  unsigned int version;
@@ -1420,12 +1469,16 @@ typedef struct git_diff_patchid_options {
1420
1469
  #define GIT_DIFF_PATCHID_OPTIONS_INIT { GIT_DIFF_PATCHID_OPTIONS_VERSION }
1421
1470
 
1422
1471
  /**
1423
- * Initialize `git_diff_patchid_options` structure.
1472
+ * Initialize git_diff_patchid_options structure
1424
1473
  *
1425
- * Initializes the structure with default values. Equivalent to
1474
+ * Initializes a `git_diff_patchid_options` with default values. Equivalent to
1426
1475
  * creating an instance with `GIT_DIFF_PATCHID_OPTIONS_INIT`.
1476
+ *
1477
+ * @param opts The `git_diff_patchid_options` struct to initialize.
1478
+ * @param version The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`.
1479
+ * @return Zero on success; -1 on failure.
1427
1480
  */
1428
- GIT_EXTERN(int) git_diff_patchid_init_options(
1481
+ GIT_EXTERN(int) git_diff_patchid_options_init(
1429
1482
  git_diff_patchid_options *opts,
1430
1483
  unsigned int version);
1431
1484
 
@@ -1441,8 +1494,7 @@ GIT_EXTERN(int) git_diff_patchid_init_options(
1441
1494
  * defined in git-patch-id(1), and should in fact generate the
1442
1495
  * same IDs as the upstream git project does.
1443
1496
  *
1444
- * @param out Pointer where the calculated patch ID shoul be
1445
- * stored
1497
+ * @param out Pointer where the calculated patch ID should be stored
1446
1498
  * @param diff The diff to calculate the ID for
1447
1499
  * @param opts Options for how to calculate the patch ID. This is
1448
1500
  * intended for future changes, as currently no options are