rugged 1.7.2 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (361) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +1 -0
  4. data/vendor/libgit2/CMakeLists.txt +23 -10
  5. data/vendor/libgit2/COPYING +195 -1
  6. data/vendor/libgit2/cmake/{FindIconv.cmake → FindIntlIconv.cmake} +6 -0
  7. data/vendor/libgit2/cmake/FindLLHTTP.cmake +39 -0
  8. data/vendor/libgit2/cmake/SelectGSSAPI.cmake +1 -1
  9. data/vendor/libgit2/cmake/SelectHTTPParser.cmake +23 -8
  10. data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +17 -8
  11. data/vendor/libgit2/cmake/SelectHashes.cmake +28 -11
  12. data/vendor/libgit2/cmake/SelectRegex.cmake +6 -1
  13. data/vendor/libgit2/cmake/SelectSSH.cmake +22 -17
  14. data/vendor/libgit2/cmake/SelectZlib.cmake +4 -0
  15. data/vendor/libgit2/deps/llhttp/CMakeLists.txt +8 -0
  16. data/vendor/libgit2/deps/llhttp/LICENSE-MIT +22 -0
  17. data/vendor/libgit2/deps/llhttp/api.c +510 -0
  18. data/vendor/libgit2/deps/llhttp/http.c +170 -0
  19. data/vendor/libgit2/deps/llhttp/llhttp.c +10168 -0
  20. data/vendor/libgit2/deps/llhttp/llhttp.h +897 -0
  21. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +1 -1
  22. data/vendor/libgit2/deps/ntlmclient/crypt_builtin_md4.c +311 -0
  23. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +2 -1
  24. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -20
  25. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +4 -4
  26. data/vendor/libgit2/deps/ntlmclient/ntlm.c +21 -21
  27. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +5 -4
  28. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +2 -1
  29. data/vendor/libgit2/deps/ntlmclient/utf8.h +1176 -721
  30. data/vendor/libgit2/deps/ntlmclient/util.h +11 -0
  31. data/vendor/libgit2/deps/pcre/CMakeLists.txt +1 -0
  32. data/vendor/libgit2/deps/xdiff/xmerge.c +2 -2
  33. data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -1
  34. data/vendor/libgit2/deps/zlib/LICENSE +22 -0
  35. data/vendor/libgit2/deps/zlib/adler32.c +5 -27
  36. data/vendor/libgit2/deps/zlib/crc32.c +94 -167
  37. data/vendor/libgit2/deps/zlib/deflate.c +358 -435
  38. data/vendor/libgit2/deps/zlib/deflate.h +41 -10
  39. data/vendor/libgit2/deps/zlib/gzguts.h +13 -18
  40. data/vendor/libgit2/deps/zlib/infback.c +17 -30
  41. data/vendor/libgit2/deps/zlib/inffast.c +1 -4
  42. data/vendor/libgit2/deps/zlib/inffast.h +1 -1
  43. data/vendor/libgit2/deps/zlib/inflate.c +36 -102
  44. data/vendor/libgit2/deps/zlib/inftrees.c +6 -11
  45. data/vendor/libgit2/deps/zlib/inftrees.h +6 -6
  46. data/vendor/libgit2/deps/zlib/trees.c +287 -352
  47. data/vendor/libgit2/deps/zlib/zconf.h +23 -14
  48. data/vendor/libgit2/deps/zlib/zlib.h +202 -202
  49. data/vendor/libgit2/deps/zlib/zutil.c +18 -44
  50. data/vendor/libgit2/deps/zlib/zutil.h +13 -33
  51. data/vendor/libgit2/include/git2/annotated_commit.h +12 -5
  52. data/vendor/libgit2/include/git2/apply.h +27 -6
  53. data/vendor/libgit2/include/git2/attr.h +17 -4
  54. data/vendor/libgit2/include/git2/blame.h +133 -28
  55. data/vendor/libgit2/include/git2/blob.h +71 -28
  56. data/vendor/libgit2/include/git2/branch.h +22 -15
  57. data/vendor/libgit2/include/git2/buffer.h +6 -4
  58. data/vendor/libgit2/include/git2/cert.h +2 -1
  59. data/vendor/libgit2/include/git2/checkout.h +83 -32
  60. data/vendor/libgit2/include/git2/cherrypick.h +10 -3
  61. data/vendor/libgit2/include/git2/clone.h +25 -9
  62. data/vendor/libgit2/include/git2/commit.h +132 -3
  63. data/vendor/libgit2/include/git2/common.h +120 -63
  64. data/vendor/libgit2/include/git2/config.h +93 -23
  65. data/vendor/libgit2/include/git2/credential.h +30 -2
  66. data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
  67. data/vendor/libgit2/include/git2/deprecated.h +133 -3
  68. data/vendor/libgit2/include/git2/describe.h +13 -1
  69. data/vendor/libgit2/include/git2/diff.h +38 -8
  70. data/vendor/libgit2/include/git2/email.h +9 -29
  71. data/vendor/libgit2/include/git2/errors.h +46 -73
  72. data/vendor/libgit2/include/git2/filter.h +14 -7
  73. data/vendor/libgit2/include/git2/global.h +8 -1
  74. data/vendor/libgit2/include/git2/graph.h +3 -2
  75. data/vendor/libgit2/include/git2/ignore.h +10 -0
  76. data/vendor/libgit2/include/git2/index.h +99 -14
  77. data/vendor/libgit2/include/git2/indexer.h +21 -4
  78. data/vendor/libgit2/include/git2/mailmap.h +7 -1
  79. data/vendor/libgit2/include/git2/merge.h +46 -1
  80. data/vendor/libgit2/include/git2/message.h +2 -2
  81. data/vendor/libgit2/include/git2/net.h +3 -1
  82. data/vendor/libgit2/include/git2/notes.h +9 -6
  83. data/vendor/libgit2/include/git2/object.h +9 -8
  84. data/vendor/libgit2/include/git2/odb.h +91 -49
  85. data/vendor/libgit2/include/git2/odb_backend.h +80 -52
  86. data/vendor/libgit2/include/git2/oid.h +23 -24
  87. data/vendor/libgit2/include/git2/oidarray.h +7 -1
  88. data/vendor/libgit2/include/git2/pack.h +13 -1
  89. data/vendor/libgit2/include/git2/patch.h +2 -3
  90. data/vendor/libgit2/include/git2/pathspec.h +9 -0
  91. data/vendor/libgit2/include/git2/proxy.h +10 -0
  92. data/vendor/libgit2/include/git2/rebase.h +9 -6
  93. data/vendor/libgit2/include/git2/refdb.h +2 -2
  94. data/vendor/libgit2/include/git2/reflog.h +3 -2
  95. data/vendor/libgit2/include/git2/refs.h +9 -6
  96. data/vendor/libgit2/include/git2/refspec.h +14 -4
  97. data/vendor/libgit2/include/git2/remote.h +94 -18
  98. data/vendor/libgit2/include/git2/repository.h +57 -21
  99. data/vendor/libgit2/include/git2/reset.h +16 -3
  100. data/vendor/libgit2/include/git2/revert.h +9 -4
  101. data/vendor/libgit2/include/git2/revparse.h +3 -3
  102. data/vendor/libgit2/include/git2/revwalk.h +3 -2
  103. data/vendor/libgit2/include/git2/signature.h +46 -1
  104. data/vendor/libgit2/include/git2/stash.h +17 -3
  105. data/vendor/libgit2/include/git2/status.h +10 -6
  106. data/vendor/libgit2/include/git2/stdint.h +87 -85
  107. data/vendor/libgit2/include/git2/strarray.h +2 -3
  108. data/vendor/libgit2/include/git2/submodule.h +20 -9
  109. data/vendor/libgit2/include/git2/sys/alloc.h +12 -0
  110. data/vendor/libgit2/include/git2/sys/commit.h +77 -3
  111. data/vendor/libgit2/include/git2/sys/commit_graph.h +103 -62
  112. data/vendor/libgit2/include/git2/sys/config.h +80 -4
  113. data/vendor/libgit2/include/git2/sys/credential.h +4 -3
  114. data/vendor/libgit2/include/git2/sys/diff.h +21 -1
  115. data/vendor/libgit2/include/git2/sys/email.h +7 -0
  116. data/vendor/libgit2/include/git2/sys/errors.h +76 -0
  117. data/vendor/libgit2/include/git2/sys/filter.h +66 -3
  118. data/vendor/libgit2/include/git2/sys/hashsig.h +11 -0
  119. data/vendor/libgit2/include/git2/sys/index.h +3 -2
  120. data/vendor/libgit2/include/git2/sys/mempack.h +32 -2
  121. data/vendor/libgit2/include/git2/sys/merge.h +55 -7
  122. data/vendor/libgit2/include/git2/sys/midx.h +43 -4
  123. data/vendor/libgit2/include/git2/sys/odb_backend.h +7 -3
  124. data/vendor/libgit2/include/git2/sys/openssl.h +8 -1
  125. data/vendor/libgit2/include/git2/sys/path.h +12 -1
  126. data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -36
  127. data/vendor/libgit2/include/git2/sys/refs.h +3 -2
  128. data/vendor/libgit2/include/git2/sys/remote.h +8 -1
  129. data/vendor/libgit2/include/git2/sys/repository.h +63 -3
  130. data/vendor/libgit2/include/git2/sys/stream.h +11 -2
  131. data/vendor/libgit2/include/git2/sys/transport.h +24 -3
  132. data/vendor/libgit2/include/git2/tag.h +3 -1
  133. data/vendor/libgit2/include/git2/trace.h +9 -3
  134. data/vendor/libgit2/include/git2/transaction.h +3 -2
  135. data/vendor/libgit2/include/git2/transport.h +11 -3
  136. data/vendor/libgit2/include/git2/tree.h +16 -5
  137. data/vendor/libgit2/include/git2/types.h +19 -3
  138. data/vendor/libgit2/include/git2/version.h +44 -8
  139. data/vendor/libgit2/include/git2/worktree.h +16 -6
  140. data/vendor/libgit2/src/CMakeLists.txt +6 -4
  141. data/vendor/libgit2/src/cli/CMakeLists.txt +2 -2
  142. data/vendor/libgit2/src/cli/cmd.c +1 -1
  143. data/vendor/libgit2/src/cli/cmd.h +4 -0
  144. data/vendor/libgit2/src/cli/cmd_blame.c +287 -0
  145. data/vendor/libgit2/src/cli/cmd_cat_file.c +6 -8
  146. data/vendor/libgit2/src/cli/cmd_clone.c +5 -7
  147. data/vendor/libgit2/src/cli/cmd_config.c +241 -0
  148. data/vendor/libgit2/src/cli/cmd_hash_object.c +6 -8
  149. data/vendor/libgit2/src/cli/cmd_help.c +6 -7
  150. data/vendor/libgit2/src/cli/cmd_index_pack.c +114 -0
  151. data/vendor/libgit2/src/cli/cmd_init.c +102 -0
  152. data/vendor/libgit2/src/cli/common.c +168 -0
  153. data/vendor/libgit2/src/cli/common.h +63 -0
  154. data/vendor/libgit2/src/cli/error.h +1 -1
  155. data/vendor/libgit2/src/cli/main.c +52 -24
  156. data/vendor/libgit2/src/cli/opt.c +29 -3
  157. data/vendor/libgit2/src/cli/opt.h +21 -3
  158. data/vendor/libgit2/src/cli/opt_usage.c +102 -33
  159. data/vendor/libgit2/src/cli/opt_usage.h +6 -1
  160. data/vendor/libgit2/src/cli/progress.c +51 -2
  161. data/vendor/libgit2/src/cli/progress.h +12 -0
  162. data/vendor/libgit2/src/cli/unix/sighandler.c +2 -1
  163. data/vendor/libgit2/src/cli/win32/precompiled.h +1 -1
  164. data/vendor/libgit2/src/cli/win32/sighandler.c +1 -1
  165. data/vendor/libgit2/src/libgit2/CMakeLists.txt +26 -8
  166. data/vendor/libgit2/src/libgit2/apply.c +10 -13
  167. data/vendor/libgit2/src/libgit2/attr.c +30 -13
  168. data/vendor/libgit2/src/libgit2/attr_file.c +7 -2
  169. data/vendor/libgit2/src/libgit2/attr_file.h +2 -0
  170. data/vendor/libgit2/src/libgit2/attrcache.c +69 -33
  171. data/vendor/libgit2/src/libgit2/attrcache.h +5 -9
  172. data/vendor/libgit2/src/libgit2/blame.c +130 -44
  173. data/vendor/libgit2/src/libgit2/blame.h +1 -0
  174. data/vendor/libgit2/src/libgit2/cache.c +22 -17
  175. data/vendor/libgit2/src/libgit2/cache.h +7 -9
  176. data/vendor/libgit2/src/libgit2/checkout.c +34 -24
  177. data/vendor/libgit2/src/libgit2/checkout.h +0 -2
  178. data/vendor/libgit2/src/libgit2/cherrypick.c +1 -2
  179. data/vendor/libgit2/src/libgit2/clone.c +186 -166
  180. data/vendor/libgit2/src/libgit2/clone.h +4 -1
  181. data/vendor/libgit2/src/libgit2/commit.c +92 -0
  182. data/vendor/libgit2/src/libgit2/commit_graph.c +67 -56
  183. data/vendor/libgit2/src/libgit2/commit_graph.h +1 -2
  184. data/vendor/libgit2/src/libgit2/config.c +389 -298
  185. data/vendor/libgit2/src/libgit2/config.cmake.in +3 -0
  186. data/vendor/libgit2/src/libgit2/config.h +9 -4
  187. data/vendor/libgit2/src/libgit2/config_backend.h +8 -10
  188. data/vendor/libgit2/src/libgit2/config_cache.c +4 -5
  189. data/vendor/libgit2/src/libgit2/config_file.c +99 -88
  190. data/vendor/libgit2/src/libgit2/config_list.c +285 -0
  191. data/vendor/libgit2/src/libgit2/config_list.h +32 -0
  192. data/vendor/libgit2/src/libgit2/config_mem.c +194 -40
  193. data/vendor/libgit2/src/libgit2/config_parse.c +10 -9
  194. data/vendor/libgit2/src/libgit2/config_snapshot.c +24 -31
  195. data/vendor/libgit2/src/libgit2/describe.c +24 -24
  196. data/vendor/libgit2/src/libgit2/diff.c +1 -1
  197. data/vendor/libgit2/src/libgit2/diff_driver.c +12 -19
  198. data/vendor/libgit2/src/libgit2/diff_driver.h +2 -2
  199. data/vendor/libgit2/src/libgit2/diff_generate.c +3 -3
  200. data/vendor/libgit2/src/libgit2/diff_parse.c +2 -2
  201. data/vendor/libgit2/src/libgit2/diff_print.c +65 -9
  202. data/vendor/libgit2/src/libgit2/diff_tform.c +36 -8
  203. data/vendor/libgit2/src/libgit2/email.c +1 -0
  204. data/vendor/libgit2/src/libgit2/fetch.c +5 -3
  205. data/vendor/libgit2/src/libgit2/filter.c +5 -5
  206. data/vendor/libgit2/src/libgit2/git2.rc +3 -3
  207. data/vendor/libgit2/src/libgit2/grafts.c +18 -20
  208. data/vendor/libgit2/src/libgit2/grafts.h +0 -1
  209. data/vendor/libgit2/src/libgit2/graph.c +1 -1
  210. data/vendor/libgit2/src/libgit2/hashmap_oid.h +30 -0
  211. data/vendor/libgit2/src/libgit2/ignore.c +9 -5
  212. data/vendor/libgit2/src/libgit2/index.c +68 -90
  213. data/vendor/libgit2/src/libgit2/index.h +2 -2
  214. data/vendor/libgit2/src/libgit2/index_map.c +95 -0
  215. data/vendor/libgit2/src/libgit2/index_map.h +28 -0
  216. data/vendor/libgit2/src/libgit2/indexer.c +34 -38
  217. data/vendor/libgit2/src/libgit2/iterator.c +14 -8
  218. data/vendor/libgit2/src/libgit2/libgit2.c +153 -368
  219. data/vendor/libgit2/src/libgit2/mailmap.c +1 -1
  220. data/vendor/libgit2/src/libgit2/merge.c +42 -37
  221. data/vendor/libgit2/src/libgit2/merge_driver.c +2 -2
  222. data/vendor/libgit2/src/libgit2/midx.c +28 -15
  223. data/vendor/libgit2/src/libgit2/mwindow.c +38 -45
  224. data/vendor/libgit2/src/libgit2/mwindow.h +4 -0
  225. data/vendor/libgit2/src/libgit2/object.c +6 -5
  226. data/vendor/libgit2/src/libgit2/odb.c +5 -4
  227. data/vendor/libgit2/src/libgit2/odb_mempack.c +49 -17
  228. data/vendor/libgit2/src/libgit2/odb_pack.c +13 -5
  229. data/vendor/libgit2/src/libgit2/oid.c +32 -5
  230. data/vendor/libgit2/src/libgit2/oid.h +11 -0
  231. data/vendor/libgit2/src/libgit2/pack-objects.c +58 -31
  232. data/vendor/libgit2/src/libgit2/pack-objects.h +12 -4
  233. data/vendor/libgit2/src/libgit2/pack.c +30 -24
  234. data/vendor/libgit2/src/libgit2/pack.h +15 -10
  235. data/vendor/libgit2/src/libgit2/patch_parse.c +2 -2
  236. data/vendor/libgit2/src/libgit2/path.c +1 -1
  237. data/vendor/libgit2/src/libgit2/pathspec.c +1 -1
  238. data/vendor/libgit2/src/libgit2/push.c +79 -28
  239. data/vendor/libgit2/src/libgit2/push.h +1 -0
  240. data/vendor/libgit2/src/libgit2/refdb_fs.c +128 -61
  241. data/vendor/libgit2/src/libgit2/reflog.c +1 -2
  242. data/vendor/libgit2/src/libgit2/reflog.h +2 -0
  243. data/vendor/libgit2/src/libgit2/refs.c +26 -7
  244. data/vendor/libgit2/src/libgit2/refs.h +6 -1
  245. data/vendor/libgit2/src/libgit2/refspec.c +28 -1
  246. data/vendor/libgit2/src/libgit2/refspec.h +8 -0
  247. data/vendor/libgit2/src/libgit2/remote.c +121 -61
  248. data/vendor/libgit2/src/libgit2/repository.c +231 -51
  249. data/vendor/libgit2/src/libgit2/repository.h +10 -6
  250. data/vendor/libgit2/src/libgit2/revert.c +1 -2
  251. data/vendor/libgit2/src/libgit2/revparse.c +2 -2
  252. data/vendor/libgit2/src/libgit2/revwalk.c +13 -10
  253. data/vendor/libgit2/src/libgit2/revwalk.h +3 -3
  254. data/vendor/libgit2/src/libgit2/settings.c +468 -0
  255. data/vendor/libgit2/src/libgit2/settings.h +6 -2
  256. data/vendor/libgit2/src/libgit2/signature.c +132 -15
  257. data/vendor/libgit2/src/libgit2/signature.h +0 -1
  258. data/vendor/libgit2/src/libgit2/status.c +1 -1
  259. data/vendor/libgit2/src/libgit2/streams/mbedtls.c +54 -60
  260. data/vendor/libgit2/src/libgit2/streams/openssl.c +32 -7
  261. data/vendor/libgit2/src/libgit2/streams/openssl.h +2 -0
  262. data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.c +4 -0
  263. data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.h +3 -0
  264. data/vendor/libgit2/src/libgit2/streams/stransport.c +39 -7
  265. data/vendor/libgit2/src/libgit2/submodule.c +106 -63
  266. data/vendor/libgit2/src/libgit2/submodule.h +6 -7
  267. data/vendor/libgit2/src/libgit2/tag.c +1 -1
  268. data/vendor/libgit2/src/libgit2/trailer.c +6 -6
  269. data/vendor/libgit2/src/libgit2/transaction.c +26 -20
  270. data/vendor/libgit2/src/libgit2/transaction.h +4 -1
  271. data/vendor/libgit2/src/libgit2/transport.c +4 -1
  272. data/vendor/libgit2/src/libgit2/transports/credential.c +1 -1
  273. data/vendor/libgit2/src/libgit2/transports/http.c +1 -2
  274. data/vendor/libgit2/src/libgit2/transports/http.h +0 -10
  275. data/vendor/libgit2/src/libgit2/transports/httpclient.c +112 -72
  276. data/vendor/libgit2/src/libgit2/transports/httpparser.c +128 -0
  277. data/vendor/libgit2/src/libgit2/transports/httpparser.h +99 -0
  278. data/vendor/libgit2/src/libgit2/transports/local.c +8 -7
  279. data/vendor/libgit2/src/libgit2/transports/smart.c +20 -8
  280. data/vendor/libgit2/src/libgit2/transports/smart.h +4 -2
  281. data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +2 -2
  282. data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +55 -10
  283. data/vendor/libgit2/src/libgit2/transports/ssh.c +41 -1103
  284. data/vendor/libgit2/src/libgit2/transports/ssh_exec.c +347 -0
  285. data/vendor/libgit2/src/libgit2/transports/ssh_exec.h +26 -0
  286. data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.c +1126 -0
  287. data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.h +28 -0
  288. data/vendor/libgit2/src/libgit2/transports/winhttp.c +35 -7
  289. data/vendor/libgit2/src/libgit2/tree.c +34 -26
  290. data/vendor/libgit2/src/libgit2/tree.h +3 -2
  291. data/vendor/libgit2/src/libgit2/worktree.c +14 -17
  292. data/vendor/libgit2/src/util/CMakeLists.txt +4 -6
  293. data/vendor/libgit2/src/util/alloc.c +4 -1
  294. data/vendor/libgit2/src/util/allocators/debugalloc.c +73 -0
  295. data/vendor/libgit2/src/{cli/cli.h → util/allocators/debugalloc.h} +6 -9
  296. data/vendor/libgit2/src/util/allocators/stdalloc.c +0 -10
  297. data/vendor/libgit2/src/util/array.h +18 -17
  298. data/vendor/libgit2/src/util/cc-compat.h +2 -0
  299. data/vendor/libgit2/src/util/ctype_compat.h +70 -0
  300. data/vendor/libgit2/src/util/date.c +22 -14
  301. data/vendor/libgit2/src/util/date.h +12 -0
  302. data/vendor/libgit2/src/util/errors.c +401 -0
  303. data/vendor/libgit2/src/{libgit2 → util}/errors.h +21 -17
  304. data/vendor/libgit2/src/util/fs_path.c +15 -4
  305. data/vendor/libgit2/src/util/fs_path.h +23 -0
  306. data/vendor/libgit2/src/util/futils.c +6 -5
  307. data/vendor/libgit2/src/util/futils.h +13 -4
  308. data/vendor/libgit2/src/util/git2_features.h.in +12 -1
  309. data/vendor/libgit2/src/util/git2_util.h +6 -0
  310. data/vendor/libgit2/src/util/hash/openssl.c +152 -0
  311. data/vendor/libgit2/src/util/hash/openssl.h +17 -1
  312. data/vendor/libgit2/src/util/hash/sha.h +4 -1
  313. data/vendor/libgit2/src/util/hashmap.h +424 -0
  314. data/vendor/libgit2/src/util/hashmap_str.h +43 -0
  315. data/vendor/libgit2/src/util/integer.h +3 -1
  316. data/vendor/libgit2/src/util/net.c +13 -7
  317. data/vendor/libgit2/src/util/net.h +2 -0
  318. data/vendor/libgit2/src/util/pool.c +1 -1
  319. data/vendor/libgit2/src/util/pool.h +5 -0
  320. data/vendor/libgit2/src/util/pqueue.h +1 -1
  321. data/vendor/libgit2/src/util/process.h +222 -0
  322. data/vendor/libgit2/src/util/rand.c +1 -7
  323. data/vendor/libgit2/src/util/regexp.c +1 -1
  324. data/vendor/libgit2/src/util/sortedcache.c +14 -13
  325. data/vendor/libgit2/src/util/sortedcache.h +3 -3
  326. data/vendor/libgit2/src/util/str.c +2 -2
  327. data/vendor/libgit2/src/util/strlist.c +108 -0
  328. data/vendor/libgit2/src/util/strlist.h +36 -0
  329. data/vendor/libgit2/src/util/unix/posix.h +0 -2
  330. data/vendor/libgit2/src/util/unix/process.c +629 -0
  331. data/vendor/libgit2/src/util/unix/realpath.c +23 -5
  332. data/vendor/libgit2/src/util/util.c +2 -2
  333. data/vendor/libgit2/src/util/util.h +4 -38
  334. data/vendor/libgit2/src/util/vector.c +3 -3
  335. data/vendor/libgit2/src/util/vector.h +2 -2
  336. data/vendor/libgit2/src/util/win32/posix_w32.c +29 -6
  337. data/vendor/libgit2/src/util/win32/process.c +506 -0
  338. metadata +45 -28
  339. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -6
  340. data/vendor/libgit2/deps/http-parser/COPYING +0 -23
  341. data/vendor/libgit2/deps/http-parser/http_parser.c +0 -2182
  342. data/vendor/libgit2/deps/http-parser/http_parser.h +0 -305
  343. data/vendor/libgit2/deps/zlib/COPYING +0 -27
  344. data/vendor/libgit2/include/git2/sys/reflog.h +0 -21
  345. data/vendor/libgit2/src/libgit2/config_entries.c +0 -237
  346. data/vendor/libgit2/src/libgit2/config_entries.h +0 -24
  347. data/vendor/libgit2/src/libgit2/errors.c +0 -293
  348. data/vendor/libgit2/src/libgit2/idxmap.c +0 -157
  349. data/vendor/libgit2/src/libgit2/idxmap.h +0 -177
  350. data/vendor/libgit2/src/libgit2/libgit2.h +0 -15
  351. data/vendor/libgit2/src/libgit2/offmap.c +0 -101
  352. data/vendor/libgit2/src/libgit2/offmap.h +0 -133
  353. data/vendor/libgit2/src/libgit2/oidmap.c +0 -107
  354. data/vendor/libgit2/src/libgit2/oidmap.h +0 -128
  355. data/vendor/libgit2/src/libgit2/threadstate.c +0 -97
  356. data/vendor/libgit2/src/libgit2/threadstate.h +0 -22
  357. data/vendor/libgit2/src/libgit2/transports/ssh.h +0 -14
  358. data/vendor/libgit2/src/util/khash.h +0 -615
  359. data/vendor/libgit2/src/util/strmap.c +0 -100
  360. data/vendor/libgit2/src/util/strmap.h +0 -131
  361. /data/vendor/libgit2/cmake/{FindHTTPParser.cmake → FindHTTP_Parser.cmake} +0 -0
@@ -12,8 +12,8 @@
12
12
  #include "futils.h"
13
13
  #include "filebuf.h"
14
14
  #include "vector.h"
15
- #include "idxmap.h"
16
15
  #include "tree-cache.h"
16
+ #include "index_map.h"
17
17
  #include "git2/odb.h"
18
18
  #include "git2/index.h"
19
19
 
@@ -30,7 +30,7 @@ struct git_index {
30
30
  unsigned char checksum[GIT_HASH_MAX_SIZE];
31
31
 
32
32
  git_vector entries;
33
- git_idxmap *entries_map;
33
+ git_index_entrymap entries_map;
34
34
 
35
35
  git_vector deleted; /* deleted entries if readers > 0 */
36
36
  git_atomic32 readers; /* number of active iterators */
@@ -0,0 +1,95 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+
8
+ #include "common.h"
9
+ #include "hashmap.h"
10
+ #include "index_map.h"
11
+
12
+ typedef git_index_entrymap git_index_entrymap_default;
13
+ typedef git_index_entrymap git_index_entrymap_icase;
14
+
15
+ /* This is __ac_X31_hash_string but with tolower and it takes the entry's stage into account */
16
+ GIT_INLINE(uint32_t) git_index_entrymap_hash(const git_index_entry *e)
17
+ {
18
+ const char *s = e->path;
19
+ uint32_t h = (uint32_t)git__tolower(*s);
20
+ if (h) {
21
+ for (++s ; *s; ++s)
22
+ h = (h << 5) - h + (uint32_t)git__tolower(*s);
23
+ }
24
+ return h + GIT_INDEX_ENTRY_STAGE(e);
25
+ }
26
+
27
+ #define git_index_entrymap_equal_default(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
28
+ #define git_index_entrymap_equal_icase(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
29
+
30
+ GIT_HASHMAP_FUNCTIONS(git_index_entrymap_default, GIT_HASHMAP_INLINE, git_index_entry *, git_index_entry *, git_index_entrymap_hash, git_index_entrymap_equal_default)
31
+ GIT_HASHMAP_FUNCTIONS(git_index_entrymap_icase, GIT_HASHMAP_INLINE, git_index_entry *, git_index_entry *, git_index_entrymap_hash, git_index_entrymap_equal_icase)
32
+
33
+ int git_index_entrymap_put(git_index_entrymap *map, git_index_entry *e)
34
+ {
35
+ if (map->ignore_case)
36
+ return git_index_entrymap_icase_put((git_index_entrymap_icase *)map, e, e);
37
+ else
38
+ return git_index_entrymap_default_put((git_index_entrymap_default *)map, e, e);
39
+ }
40
+
41
+ int git_index_entrymap_get(git_index_entry **out, git_index_entrymap *map, git_index_entry *e)
42
+ {
43
+ if (map->ignore_case)
44
+ return git_index_entrymap_icase_get(out, (git_index_entrymap_icase *)map, e);
45
+ else
46
+ return git_index_entrymap_default_get(out, (git_index_entrymap_default *)map, e);
47
+ }
48
+
49
+ int git_index_entrymap_remove(git_index_entrymap *map, git_index_entry *e)
50
+ {
51
+ if (map->ignore_case)
52
+ return git_index_entrymap_icase_remove((git_index_entrymap_icase *)map, e);
53
+ else
54
+ return git_index_entrymap_default_remove((git_index_entrymap_default *)map, e);
55
+ }
56
+
57
+ int git_index_entrymap_resize(git_index_entrymap *map, size_t count)
58
+ {
59
+ if (count > UINT32_MAX) {
60
+ git_error_set(GIT_ERROR_INDEX, "index map is out of bounds");
61
+ return -1;
62
+ }
63
+
64
+ if (map->ignore_case)
65
+ return git_index_entrymap_icase__resize((git_index_entrymap_icase *)map, (uint32_t)count);
66
+ else
67
+ return git_index_entrymap_default__resize((git_index_entrymap_default *)map, (uint32_t)count);
68
+ }
69
+
70
+ void git_index_entrymap_swap(git_index_entrymap *a, git_index_entrymap *b)
71
+ {
72
+ git_index_entrymap t;
73
+
74
+ if (a != b) {
75
+ memcpy(&t, a, sizeof(t));
76
+ memcpy(a, b, sizeof(t));
77
+ memcpy(b, &t, sizeof(t));
78
+ }
79
+ }
80
+
81
+ void git_index_entrymap_clear(git_index_entrymap *map)
82
+ {
83
+ if (map->ignore_case)
84
+ git_index_entrymap_icase_clear((git_index_entrymap_icase *)map);
85
+ else
86
+ git_index_entrymap_default_clear((git_index_entrymap_default *)map);
87
+ }
88
+
89
+ void git_index_entrymap_dispose(git_index_entrymap *map)
90
+ {
91
+ if (map->ignore_case)
92
+ git_index_entrymap_icase_dispose((git_index_entrymap_icase *)map);
93
+ else
94
+ git_index_entrymap_default_dispose((git_index_entrymap_default *)map);
95
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (C) the libgit2 contributors. All rights reserved.
3
+ *
4
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
5
+ * a Linking Exception. For full terms see the included COPYING file.
6
+ */
7
+ #ifndef INCLUDE_index_map_h__
8
+ #define INCLUDE_index_map_h__
9
+
10
+ #include "common.h"
11
+ #include "hashmap.h"
12
+
13
+ typedef struct {
14
+ unsigned int ignore_case;
15
+ GIT_HASHMAP_STRUCT_MEMBERS(git_index_entry *, git_index_entry *)
16
+ } git_index_entrymap;
17
+
18
+ #define GIT_INDEX_ENTRYMAP_INIT { 0 }
19
+
20
+ extern int git_index_entrymap_get(git_index_entry **out, git_index_entrymap *map, git_index_entry *e);
21
+ extern int git_index_entrymap_put(git_index_entrymap *map, git_index_entry *e);
22
+ extern int git_index_entrymap_remove(git_index_entrymap *map, git_index_entry *e);
23
+ extern int git_index_entrymap_resize(git_index_entrymap *map, size_t count);
24
+ extern void git_index_entrymap_swap(git_index_entrymap *a, git_index_entrymap *b);
25
+ extern void git_index_entrymap_clear(git_index_entrymap *map);
26
+ extern void git_index_entrymap_dispose(git_index_entrymap *map);
27
+
28
+ #endif
@@ -20,14 +20,16 @@
20
20
  #include "filebuf.h"
21
21
  #include "oid.h"
22
22
  #include "oidarray.h"
23
- #include "oidmap.h"
24
23
  #include "zstream.h"
25
24
  #include "object.h"
25
+ #include "hashmap_oid.h"
26
26
 
27
27
  size_t git_indexer__max_objects = UINT32_MAX;
28
28
 
29
29
  #define UINT31_MAX (0x7FFFFFFF)
30
30
 
31
+ GIT_HASHMAP_OID_SETUP(git_indexer_oidmap, git_oid *);
32
+
31
33
  struct entry {
32
34
  git_oid oid;
33
35
  uint32_t crc;
@@ -63,7 +65,7 @@ struct git_indexer {
63
65
  char objbuf[8*1024];
64
66
 
65
67
  /* OIDs referenced from pack objects. Used for verification. */
66
- git_oidmap *expected_oids;
68
+ git_indexer_oidmap expected_oids;
67
69
 
68
70
  /* Needed to look up objects which we want to inject to fix a thin pack */
69
71
  git_odb *odb;
@@ -169,9 +171,12 @@ static int indexer_new(
169
171
  if (in_opts)
170
172
  memcpy(&opts, in_opts, sizeof(opts));
171
173
 
174
+ if (oid_type)
175
+ GIT_ASSERT_ARG(git_oid_type_is_valid(oid_type));
176
+
172
177
  idx = git__calloc(1, sizeof(git_indexer));
173
178
  GIT_ERROR_CHECK_ALLOC(idx);
174
- idx->oid_type = oid_type;
179
+ idx->oid_type = oid_type ? oid_type : GIT_OID_DEFAULT;
175
180
  idx->odb = odb;
176
181
  idx->progress_cb = opts.progress_cb;
177
182
  idx->progress_payload = opts.progress_cb_payload;
@@ -181,8 +186,7 @@ static int indexer_new(
181
186
  checksum_type = indexer_hash_algorithm(idx);
182
187
 
183
188
  if ((error = git_hash_ctx_init(&idx->hash_ctx, checksum_type)) < 0 ||
184
- (error = git_hash_ctx_init(&idx->trailer, checksum_type)) < 0 ||
185
- (error = git_oidmap_new(&idx->expected_oids)) < 0)
189
+ (error = git_hash_ctx_init(&idx->trailer, checksum_type)) < 0)
186
190
  goto cleanup;
187
191
 
188
192
  idx->do_verify = opts.verify;
@@ -232,13 +236,12 @@ cleanup:
232
236
  int git_indexer_new(
233
237
  git_indexer **out,
234
238
  const char *prefix,
235
- git_oid_t oid_type,
236
239
  git_indexer_options *opts)
237
240
  {
238
241
  return indexer_new(
239
242
  out,
240
243
  prefix,
241
- oid_type,
244
+ opts ? opts->oid_type : 0,
242
245
  opts ? opts->mode : 0,
243
246
  opts ? opts->odb : NULL,
244
247
  opts);
@@ -380,12 +383,12 @@ static int add_expected_oid(git_indexer *idx, const git_oid *oid)
380
383
  * not have to expect it.
381
384
  */
382
385
  if ((!idx->odb || !git_odb_exists(idx->odb, oid)) &&
383
- !git_oidmap_exists(idx->pack->idx_cache, oid) &&
384
- !git_oidmap_exists(idx->expected_oids, oid)) {
386
+ !git_pack_oidmap_contains(&idx->pack->idx_cache, oid) &&
387
+ !git_indexer_oidmap_contains(&idx->expected_oids, oid)) {
385
388
  git_oid *dup = git__malloc(sizeof(*oid));
386
389
  GIT_ERROR_CHECK_ALLOC(dup);
387
390
  git_oid_cpy(dup, oid);
388
- return git_oidmap_set(idx->expected_oids, dup, dup);
391
+ return git_indexer_oidmap_put(&idx->expected_oids, dup, dup);
389
392
  }
390
393
 
391
394
  return 0;
@@ -412,8 +415,8 @@ static int check_object_connectivity(git_indexer *idx, const git_rawobj *obj)
412
415
  goto out;
413
416
  }
414
417
 
415
- if ((expected = git_oidmap_get(idx->expected_oids, &object->cached.oid)) != NULL) {
416
- git_oidmap_delete(idx->expected_oids, &object->cached.oid);
418
+ if (git_indexer_oidmap_get(&expected, &idx->expected_oids, &object->cached.oid) == 0) {
419
+ git_indexer_oidmap_remove(&idx->expected_oids, &object->cached.oid);
417
420
  git__free(expected);
418
421
  }
419
422
 
@@ -518,7 +521,7 @@ static int store_object(git_indexer *idx)
518
521
  git_oid_cpy(&pentry->id, &oid);
519
522
  pentry->offset = entry_start;
520
523
 
521
- if (git_oidmap_exists(idx->pack->idx_cache, &pentry->id)) {
524
+ if (git_pack_oidmap_contains(&idx->pack->idx_cache, &pentry->id)) {
522
525
  const char *idstr = git_oid_tostr_s(&pentry->id);
523
526
 
524
527
  if (!idstr)
@@ -530,7 +533,7 @@ static int store_object(git_indexer *idx)
530
533
  goto on_error;
531
534
  }
532
535
 
533
- if ((error = git_oidmap_set(idx->pack->idx_cache, &pentry->id, pentry)) < 0) {
536
+ if ((error = git_pack_oidmap_put(&idx->pack->idx_cache, &pentry->id, pentry)) < 0) {
534
537
  git__free(pentry);
535
538
  git_error_set_oom();
536
539
  goto on_error;
@@ -559,7 +562,7 @@ on_error:
559
562
 
560
563
  GIT_INLINE(bool) has_entry(git_indexer *idx, git_oid *id)
561
564
  {
562
- return git_oidmap_exists(idx->pack->idx_cache, id);
565
+ return git_pack_oidmap_contains(&idx->pack->idx_cache, id);
563
566
  }
564
567
 
565
568
  static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_entry *pentry, off64_t entry_start)
@@ -575,8 +578,8 @@ static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_ent
575
578
 
576
579
  pentry->offset = entry_start;
577
580
 
578
- if (git_oidmap_exists(idx->pack->idx_cache, &pentry->id) ||
579
- git_oidmap_set(idx->pack->idx_cache, &pentry->id, pentry) < 0) {
581
+ if (git_pack_oidmap_contains(&idx->pack->idx_cache, &pentry->id) ||
582
+ git_pack_oidmap_put(&idx->pack->idx_cache, &pentry->id, pentry) < 0) {
580
583
  git_error_set(GIT_ERROR_INDEXER, "cannot insert object into pack");
581
584
  return -1;
582
585
  }
@@ -911,9 +914,6 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_inde
911
914
  return -1;
912
915
  }
913
916
 
914
- if (git_oidmap_new(&idx->pack->idx_cache) < 0)
915
- return -1;
916
-
917
917
  idx->pack->has_cache = 1;
918
918
  if (git_vector_init(&idx->objects, total_objects, objects_cmp) < 0)
919
919
  return -1;
@@ -1301,9 +1301,9 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
1301
1301
  * bail out due to an incomplete and thus corrupt
1302
1302
  * packfile.
1303
1303
  */
1304
- if (git_oidmap_size(idx->expected_oids) > 0) {
1304
+ if (git_indexer_oidmap_size(&idx->expected_oids) > 0) {
1305
1305
  git_error_set(GIT_ERROR_INDEXER, "packfile is missing %"PRIuZ" objects",
1306
- git_oidmap_size(idx->expected_oids));
1306
+ (size_t)git_indexer_oidmap_size(&idx->expected_oids));
1307
1307
  return -1;
1308
1308
  }
1309
1309
 
@@ -1446,9 +1446,9 @@ on_error:
1446
1446
 
1447
1447
  void git_indexer_free(git_indexer *idx)
1448
1448
  {
1449
- const git_oid *key;
1450
- git_oid *value;
1451
- size_t iter;
1449
+ struct git_pack_entry *pentry;
1450
+ git_oid *id;
1451
+ git_hashmap_iter_t iter = GIT_HASHMAP_ITER_INIT;
1452
1452
 
1453
1453
  if (idx == NULL)
1454
1454
  return;
@@ -1456,28 +1456,24 @@ void git_indexer_free(git_indexer *idx)
1456
1456
  if (idx->have_stream)
1457
1457
  git_packfile_stream_dispose(&idx->stream);
1458
1458
 
1459
- git_vector_free_deep(&idx->objects);
1459
+ git_vector_dispose_deep(&idx->objects);
1460
1460
 
1461
- if (idx->pack->idx_cache) {
1462
- struct git_pack_entry *pentry;
1463
- git_oidmap_foreach_value(idx->pack->idx_cache, pentry, {
1464
- git__free(pentry);
1465
- });
1461
+ while (git_pack_oidmap_iterate(&iter, NULL, &pentry, &idx->pack->idx_cache) == 0)
1462
+ git__free(pentry);
1466
1463
 
1467
- git_oidmap_free(idx->pack->idx_cache);
1468
- }
1464
+ git_pack_oidmap_dispose(&idx->pack->idx_cache);
1469
1465
 
1470
- git_vector_free_deep(&idx->deltas);
1466
+ git_vector_dispose_deep(&idx->deltas);
1471
1467
 
1472
1468
  git_packfile_free(idx->pack, !idx->pack_committed);
1473
1469
 
1474
- iter = 0;
1475
- while (git_oidmap_iterate((void **) &value, idx->expected_oids, &iter, &key) == 0)
1476
- git__free(value);
1470
+ iter = GIT_HASHMAP_ITER_INIT;
1471
+ while (git_indexer_oidmap_iterate(&iter, NULL, &id, &idx->expected_oids) == 0)
1472
+ git__free(id);
1477
1473
 
1478
1474
  git_hash_ctx_cleanup(&idx->trailer);
1479
1475
  git_hash_ctx_cleanup(&idx->hash_ctx);
1480
1476
  git_str_dispose(&idx->entry_data);
1481
- git_oidmap_free(idx->expected_oids);
1477
+ git_indexer_oidmap_dispose(&idx->expected_oids);
1482
1478
  git__free(idx);
1483
1479
  }
@@ -26,9 +26,10 @@
26
26
  #define iterator__ignore_dot_git(I) iterator__flag(I,IGNORE_DOT_GIT)
27
27
  #define iterator__descend_symlinks(I) iterator__flag(I,DESCEND_SYMLINKS)
28
28
 
29
-
30
29
  static void iterator_set_ignore_case(git_iterator *iter, bool ignore_case)
31
30
  {
31
+ int (*vector_cmp)(const void *a, const void *b);
32
+
32
33
  if (ignore_case)
33
34
  iter->flags |= GIT_ITERATOR_IGNORE_CASE;
34
35
  else
@@ -39,7 +40,9 @@ static void iterator_set_ignore_case(git_iterator *iter, bool ignore_case)
39
40
  iter->prefixcomp = ignore_case ? git__prefixcmp_icase : git__prefixcmp;
40
41
  iter->entry_srch = ignore_case ? git_index_entry_isrch : git_index_entry_srch;
41
42
 
42
- git_vector_set_cmp(&iter->pathlist, (git_vector_cmp)iter->strcomp);
43
+ vector_cmp = ignore_case ? git__strcasecmp_cb : git__strcmp_cb;
44
+
45
+ git_vector_set_cmp(&iter->pathlist, vector_cmp);
43
46
  }
44
47
 
45
48
  static int iterator_range_init(
@@ -299,6 +302,7 @@ typedef enum {
299
302
  static iterator_pathlist_search_t iterator_pathlist_search(
300
303
  git_iterator *iter, const char *path, size_t path_len)
301
304
  {
305
+ int (*vector_cmp)(const void *a, const void *b);
302
306
  const char *p;
303
307
  size_t idx;
304
308
  int error;
@@ -308,8 +312,10 @@ static iterator_pathlist_search_t iterator_pathlist_search(
308
312
 
309
313
  git_vector_sort(&iter->pathlist);
310
314
 
311
- error = git_vector_bsearch2(&idx, &iter->pathlist,
312
- (git_vector_cmp)iter->strcomp, path);
315
+ vector_cmp = (iter->flags & GIT_ITERATOR_IGNORE_CASE) != 0 ?
316
+ git__strcasecmp_cb : git__strcmp_cb;
317
+
318
+ error = git_vector_bsearch2(&idx, &iter->pathlist, vector_cmp, path);
313
319
 
314
320
  /* the given path was found in the pathlist. since the pathlist only
315
321
  * matches directories when they're suffixed with a '/', analyze the
@@ -690,7 +696,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)
690
696
 
691
697
  frame = git_array_pop(iter->frames);
692
698
 
693
- git_vector_free(&frame->entries);
699
+ git_vector_dispose(&frame->entries);
694
700
  git_tree_free(frame->tree);
695
701
 
696
702
  do {
@@ -703,7 +709,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)
703
709
  git_vector_foreach(&frame->similar_trees, i, tree)
704
710
  git_tree_free(tree);
705
711
 
706
- git_vector_free(&frame->similar_trees);
712
+ git_vector_dispose(&frame->similar_trees);
707
713
 
708
714
  git_str_dispose(&frame->path);
709
715
 
@@ -1495,7 +1501,7 @@ GIT_INLINE(int) filesystem_iterator_frame_pop(filesystem_iterator *iter)
1495
1501
  filesystem_iterator_frame_pop_ignores(iter);
1496
1502
 
1497
1503
  git_pool_clear(&frame->entry_pool);
1498
- git_vector_free(&frame->entries);
1504
+ git_vector_dispose(&frame->entries);
1499
1505
 
1500
1506
  return 0;
1501
1507
  }
@@ -2330,7 +2336,7 @@ void git_iterator_free(git_iterator *iter)
2330
2336
 
2331
2337
  iter->cb->free(iter);
2332
2338
 
2333
- git_vector_free(&iter->pathlist);
2339
+ git_vector_dispose(&iter->pathlist);
2334
2340
  git__free(iter->start);
2335
2341
  git__free(iter->end);
2336
2342