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
@@ -11,9 +11,7 @@
11
11
  #include <libssh2.h>
12
12
  #endif
13
13
 
14
- #include "global.h"
15
- #include "git2.h"
16
- #include "buffer.h"
14
+ #include "runtime.h"
17
15
  #include "net.h"
18
16
  #include "netops.h"
19
17
  #include "smart.h"
@@ -26,8 +24,6 @@
26
24
 
27
25
  #define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport)
28
26
 
29
- static const char *ssh_prefixes[] = { "ssh://", "ssh+git://", "git+ssh://" };
30
-
31
27
  static const char cmd_uploadpack[] = "git-upload-pack";
32
28
  static const char cmd_receivepack[] = "git-receive-pack";
33
29
 
@@ -37,7 +33,7 @@ typedef struct {
37
33
  LIBSSH2_SESSION *session;
38
34
  LIBSSH2_CHANNEL *channel;
39
35
  const char *cmd;
40
- char *url;
36
+ git_net_url url;
41
37
  unsigned sent_command : 1;
42
38
  } ssh_stream;
43
39
 
@@ -65,42 +61,26 @@ static void ssh_error(LIBSSH2_SESSION *session, const char *errmsg)
65
61
  *
66
62
  * For example: git-upload-pack '/libgit2/libgit2'
67
63
  */
68
- static int gen_proto(git_buf *request, const char *cmd, const char *url)
64
+ static int gen_proto(git_str *request, const char *cmd, git_net_url *url)
69
65
  {
70
66
  const char *repo;
71
- int len;
72
- size_t i;
73
-
74
- for (i = 0; i < ARRAY_SIZE(ssh_prefixes); ++i) {
75
- const char *p = ssh_prefixes[i];
76
67
 
77
- if (!git__prefixcmp(url, p)) {
78
- url = url + strlen(p);
79
- repo = strchr(url, '/');
80
- if (repo && repo[1] == '~')
81
- ++repo;
68
+ repo = url->path;
82
69
 
83
- goto done;
84
- }
85
- }
86
- repo = strchr(url, ':');
87
- if (repo) repo++;
70
+ if (repo && repo[0] == '/' && repo[1] == '~')
71
+ repo++;
88
72
 
89
- done:
90
- if (!repo) {
73
+ if (!repo || !repo[0]) {
91
74
  git_error_set(GIT_ERROR_NET, "malformed git protocol URL");
92
75
  return -1;
93
76
  }
94
77
 
95
- len = strlen(cmd) + 1 /* Space */ + 1 /* Quote */ + strlen(repo) + 1 /* Quote */ + 1;
78
+ git_str_puts(request, cmd);
79
+ git_str_puts(request, " '");
80
+ git_str_puts(request, repo);
81
+ git_str_puts(request, "'");
96
82
 
97
- git_buf_grow(request, len);
98
- git_buf_puts(request, cmd);
99
- git_buf_puts(request, " '");
100
- git_buf_decode_percent(request, repo, strlen(repo));
101
- git_buf_puts(request, "'");
102
-
103
- if (git_buf_oom(request))
83
+ if (git_str_oom(request))
104
84
  return -1;
105
85
 
106
86
  return 0;
@@ -109,9 +89,9 @@ done:
109
89
  static int send_command(ssh_stream *s)
110
90
  {
111
91
  int error;
112
- git_buf request = GIT_BUF_INIT;
92
+ git_str request = GIT_STR_INIT;
113
93
 
114
- error = gen_proto(&request, s->cmd, s->url);
94
+ error = gen_proto(&request, s->cmd, &s->url);
115
95
  if (error < 0)
116
96
  goto cleanup;
117
97
 
@@ -124,7 +104,7 @@ static int send_command(ssh_stream *s)
124
104
  s->sent_command = 1;
125
105
 
126
106
  cleanup:
127
- git_buf_dispose(&request);
107
+ git_str_dispose(&request);
128
108
  return error;
129
109
  }
130
110
 
@@ -226,19 +206,18 @@ static void ssh_stream_free(git_smart_subtransport_stream *stream)
226
206
  s->io = NULL;
227
207
  }
228
208
 
229
- git__free(s->url);
209
+ git_net_url_dispose(&s->url);
230
210
  git__free(s);
231
211
  }
232
212
 
233
213
  static int ssh_stream_alloc(
234
214
  ssh_subtransport *t,
235
- const char *url,
236
215
  const char *cmd,
237
216
  git_smart_subtransport_stream **stream)
238
217
  {
239
218
  ssh_stream *s;
240
219
 
241
- assert(stream);
220
+ GIT_ASSERT_ARG(stream);
242
221
 
243
222
  s = git__calloc(sizeof(ssh_stream), 1);
244
223
  GIT_ERROR_CHECK_ALLOC(s);
@@ -250,47 +229,10 @@ static int ssh_stream_alloc(
250
229
 
251
230
  s->cmd = cmd;
252
231
 
253
- s->url = git__strdup(url);
254
- if (!s->url) {
255
- git__free(s);
256
- return -1;
257
- }
258
-
259
232
  *stream = &s->parent;
260
233
  return 0;
261
234
  }
262
235
 
263
- static int git_ssh_extract_url_parts(
264
- git_net_url *urldata,
265
- const char *url)
266
- {
267
- char *colon, *at;
268
- const char *start;
269
-
270
- colon = strchr(url, ':');
271
-
272
-
273
- at = strchr(url, '@');
274
- if (at) {
275
- start = at + 1;
276
- urldata->username = git__substrdup(url, at - url);
277
- GIT_ERROR_CHECK_ALLOC(urldata->username);
278
- } else {
279
- start = url;
280
- urldata->username = NULL;
281
- }
282
-
283
- if (colon == NULL || (colon < start)) {
284
- git_error_set(GIT_ERROR_NET, "malformed URL");
285
- return -1;
286
- }
287
-
288
- urldata->host = git__substrdup(start, colon - start);
289
- GIT_ERROR_CHECK_ALLOC(urldata->host);
290
-
291
- return 0;
292
- }
293
-
294
236
  static int ssh_agent_auth(LIBSSH2_SESSION *session, git_credential_ssh_key *c) {
295
237
  int rc = LIBSSH2_ERROR_NONE;
296
238
 
@@ -404,8 +346,8 @@ static int _git_ssh_authenticate_session(
404
346
  case GIT_CREDENTIAL_SSH_MEMORY: {
405
347
  git_credential_ssh_key *c = (git_credential_ssh_key *)cred;
406
348
 
407
- assert(c->username);
408
- assert(c->privatekey);
349
+ GIT_ASSERT(c->username);
350
+ GIT_ASSERT(c->privatekey);
409
351
 
410
352
  rc = libssh2_userauth_publickey_frommemory(
411
353
  session,
@@ -443,11 +385,15 @@ static int request_creds(git_credential **out, ssh_subtransport *t, const char *
443
385
  int error, no_callback = 0;
444
386
  git_credential *cred = NULL;
445
387
 
446
- if (!t->owner->cred_acquire_cb) {
388
+ if (!t->owner->connect_opts.callbacks.credentials) {
447
389
  no_callback = 1;
448
390
  } else {
449
- error = t->owner->cred_acquire_cb(&cred, t->owner->url, user, auth_methods,
450
- t->owner->cred_acquire_payload);
391
+ error = t->owner->connect_opts.callbacks.credentials(
392
+ &cred,
393
+ t->owner->url,
394
+ user,
395
+ auth_methods,
396
+ t->owner->connect_opts.callbacks.payload);
451
397
 
452
398
  if (error == GIT_PASSTHROUGH) {
453
399
  no_callback = 1;
@@ -461,13 +407,13 @@ static int request_creds(git_credential **out, ssh_subtransport *t, const char *
461
407
 
462
408
  if (no_callback) {
463
409
  git_error_set(GIT_ERROR_SSH, "authentication required but no callback set");
464
- return -1;
410
+ return GIT_EAUTH;
465
411
  }
466
412
 
467
413
  if (!(cred->credtype & auth_methods)) {
468
414
  cred->free(cred);
469
- git_error_set(GIT_ERROR_SSH, "callback returned unsupported credentials type");
470
- return -1;
415
+ git_error_set(GIT_ERROR_SSH, "authentication callback returned unsupported credentials type");
416
+ return GIT_EAUTH;
471
417
  }
472
418
 
473
419
  *out = cred;
@@ -476,14 +422,14 @@ static int request_creds(git_credential **out, ssh_subtransport *t, const char *
476
422
  }
477
423
 
478
424
  static int _git_ssh_session_create(
479
- LIBSSH2_SESSION** session,
425
+ LIBSSH2_SESSION **session,
480
426
  git_stream *io)
481
427
  {
482
428
  int rc = 0;
483
- LIBSSH2_SESSION* s;
429
+ LIBSSH2_SESSION *s;
484
430
  git_socket_stream *socket = GIT_CONTAINER_OF(io, git_socket_stream, parent);
485
431
 
486
- assert(session);
432
+ GIT_ASSERT_ARG(session);
487
433
 
488
434
  s = libssh2_session_init();
489
435
  if (!s) {
@@ -516,56 +462,80 @@ static int _git_ssh_setup_conn(
516
462
  const char *cmd,
517
463
  git_smart_subtransport_stream **stream)
518
464
  {
519
- git_net_url urldata = GIT_NET_URL_INIT;
520
465
  int auth_methods, error = 0;
521
- size_t i;
522
466
  ssh_stream *s;
523
467
  git_credential *cred = NULL;
524
- LIBSSH2_SESSION* session=NULL;
525
- LIBSSH2_CHANNEL* channel=NULL;
468
+ LIBSSH2_SESSION *session=NULL;
469
+ LIBSSH2_CHANNEL *channel=NULL;
526
470
 
527
471
  t->current_stream = NULL;
528
472
 
529
473
  *stream = NULL;
530
- if (ssh_stream_alloc(t, url, cmd, stream) < 0)
474
+ if (ssh_stream_alloc(t, cmd, stream) < 0)
531
475
  return -1;
532
476
 
533
477
  s = (ssh_stream *)*stream;
534
478
  s->session = NULL;
535
479
  s->channel = NULL;
536
480
 
537
- for (i = 0; i < ARRAY_SIZE(ssh_prefixes); ++i) {
538
- const char *p = ssh_prefixes[i];
481
+ if (git_net_str_is_url(url))
482
+ error = git_net_url_parse(&s->url, url);
483
+ else
484
+ error = git_net_url_parse_scp(&s->url, url);
539
485
 
540
- if (!git__prefixcmp(url, p)) {
541
- if ((error = git_net_url_parse(&urldata, url)) < 0)
542
- goto done;
543
-
544
- goto post_extract;
545
- }
546
- }
547
- if ((error = git_ssh_extract_url_parts(&urldata, url)) < 0)
486
+ if (error < 0)
548
487
  goto done;
549
488
 
550
- if (urldata.port == NULL)
551
- urldata.port = git__strdup(SSH_DEFAULT_PORT);
552
-
553
- GIT_ERROR_CHECK_ALLOC(urldata.port);
554
-
555
- post_extract:
556
- if ((error = git_socket_stream_new(&s->io, urldata.host, urldata.port)) < 0 ||
489
+ if ((error = git_socket_stream_new(&s->io, s->url.host, s->url.port)) < 0 ||
557
490
  (error = git_stream_connect(s->io)) < 0)
558
491
  goto done;
559
492
 
560
493
  if ((error = _git_ssh_session_create(&session, s->io)) < 0)
561
494
  goto done;
562
495
 
563
- if (t->owner->certificate_check_cb != NULL) {
496
+ if (t->owner->connect_opts.callbacks.certificate_check != NULL) {
564
497
  git_cert_hostkey cert = {{ 0 }}, *cert_ptr;
565
498
  const char *key;
499
+ size_t cert_len;
500
+ int cert_type;
566
501
 
567
502
  cert.parent.cert_type = GIT_CERT_HOSTKEY_LIBSSH2;
568
503
 
504
+ key = libssh2_session_hostkey(session, &cert_len, &cert_type);
505
+ if (key != NULL) {
506
+ cert.type |= GIT_CERT_SSH_RAW;
507
+ cert.hostkey = key;
508
+ cert.hostkey_len = cert_len;
509
+ switch (cert_type) {
510
+ case LIBSSH2_HOSTKEY_TYPE_RSA:
511
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_RSA;
512
+ break;
513
+ case LIBSSH2_HOSTKEY_TYPE_DSS:
514
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_DSS;
515
+ break;
516
+
517
+ #ifdef LIBSSH2_HOSTKEY_TYPE_ECDSA_256
518
+ case LIBSSH2_HOSTKEY_TYPE_ECDSA_256:
519
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_256;
520
+ break;
521
+ case LIBSSH2_HOSTKEY_TYPE_ECDSA_384:
522
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_384;
523
+ break;
524
+ case LIBSSH2_KNOWNHOST_KEY_ECDSA_521:
525
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_521;
526
+ break;
527
+ #endif
528
+
529
+ #ifdef LIBSSH2_HOSTKEY_TYPE_ED25519
530
+ case LIBSSH2_HOSTKEY_TYPE_ED25519:
531
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_KEY_ED25519;
532
+ break;
533
+ #endif
534
+ default:
535
+ cert.raw_type = GIT_CERT_SSH_RAW_TYPE_UNKNOWN;
536
+ }
537
+ }
538
+
569
539
  #ifdef LIBSSH2_HOSTKEY_HASH_SHA256
570
540
  key = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA256);
571
541
  if (key != NULL) {
@@ -597,7 +567,11 @@ post_extract:
597
567
 
598
568
  cert_ptr = &cert;
599
569
 
600
- error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, urldata.host, t->owner->message_cb_payload);
570
+ error = t->owner->connect_opts.callbacks.certificate_check(
571
+ (git_cert *)cert_ptr,
572
+ 0,
573
+ s->url.host,
574
+ t->owner->connect_opts.callbacks.payload);
601
575
 
602
576
  if (error < 0 && error != GIT_PASSTHROUGH) {
603
577
  if (!git_error_last())
@@ -608,21 +582,21 @@ post_extract:
608
582
  }
609
583
 
610
584
  /* we need the username to ask for auth methods */
611
- if (!urldata.username) {
585
+ if (!s->url.username) {
612
586
  if ((error = request_creds(&cred, t, NULL, GIT_CREDENTIAL_USERNAME)) < 0)
613
587
  goto done;
614
588
 
615
- urldata.username = git__strdup(((git_credential_username *) cred)->username);
589
+ s->url.username = git__strdup(((git_credential_username *) cred)->username);
616
590
  cred->free(cred);
617
591
  cred = NULL;
618
- if (!urldata.username)
592
+ if (!s->url.username)
619
593
  goto done;
620
- } else if (urldata.username && urldata.password) {
621
- if ((error = git_credential_userpass_plaintext_new(&cred, urldata.username, urldata.password)) < 0)
594
+ } else if (s->url.username && s->url.password) {
595
+ if ((error = git_credential_userpass_plaintext_new(&cred, s->url.username, s->url.password)) < 0)
622
596
  goto done;
623
597
  }
624
598
 
625
- if ((error = list_auth_methods(&auth_methods, session, urldata.username)) < 0)
599
+ if ((error = list_auth_methods(&auth_methods, session, s->url.username)) < 0)
626
600
  goto done;
627
601
 
628
602
  error = GIT_EAUTH;
@@ -636,10 +610,10 @@ post_extract:
636
610
  cred = NULL;
637
611
  }
638
612
 
639
- if ((error = request_creds(&cred, t, urldata.username, auth_methods)) < 0)
613
+ if ((error = request_creds(&cred, t, s->url.username, auth_methods)) < 0)
640
614
  goto done;
641
615
 
642
- if (strcmp(urldata.username, git_credential_get_username(cred))) {
616
+ if (strcmp(s->url.username, git_credential_get_username(cred))) {
643
617
  git_error_set(GIT_ERROR_SSH, "username does not match previous request");
644
618
  error = -1;
645
619
  goto done;
@@ -649,7 +623,7 @@ post_extract:
649
623
 
650
624
  if (error == GIT_EAUTH) {
651
625
  /* refresh auth methods */
652
- if ((error = list_auth_methods(&auth_methods, session, urldata.username)) < 0)
626
+ if ((error = list_auth_methods(&auth_methods, session, s->url.username)) < 0)
653
627
  goto done;
654
628
  else
655
629
  error = GIT_EAUTH;
@@ -684,8 +658,6 @@ done:
684
658
  if (cred)
685
659
  cred->free(cred);
686
660
 
687
- git_net_url_dispose(&urldata);
688
-
689
661
  return error;
690
662
  }
691
663
 
@@ -772,7 +744,7 @@ static int _ssh_close(git_smart_subtransport *subtransport)
772
744
  {
773
745
  ssh_subtransport *t = GIT_CONTAINER_OF(subtransport, ssh_subtransport, parent);
774
746
 
775
- assert(!t->current_stream);
747
+ GIT_ASSERT(!t->current_stream);
776
748
 
777
749
  GIT_UNUSED(t);
778
750
 
@@ -783,8 +755,6 @@ static void _ssh_free(git_smart_subtransport *subtransport)
783
755
  {
784
756
  ssh_subtransport *t = GIT_CONTAINER_OF(subtransport, ssh_subtransport, parent);
785
757
 
786
- assert(!t->current_stream);
787
-
788
758
  git__free(t->cmd_uploadpack);
789
759
  git__free(t->cmd_receivepack);
790
760
  git__free(t);
@@ -805,7 +775,7 @@ static int list_auth_methods(int *out, LIBSSH2_SESSION *session, const char *use
805
775
  /* either error, or the remote accepts NONE auth, which is bizarre, let's punt */
806
776
  if (list == NULL && !libssh2_userauth_authenticated(session)) {
807
777
  ssh_error(session, "Failed to retrieve list of SSH authentication methods");
808
- return -1;
778
+ return GIT_EAUTH;
809
779
  }
810
780
 
811
781
  ptr = list;
@@ -835,7 +805,7 @@ static int list_auth_methods(int *out, LIBSSH2_SESSION *session, const char *use
835
805
  continue;
836
806
  }
837
807
 
838
- /* Skipt it if we don't know it */
808
+ /* Skip it if we don't know it */
839
809
  ptr = strchr(ptr, ',');
840
810
  }
841
811
 
@@ -849,7 +819,7 @@ int git_smart_subtransport_ssh(
849
819
  #ifdef GIT_SSH
850
820
  ssh_subtransport *t;
851
821
 
852
- assert(out);
822
+ GIT_ASSERT_ARG(out);
853
823
 
854
824
  GIT_UNUSED(param);
855
825
 
@@ -867,7 +837,7 @@ int git_smart_subtransport_ssh(
867
837
  GIT_UNUSED(owner);
868
838
  GIT_UNUSED(param);
869
839
 
870
- assert(out);
840
+ GIT_ASSERT_ARG(out);
871
841
  *out = NULL;
872
842
 
873
843
  git_error_set(GIT_ERROR_INVALID, "cannot create SSH transport. Library was built without SSH support");
@@ -911,7 +881,7 @@ int git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *p
911
881
  GIT_UNUSED(owner);
912
882
  GIT_UNUSED(payload);
913
883
 
914
- assert(out);
884
+ GIT_ASSERT_ARG(out);
915
885
  *out = NULL;
916
886
 
917
887
  git_error_set(GIT_ERROR_INVALID, "cannot create SSH transport. Library was built without SSH support");
@@ -934,8 +904,7 @@ int git_transport_ssh_global_init(void)
934
904
  return -1;
935
905
  }
936
906
 
937
- git__on_shutdown(shutdown_ssh);
938
- return 0;
907
+ return git_runtime_shutdown_register(shutdown_ssh);
939
908
 
940
909
  #else
941
910