rugged 1.1.1 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (407) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -0
  3. data/README.md +1 -1
  4. data/ext/rugged/extconf.rb +2 -2
  5. data/ext/rugged/rugged.c +7 -4
  6. data/ext/rugged/rugged_config.c +7 -2
  7. data/ext/rugged/rugged_object.c +1 -1
  8. data/ext/rugged/rugged_remote.c +17 -0
  9. data/ext/rugged/rugged_repo.c +3 -3
  10. data/lib/rugged/repository.rb +2 -2
  11. data/lib/rugged/version.rb +1 -1
  12. data/vendor/libgit2/CMakeLists.txt +103 -271
  13. data/vendor/libgit2/COPYING +149 -24
  14. data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
  15. data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
  16. data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
  17. data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
  18. data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
  19. data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
  20. data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
  21. data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
  22. data/vendor/libgit2/cmake/FindLibSSH2.cmake +13 -0
  23. data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
  24. data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
  25. data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
  26. data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
  27. data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
  28. data/vendor/libgit2/cmake/Findfutimens.cmake +14 -0
  29. data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
  30. data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
  31. data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
  32. data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
  33. data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
  34. data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
  35. data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -96
  36. data/vendor/libgit2/cmake/SelectHashes.cmake +39 -48
  37. data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
  38. data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
  39. data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
  40. data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
  41. data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +101 -0
  42. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +32 -20
  43. data/vendor/libgit2/deps/ntlmclient/crypt.h +14 -9
  44. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +20 -20
  45. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +3 -3
  46. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +37 -36
  47. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +4 -3
  48. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +178 -51
  49. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +74 -5
  50. data/vendor/libgit2/deps/ntlmclient/ntlm.c +154 -122
  51. data/vendor/libgit2/deps/ntlmclient/ntlm.h +17 -13
  52. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +17 -4
  53. data/vendor/libgit2/deps/ntlmclient/unicode.h +10 -4
  54. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +16 -27
  55. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.h +20 -0
  56. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +28 -52
  57. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.h +22 -0
  58. data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
  59. data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
  60. data/vendor/libgit2/include/git2/apply.h +16 -2
  61. data/vendor/libgit2/include/git2/attr.h +106 -2
  62. data/vendor/libgit2/include/git2/blame.h +97 -43
  63. data/vendor/libgit2/include/git2/blob.h +33 -2
  64. data/vendor/libgit2/include/git2/branch.h +27 -0
  65. data/vendor/libgit2/include/git2/buffer.h +18 -78
  66. data/vendor/libgit2/include/git2/cert.h +43 -6
  67. data/vendor/libgit2/include/git2/checkout.h +32 -13
  68. data/vendor/libgit2/include/git2/clone.h +4 -4
  69. data/vendor/libgit2/include/git2/commit.h +37 -19
  70. data/vendor/libgit2/include/git2/common.h +46 -5
  71. data/vendor/libgit2/include/git2/config.h +19 -3
  72. data/vendor/libgit2/include/git2/credential.h +2 -1
  73. data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
  74. data/vendor/libgit2/include/git2/deprecated.h +326 -6
  75. data/vendor/libgit2/include/git2/describe.h +7 -2
  76. data/vendor/libgit2/include/git2/diff.h +50 -121
  77. data/vendor/libgit2/include/git2/email.h +127 -0
  78. data/vendor/libgit2/include/git2/errors.h +7 -6
  79. data/vendor/libgit2/include/git2/filter.h +69 -18
  80. data/vendor/libgit2/include/git2/graph.h +21 -2
  81. data/vendor/libgit2/include/git2/ignore.h +1 -1
  82. data/vendor/libgit2/include/git2/index.h +13 -7
  83. data/vendor/libgit2/include/git2/indexer.h +19 -0
  84. data/vendor/libgit2/include/git2/merge.h +23 -3
  85. data/vendor/libgit2/include/git2/message.h +2 -0
  86. data/vendor/libgit2/include/git2/notes.h +2 -2
  87. data/vendor/libgit2/include/git2/object.h +23 -0
  88. data/vendor/libgit2/include/git2/odb.h +65 -6
  89. data/vendor/libgit2/include/git2/odb_backend.h +1 -1
  90. data/vendor/libgit2/include/git2/oidarray.h +5 -8
  91. data/vendor/libgit2/include/git2/pack.h +24 -8
  92. data/vendor/libgit2/include/git2/patch.h +16 -0
  93. data/vendor/libgit2/include/git2/pathspec.h +1 -1
  94. data/vendor/libgit2/include/git2/proxy.h +1 -1
  95. data/vendor/libgit2/include/git2/rebase.h +34 -2
  96. data/vendor/libgit2/include/git2/refdb.h +3 -0
  97. data/vendor/libgit2/include/git2/reflog.h +1 -1
  98. data/vendor/libgit2/include/git2/refs.h +8 -4
  99. data/vendor/libgit2/include/git2/remote.h +246 -46
  100. data/vendor/libgit2/include/git2/repository.h +25 -18
  101. data/vendor/libgit2/include/git2/reset.h +2 -2
  102. data/vendor/libgit2/include/git2/revparse.h +5 -5
  103. data/vendor/libgit2/include/git2/revwalk.h +4 -1
  104. data/vendor/libgit2/include/git2/signature.h +1 -1
  105. data/vendor/libgit2/include/git2/stash.h +4 -4
  106. data/vendor/libgit2/include/git2/status.h +124 -62
  107. data/vendor/libgit2/include/git2/stdint.h +3 -3
  108. data/vendor/libgit2/include/git2/submodule.h +16 -2
  109. data/vendor/libgit2/include/git2/sys/commit_graph.h +174 -0
  110. data/vendor/libgit2/include/git2/sys/email.h +45 -0
  111. data/vendor/libgit2/include/git2/sys/filter.h +49 -28
  112. data/vendor/libgit2/include/git2/sys/midx.h +74 -0
  113. data/vendor/libgit2/include/git2/sys/odb_backend.h +9 -5
  114. data/vendor/libgit2/include/git2/sys/remote.h +31 -0
  115. data/vendor/libgit2/include/git2/sys/stream.h +1 -1
  116. data/vendor/libgit2/include/git2/sys/transport.h +26 -34
  117. data/vendor/libgit2/include/git2/tag.h +13 -0
  118. data/vendor/libgit2/include/git2/tree.h +4 -17
  119. data/vendor/libgit2/include/git2/types.h +16 -7
  120. data/vendor/libgit2/include/git2/version.h +4 -4
  121. data/vendor/libgit2/include/git2/worktree.h +13 -2
  122. data/vendor/libgit2/include/git2.h +1 -0
  123. data/vendor/libgit2/src/CMakeLists.txt +192 -290
  124. data/vendor/libgit2/src/alloc.c +21 -8
  125. data/vendor/libgit2/src/allocators/failalloc.c +92 -0
  126. data/vendor/libgit2/src/allocators/failalloc.h +23 -0
  127. data/vendor/libgit2/src/allocators/stdalloc.c +41 -10
  128. data/vendor/libgit2/src/allocators/win32_leakcheck.c +118 -0
  129. data/vendor/libgit2/src/allocators/{win32_crtdbg.h → win32_leakcheck.h} +3 -3
  130. data/vendor/libgit2/src/annotated_commit.c +21 -9
  131. data/vendor/libgit2/src/annotated_commit.h +1 -1
  132. data/vendor/libgit2/src/apply.c +34 -25
  133. data/vendor/libgit2/src/apply.h +2 -2
  134. data/vendor/libgit2/src/array.h +11 -11
  135. data/vendor/libgit2/src/attr.c +204 -82
  136. data/vendor/libgit2/src/attr_file.c +105 -52
  137. data/vendor/libgit2/src/attr_file.h +36 -15
  138. data/vendor/libgit2/src/attrcache.c +55 -45
  139. data/vendor/libgit2/src/attrcache.h +4 -5
  140. data/vendor/libgit2/src/blame.c +15 -9
  141. data/vendor/libgit2/src/blame_git.c +2 -2
  142. data/vendor/libgit2/src/blob.c +76 -52
  143. data/vendor/libgit2/src/blob.h +1 -1
  144. data/vendor/libgit2/src/branch.c +203 -110
  145. data/vendor/libgit2/src/branch.h +15 -3
  146. data/vendor/libgit2/src/buf.c +126 -0
  147. data/vendor/libgit2/src/buf.h +50 -0
  148. data/vendor/libgit2/src/cache.c +2 -2
  149. data/vendor/libgit2/src/cache.h +7 -7
  150. data/vendor/libgit2/src/cc-compat.h +11 -9
  151. data/vendor/libgit2/src/checkout.c +118 -91
  152. data/vendor/libgit2/src/cherrypick.c +16 -12
  153. data/vendor/libgit2/src/clone.c +97 -103
  154. data/vendor/libgit2/src/commit.c +167 -84
  155. data/vendor/libgit2/src/commit.h +24 -1
  156. data/vendor/libgit2/src/commit_graph.c +1224 -0
  157. data/vendor/libgit2/src/commit_graph.h +169 -0
  158. data/vendor/libgit2/src/commit_list.c +48 -3
  159. data/vendor/libgit2/src/commit_list.h +2 -0
  160. data/vendor/libgit2/src/common.h +35 -5
  161. data/vendor/libgit2/src/config.c +119 -64
  162. data/vendor/libgit2/src/config.h +15 -2
  163. data/vendor/libgit2/src/config_cache.c +5 -3
  164. data/vendor/libgit2/src/config_file.c +120 -100
  165. data/vendor/libgit2/src/config_mem.c +9 -9
  166. data/vendor/libgit2/src/config_parse.c +29 -27
  167. data/vendor/libgit2/src/crlf.c +36 -23
  168. data/vendor/libgit2/src/date.c +13 -19
  169. data/vendor/libgit2/src/date.h +33 -0
  170. data/vendor/libgit2/src/delta.c +1 -1
  171. data/vendor/libgit2/src/describe.c +32 -21
  172. data/vendor/libgit2/src/diff.c +71 -183
  173. data/vendor/libgit2/src/diff.h +2 -4
  174. data/vendor/libgit2/src/diff_driver.c +53 -51
  175. data/vendor/libgit2/src/diff_driver.h +3 -3
  176. data/vendor/libgit2/src/diff_file.c +31 -26
  177. data/vendor/libgit2/src/diff_generate.c +76 -23
  178. data/vendor/libgit2/src/diff_generate.h +5 -3
  179. data/vendor/libgit2/src/diff_print.c +120 -95
  180. data/vendor/libgit2/src/diff_stats.c +47 -34
  181. data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
  182. data/vendor/libgit2/src/diff_tform.c +18 -16
  183. data/vendor/libgit2/src/diff_xdiff.c +7 -10
  184. data/vendor/libgit2/src/diff_xdiff.h +1 -1
  185. data/vendor/libgit2/src/email.c +315 -0
  186. data/vendor/libgit2/src/email.h +25 -0
  187. data/vendor/libgit2/src/errors.c +37 -32
  188. data/vendor/libgit2/src/features.h.in +11 -2
  189. data/vendor/libgit2/src/fetch.c +77 -26
  190. data/vendor/libgit2/src/fetch.h +1 -1
  191. data/vendor/libgit2/src/fetchhead.c +27 -23
  192. data/vendor/libgit2/src/filebuf.c +36 -34
  193. data/vendor/libgit2/src/filebuf.h +1 -1
  194. data/vendor/libgit2/src/filter.c +278 -132
  195. data/vendor/libgit2/src/filter.h +46 -6
  196. data/vendor/libgit2/src/fs_path.c +2071 -0
  197. data/vendor/libgit2/src/fs_path.h +772 -0
  198. data/vendor/libgit2/src/futils.c +96 -90
  199. data/vendor/libgit2/src/futils.h +27 -15
  200. data/vendor/libgit2/src/graph.c +64 -9
  201. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +5 -5
  202. data/vendor/libgit2/src/hash/sha1/common_crypto.c +5 -5
  203. data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
  204. data/vendor/libgit2/src/hash/sha1/generic.h +1 -1
  205. data/vendor/libgit2/src/hash/sha1/mbedtls.c +13 -13
  206. data/vendor/libgit2/src/hash/sha1/openssl.c +5 -5
  207. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +9 -11
  208. data/vendor/libgit2/src/hash/sha1/win32.c +21 -17
  209. data/vendor/libgit2/src/hash/sha1.h +3 -1
  210. data/vendor/libgit2/src/hash.c +71 -36
  211. data/vendor/libgit2/src/hash.h +13 -13
  212. data/vendor/libgit2/src/hashsig.c +23 -10
  213. data/vendor/libgit2/src/ident.c +30 -20
  214. data/vendor/libgit2/src/ignore.c +63 -46
  215. data/vendor/libgit2/src/ignore.h +2 -2
  216. data/vendor/libgit2/src/index.c +184 -149
  217. data/vendor/libgit2/src/index.h +7 -4
  218. data/vendor/libgit2/src/indexer.c +143 -89
  219. data/vendor/libgit2/src/integer.h +64 -2
  220. data/vendor/libgit2/src/iterator.c +93 -73
  221. data/vendor/libgit2/src/iterator.h +6 -6
  222. data/vendor/libgit2/src/khash.h +3 -12
  223. data/vendor/libgit2/src/{settings.c → libgit2.c} +165 -56
  224. data/vendor/libgit2/src/libgit2.h +15 -0
  225. data/vendor/libgit2/src/mailmap.c +60 -45
  226. data/vendor/libgit2/src/map.h +3 -3
  227. data/vendor/libgit2/src/merge.c +104 -61
  228. data/vendor/libgit2/src/merge.h +3 -15
  229. data/vendor/libgit2/src/merge_driver.c +21 -15
  230. data/vendor/libgit2/src/merge_file.c +24 -6
  231. data/vendor/libgit2/src/message.c +21 -8
  232. data/vendor/libgit2/src/midx.c +501 -18
  233. data/vendor/libgit2/src/midx.h +29 -2
  234. data/vendor/libgit2/src/mwindow.c +103 -59
  235. data/vendor/libgit2/src/mwindow.h +3 -3
  236. data/vendor/libgit2/src/net.c +405 -71
  237. data/vendor/libgit2/src/net.h +26 -5
  238. data/vendor/libgit2/src/netops.c +7 -5
  239. data/vendor/libgit2/src/netops.h +3 -3
  240. data/vendor/libgit2/src/notes.c +40 -49
  241. data/vendor/libgit2/src/object.c +68 -20
  242. data/vendor/libgit2/src/object.h +1 -1
  243. data/vendor/libgit2/src/odb.c +320 -80
  244. data/vendor/libgit2/src/odb.h +17 -3
  245. data/vendor/libgit2/src/odb_loose.c +96 -86
  246. data/vendor/libgit2/src/odb_mempack.c +19 -6
  247. data/vendor/libgit2/src/odb_pack.c +402 -125
  248. data/vendor/libgit2/src/oid.c +16 -8
  249. data/vendor/libgit2/src/oid.h +15 -0
  250. data/vendor/libgit2/src/oidarray.c +10 -1
  251. data/vendor/libgit2/src/pack-objects.c +90 -69
  252. data/vendor/libgit2/src/pack-objects.h +11 -6
  253. data/vendor/libgit2/src/pack.c +337 -127
  254. data/vendor/libgit2/src/pack.h +25 -7
  255. data/vendor/libgit2/src/patch.c +17 -10
  256. data/vendor/libgit2/src/patch.h +1 -0
  257. data/vendor/libgit2/src/patch_generate.c +29 -13
  258. data/vendor/libgit2/src/patch_generate.h +5 -5
  259. data/vendor/libgit2/src/patch_parse.c +26 -25
  260. data/vendor/libgit2/src/path.c +86 -1768
  261. data/vendor/libgit2/src/path.h +39 -635
  262. data/vendor/libgit2/src/pathspec.c +12 -12
  263. data/vendor/libgit2/src/pathspec.h +2 -2
  264. data/vendor/libgit2/src/pool.c +13 -7
  265. data/vendor/libgit2/src/posix.c +14 -6
  266. data/vendor/libgit2/src/posix.h +1 -0
  267. data/vendor/libgit2/src/pqueue.h +1 -1
  268. data/vendor/libgit2/src/proxy.c +4 -1
  269. data/vendor/libgit2/src/proxy.h +1 -1
  270. data/vendor/libgit2/src/push.c +30 -35
  271. data/vendor/libgit2/src/push.h +4 -16
  272. data/vendor/libgit2/src/rand.c +226 -0
  273. data/vendor/libgit2/src/rand.h +37 -0
  274. data/vendor/libgit2/src/reader.c +18 -14
  275. data/vendor/libgit2/src/reader.h +2 -2
  276. data/vendor/libgit2/src/rebase.c +177 -132
  277. data/vendor/libgit2/src/refdb.c +30 -13
  278. data/vendor/libgit2/src/refdb_fs.c +548 -222
  279. data/vendor/libgit2/src/reflog.c +19 -14
  280. data/vendor/libgit2/src/refs.c +107 -72
  281. data/vendor/libgit2/src/refs.h +2 -2
  282. data/vendor/libgit2/src/refspec.c +53 -38
  283. data/vendor/libgit2/src/refspec.h +5 -2
  284. data/vendor/libgit2/src/regexp.c +1 -1
  285. data/vendor/libgit2/src/remote.c +960 -486
  286. data/vendor/libgit2/src/remote.h +16 -10
  287. data/vendor/libgit2/src/repository.c +702 -422
  288. data/vendor/libgit2/src/repository.h +26 -8
  289. data/vendor/libgit2/src/reset.c +16 -12
  290. data/vendor/libgit2/src/revert.c +16 -12
  291. data/vendor/libgit2/src/revparse.c +66 -48
  292. data/vendor/libgit2/src/revwalk.c +39 -22
  293. data/vendor/libgit2/src/runtime.c +162 -0
  294. data/vendor/libgit2/src/runtime.h +62 -0
  295. data/vendor/libgit2/src/settings.h +11 -0
  296. data/vendor/libgit2/src/signature.c +18 -11
  297. data/vendor/libgit2/src/signature.h +1 -1
  298. data/vendor/libgit2/src/sortedcache.c +1 -1
  299. data/vendor/libgit2/src/sortedcache.h +10 -8
  300. data/vendor/libgit2/src/stash.c +39 -38
  301. data/vendor/libgit2/src/status.c +11 -5
  302. data/vendor/libgit2/src/{buffer.c → str.c} +459 -136
  303. data/vendor/libgit2/src/str.h +357 -0
  304. data/vendor/libgit2/src/strarray.c +2 -1
  305. data/vendor/libgit2/src/streams/mbedtls.c +22 -23
  306. data/vendor/libgit2/src/streams/mbedtls.h +1 -1
  307. data/vendor/libgit2/src/streams/openssl.c +101 -201
  308. data/vendor/libgit2/src/streams/openssl.h +9 -1
  309. data/vendor/libgit2/src/streams/openssl_dynamic.c +309 -0
  310. data/vendor/libgit2/src/streams/openssl_dynamic.h +348 -0
  311. data/vendor/libgit2/src/streams/openssl_legacy.c +203 -0
  312. data/vendor/libgit2/src/streams/openssl_legacy.h +63 -0
  313. data/vendor/libgit2/src/streams/registry.c +5 -6
  314. data/vendor/libgit2/src/streams/socket.c +6 -2
  315. data/vendor/libgit2/src/streams/stransport.c +6 -3
  316. data/vendor/libgit2/src/streams/tls.c +5 -3
  317. data/vendor/libgit2/src/submodule.c +290 -212
  318. data/vendor/libgit2/src/submodule.h +10 -10
  319. data/vendor/libgit2/src/sysdir.c +70 -56
  320. data/vendor/libgit2/src/sysdir.h +15 -10
  321. data/vendor/libgit2/src/tag.c +72 -34
  322. data/vendor/libgit2/src/thread.c +140 -0
  323. data/vendor/libgit2/src/thread.h +479 -0
  324. data/vendor/libgit2/src/threadstate.c +84 -0
  325. data/vendor/libgit2/src/threadstate.h +24 -0
  326. data/vendor/libgit2/src/trace.c +3 -16
  327. data/vendor/libgit2/src/trace.h +17 -30
  328. data/vendor/libgit2/src/trailer.c +2 -2
  329. data/vendor/libgit2/src/transaction.c +20 -9
  330. data/vendor/libgit2/src/transport.c +13 -13
  331. data/vendor/libgit2/src/transports/auth.c +8 -10
  332. data/vendor/libgit2/src/transports/auth.h +2 -3
  333. data/vendor/libgit2/src/transports/auth_negotiate.c +23 -17
  334. data/vendor/libgit2/src/transports/auth_ntlm.c +20 -16
  335. data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
  336. data/vendor/libgit2/src/transports/credential.c +15 -7
  337. data/vendor/libgit2/src/transports/git.c +10 -14
  338. data/vendor/libgit2/src/transports/http.c +56 -34
  339. data/vendor/libgit2/src/transports/http.h +3 -3
  340. data/vendor/libgit2/src/transports/httpclient.c +106 -79
  341. data/vendor/libgit2/src/transports/httpclient.h +1 -1
  342. data/vendor/libgit2/src/transports/local.c +127 -119
  343. data/vendor/libgit2/src/transports/smart.c +61 -144
  344. data/vendor/libgit2/src/transports/smart.h +26 -32
  345. data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
  346. data/vendor/libgit2/src/transports/smart_protocol.c +68 -44
  347. data/vendor/libgit2/src/transports/ssh.c +100 -131
  348. data/vendor/libgit2/src/transports/winhttp.c +86 -82
  349. data/vendor/libgit2/src/tree-cache.c +5 -5
  350. data/vendor/libgit2/src/tree-cache.h +2 -2
  351. data/vendor/libgit2/src/tree.c +150 -116
  352. data/vendor/libgit2/src/tree.h +1 -0
  353. data/vendor/libgit2/src/tsort.c +0 -2
  354. data/vendor/libgit2/src/unix/map.c +3 -3
  355. data/vendor/libgit2/src/unix/posix.h +1 -4
  356. data/vendor/libgit2/src/unix/pthread.h +2 -1
  357. data/vendor/libgit2/src/unix/realpath.c +0 -2
  358. data/vendor/libgit2/src/utf8.c +150 -0
  359. data/vendor/libgit2/src/utf8.h +52 -0
  360. data/vendor/libgit2/src/util.c +68 -144
  361. data/vendor/libgit2/src/util.h +36 -68
  362. data/vendor/libgit2/src/vector.c +23 -19
  363. data/vendor/libgit2/src/vector.h +5 -3
  364. data/vendor/libgit2/src/win32/findfile.c +172 -114
  365. data/vendor/libgit2/src/win32/findfile.h +7 -4
  366. data/vendor/libgit2/src/win32/map.c +1 -1
  367. data/vendor/libgit2/src/win32/msvc-compat.h +9 -1
  368. data/vendor/libgit2/src/win32/path_w32.c +162 -33
  369. data/vendor/libgit2/src/win32/path_w32.h +2 -1
  370. data/vendor/libgit2/src/win32/posix.h +6 -7
  371. data/vendor/libgit2/src/win32/posix_w32.c +26 -33
  372. data/vendor/libgit2/src/win32/precompiled.h +0 -1
  373. data/vendor/libgit2/src/win32/reparse.h +4 -4
  374. data/vendor/libgit2/src/win32/thread.c +24 -15
  375. data/vendor/libgit2/src/win32/thread.h +1 -1
  376. data/vendor/libgit2/src/win32/w32_buffer.c +5 -6
  377. data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
  378. data/vendor/libgit2/src/win32/w32_common.h +18 -9
  379. data/vendor/libgit2/src/win32/{w32_crtdbg_stacktrace.c → w32_leakcheck.c} +269 -33
  380. data/vendor/libgit2/src/win32/w32_leakcheck.h +222 -0
  381. data/vendor/libgit2/src/win32/w32_util.h +6 -6
  382. data/vendor/libgit2/src/worktree.c +138 -105
  383. data/vendor/libgit2/src/worktree.h +1 -1
  384. data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
  385. data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
  386. data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
  387. data/vendor/libgit2/src/xdiff/xemit.c +23 -7
  388. data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
  389. data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
  390. data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
  391. data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
  392. data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
  393. data/vendor/libgit2/src/xdiff/xutils.c +18 -7
  394. data/vendor/libgit2/src/zstream.c +6 -6
  395. data/vendor/libgit2/src/zstream.h +4 -4
  396. metadata +60 -24
  397. data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
  398. data/vendor/libgit2/src/buf_text.c +0 -316
  399. data/vendor/libgit2/src/buf_text.h +0 -122
  400. data/vendor/libgit2/src/buffer.h +0 -222
  401. data/vendor/libgit2/src/global.c +0 -363
  402. data/vendor/libgit2/src/global.h +0 -41
  403. data/vendor/libgit2/src/thread-utils.c +0 -58
  404. data/vendor/libgit2/src/thread-utils.h +0 -369
  405. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -127
  406. data/vendor/libgit2/src/win32/w32_stack.c +0 -188
  407. data/vendor/libgit2/src/win32/w32_stack.h +0 -140
@@ -1,84 +1,85 @@
1
1
  add_library(git2internal OBJECT)
2
2
  set_target_properties(git2internal PROPERTIES C_STANDARD 90)
3
+ set_target_properties(git2internal PROPERTIES C_EXTENSIONS OFF)
3
4
 
4
- IF(DEBUG_POOL)
5
- SET(GIT_DEBUG_POOL 1)
6
- ENDIF()
7
- ADD_FEATURE_INFO(debugpool GIT_DEBUG_POOL "debug pool allocator")
8
5
 
9
- INCLUDE(PkgBuildConfig)
6
+ if(DEPRECATE_HARD)
7
+ add_definitions(-DGIT_DEPRECATE_HARD)
8
+ endif()
9
+
10
+ if(DEBUG_POOL)
11
+ set(GIT_DEBUG_POOL 1)
12
+ endif()
13
+ add_feature_info(debugpool GIT_DEBUG_POOL "debug pool allocator")
14
+
15
+ if(DEBUG_STRICT_ALLOC)
16
+ set(GIT_DEBUG_STRICT_ALLOC 1)
17
+ endif()
18
+ add_feature_info(debugalloc GIT_DEBUG_STRICT_ALLOC "debug strict allocators")
19
+
20
+ if(DEBUG_STRICT_OPEN)
21
+ set(GIT_DEBUG_STRICT_OPEN 1)
22
+ endif()
23
+ add_feature_info(debugopen GIT_DEBUG_STRICT_OPEN "path validation in open")
24
+
25
+
26
+ include(PkgBuildConfig)
27
+ include(SanitizeBool)
10
28
 
11
29
  # This variable will contain the libraries we need to put into
12
30
  # libgit2.pc's Requires.private. That is, what we're linking to or
13
31
  # what someone who's statically linking us needs to link to.
14
- SET(LIBGIT2_PC_REQUIRES "")
32
+ set(LIBGIT2_PC_REQUIRES "")
15
33
  # This will be set later if we use the system's http-parser library or
16
34
  # use iconv (OSX) and will be written to the Libs.private field in the
17
35
  # pc file.
18
- SET(LIBGIT2_PC_LIBS "")
36
+ set(LIBGIT2_PC_LIBS "")
19
37
 
20
- SET(LIBGIT2_INCLUDES
38
+ set(LIBGIT2_INCLUDES
21
39
  "${CMAKE_CURRENT_BINARY_DIR}"
22
- "${libgit2_SOURCE_DIR}/src"
23
- "${libgit2_SOURCE_DIR}/include")
24
- SET(LIBGIT2_SYSTEM_INCLUDES "")
25
- SET(LIBGIT2_LIBS "")
40
+ "${PROJECT_SOURCE_DIR}/src"
41
+ "${PROJECT_SOURCE_DIR}/include")
26
42
 
27
- enable_warnings(missing-declarations)
43
+ if(HAVE_FUTIMENS)
44
+ set(GIT_USE_FUTIMENS 1)
45
+ endif ()
46
+ add_feature_info(futimens GIT_USE_FUTIMENS "futimens support")
28
47
 
29
- # Enable tracing
30
- IF(ENABLE_TRACE)
31
- SET(GIT_TRACE 1)
32
- ENDIF()
33
- ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
34
-
35
- CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
36
- IF (HAVE_FUTIMENS)
37
- SET(GIT_USE_FUTIMENS 1)
38
- ENDIF ()
39
-
40
- CHECK_PROTOTYPE_DEFINITION(qsort_r
48
+ check_prototype_definition(qsort_r
41
49
  "void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
42
- "" "stdlib.h" HAVE_QSORT_R_BSD)
43
- IF (HAVE_QSORT_R_BSD)
44
- target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_BSD)
45
- ENDIF()
50
+ "" "stdlib.h" GIT_QSORT_R_BSD)
46
51
 
47
- CHECK_PROTOTYPE_DEFINITION(qsort_r
52
+ check_prototype_definition(qsort_r
48
53
  "void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)"
49
- "" "stdlib.h" HAVE_QSORT_R_GNU)
50
- IF (HAVE_QSORT_R_GNU)
51
- target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_GNU)
52
- ENDIF()
54
+ "" "stdlib.h" GIT_QSORT_R_GNU)
55
+
56
+ check_function_exists(qsort_s GIT_QSORT_S)
53
57
 
54
- CHECK_FUNCTION_EXISTS(qsort_s HAVE_QSORT_S)
55
- IF (HAVE_QSORT_S)
56
- target_compile_definitions(git2internal PRIVATE HAVE_QSORT_S)
57
- ENDIF ()
58
+ check_function_exists(getentropy GIT_RAND_GETENTROPY)
58
59
 
59
60
  # Find required dependencies
60
61
 
61
- IF(WIN32)
62
- LIST(APPEND LIBGIT2_LIBS ws2_32)
63
- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
64
- LIST(APPEND LIBGIT2_LIBS socket nsl)
65
- LIST(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
66
- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Haiku")
67
- LIST(APPEND LIBGIT2_LIBS network)
68
- LIST(APPEND LIBGIT2_PC_LIBS "-lnetwork")
69
- ENDIF()
70
-
71
- CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" NEED_LIBRT)
72
- IF(NEED_LIBRT)
73
- LIST(APPEND LIBGIT2_LIBS rt)
74
- LIST(APPEND LIBGIT2_PC_LIBS "-lrt")
75
- ENDIF()
76
-
77
- IF(THREADSAFE)
78
- LIST(APPEND LIBGIT2_LIBS ${CMAKE_THREAD_LIBS_INIT})
79
- LIST(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
80
- ENDIF()
81
- ADD_FEATURE_INFO(threadsafe THREADSAFE "threadsafe support")
62
+ if(WIN32)
63
+ list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32)
64
+ elseif(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
65
+ list(APPEND LIBGIT2_SYSTEM_LIBS socket nsl)
66
+ list(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
67
+ elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
68
+ list(APPEND LIBGIT2_SYSTEM_LIBS network)
69
+ list(APPEND LIBGIT2_PC_LIBS "-lnetwork")
70
+ endif()
71
+
72
+ check_library_exists(rt clock_gettime "time.h" NEED_LIBRT)
73
+ if(NEED_LIBRT)
74
+ list(APPEND LIBGIT2_SYSTEM_LIBS rt)
75
+ list(APPEND LIBGIT2_PC_LIBS "-lrt")
76
+ endif()
77
+
78
+ if(USE_THREADS)
79
+ list(APPEND LIBGIT2_SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT})
80
+ list(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
81
+ endif()
82
+ add_feature_info(threadsafe USE_THREADS "threadsafe support")
82
83
 
83
84
 
84
85
  if(WIN32 AND EMBED_SSH_PATH)
@@ -91,201 +92,90 @@ if(WIN32 AND EMBED_SSH_PATH)
91
92
  set(GIT_SSH 1)
92
93
  endif()
93
94
 
94
- IF (WIN32 AND WINHTTP)
95
- SET(GIT_WINHTTP 1)
96
-
97
- # Since MinGW does not come with headers or an import library for winhttp,
98
- # we have to include a private header and generate our own import library
99
- IF (MINGW)
100
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
101
- LIST(APPEND LIBGIT2_LIBS winhttp)
102
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
103
- ELSE()
104
- LIST(APPEND LIBGIT2_LIBS "winhttp")
105
- LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
106
- ENDIF ()
107
-
108
- LIST(APPEND LIBGIT2_LIBS "rpcrt4" "crypt32" "ole32")
109
- LIST(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
110
- ENDIF()
111
-
112
95
  include(SelectHTTPSBackend)
113
96
  include(SelectHashes)
97
+ include(SelectHTTPParser)
98
+ include(SelectRegex)
99
+ include(SelectSSH)
100
+ include(SelectWinHTTP)
101
+ include(SelectZlib)
102
+
103
+
104
+ if(USE_SHA1 STREQUAL "CollisionDetection")
105
+ file(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
106
+ elseif(USE_SHA1 STREQUAL "OpenSSL")
107
+ file(GLOB SRC_SHA1 hash/sha1/openssl.*)
108
+ elseif(USE_SHA1 STREQUAL "CommonCrypto")
109
+ file(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
110
+ elseif(USE_SHA1 STREQUAL "mbedTLS")
111
+ file(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
112
+ elseif(USE_SHA1 STREQUAL "Win32")
113
+ file(GLOB SRC_SHA1 hash/sha1/win32.*)
114
+ elseif(USE_SHA1 STREQUAL "Generic")
115
+ file(GLOB SRC_SHA1 hash/sha1/generic.*)
116
+ endif()
117
+ list(APPEND SRC_SHA1 "hash/sha1.h")
114
118
  target_sources(git2internal PRIVATE ${SRC_SHA1})
115
119
 
116
- # Specify regular expression implementation
117
- FIND_PACKAGE(PCRE)
118
-
119
- IF(REGEX_BACKEND STREQUAL "")
120
- CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
121
-
122
- IF(HAVE_REGCOMP_L)
123
- SET(REGEX_BACKEND "regcomp_l")
124
- ELSEIF(PCRE_FOUND)
125
- SET(REGEX_BACKEND "pcre")
126
- ELSE()
127
- SET(REGEX_BACKEND "builtin")
128
- ENDIF()
129
- ENDIF()
130
-
131
- IF(REGEX_BACKEND STREQUAL "regcomp_l")
132
- ADD_FEATURE_INFO(regex ON "using system regcomp_l")
133
- SET(GIT_REGEX_REGCOMP_L 1)
134
- ELSEIF(REGEX_BACKEND STREQUAL "pcre2")
135
- FIND_PACKAGE(PCRE2)
136
-
137
- IF(NOT PCRE2_FOUND)
138
- MESSAGE(FATAL_ERROR "PCRE2 support was requested but not found")
139
- ENDIF()
140
-
141
- ADD_FEATURE_INFO(regex ON "using system PCRE2")
142
- SET(GIT_REGEX_PCRE2 1)
143
-
144
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE2_INCLUDE_DIRS})
145
- LIST(APPEND LIBGIT2_LIBS ${PCRE2_LIBRARIES})
146
- LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre2-8")
147
- ELSEIF(REGEX_BACKEND STREQUAL "pcre")
148
- ADD_FEATURE_INFO(regex ON "using system PCRE")
149
- SET(GIT_REGEX_PCRE 1)
150
-
151
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
152
- LIST(APPEND LIBGIT2_LIBS ${PCRE_LIBRARIES})
153
- LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre")
154
- ELSEIF(REGEX_BACKEND STREQUAL "regcomp")
155
- ADD_FEATURE_INFO(regex ON "using system regcomp")
156
- SET(GIT_REGEX_REGCOMP 1)
157
- ELSEIF(REGEX_BACKEND STREQUAL "builtin")
158
- ADD_FEATURE_INFO(regex ON "using bundled PCRE")
159
- SET(GIT_REGEX_BUILTIN 1)
160
-
161
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/pcre" "${libgit2_BINARY_DIR}/deps/pcre")
162
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/pcre")
163
- LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:pcre>)
164
- ELSE()
165
- MESSAGE(FATAL_ERROR "The REGEX_BACKEND option provided is not supported")
166
- ENDIF()
167
-
168
- # Optional external dependency: http-parser
169
- IF(USE_HTTP_PARSER STREQUAL "system")
170
- FIND_PACKAGE(HTTP_Parser)
171
-
172
- IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
173
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
174
- LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES})
175
- LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
176
- ADD_FEATURE_INFO(http-parser ON "http-parser support (system)")
177
- ELSE()
178
- MESSAGE(FATAL_ERROR "http-parser support was requested but not found")
179
- ENDIF()
180
- ELSE()
181
- MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
182
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser")
183
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
184
- LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>")
185
- ADD_FEATURE_INFO(http-parser ON "http-parser support (bundled)")
186
- ENDIF()
187
-
188
- # Optional external dependency: zlib
189
- IF(NOT USE_BUNDLED_ZLIB)
190
- FIND_PACKAGE(ZLIB)
191
- IF(ZLIB_FOUND)
192
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
193
- LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
194
- IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
195
- LIST(APPEND LIBGIT2_PC_LIBS "-lz")
196
- ELSE()
197
- LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
198
- ENDIF()
199
- ADD_FEATURE_INFO(zlib ON "using system zlib")
200
- ELSE()
201
- MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )
202
- ENDIF()
203
- ENDIF()
204
- IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
205
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib")
206
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
207
- LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
208
- ADD_FEATURE_INFO(zlib ON "using bundled zlib")
209
- ENDIF()
210
-
211
- # Optional external dependency: libssh2
212
- IF (USE_SSH)
213
- FIND_PKGLIBRARIES(LIBSSH2 libssh2)
214
- ENDIF()
215
- IF (LIBSSH2_FOUND)
216
- SET(GIT_SSH 1)
217
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
218
- LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES})
219
- LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
220
-
221
- CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
222
- IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
223
- SET(GIT_SSH_MEMORY_CREDENTIALS 1)
224
- ENDIF()
225
- ELSE()
226
- MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
227
- ENDIF()
228
- ADD_FEATURE_INFO(SSH GIT_SSH "SSH transport support")
229
-
230
120
  # Optional external dependency: ntlmclient
231
- IF (USE_NTLMCLIENT)
232
- SET(GIT_NTLM 1)
233
- ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/ntlmclient" "${libgit2_BINARY_DIR}/deps/ntlmclient")
234
- LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/ntlmclient")
235
- LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:ntlmclient>")
236
- ENDIF()
237
- ADD_FEATURE_INFO(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
121
+ if(USE_NTLMCLIENT)
122
+ set(GIT_NTLM 1)
123
+ add_subdirectory("${PROJECT_SOURCE_DIR}/deps/ntlmclient" "${PROJECT_BINARY_DIR}/deps/ntlmclient")
124
+ list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/ntlmclient")
125
+ list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:ntlmclient>")
126
+ endif()
127
+ add_feature_info(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
238
128
 
239
129
  # Optional external dependency: GSSAPI
240
130
 
241
- INCLUDE(SelectGSSAPI)
131
+ include(SelectGSSAPI)
242
132
 
243
133
  # Optional external dependency: iconv
244
- IF (USE_ICONV)
245
- FIND_PACKAGE(Iconv)
246
- ENDIF()
247
- IF (ICONV_FOUND)
248
- SET(GIT_USE_ICONV 1)
249
- LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
250
- LIST(APPEND LIBGIT2_LIBS ${ICONV_LIBRARIES})
251
- LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
252
- ENDIF()
253
- ADD_FEATURE_INFO(iconv GIT_USE_ICONV "iconv encoding conversion support")
254
-
255
-
256
- IF (THREADSAFE)
257
- IF (NOT WIN32)
258
- FIND_PACKAGE(Threads REQUIRED)
259
- ENDIF()
260
-
261
- SET(GIT_THREADS 1)
262
- ENDIF()
263
-
264
- IF (USE_NSEC)
265
- SET(GIT_USE_NSEC 1)
266
- ENDIF()
267
-
268
- IF (HAVE_STRUCT_STAT_ST_MTIM)
269
- SET(GIT_USE_STAT_MTIM 1)
270
- ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC)
271
- SET(GIT_USE_STAT_MTIMESPEC 1)
272
- ELSEIF (HAVE_STRUCT_STAT_ST_MTIME_NSEC)
273
- SET(GIT_USE_STAT_MTIME_NSEC 1)
274
- ENDIF()
134
+ if(USE_ICONV)
135
+ find_package(Iconv)
136
+ endif()
137
+ if(ICONV_FOUND)
138
+ set(GIT_USE_ICONV 1)
139
+ list(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
140
+ list(APPEND LIBGIT2_SYSTEM_LIBS ${ICONV_LIBRARIES})
141
+ list(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
142
+ endif()
143
+ add_feature_info(iconv GIT_USE_ICONV "iconv encoding conversion support")
144
+
145
+
146
+ if(USE_THREADS)
147
+ if(NOT WIN32)
148
+ find_package(Threads REQUIRED)
149
+ endif()
150
+
151
+ set(GIT_THREADS 1)
152
+ endif()
153
+
154
+ if(USE_NSEC)
155
+ set(GIT_USE_NSEC 1)
156
+ endif()
157
+
158
+ if(HAVE_STRUCT_STAT_ST_MTIM)
159
+ set(GIT_USE_STAT_MTIM 1)
160
+ elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
161
+ set(GIT_USE_STAT_MTIMESPEC 1)
162
+ elseif(HAVE_STRUCT_STAT_ST_MTIME_NSEC)
163
+ set(GIT_USE_STAT_MTIME_NSEC 1)
164
+ endif()
275
165
 
276
166
  target_compile_definitions(git2internal PRIVATE _FILE_OFFSET_BITS=64)
277
167
 
278
168
  # Collect sourcefiles
279
169
  file(GLOB SRC_H
280
- "${libgit2_SOURCE_DIR}/include/git2.h"
281
- "${libgit2_SOURCE_DIR}/include/git2/*.h"
282
- "${libgit2_SOURCE_DIR}/include/git2/sys/*.h")
170
+ "${PROJECT_SOURCE_DIR}/include/git2.h"
171
+ "${PROJECT_SOURCE_DIR}/include/git2/*.h"
172
+ "${PROJECT_SOURCE_DIR}/include/git2/sys/*.h")
283
173
  list(SORT SRC_H)
284
174
  target_sources(git2internal PRIVATE ${SRC_H})
285
175
 
286
176
  # On Windows use specific platform sources
287
177
  if(WIN32 AND NOT CYGWIN)
288
- SET(WIN_RC "win32/git2.rc")
178
+ set(WIN_RC "win32/git2.rc")
289
179
 
290
180
  file(GLOB SRC_OS win32/*.c win32/*.h)
291
181
  list(SORT SRC_OS)
@@ -298,9 +188,9 @@ else()
298
188
  target_sources(git2internal PRIVATE ${SRC_OS})
299
189
  endif()
300
190
 
301
- IF (USE_LEAK_CHECKER STREQUAL "valgrind")
191
+ if(USE_LEAK_CHECKER STREQUAL "valgrind")
302
192
  target_compile_definitions(git2internal PRIVATE VALGRIND)
303
- ENDIF()
193
+ endif()
304
194
 
305
195
  file(GLOB SRC_GIT2 *.c *.h
306
196
  allocators/*.c allocators/*.h
@@ -310,78 +200,90 @@ file(GLOB SRC_GIT2 *.c *.h
310
200
  list(SORT SRC_GIT2)
311
201
  target_sources(git2internal PRIVATE ${SRC_GIT2})
312
202
 
313
- IF(APPLE)
203
+ if(APPLE)
314
204
  # The old Secure Transport API has been deprecated in macOS 10.15.
315
- SET_SOURCE_FILES_PROPERTIES(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
316
- ENDIF()
205
+ set_source_files_properties(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
206
+ endif()
317
207
 
318
208
  # the xdiff dependency is not (yet) warning-free, disable warnings as
319
209
  # errors for the xdiff sources until we've sorted them out
320
- IF(MSVC)
321
- SET_SOURCE_FILES_PROPERTIES(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
322
- SET_SOURCE_FILES_PROPERTIES(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
323
- ENDIF()
210
+ if(MSVC)
211
+ set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
212
+ set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS -WX-)
213
+ set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS -WX-)
214
+ set_source_files_properties(xdiff/xmerge.c PROPERTIES COMPILE_FLAGS -WX-)
215
+ set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
216
+ set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS -WX-)
217
+ else()
218
+ set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
219
+ set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
220
+ set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
221
+ set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
222
+ set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
223
+ endif()
324
224
 
325
225
  # Determine architecture of the machine
326
- IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
327
- SET(GIT_ARCH_64 1)
328
- ELSEIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
329
- SET(GIT_ARCH_32 1)
330
- ELSEIF (CMAKE_SIZEOF_VOID_P)
331
- MESSAGE(FATAL_ERROR "Unsupported architecture (pointer size is ${CMAKE_SIZEOF_VOID_P} bytes)")
332
- ELSE()
333
- MESSAGE(FATAL_ERROR "Unsupported architecture (CMAKE_SIZEOF_VOID_P is unset)")
334
- ENDIF()
335
-
336
- CONFIGURE_FILE(features.h.in git2/sys/features.h)
337
-
338
- IDE_SPLIT_SOURCES(git2internal)
339
- LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal>)
340
-
341
- TARGET_INCLUDE_DIRECTORIES(git2internal PRIVATE ${LIBGIT2_INCLUDES} PUBLIC ${libgit2_SOURCE_DIR}/include)
342
- TARGET_INCLUDE_DIRECTORIES(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
343
-
344
- SET(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
345
- SET(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
346
- SET(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
347
- SET(LIBGIT2_LIBS ${LIBGIT2_LIBS} PARENT_SCOPE)
348
-
349
- IF(XCODE_VERSION)
226
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
227
+ set(GIT_ARCH_64 1)
228
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
229
+ set(GIT_ARCH_32 1)
230
+ elseif(CMAKE_SIZEOF_VOID_P)
231
+ message(FATAL_ERROR "Unsupported architecture (pointer size is ${CMAKE_SIZEOF_VOID_P} bytes)")
232
+ else()
233
+ message(FATAL_ERROR "Unsupported architecture (CMAKE_SIZEOF_VOID_P is unset)")
234
+ endif()
235
+
236
+ configure_file(features.h.in git2/sys/features.h)
237
+
238
+ ide_split_sources(git2internal)
239
+ list(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal> ${LIBGIT2_DEPENDENCY_OBJECTS})
240
+
241
+ target_include_directories(git2internal PRIVATE ${LIBGIT2_INCLUDES} ${LIBGIT2_DEPENDENCY_INCLUDES} PUBLIC ${PROJECT_SOURCE_DIR}/include)
242
+ target_include_directories(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
243
+
244
+ set(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
245
+ set(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
246
+ set(LIBGIT2_DEPENDENCY_INCLUDES ${LIBGIT2_DEPENDENCY_INCLUDES} PARENT_SCOPE)
247
+ set(LIBGIT2_DEPENDENCY_OBJECTS ${LIBGIT2_DEPENDENCY_OBJECTS} PARENT_SCOPE)
248
+ set(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
249
+ set(LIBGIT2_SYSTEM_LIBS ${LIBGIT2_SYSTEM_LIBS} PARENT_SCOPE)
250
+
251
+ if(XCODE_VERSION)
350
252
  # This is required for Xcode to actually link the libgit2 library
351
253
  # when using only object libraries.
352
- FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.c "")
353
- LIST(APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.c)
354
- ENDIF()
254
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.c "")
255
+ list(APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.c)
256
+ endif()
355
257
 
356
258
  # Compile and link libgit2
357
- ADD_LIBRARY(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
358
- TARGET_LINK_LIBRARIES(git2 ${LIBGIT2_LIBS})
259
+ add_library(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
260
+ target_link_libraries(git2 ${LIBGIT2_SYSTEM_LIBS})
359
261
 
360
- SET_TARGET_PROPERTIES(git2 PROPERTIES C_STANDARD 90)
361
- SET_TARGET_PROPERTIES(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
362
- SET_TARGET_PROPERTIES(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
363
- SET_TARGET_PROPERTIES(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${libgit2_BINARY_DIR})
262
+ set_target_properties(git2 PROPERTIES C_STANDARD 90)
263
+ set_target_properties(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
264
+ set_target_properties(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
265
+ set_target_properties(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
364
266
 
365
267
  # Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240)
366
268
  # Win64+MSVC+static libs = linker error
367
- IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
368
- SET_TARGET_PROPERTIES(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
369
- ENDIF()
269
+ if(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
270
+ set_target_properties(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
271
+ endif()
370
272
 
371
- IDE_SPLIT_SOURCES(git2)
273
+ ide_split_sources(git2)
372
274
 
373
275
  if(SONAME)
374
276
  set_target_properties(git2 PROPERTIES VERSION ${libgit2_VERSION})
375
277
  set_target_properties(git2 PROPERTIES SOVERSION "${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
376
278
  if(LIBGIT2_FILENAME)
377
- target_compile_definitions(git2internal PRIVATE LIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
279
+ target_compile_definitions(git2 PRIVATE LIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
378
280
  set_target_properties(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
379
281
  elseif(DEFINED LIBGIT2_PREFIX)
380
282
  set_target_properties(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
381
283
  endif()
382
284
  endif()
383
285
 
384
- PKG_BUILD_CONFIG(NAME libgit2
286
+ pkg_build_config(NAME libgit2
385
287
  VERSION ${libgit2_VERSION}
386
288
  DESCRIPTION "The git library, take 2"
387
289
  LIBS_SELF git2
@@ -389,17 +291,17 @@ PKG_BUILD_CONFIG(NAME libgit2
389
291
  REQUIRES ${LIBGIT2_PC_REQUIRES}
390
292
  )
391
293
 
392
- IF (MSVC_IDE)
393
- # Precompiled headers
394
- SET_TARGET_PROPERTIES(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
395
- SET_SOURCE_FILES_PROPERTIES(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h")
396
- ENDIF ()
294
+ if(MSVC_IDE)
295
+ # Precompiled headers
296
+ set_target_properties(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
297
+ set_source_files_properties(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h")
298
+ endif()
397
299
 
398
300
  # Install
399
- INSTALL(TARGETS git2
301
+ install(TARGETS git2
400
302
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
401
303
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
402
304
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
403
305
  )
404
- INSTALL(DIRECTORY ${libgit2_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
405
- INSTALL(FILES ${libgit2_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
306
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
307
+ install(FILES ${PROJECT_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -6,16 +6,29 @@
6
6
  */
7
7
 
8
8
  #include "alloc.h"
9
+ #include "runtime.h"
9
10
 
11
+ #include "allocators/failalloc.h"
10
12
  #include "allocators/stdalloc.h"
11
- #include "allocators/win32_crtdbg.h"
12
-
13
- git_allocator git__allocator;
13
+ #include "allocators/win32_leakcheck.h"
14
+
15
+ /* Fail any allocation until git_libgit2_init is called. */
16
+ git_allocator git__allocator = {
17
+ git_failalloc_malloc,
18
+ git_failalloc_calloc,
19
+ git_failalloc_strdup,
20
+ git_failalloc_strndup,
21
+ git_failalloc_substrdup,
22
+ git_failalloc_realloc,
23
+ git_failalloc_reallocarray,
24
+ git_failalloc_mallocarray,
25
+ git_failalloc_free
26
+ };
14
27
 
15
28
  static int setup_default_allocator(void)
16
29
  {
17
- #if defined(GIT_MSVC_CRTDBG)
18
- return git_win32_crtdbg_init_allocator(&git__allocator);
30
+ #if defined(GIT_WIN32_LEAKCHECK)
31
+ return git_win32_leakcheck_init_allocator(&git__allocator);
19
32
  #else
20
33
  return git_stdalloc_init_allocator(&git__allocator);
21
34
  #endif
@@ -24,10 +37,10 @@ static int setup_default_allocator(void)
24
37
  int git_allocator_global_init(void)
25
38
  {
26
39
  /*
27
- * We don't want to overwrite any allocator which has been set before
28
- * the init function is called.
40
+ * We don't want to overwrite any allocator which has been set
41
+ * before the init function is called.
29
42
  */
30
- if (git__allocator.gmalloc != NULL)
43
+ if (git__allocator.gmalloc != git_failalloc_malloc)
31
44
  return 0;
32
45
 
33
46
  return setup_default_allocator();