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
@@ -10,7 +10,7 @@
10
10
  #include "git2/config.h"
11
11
  #include "git2/sys/config.h"
12
12
 
13
- #include "buf_text.h"
13
+ #include "buf.h"
14
14
  #include "config_backend.h"
15
15
  #include "regexp.h"
16
16
  #include "sysdir.h"
@@ -108,7 +108,8 @@ int git_config_add_file_ondisk(
108
108
  struct stat st;
109
109
  int res;
110
110
 
111
- assert(cfg && path);
111
+ GIT_ASSERT_ARG(cfg);
112
+ GIT_ASSERT_ARG(path);
112
113
 
113
114
  res = p_stat(path, &st);
114
115
  if (res < 0 && errno != ENOENT && errno != ENOTDIR) {
@@ -316,7 +317,8 @@ int git_config_add_backend(
316
317
  backend_internal *internal;
317
318
  int result;
318
319
 
319
- assert(cfg && backend);
320
+ GIT_ASSERT_ARG(cfg);
321
+ GIT_ASSERT_ARG(backend);
320
322
 
321
323
  GIT_ERROR_CHECK_VERSION(backend, GIT_CONFIG_BACKEND_VERSION, "git_config_backend");
322
324
 
@@ -510,11 +512,12 @@ int git_config_backend_foreach_match(
510
512
  void *payload)
511
513
  {
512
514
  git_config_entry *entry;
513
- git_config_iterator* iter;
515
+ git_config_iterator *iter;
514
516
  git_regexp regex;
515
517
  int error = 0;
516
518
 
517
- assert(backend && cb);
519
+ GIT_ASSERT_ARG(backend);
520
+ GIT_ASSERT_ARG(cb);
518
521
 
519
522
  if (regexp && git_regexp_compile(&regex, regexp, 0) < 0)
520
523
  return -1;
@@ -846,7 +849,40 @@ static int is_readonly(const git_config *cfg)
846
849
  return 1;
847
850
  }
848
851
 
849
- int git_config_get_path(git_buf *out, const git_config *cfg, const char *name)
852
+ static int git_config__parse_path(git_str *out, const char *value)
853
+ {
854
+ GIT_ASSERT_ARG(out);
855
+ GIT_ASSERT_ARG(value);
856
+
857
+ if (value[0] == '~') {
858
+ if (value[1] != '\0' && value[1] != '/') {
859
+ git_error_set(GIT_ERROR_CONFIG, "retrieving a homedir by name is not supported");
860
+ return -1;
861
+ }
862
+
863
+ return git_sysdir_expand_global_file(out, value[1] ? &value[2] : NULL);
864
+ }
865
+
866
+ return git_str_sets(out, value);
867
+ }
868
+
869
+ int git_config_parse_path(git_buf *out, const char *value)
870
+ {
871
+ GIT_BUF_WRAP_PRIVATE(out, git_config__parse_path, value);
872
+ }
873
+
874
+ int git_config_get_path(
875
+ git_buf *out,
876
+ const git_config *cfg,
877
+ const char *name)
878
+ {
879
+ GIT_BUF_WRAP_PRIVATE(out, git_config__get_path, cfg, name);
880
+ }
881
+
882
+ int git_config__get_path(
883
+ git_str *out,
884
+ const git_config *cfg,
885
+ const char *name)
850
886
  {
851
887
  git_config_entry *entry;
852
888
  int error;
@@ -854,7 +890,7 @@ int git_config_get_path(git_buf *out, const git_config *cfg, const char *name)
854
890
  if ((error = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0)
855
891
  return error;
856
892
 
857
- error = git_config_parse_path(out, entry->value);
893
+ error = git_config__parse_path(out, entry->value);
858
894
  git_config_entry_free(entry);
859
895
 
860
896
  return error;
@@ -881,18 +917,25 @@ int git_config_get_string(
881
917
 
882
918
  int git_config_get_string_buf(
883
919
  git_buf *out, const git_config *cfg, const char *name)
920
+ {
921
+ GIT_BUF_WRAP_PRIVATE(out, git_config__get_string_buf, cfg, name);
922
+ }
923
+
924
+ int git_config__get_string_buf(
925
+ git_str *out, const git_config *cfg, const char *name)
884
926
  {
885
927
  git_config_entry *entry;
886
928
  int ret;
887
929
  const char *str;
888
930
 
889
- git_buf_sanitize(out);
931
+ GIT_ASSERT_ARG(out);
932
+ GIT_ASSERT_ARG(cfg);
890
933
 
891
934
  ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS);
892
935
  str = !ret ? (entry->value ? entry->value : "") : NULL;
893
936
 
894
937
  if (str)
895
- ret = git_buf_puts(out, str);
938
+ ret = git_str_puts(out, str);
896
939
 
897
940
  git_config_entry_free(entry);
898
941
 
@@ -1084,87 +1127,116 @@ void git_config_iterator_free(git_config_iterator *iter)
1084
1127
 
1085
1128
  int git_config_find_global(git_buf *path)
1086
1129
  {
1087
- git_buf_sanitize(path);
1130
+ GIT_BUF_WRAP_PRIVATE(path, git_sysdir_find_global_file, GIT_CONFIG_FILENAME_GLOBAL);
1131
+ }
1132
+
1133
+ int git_config__find_global(git_str *path)
1134
+ {
1088
1135
  return git_sysdir_find_global_file(path, GIT_CONFIG_FILENAME_GLOBAL);
1089
1136
  }
1090
1137
 
1091
1138
  int git_config_find_xdg(git_buf *path)
1092
1139
  {
1093
- git_buf_sanitize(path);
1140
+ GIT_BUF_WRAP_PRIVATE(path, git_sysdir_find_global_file, GIT_CONFIG_FILENAME_XDG);
1141
+ }
1142
+
1143
+ int git_config__find_xdg(git_str *path)
1144
+ {
1094
1145
  return git_sysdir_find_xdg_file(path, GIT_CONFIG_FILENAME_XDG);
1095
1146
  }
1096
1147
 
1097
1148
  int git_config_find_system(git_buf *path)
1098
1149
  {
1099
- git_buf_sanitize(path);
1150
+ GIT_BUF_WRAP_PRIVATE(path, git_sysdir_find_global_file, GIT_CONFIG_FILENAME_SYSTEM);
1151
+ }
1152
+
1153
+ int git_config__find_system(git_str *path)
1154
+ {
1100
1155
  return git_sysdir_find_system_file(path, GIT_CONFIG_FILENAME_SYSTEM);
1101
1156
  }
1102
1157
 
1103
1158
  int git_config_find_programdata(git_buf *path)
1104
1159
  {
1105
- int ret;
1160
+ git_str str = GIT_STR_INIT;
1161
+ int error;
1106
1162
 
1107
- git_buf_sanitize(path);
1108
- ret = git_sysdir_find_programdata_file(path,
1109
- GIT_CONFIG_FILENAME_PROGRAMDATA);
1110
- if (ret != GIT_OK)
1111
- return ret;
1163
+ if ((error = git_buf_tostr(&str, path)) == 0 &&
1164
+ (error = git_config__find_programdata(&str)) == 0)
1165
+ error = git_buf_fromstr(path, &str);
1166
+
1167
+ git_str_dispose(&str);
1168
+ return error;
1169
+ }
1170
+
1171
+ int git_config__find_programdata(git_str *path)
1172
+ {
1173
+ bool is_safe;
1174
+
1175
+ if (git_sysdir_find_programdata_file(path, GIT_CONFIG_FILENAME_PROGRAMDATA) < 0 ||
1176
+ git_fs_path_owner_is_system_or_current_user(&is_safe, path->ptr) < 0)
1177
+ return -1;
1178
+
1179
+ if (!is_safe) {
1180
+ git_error_set(GIT_ERROR_CONFIG, "programdata path has invalid ownership");
1181
+ return -1;
1182
+ }
1112
1183
 
1113
- return git_path_validate_system_file_ownership(path->ptr);
1184
+ return 0;
1114
1185
  }
1115
1186
 
1116
- int git_config__global_location(git_buf *buf)
1187
+ int git_config__global_location(git_str *buf)
1117
1188
  {
1118
- const git_buf *paths;
1189
+ const git_str *paths;
1119
1190
  const char *sep, *start;
1120
1191
 
1121
1192
  if (git_sysdir_get(&paths, GIT_SYSDIR_GLOBAL) < 0)
1122
1193
  return -1;
1123
1194
 
1124
1195
  /* no paths, so give up */
1125
- if (!paths || !git_buf_len(paths))
1196
+ if (!paths || !git_str_len(paths))
1126
1197
  return -1;
1127
1198
 
1128
1199
  /* find unescaped separator or end of string */
1129
- for (sep = start = git_buf_cstr(paths); *sep; ++sep) {
1200
+ for (sep = start = git_str_cstr(paths); *sep; ++sep) {
1130
1201
  if (*sep == GIT_PATH_LIST_SEPARATOR &&
1131
1202
  (sep <= start || sep[-1] != '\\'))
1132
1203
  break;
1133
1204
  }
1134
1205
 
1135
- if (git_buf_set(buf, start, (size_t)(sep - start)) < 0)
1206
+ if (git_str_set(buf, start, (size_t)(sep - start)) < 0)
1136
1207
  return -1;
1137
1208
 
1138
- return git_buf_joinpath(buf, buf->ptr, GIT_CONFIG_FILENAME_GLOBAL);
1209
+ return git_str_joinpath(buf, buf->ptr, GIT_CONFIG_FILENAME_GLOBAL);
1139
1210
  }
1140
1211
 
1141
1212
  int git_config_open_default(git_config **out)
1142
1213
  {
1143
1214
  int error;
1144
1215
  git_config *cfg = NULL;
1145
- git_buf buf = GIT_BUF_INIT;
1216
+ git_str buf = GIT_STR_INIT;
1146
1217
 
1147
1218
  if ((error = git_config_new(&cfg)) < 0)
1148
1219
  return error;
1149
1220
 
1150
- if (!git_config_find_global(&buf) || !git_config__global_location(&buf)) {
1221
+ if (!git_config__find_global(&buf) ||
1222
+ !git_config__global_location(&buf)) {
1151
1223
  error = git_config_add_file_ondisk(cfg, buf.ptr,
1152
1224
  GIT_CONFIG_LEVEL_GLOBAL, NULL, 0);
1153
1225
  }
1154
1226
 
1155
- if (!error && !git_config_find_xdg(&buf))
1227
+ if (!error && !git_config__find_xdg(&buf))
1156
1228
  error = git_config_add_file_ondisk(cfg, buf.ptr,
1157
1229
  GIT_CONFIG_LEVEL_XDG, NULL, 0);
1158
1230
 
1159
- if (!error && !git_config_find_system(&buf))
1231
+ if (!error && !git_config__find_system(&buf))
1160
1232
  error = git_config_add_file_ondisk(cfg, buf.ptr,
1161
1233
  GIT_CONFIG_LEVEL_SYSTEM, NULL, 0);
1162
1234
 
1163
- if (!error && !git_config_find_programdata(&buf))
1235
+ if (!error && !git_config__find_programdata(&buf))
1164
1236
  error = git_config_add_file_ondisk(cfg, buf.ptr,
1165
1237
  GIT_CONFIG_LEVEL_PROGRAMDATA, NULL, 0);
1166
1238
 
1167
- git_buf_dispose(&buf);
1239
+ git_str_dispose(&buf);
1168
1240
 
1169
1241
  if (error) {
1170
1242
  git_config_free(cfg);
@@ -1182,7 +1254,7 @@ int git_config_lock(git_transaction **out, git_config *cfg)
1182
1254
  git_config_backend *backend;
1183
1255
  backend_internal *internal;
1184
1256
 
1185
- assert(cfg);
1257
+ GIT_ASSERT_ARG(cfg);
1186
1258
 
1187
1259
  internal = git_vector_get(&cfg->backends, 0);
1188
1260
  if (!internal || !internal->backend) {
@@ -1202,7 +1274,7 @@ int git_config_unlock(git_config *cfg, int commit)
1202
1274
  git_config_backend *backend;
1203
1275
  backend_internal *internal;
1204
1276
 
1205
- assert(cfg);
1277
+ GIT_ASSERT_ARG(cfg);
1206
1278
 
1207
1279
  internal = git_vector_get(&cfg->backends, 0);
1208
1280
  if (!internal || !internal->backend) {
@@ -1358,24 +1430,6 @@ fail_parse:
1358
1430
  return -1;
1359
1431
  }
1360
1432
 
1361
- int git_config_parse_path(git_buf *out, const char *value)
1362
- {
1363
- assert(out && value);
1364
-
1365
- git_buf_sanitize(out);
1366
-
1367
- if (value[0] == '~') {
1368
- if (value[1] != '\0' && value[1] != '/') {
1369
- git_error_set(GIT_ERROR_CONFIG, "retrieving a homedir by name is not supported");
1370
- return -1;
1371
- }
1372
-
1373
- return git_sysdir_expand_global_file(out, value[1] ? &value[2] : NULL);
1374
- }
1375
-
1376
- return git_buf_sets(out, value);
1377
- }
1378
-
1379
1433
  static int normalize_section(char *start, char *end)
1380
1434
  {
1381
1435
  char *scan;
@@ -1405,7 +1459,8 @@ int git_config__normalize_name(const char *in, char **out)
1405
1459
  {
1406
1460
  char *name, *fdot, *ldot;
1407
1461
 
1408
- assert(in && out);
1462
+ GIT_ASSERT_ARG(in);
1463
+ GIT_ASSERT_ARG(out);
1409
1464
 
1410
1465
  name = git__strdup(in);
1411
1466
  GIT_ERROR_CHECK_ALLOC(name);
@@ -1437,7 +1492,7 @@ invalid:
1437
1492
 
1438
1493
  struct rename_data {
1439
1494
  git_config *config;
1440
- git_buf *name;
1495
+ git_str *name;
1441
1496
  size_t old_len;
1442
1497
  };
1443
1498
 
@@ -1447,15 +1502,15 @@ static int rename_config_entries_cb(
1447
1502
  {
1448
1503
  int error = 0;
1449
1504
  struct rename_data *data = (struct rename_data *)payload;
1450
- size_t base_len = git_buf_len(data->name);
1505
+ size_t base_len = git_str_len(data->name);
1451
1506
 
1452
1507
  if (base_len > 0 &&
1453
- !(error = git_buf_puts(data->name, entry->name + data->old_len)))
1508
+ !(error = git_str_puts(data->name, entry->name + data->old_len)))
1454
1509
  {
1455
1510
  error = git_config_set_string(
1456
- data->config, git_buf_cstr(data->name), entry->value);
1511
+ data->config, git_str_cstr(data->name), entry->value);
1457
1512
 
1458
- git_buf_truncate(data->name, base_len);
1513
+ git_str_truncate(data->name, base_len);
1459
1514
  }
1460
1515
 
1461
1516
  if (!error)
@@ -1470,13 +1525,13 @@ int git_config_rename_section(
1470
1525
  const char *new_section_name)
1471
1526
  {
1472
1527
  git_config *config;
1473
- git_buf pattern = GIT_BUF_INIT, replace = GIT_BUF_INIT;
1528
+ git_str pattern = GIT_STR_INIT, replace = GIT_STR_INIT;
1474
1529
  int error = 0;
1475
1530
  struct rename_data data;
1476
1531
 
1477
- git_buf_text_puts_escape_regex(&pattern, old_section_name);
1532
+ git_str_puts_escape_regex(&pattern, old_section_name);
1478
1533
 
1479
- if ((error = git_buf_puts(&pattern, "\\..+")) < 0)
1534
+ if ((error = git_str_puts(&pattern, "\\..+")) < 0)
1480
1535
  goto cleanup;
1481
1536
 
1482
1537
  if ((error = git_repository_config__weakptr(&config, repo)) < 0)
@@ -1486,7 +1541,7 @@ int git_config_rename_section(
1486
1541
  data.name = &replace;
1487
1542
  data.old_len = strlen(old_section_name) + 1;
1488
1543
 
1489
- if ((error = git_buf_join(&replace, '.', new_section_name, "")) < 0)
1544
+ if ((error = git_str_join(&replace, '.', new_section_name, "")) < 0)
1490
1545
  goto cleanup;
1491
1546
 
1492
1547
  if (new_section_name != NULL &&
@@ -1498,11 +1553,11 @@ int git_config_rename_section(
1498
1553
  }
1499
1554
 
1500
1555
  error = git_config_foreach_match(
1501
- config, git_buf_cstr(&pattern), rename_config_entries_cb, &data);
1556
+ config, git_str_cstr(&pattern), rename_config_entries_cb, &data);
1502
1557
 
1503
1558
  cleanup:
1504
- git_buf_dispose(&pattern);
1505
- git_buf_dispose(&replace);
1559
+ git_str_dispose(&pattern);
1560
+ git_str_dispose(&replace);
1506
1561
 
1507
1562
  return error;
1508
1563
  }
@@ -27,7 +27,12 @@ struct git_config {
27
27
  git_vector backends;
28
28
  };
29
29
 
30
- extern int git_config__global_location(git_buf *buf);
30
+ extern int git_config__global_location(git_str *buf);
31
+
32
+ extern int git_config__find_global(git_str *path);
33
+ extern int git_config__find_xdg(git_str *path);
34
+ extern int git_config__find_system(git_str *path);
35
+ extern int git_config__find_programdata(git_str *path);
31
36
 
32
37
  extern int git_config_rename_section(
33
38
  git_repository *repo,
@@ -51,6 +56,14 @@ extern int git_config__update_entry(
51
56
  bool overwrite_existing,
52
57
  bool only_if_existing);
53
58
 
59
+ int git_config__get_path(
60
+ git_str *out,
61
+ const git_config *cfg,
62
+ const char *name);
63
+
64
+ int git_config__get_string_buf(
65
+ git_str *out, const git_config *cfg, const char *name);
66
+
54
67
  /*
55
68
  * Lookup functions that cannot fail. These functions look up a config
56
69
  * value and return a fallback value if the value is missing or if any
@@ -83,7 +96,7 @@ int git_config_lookup_map_enum(git_configmap_t *type_out,
83
96
  /**
84
97
  * Unlock the backend with the highest priority
85
98
  *
86
- * Unlocking will allow other writers to updat the configuration
99
+ * Unlocking will allow other writers to update the configuration
87
100
  * file. Optionally, any changes performed since the lock will be
88
101
  * applied to the configuration.
89
102
  *
@@ -86,6 +86,7 @@ static struct map_data _configmaps[] = {
86
86
  {"core.protecthfs", NULL, 0, GIT_PROTECTHFS_DEFAULT },
87
87
  {"core.protectntfs", NULL, 0, GIT_PROTECTNTFS_DEFAULT },
88
88
  {"core.fsyncobjectfiles", NULL, 0, GIT_FSYNCOBJECTFILES_DEFAULT },
89
+ {"core.longpaths", NULL, 0, GIT_LONGPATHS_DEFAULT },
89
90
  };
90
91
 
91
92
  int git_config__configmap_lookup(int *out, git_config *config, git_configmap_item item)
@@ -111,20 +112,21 @@ int git_config__configmap_lookup(int *out, git_config *config, git_configmap_ite
111
112
 
112
113
  int git_repository__configmap_lookup(int *out, git_repository *repo, git_configmap_item item)
113
114
  {
114
- intptr_t value = repo->configmap_cache[(int)item];
115
+ intptr_t value = (intptr_t)git_atomic_load(repo->configmap_cache[(int)item]);
115
116
 
116
117
  *out = (int)value;
117
118
 
118
119
  if (value == GIT_CONFIGMAP_NOT_CACHED) {
119
- int error;
120
120
  git_config *config;
121
+ intptr_t oldval = value;
122
+ int error;
121
123
 
122
124
  if ((error = git_repository_config__weakptr(&config, repo)) < 0 ||
123
125
  (error = git_config__configmap_lookup(out, config, item)) < 0)
124
126
  return error;
125
127
 
126
128
  value = *out;
127
- repo->configmap_cache[(int)item] = value;
129
+ git_atomic_compare_and_swap(&repo->configmap_cache[(int)item], (void *)oldval, (void *)value);
128
130
  }
129
131
 
130
132
  return 0;