rugged 0.27.7 → 0.27.10

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 (409) 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 +99 -51
  5. data/vendor/libgit2/COPYING +28 -0
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  7. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
  8. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
  9. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
  10. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  11. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  12. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
  13. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
  14. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
  15. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
  16. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  17. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
  18. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
  19. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
  20. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
  21. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -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/annotated_commit.h +9 -0
  82. data/vendor/libgit2/include/git2/apply.h +149 -0
  83. data/vendor/libgit2/include/git2/attr.h +20 -13
  84. data/vendor/libgit2/include/git2/blame.h +4 -4
  85. data/vendor/libgit2/include/git2/blob.h +44 -12
  86. data/vendor/libgit2/include/git2/buffer.h +20 -26
  87. data/vendor/libgit2/include/git2/cert.h +135 -0
  88. data/vendor/libgit2/include/git2/checkout.h +53 -21
  89. data/vendor/libgit2/include/git2/cherrypick.h +3 -3
  90. data/vendor/libgit2/include/git2/clone.h +5 -5
  91. data/vendor/libgit2/include/git2/commit.h +25 -3
  92. data/vendor/libgit2/include/git2/common.h +35 -10
  93. data/vendor/libgit2/include/git2/config.h +29 -19
  94. data/vendor/libgit2/include/git2/cred.h +308 -0
  95. data/vendor/libgit2/include/git2/deprecated.h +493 -0
  96. data/vendor/libgit2/include/git2/describe.h +4 -4
  97. data/vendor/libgit2/include/git2/diff.h +177 -135
  98. data/vendor/libgit2/include/git2/errors.h +53 -46
  99. data/vendor/libgit2/include/git2/filter.h +8 -0
  100. data/vendor/libgit2/include/git2/index.h +74 -52
  101. data/vendor/libgit2/include/git2/indexer.h +76 -6
  102. data/vendor/libgit2/include/git2/merge.h +25 -10
  103. data/vendor/libgit2/include/git2/net.h +0 -5
  104. data/vendor/libgit2/include/git2/notes.h +1 -1
  105. data/vendor/libgit2/include/git2/object.h +17 -29
  106. data/vendor/libgit2/include/git2/odb.h +12 -11
  107. data/vendor/libgit2/include/git2/odb_backend.h +10 -9
  108. data/vendor/libgit2/include/git2/oid.h +2 -2
  109. data/vendor/libgit2/include/git2/pack.h +14 -3
  110. data/vendor/libgit2/include/git2/proxy.h +5 -3
  111. data/vendor/libgit2/include/git2/rebase.h +46 -2
  112. data/vendor/libgit2/include/git2/refs.h +34 -16
  113. data/vendor/libgit2/include/git2/remote.h +111 -14
  114. data/vendor/libgit2/include/git2/repository.h +69 -34
  115. data/vendor/libgit2/include/git2/revert.h +1 -1
  116. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  117. data/vendor/libgit2/include/git2/signature.h +2 -2
  118. data/vendor/libgit2/include/git2/stash.h +5 -5
  119. data/vendor/libgit2/include/git2/status.h +26 -17
  120. data/vendor/libgit2/include/git2/submodule.h +23 -6
  121. data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
  122. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  123. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  124. data/vendor/libgit2/include/git2/sys/cred.h +90 -0
  125. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  126. data/vendor/libgit2/include/git2/sys/merge.h +3 -3
  127. data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
  128. data/vendor/libgit2/include/git2/sys/path.h +14 -5
  129. data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
  130. data/vendor/libgit2/include/git2/sys/repository.h +5 -1
  131. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  132. data/vendor/libgit2/include/git2/sys/transport.h +129 -83
  133. data/vendor/libgit2/include/git2/tag.h +13 -4
  134. data/vendor/libgit2/include/git2/trace.h +2 -2
  135. data/vendor/libgit2/include/git2/transport.h +11 -311
  136. data/vendor/libgit2/include/git2/tree.h +4 -4
  137. data/vendor/libgit2/include/git2/types.h +25 -106
  138. data/vendor/libgit2/include/git2/version.h +3 -3
  139. data/vendor/libgit2/include/git2/worktree.h +5 -5
  140. data/vendor/libgit2/include/git2.h +4 -0
  141. data/vendor/libgit2/src/CMakeLists.txt +104 -235
  142. data/vendor/libgit2/src/alloc.c +14 -18
  143. data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
  144. data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
  145. data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
  146. data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
  147. data/vendor/libgit2/src/annotated_commit.c +18 -11
  148. data/vendor/libgit2/src/apply.c +535 -28
  149. data/vendor/libgit2/src/apply.h +3 -1
  150. data/vendor/libgit2/src/array.h +2 -2
  151. data/vendor/libgit2/src/attr.c +77 -71
  152. data/vendor/libgit2/src/attr_file.c +203 -117
  153. data/vendor/libgit2/src/attr_file.h +9 -9
  154. data/vendor/libgit2/src/attrcache.c +49 -51
  155. data/vendor/libgit2/src/attrcache.h +2 -1
  156. data/vendor/libgit2/src/blame.c +38 -18
  157. data/vendor/libgit2/src/blame.h +1 -1
  158. data/vendor/libgit2/src/blame_git.c +29 -15
  159. data/vendor/libgit2/src/blob.c +123 -37
  160. data/vendor/libgit2/src/blob.h +19 -2
  161. data/vendor/libgit2/src/branch.c +47 -23
  162. data/vendor/libgit2/src/buf_text.c +7 -6
  163. data/vendor/libgit2/src/buffer.c +60 -53
  164. data/vendor/libgit2/src/cache.c +38 -45
  165. data/vendor/libgit2/src/cache.h +3 -3
  166. data/vendor/libgit2/src/cc-compat.h +20 -3
  167. data/vendor/libgit2/src/checkout.c +77 -67
  168. data/vendor/libgit2/src/cherrypick.c +12 -6
  169. data/vendor/libgit2/src/clone.c +36 -14
  170. data/vendor/libgit2/src/clone.h +4 -0
  171. data/vendor/libgit2/src/commit.c +103 -48
  172. data/vendor/libgit2/src/commit.h +7 -0
  173. data/vendor/libgit2/src/commit_list.c +36 -78
  174. data/vendor/libgit2/src/commit_list.h +2 -2
  175. data/vendor/libgit2/src/common.h +24 -90
  176. data/vendor/libgit2/src/config.c +203 -176
  177. data/vendor/libgit2/src/config.h +8 -20
  178. data/vendor/libgit2/src/config_backend.h +96 -0
  179. data/vendor/libgit2/src/config_cache.c +41 -35
  180. data/vendor/libgit2/src/config_entries.c +229 -0
  181. data/vendor/libgit2/src/config_entries.h +24 -0
  182. data/vendor/libgit2/src/config_file.c +422 -680
  183. data/vendor/libgit2/src/config_mem.c +220 -0
  184. data/vendor/libgit2/src/config_parse.c +96 -68
  185. data/vendor/libgit2/src/config_parse.h +15 -14
  186. data/vendor/libgit2/src/config_snapshot.c +206 -0
  187. data/vendor/libgit2/src/crlf.c +219 -196
  188. data/vendor/libgit2/src/delta.c +25 -18
  189. data/vendor/libgit2/src/describe.c +42 -41
  190. data/vendor/libgit2/src/diff.c +52 -67
  191. data/vendor/libgit2/src/diff.h +2 -1
  192. data/vendor/libgit2/src/diff_driver.c +44 -46
  193. data/vendor/libgit2/src/diff_file.c +16 -14
  194. data/vendor/libgit2/src/diff_file.h +1 -1
  195. data/vendor/libgit2/src/diff_generate.c +158 -103
  196. data/vendor/libgit2/src/diff_generate.h +3 -3
  197. data/vendor/libgit2/src/diff_parse.c +4 -4
  198. data/vendor/libgit2/src/diff_print.c +34 -22
  199. data/vendor/libgit2/src/diff_stats.c +22 -7
  200. data/vendor/libgit2/src/diff_tform.c +18 -16
  201. data/vendor/libgit2/src/diff_xdiff.c +3 -3
  202. data/vendor/libgit2/src/errors.c +51 -39
  203. data/vendor/libgit2/src/errors.h +81 -0
  204. data/vendor/libgit2/src/features.h.in +9 -3
  205. data/vendor/libgit2/src/fetch.c +8 -3
  206. data/vendor/libgit2/src/fetchhead.c +12 -12
  207. data/vendor/libgit2/src/filebuf.c +28 -32
  208. data/vendor/libgit2/src/filebuf.h +2 -2
  209. data/vendor/libgit2/src/filter.c +47 -33
  210. data/vendor/libgit2/src/filter.h +0 -10
  211. data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
  212. data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
  213. data/vendor/libgit2/src/global.c +35 -55
  214. data/vendor/libgit2/src/global.h +0 -2
  215. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
  216. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
  217. data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
  218. data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
  219. data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
  220. data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
  221. data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
  222. data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
  223. data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
  224. data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
  225. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
  226. data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
  227. data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
  228. data/vendor/libgit2/src/hash/sha1.h +38 -0
  229. data/vendor/libgit2/src/hash.c +61 -0
  230. data/vendor/libgit2/src/hash.h +20 -21
  231. data/vendor/libgit2/src/hashsig.c +5 -5
  232. data/vendor/libgit2/src/idxmap.c +107 -61
  233. data/vendor/libgit2/src/idxmap.h +153 -31
  234. data/vendor/libgit2/src/ignore.c +38 -42
  235. data/vendor/libgit2/src/index.c +264 -199
  236. data/vendor/libgit2/src/index.h +7 -1
  237. data/vendor/libgit2/src/indexer.c +338 -167
  238. data/vendor/libgit2/src/integer.h +71 -26
  239. data/vendor/libgit2/src/iterator.c +134 -62
  240. data/vendor/libgit2/src/iterator.h +15 -0
  241. data/vendor/libgit2/src/mailmap.c +8 -8
  242. data/vendor/libgit2/src/map.h +1 -1
  243. data/vendor/libgit2/src/merge.c +137 -93
  244. data/vendor/libgit2/src/merge_driver.c +11 -11
  245. data/vendor/libgit2/src/merge_file.c +2 -2
  246. data/vendor/libgit2/src/mwindow.c +24 -29
  247. data/vendor/libgit2/src/mwindow.h +4 -4
  248. data/vendor/libgit2/src/net.c +184 -0
  249. data/vendor/libgit2/src/net.h +36 -0
  250. data/vendor/libgit2/src/netops.c +55 -156
  251. data/vendor/libgit2/src/netops.h +3 -23
  252. data/vendor/libgit2/src/notes.c +14 -9
  253. data/vendor/libgit2/src/object.c +120 -69
  254. data/vendor/libgit2/src/object.h +22 -9
  255. data/vendor/libgit2/src/object_api.c +8 -8
  256. data/vendor/libgit2/src/odb.c +111 -88
  257. data/vendor/libgit2/src/odb.h +8 -7
  258. data/vendor/libgit2/src/odb_loose.c +58 -47
  259. data/vendor/libgit2/src/odb_mempack.c +21 -34
  260. data/vendor/libgit2/src/odb_pack.c +17 -13
  261. data/vendor/libgit2/src/offmap.c +53 -35
  262. data/vendor/libgit2/src/offmap.h +108 -21
  263. data/vendor/libgit2/src/oid.c +12 -7
  264. data/vendor/libgit2/src/oidmap.c +49 -47
  265. data/vendor/libgit2/src/oidmap.h +101 -24
  266. data/vendor/libgit2/src/pack-objects.c +87 -86
  267. data/vendor/libgit2/src/pack-objects.h +2 -8
  268. data/vendor/libgit2/src/pack.c +94 -96
  269. data/vendor/libgit2/src/pack.h +16 -18
  270. data/vendor/libgit2/src/parse.c +17 -4
  271. data/vendor/libgit2/src/parse.h +3 -3
  272. data/vendor/libgit2/src/patch.c +3 -3
  273. data/vendor/libgit2/src/patch_generate.c +18 -18
  274. data/vendor/libgit2/src/patch_parse.c +147 -79
  275. data/vendor/libgit2/src/path.c +207 -62
  276. data/vendor/libgit2/src/path.h +14 -0
  277. data/vendor/libgit2/src/pathspec.c +18 -18
  278. data/vendor/libgit2/src/pool.c +26 -22
  279. data/vendor/libgit2/src/pool.h +7 -7
  280. data/vendor/libgit2/src/posix.c +10 -10
  281. data/vendor/libgit2/src/posix.h +12 -1
  282. data/vendor/libgit2/src/proxy.c +8 -3
  283. data/vendor/libgit2/src/push.c +35 -29
  284. data/vendor/libgit2/src/push.h +2 -1
  285. data/vendor/libgit2/src/reader.c +265 -0
  286. data/vendor/libgit2/src/reader.h +107 -0
  287. data/vendor/libgit2/src/rebase.c +97 -38
  288. data/vendor/libgit2/src/refdb.c +15 -3
  289. data/vendor/libgit2/src/refdb_fs.c +318 -222
  290. data/vendor/libgit2/src/reflog.c +13 -15
  291. data/vendor/libgit2/src/refs.c +122 -89
  292. data/vendor/libgit2/src/refs.h +5 -3
  293. data/vendor/libgit2/src/refspec.c +27 -33
  294. data/vendor/libgit2/src/regexp.c +221 -0
  295. data/vendor/libgit2/src/regexp.h +97 -0
  296. data/vendor/libgit2/src/remote.c +229 -178
  297. data/vendor/libgit2/src/remote.h +11 -2
  298. data/vendor/libgit2/src/repository.c +227 -172
  299. data/vendor/libgit2/src/repository.h +52 -40
  300. data/vendor/libgit2/src/reset.c +7 -7
  301. data/vendor/libgit2/src/revert.c +11 -6
  302. data/vendor/libgit2/src/revparse.c +46 -46
  303. data/vendor/libgit2/src/revwalk.c +89 -54
  304. data/vendor/libgit2/src/revwalk.h +20 -0
  305. data/vendor/libgit2/src/settings.c +22 -9
  306. data/vendor/libgit2/src/signature.c +15 -13
  307. data/vendor/libgit2/src/sortedcache.c +22 -36
  308. data/vendor/libgit2/src/sortedcache.h +1 -1
  309. data/vendor/libgit2/src/stash.c +56 -76
  310. data/vendor/libgit2/src/status.c +27 -21
  311. data/vendor/libgit2/src/stream.h +17 -2
  312. data/vendor/libgit2/src/streams/mbedtls.c +100 -80
  313. data/vendor/libgit2/src/streams/mbedtls.h +5 -2
  314. data/vendor/libgit2/src/streams/openssl.c +93 -81
  315. data/vendor/libgit2/src/streams/openssl.h +5 -2
  316. data/vendor/libgit2/src/streams/registry.c +118 -0
  317. data/vendor/libgit2/src/streams/registry.h +19 -0
  318. data/vendor/libgit2/src/streams/socket.c +55 -30
  319. data/vendor/libgit2/src/streams/stransport.c +57 -32
  320. data/vendor/libgit2/src/streams/stransport.h +5 -0
  321. data/vendor/libgit2/src/streams/tls.c +48 -20
  322. data/vendor/libgit2/src/streams/tls.h +12 -4
  323. data/vendor/libgit2/src/strmap.c +47 -74
  324. data/vendor/libgit2/src/strmap.h +108 -33
  325. data/vendor/libgit2/src/submodule.c +190 -169
  326. data/vendor/libgit2/src/submodule.h +1 -1
  327. data/vendor/libgit2/src/sysdir.c +25 -15
  328. data/vendor/libgit2/src/tag.c +39 -26
  329. data/vendor/libgit2/src/tag.h +2 -1
  330. data/vendor/libgit2/src/trace.c +2 -2
  331. data/vendor/libgit2/src/trace.h +2 -2
  332. data/vendor/libgit2/src/trailer.c +46 -32
  333. data/vendor/libgit2/src/transaction.c +30 -29
  334. data/vendor/libgit2/src/transport.c +3 -3
  335. data/vendor/libgit2/src/transports/auth.c +14 -10
  336. data/vendor/libgit2/src/transports/auth.h +10 -3
  337. data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
  338. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  339. data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
  340. data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
  341. data/vendor/libgit2/src/transports/cred.c +24 -24
  342. data/vendor/libgit2/src/transports/git.c +25 -30
  343. data/vendor/libgit2/src/transports/http.c +871 -335
  344. data/vendor/libgit2/src/transports/http.h +2 -0
  345. data/vendor/libgit2/src/transports/local.c +28 -28
  346. data/vendor/libgit2/src/transports/smart.c +64 -46
  347. data/vendor/libgit2/src/transports/smart.h +5 -6
  348. data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
  349. data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
  350. data/vendor/libgit2/src/transports/ssh.c +76 -65
  351. data/vendor/libgit2/src/transports/winhttp.c +328 -319
  352. data/vendor/libgit2/src/tree-cache.c +21 -14
  353. data/vendor/libgit2/src/tree.c +119 -112
  354. data/vendor/libgit2/src/tree.h +1 -0
  355. data/vendor/libgit2/src/unix/map.c +3 -3
  356. data/vendor/libgit2/src/unix/posix.h +1 -11
  357. data/vendor/libgit2/src/userdiff.h +3 -1
  358. data/vendor/libgit2/src/util.c +154 -93
  359. data/vendor/libgit2/src/util.h +19 -23
  360. data/vendor/libgit2/src/vector.c +15 -10
  361. data/vendor/libgit2/src/wildmatch.c +320 -0
  362. data/vendor/libgit2/src/wildmatch.h +23 -0
  363. data/vendor/libgit2/src/win32/dir.c +3 -3
  364. data/vendor/libgit2/src/win32/findfile.c +1 -1
  365. data/vendor/libgit2/src/win32/map.c +9 -11
  366. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  367. data/vendor/libgit2/src/win32/path_w32.c +113 -9
  368. data/vendor/libgit2/src/win32/path_w32.h +18 -29
  369. data/vendor/libgit2/src/win32/posix.h +1 -4
  370. data/vendor/libgit2/src/win32/posix_w32.c +69 -44
  371. data/vendor/libgit2/src/win32/precompiled.h +0 -2
  372. data/vendor/libgit2/src/win32/thread.c +5 -10
  373. data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
  374. data/vendor/libgit2/src/win32/w32_common.h +39 -0
  375. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
  376. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
  377. data/vendor/libgit2/src/win32/w32_stack.c +6 -11
  378. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  379. data/vendor/libgit2/src/win32/w32_util.c +27 -64
  380. data/vendor/libgit2/src/win32/w32_util.h +5 -49
  381. data/vendor/libgit2/src/worktree.c +44 -30
  382. data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
  383. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  384. data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
  385. data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
  386. data/vendor/libgit2/src/zstream.c +4 -4
  387. metadata +115 -38
  388. data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
  389. data/vendor/libgit2/deps/regex/config.h +0 -7
  390. data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
  391. data/vendor/libgit2/deps/regex/regex.c +0 -92
  392. data/vendor/libgit2/deps/regex/regex.h +0 -582
  393. data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
  394. data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
  395. data/vendor/libgit2/deps/regex/regexec.c +0 -4369
  396. data/vendor/libgit2/include/git2/inttypes.h +0 -309
  397. data/vendor/libgit2/include/git2/sys/time.h +0 -31
  398. data/vendor/libgit2/libgit2.pc.in +0 -13
  399. data/vendor/libgit2/src/config_file.h +0 -73
  400. data/vendor/libgit2/src/fnmatch.c +0 -248
  401. data/vendor/libgit2/src/fnmatch.h +0 -48
  402. data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
  403. data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
  404. data/vendor/libgit2/src/streams/curl.c +0 -385
  405. data/vendor/libgit2/src/streams/curl.h +0 -17
  406. /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  407. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
  408. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
  409. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
@@ -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
 
@@ -217,10 +173,22 @@ typedef enum {
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 */
@@ -446,7 +451,7 @@ typedef struct {
446
451
  * @param version The struct version; pass `GIT_DIFF_OPTIONS_VERSION`.
447
452
  * @return Zero on success; -1 on failure.
448
453
  */
449
- GIT_EXTERN(int) git_diff_init_options(
454
+ GIT_EXTERN(int) git_diff_options_init(
450
455
  git_diff_options *opts,
451
456
  unsigned int version);
452
457
 
@@ -457,7 +462,7 @@ GIT_EXTERN(int) git_diff_init_options(
457
462
  * @param progress Goes from 0 to 1 over the diff
458
463
  * @param payload User-specified pointer from foreach function
459
464
  */
460
- typedef int (*git_diff_file_cb)(
465
+ typedef int GIT_CALLBACK(git_diff_file_cb)(
461
466
  const git_diff_delta *delta,
462
467
  float progress,
463
468
  void *payload);
@@ -496,12 +501,21 @@ typedef struct {
496
501
  size_t inflatedlen;
497
502
  } git_diff_binary_file;
498
503
 
499
- /** 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
+ */
500
513
  typedef struct {
501
514
  /**
502
- * Whether there is data in this binary structure or not. If this
503
- * is `1`, then this was produced and included binary content. If
504
- * 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
505
519
  * file changed but without providing the data, probably from a patch
506
520
  * that said `Binary files a/file.txt and b/file.txt differ`.
507
521
  */
@@ -511,16 +525,22 @@ typedef struct {
511
525
  } git_diff_binary;
512
526
 
513
527
  /**
514
- * When iterating over a diff, callback that will be made for
515
- * binary content within the diff.
516
- */
517
- 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)(
518
532
  const git_diff_delta *delta,
519
533
  const git_diff_binary *binary,
520
534
  void *payload);
521
535
 
522
536
  /**
523
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.
524
544
  */
525
545
  typedef struct {
526
546
  int old_start; /**< Starting line number in old_file */
@@ -534,7 +554,7 @@ typedef struct {
534
554
  /**
535
555
  * When iterating over a diff, callback that will be made per hunk.
536
556
  */
537
- typedef int (*git_diff_hunk_cb)(
557
+ typedef int GIT_CALLBACK(git_diff_hunk_cb)(
538
558
  const git_diff_delta *delta,
539
559
  const git_diff_hunk *hunk,
540
560
  void *payload);
@@ -568,6 +588,14 @@ typedef enum {
568
588
 
569
589
  /**
570
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.
571
599
  */
572
600
  typedef struct {
573
601
  char origin; /**< A git_diff_line_t value */
@@ -587,7 +615,7 @@ typedef struct {
587
615
  * of text. This uses some extra GIT_DIFF_LINE_... constants for output
588
616
  * of lines of file and hunk headers.
589
617
  */
590
- typedef int (*git_diff_line_cb)(
618
+ typedef int GIT_CALLBACK(git_diff_line_cb)(
591
619
  const git_diff_delta *delta, /**< delta that contains this data */
592
620
  const git_diff_hunk *hunk, /**< hunk containing this data */
593
621
  const git_diff_line *line, /**< line data */
@@ -671,14 +699,14 @@ typedef enum {
671
699
  * Pluggable similarity metric
672
700
  */
673
701
  typedef struct {
674
- int (*file_signature)(
702
+ int GIT_CALLBACK(file_signature)(
675
703
  void **out, const git_diff_file *file,
676
704
  const char *fullpath, void *payload);
677
- int (*buffer_signature)(
705
+ int GIT_CALLBACK(buffer_signature)(
678
706
  void **out, const git_diff_file *file,
679
707
  const char *buf, size_t buflen, void *payload);
680
- void (*free_signature)(void *sig, void *payload);
681
- 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);
682
710
  void *payload;
683
711
  } git_diff_similarity_metric;
684
712
 
@@ -686,21 +714,6 @@ typedef struct {
686
714
  * Control behavior of rename and copy detection
687
715
  *
688
716
  * These options mostly mimic parameters that can be passed to git-diff.
689
- *
690
- * - `rename_threshold` is the same as the -M option with a value
691
- * - `copy_threshold` is the same as the -C option with a value
692
- * - `rename_from_rewrite_threshold` matches the top of the -B option
693
- * - `break_rewrite_threshold` matches the bottom of the -B option
694
- * - `rename_limit` is the maximum number of matches to consider for
695
- * a particular file. This is a little different from the `-l` option
696
- * to regular Git because we will still process up to this many matches
697
- * before abandoning the search.
698
- *
699
- * The `metric` option allows you to plug in a custom similarity metric.
700
- * Set it to NULL for the default internal metric which is based on sampling
701
- * hashes of ranges of data in the file. The default metric is a pretty
702
- * good similarity approximation that should work fairly well for both text
703
- * and binary data, and is pretty fast with fixed memory overhead.
704
717
  */
705
718
  typedef struct {
706
719
  unsigned int version;
@@ -712,21 +725,49 @@ typedef struct {
712
725
  */
713
726
  uint32_t flags;
714
727
 
715
- /** 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
+ */
716
732
  uint16_t rename_threshold;
717
- /** 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
+ */
718
738
  uint16_t rename_from_rewrite_threshold;
719
- /** 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
+ */
720
744
  uint16_t copy_threshold;
721
- /** 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
+ */
722
750
  uint16_t break_rewrite_threshold;
723
751
 
724
- /** Maximum similarity sources to examine for a file (somewhat like
725
- * 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.
726
758
  */
727
759
  size_t rename_limit;
728
760
 
729
- /** 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
+ */
730
771
  git_diff_similarity_metric *metric;
731
772
  } git_diff_find_options;
732
773
 
@@ -743,7 +784,7 @@ typedef struct {
743
784
  * @param version The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`.
744
785
  * @return Zero on success; -1 on failure.
745
786
  */
746
- GIT_EXTERN(int) git_diff_find_init_options(
787
+ GIT_EXTERN(int) git_diff_find_options_init(
747
788
  git_diff_find_options *opts,
748
789
  unsigned int version);
749
790
 
@@ -782,7 +823,7 @@ GIT_EXTERN(int) git_diff_tree_to_tree(
782
823
  git_repository *repo,
783
824
  git_tree *old_tree,
784
825
  git_tree *new_tree,
785
- const git_diff_options *opts); /**< can be NULL for defaults */
826
+ const git_diff_options *opts);
786
827
 
787
828
  /**
788
829
  * Create a diff between a tree and repository index.
@@ -808,7 +849,7 @@ GIT_EXTERN(int) git_diff_tree_to_index(
808
849
  git_repository *repo,
809
850
  git_tree *old_tree,
810
851
  git_index *index,
811
- const git_diff_options *opts); /**< can be NULL for defaults */
852
+ const git_diff_options *opts);
812
853
 
813
854
  /**
814
855
  * Create a diff between the repository index and the workdir directory.
@@ -834,7 +875,7 @@ GIT_EXTERN(int) git_diff_index_to_workdir(
834
875
  git_diff **diff,
835
876
  git_repository *repo,
836
877
  git_index *index,
837
- const git_diff_options *opts); /**< can be NULL for defaults */
878
+ const git_diff_options *opts);
838
879
 
839
880
  /**
840
881
  * Create a diff between a tree and the working directory.
@@ -863,7 +904,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir(
863
904
  git_diff **diff,
864
905
  git_repository *repo,
865
906
  git_tree *old_tree,
866
- const git_diff_options *opts); /**< can be NULL for defaults */
907
+ const git_diff_options *opts);
867
908
 
868
909
  /**
869
910
  * Create a diff between a tree and the working directory using index data
@@ -882,7 +923,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
882
923
  git_diff **diff,
883
924
  git_repository *repo,
884
925
  git_tree *old_tree,
885
- const git_diff_options *opts); /**< can be NULL for defaults */
926
+ const git_diff_options *opts);
886
927
 
887
928
  /**
888
929
  * Create a diff with the difference between two index objects.
@@ -901,7 +942,7 @@ GIT_EXTERN(int) git_diff_index_to_index(
901
942
  git_repository *repo,
902
943
  git_index *old_index,
903
944
  git_index *new_index,
904
- const git_diff_options *opts); /**< can be NULL for defaults */
945
+ const git_diff_options *opts);
905
946
 
906
947
  /**
907
948
  * Merge one diff into another.
@@ -1052,6 +1093,7 @@ typedef enum {
1052
1093
  GIT_DIFF_FORMAT_RAW = 3u, /**< like git diff --raw */
1053
1094
  GIT_DIFF_FORMAT_NAME_ONLY = 4u, /**< like git diff --name-only */
1054
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 */
1055
1097
  } git_diff_format_t;
1056
1098
 
1057
1099
  /**
@@ -1337,7 +1379,8 @@ typedef enum {
1337
1379
  typedef struct {
1338
1380
  unsigned int version;
1339
1381
 
1340
- git_diff_format_email_flags_t flags;
1382
+ /** see `git_diff_format_email_flags_t` above */
1383
+ uint32_t flags;
1341
1384
 
1342
1385
  /** This patch number */
1343
1386
  size_t patch_no;
@@ -1394,7 +1437,7 @@ GIT_EXTERN(int) git_diff_commit_as_email(
1394
1437
  git_commit *commit,
1395
1438
  size_t patch_no,
1396
1439
  size_t total_patches,
1397
- git_diff_format_email_flags_t flags,
1440
+ uint32_t flags,
1398
1441
  const git_diff_options *diff_opts);
1399
1442
 
1400
1443
  /**
@@ -1407,7 +1450,7 @@ GIT_EXTERN(int) git_diff_commit_as_email(
1407
1450
  * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
1408
1451
  * @return Zero on success; -1 on failure.
1409
1452
  */
1410
- GIT_EXTERN(int) git_diff_format_email_init_options(
1453
+ GIT_EXTERN(int) git_diff_format_email_options_init(
1411
1454
  git_diff_format_email_options *opts,
1412
1455
  unsigned int version);
1413
1456
 
@@ -1415,7 +1458,7 @@ GIT_EXTERN(int) git_diff_format_email_init_options(
1415
1458
  * Patch ID options structure
1416
1459
  *
1417
1460
  * Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can
1418
- * use `git_patchid_init_options`.
1461
+ * use `git_diff_patchid_options_init`.
1419
1462
  *
1420
1463
  */
1421
1464
  typedef struct git_diff_patchid_options {
@@ -1435,7 +1478,7 @@ typedef struct git_diff_patchid_options {
1435
1478
  * @param version The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`.
1436
1479
  * @return Zero on success; -1 on failure.
1437
1480
  */
1438
- GIT_EXTERN(int) git_diff_patchid_init_options(
1481
+ GIT_EXTERN(int) git_diff_patchid_options_init(
1439
1482
  git_diff_patchid_options *opts,
1440
1483
  unsigned int version);
1441
1484
 
@@ -1451,8 +1494,7 @@ GIT_EXTERN(int) git_diff_patchid_init_options(
1451
1494
  * defined in git-patch-id(1), and should in fact generate the
1452
1495
  * same IDs as the upstream git project does.
1453
1496
  *
1454
- * @param out Pointer where the calculated patch ID shoul be
1455
- * stored
1497
+ * @param out Pointer where the calculated patch ID should be stored
1456
1498
  * @param diff The diff to calculate the ID for
1457
1499
  * @param opts Options for how to calculate the patch ID. This is
1458
1500
  * intended for future changes, as currently no options are