rugged 0.27.7 → 0.27.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +1 -0
  4. data/vendor/libgit2/CMakeLists.txt +99 -51
  5. data/vendor/libgit2/COPYING +28 -0
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  7. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
  8. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
  9. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
  10. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  11. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  12. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
  13. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
  14. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
  15. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
  16. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  17. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
  18. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
  19. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
  20. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
  21. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
  22. data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
  23. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
  24. data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
  25. data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
  26. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
  27. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
  28. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
  29. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
  30. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
  31. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
  32. data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
  33. data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
  34. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
  35. data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
  36. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
  37. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
  38. data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
  39. data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
  40. data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
  42. data/vendor/libgit2/deps/pcre/COPYING +5 -0
  43. data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
  44. data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
  45. data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
  46. data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
  47. data/vendor/libgit2/deps/pcre/config.h.in +57 -0
  48. data/vendor/libgit2/deps/pcre/pcre.h +641 -0
  49. data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
  50. data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
  51. data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
  52. data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
  53. data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
  54. data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
  55. data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
  56. data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
  57. data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
  58. data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
  59. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
  60. data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
  61. data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
  62. data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
  63. data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
  64. data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
  65. data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
  66. data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
  67. data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
  68. data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
  69. data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
  70. data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
  71. data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
  72. data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
  73. data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
  74. data/vendor/libgit2/deps/pcre/ucp.h +224 -0
  75. data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
  76. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
  77. data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
  78. data/vendor/libgit2/deps/zlib/COPYING +27 -0
  79. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  80. data/vendor/libgit2/deps/zlib/crc32.c +0 -7
  81. data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
  82. data/vendor/libgit2/include/git2/apply.h +149 -0
  83. data/vendor/libgit2/include/git2/attr.h +20 -13
  84. data/vendor/libgit2/include/git2/blame.h +4 -4
  85. data/vendor/libgit2/include/git2/blob.h +44 -12
  86. data/vendor/libgit2/include/git2/buffer.h +20 -26
  87. data/vendor/libgit2/include/git2/cert.h +135 -0
  88. data/vendor/libgit2/include/git2/checkout.h +53 -21
  89. data/vendor/libgit2/include/git2/cherrypick.h +3 -3
  90. data/vendor/libgit2/include/git2/clone.h +5 -5
  91. data/vendor/libgit2/include/git2/commit.h +25 -3
  92. data/vendor/libgit2/include/git2/common.h +35 -10
  93. data/vendor/libgit2/include/git2/config.h +29 -19
  94. data/vendor/libgit2/include/git2/cred.h +308 -0
  95. data/vendor/libgit2/include/git2/deprecated.h +493 -0
  96. data/vendor/libgit2/include/git2/describe.h +4 -4
  97. data/vendor/libgit2/include/git2/diff.h +177 -135
  98. data/vendor/libgit2/include/git2/errors.h +53 -46
  99. data/vendor/libgit2/include/git2/filter.h +8 -0
  100. data/vendor/libgit2/include/git2/index.h +74 -52
  101. data/vendor/libgit2/include/git2/indexer.h +76 -6
  102. data/vendor/libgit2/include/git2/merge.h +25 -10
  103. data/vendor/libgit2/include/git2/net.h +0 -5
  104. data/vendor/libgit2/include/git2/notes.h +1 -1
  105. data/vendor/libgit2/include/git2/object.h +17 -29
  106. data/vendor/libgit2/include/git2/odb.h +12 -11
  107. data/vendor/libgit2/include/git2/odb_backend.h +10 -9
  108. data/vendor/libgit2/include/git2/oid.h +2 -2
  109. data/vendor/libgit2/include/git2/pack.h +14 -3
  110. data/vendor/libgit2/include/git2/proxy.h +5 -3
  111. data/vendor/libgit2/include/git2/rebase.h +46 -2
  112. data/vendor/libgit2/include/git2/refs.h +34 -16
  113. data/vendor/libgit2/include/git2/remote.h +111 -14
  114. data/vendor/libgit2/include/git2/repository.h +69 -34
  115. data/vendor/libgit2/include/git2/revert.h +1 -1
  116. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  117. data/vendor/libgit2/include/git2/signature.h +2 -2
  118. data/vendor/libgit2/include/git2/stash.h +5 -5
  119. data/vendor/libgit2/include/git2/status.h +26 -17
  120. data/vendor/libgit2/include/git2/submodule.h +23 -6
  121. data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
  122. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  123. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  124. data/vendor/libgit2/include/git2/sys/cred.h +90 -0
  125. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  126. data/vendor/libgit2/include/git2/sys/merge.h +3 -3
  127. data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
  128. data/vendor/libgit2/include/git2/sys/path.h +14 -5
  129. data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
  130. data/vendor/libgit2/include/git2/sys/repository.h +5 -1
  131. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  132. data/vendor/libgit2/include/git2/sys/transport.h +129 -83
  133. data/vendor/libgit2/include/git2/tag.h +13 -4
  134. data/vendor/libgit2/include/git2/trace.h +2 -2
  135. data/vendor/libgit2/include/git2/transport.h +11 -311
  136. data/vendor/libgit2/include/git2/tree.h +4 -4
  137. data/vendor/libgit2/include/git2/types.h +25 -106
  138. data/vendor/libgit2/include/git2/version.h +3 -3
  139. data/vendor/libgit2/include/git2/worktree.h +5 -5
  140. data/vendor/libgit2/include/git2.h +4 -0
  141. data/vendor/libgit2/src/CMakeLists.txt +104 -235
  142. data/vendor/libgit2/src/alloc.c +14 -18
  143. data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
  144. data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
  145. data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
  146. data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
  147. data/vendor/libgit2/src/annotated_commit.c +18 -11
  148. data/vendor/libgit2/src/apply.c +535 -28
  149. data/vendor/libgit2/src/apply.h +3 -1
  150. data/vendor/libgit2/src/array.h +2 -2
  151. data/vendor/libgit2/src/attr.c +77 -71
  152. data/vendor/libgit2/src/attr_file.c +203 -117
  153. data/vendor/libgit2/src/attr_file.h +9 -9
  154. data/vendor/libgit2/src/attrcache.c +49 -51
  155. data/vendor/libgit2/src/attrcache.h +2 -1
  156. data/vendor/libgit2/src/blame.c +38 -18
  157. data/vendor/libgit2/src/blame.h +1 -1
  158. data/vendor/libgit2/src/blame_git.c +29 -15
  159. data/vendor/libgit2/src/blob.c +123 -37
  160. data/vendor/libgit2/src/blob.h +19 -2
  161. data/vendor/libgit2/src/branch.c +47 -23
  162. data/vendor/libgit2/src/buf_text.c +7 -6
  163. data/vendor/libgit2/src/buffer.c +60 -53
  164. data/vendor/libgit2/src/cache.c +38 -45
  165. data/vendor/libgit2/src/cache.h +3 -3
  166. data/vendor/libgit2/src/cc-compat.h +20 -3
  167. data/vendor/libgit2/src/checkout.c +77 -67
  168. data/vendor/libgit2/src/cherrypick.c +12 -6
  169. data/vendor/libgit2/src/clone.c +36 -14
  170. data/vendor/libgit2/src/clone.h +4 -0
  171. data/vendor/libgit2/src/commit.c +103 -48
  172. data/vendor/libgit2/src/commit.h +7 -0
  173. data/vendor/libgit2/src/commit_list.c +36 -78
  174. data/vendor/libgit2/src/commit_list.h +2 -2
  175. data/vendor/libgit2/src/common.h +24 -90
  176. data/vendor/libgit2/src/config.c +203 -176
  177. data/vendor/libgit2/src/config.h +8 -20
  178. data/vendor/libgit2/src/config_backend.h +96 -0
  179. data/vendor/libgit2/src/config_cache.c +41 -35
  180. data/vendor/libgit2/src/config_entries.c +229 -0
  181. data/vendor/libgit2/src/config_entries.h +24 -0
  182. data/vendor/libgit2/src/config_file.c +422 -680
  183. data/vendor/libgit2/src/config_mem.c +220 -0
  184. data/vendor/libgit2/src/config_parse.c +96 -68
  185. data/vendor/libgit2/src/config_parse.h +15 -14
  186. data/vendor/libgit2/src/config_snapshot.c +206 -0
  187. data/vendor/libgit2/src/crlf.c +219 -196
  188. data/vendor/libgit2/src/delta.c +25 -18
  189. data/vendor/libgit2/src/describe.c +42 -41
  190. data/vendor/libgit2/src/diff.c +52 -67
  191. data/vendor/libgit2/src/diff.h +2 -1
  192. data/vendor/libgit2/src/diff_driver.c +44 -46
  193. data/vendor/libgit2/src/diff_file.c +16 -14
  194. data/vendor/libgit2/src/diff_file.h +1 -1
  195. data/vendor/libgit2/src/diff_generate.c +158 -103
  196. data/vendor/libgit2/src/diff_generate.h +3 -3
  197. data/vendor/libgit2/src/diff_parse.c +4 -4
  198. data/vendor/libgit2/src/diff_print.c +34 -22
  199. data/vendor/libgit2/src/diff_stats.c +22 -7
  200. data/vendor/libgit2/src/diff_tform.c +18 -16
  201. data/vendor/libgit2/src/diff_xdiff.c +3 -3
  202. data/vendor/libgit2/src/errors.c +51 -39
  203. data/vendor/libgit2/src/errors.h +81 -0
  204. data/vendor/libgit2/src/features.h.in +9 -3
  205. data/vendor/libgit2/src/fetch.c +8 -3
  206. data/vendor/libgit2/src/fetchhead.c +12 -12
  207. data/vendor/libgit2/src/filebuf.c +28 -32
  208. data/vendor/libgit2/src/filebuf.h +2 -2
  209. data/vendor/libgit2/src/filter.c +47 -33
  210. data/vendor/libgit2/src/filter.h +0 -10
  211. data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
  212. data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
  213. data/vendor/libgit2/src/global.c +35 -55
  214. data/vendor/libgit2/src/global.h +0 -2
  215. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
  216. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
  217. data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
  218. data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
  219. data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
  220. data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
  221. data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
  222. data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
  223. data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
  224. data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
  225. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
  226. data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
  227. data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
  228. data/vendor/libgit2/src/hash/sha1.h +38 -0
  229. data/vendor/libgit2/src/hash.c +61 -0
  230. data/vendor/libgit2/src/hash.h +20 -21
  231. data/vendor/libgit2/src/hashsig.c +5 -5
  232. data/vendor/libgit2/src/idxmap.c +107 -61
  233. data/vendor/libgit2/src/idxmap.h +153 -31
  234. data/vendor/libgit2/src/ignore.c +38 -42
  235. data/vendor/libgit2/src/index.c +264 -199
  236. data/vendor/libgit2/src/index.h +7 -1
  237. data/vendor/libgit2/src/indexer.c +338 -167
  238. data/vendor/libgit2/src/integer.h +71 -26
  239. data/vendor/libgit2/src/iterator.c +134 -62
  240. data/vendor/libgit2/src/iterator.h +15 -0
  241. data/vendor/libgit2/src/mailmap.c +8 -8
  242. data/vendor/libgit2/src/map.h +1 -1
  243. data/vendor/libgit2/src/merge.c +137 -93
  244. data/vendor/libgit2/src/merge_driver.c +11 -11
  245. data/vendor/libgit2/src/merge_file.c +2 -2
  246. data/vendor/libgit2/src/mwindow.c +24 -29
  247. data/vendor/libgit2/src/mwindow.h +4 -4
  248. data/vendor/libgit2/src/net.c +184 -0
  249. data/vendor/libgit2/src/net.h +36 -0
  250. data/vendor/libgit2/src/netops.c +55 -156
  251. data/vendor/libgit2/src/netops.h +3 -23
  252. data/vendor/libgit2/src/notes.c +14 -9
  253. data/vendor/libgit2/src/object.c +120 -69
  254. data/vendor/libgit2/src/object.h +22 -9
  255. data/vendor/libgit2/src/object_api.c +8 -8
  256. data/vendor/libgit2/src/odb.c +111 -88
  257. data/vendor/libgit2/src/odb.h +8 -7
  258. data/vendor/libgit2/src/odb_loose.c +58 -47
  259. data/vendor/libgit2/src/odb_mempack.c +21 -34
  260. data/vendor/libgit2/src/odb_pack.c +17 -13
  261. data/vendor/libgit2/src/offmap.c +53 -35
  262. data/vendor/libgit2/src/offmap.h +108 -21
  263. data/vendor/libgit2/src/oid.c +12 -7
  264. data/vendor/libgit2/src/oidmap.c +49 -47
  265. data/vendor/libgit2/src/oidmap.h +101 -24
  266. data/vendor/libgit2/src/pack-objects.c +87 -86
  267. data/vendor/libgit2/src/pack-objects.h +2 -8
  268. data/vendor/libgit2/src/pack.c +94 -96
  269. data/vendor/libgit2/src/pack.h +16 -18
  270. data/vendor/libgit2/src/parse.c +17 -4
  271. data/vendor/libgit2/src/parse.h +3 -3
  272. data/vendor/libgit2/src/patch.c +3 -3
  273. data/vendor/libgit2/src/patch_generate.c +18 -18
  274. data/vendor/libgit2/src/patch_parse.c +147 -79
  275. data/vendor/libgit2/src/path.c +207 -62
  276. data/vendor/libgit2/src/path.h +14 -0
  277. data/vendor/libgit2/src/pathspec.c +18 -18
  278. data/vendor/libgit2/src/pool.c +26 -22
  279. data/vendor/libgit2/src/pool.h +7 -7
  280. data/vendor/libgit2/src/posix.c +10 -10
  281. data/vendor/libgit2/src/posix.h +12 -1
  282. data/vendor/libgit2/src/proxy.c +8 -3
  283. data/vendor/libgit2/src/push.c +35 -29
  284. data/vendor/libgit2/src/push.h +2 -1
  285. data/vendor/libgit2/src/reader.c +265 -0
  286. data/vendor/libgit2/src/reader.h +107 -0
  287. data/vendor/libgit2/src/rebase.c +97 -38
  288. data/vendor/libgit2/src/refdb.c +15 -3
  289. data/vendor/libgit2/src/refdb_fs.c +318 -222
  290. data/vendor/libgit2/src/reflog.c +13 -15
  291. data/vendor/libgit2/src/refs.c +122 -89
  292. data/vendor/libgit2/src/refs.h +5 -3
  293. data/vendor/libgit2/src/refspec.c +27 -33
  294. data/vendor/libgit2/src/regexp.c +221 -0
  295. data/vendor/libgit2/src/regexp.h +97 -0
  296. data/vendor/libgit2/src/remote.c +229 -178
  297. data/vendor/libgit2/src/remote.h +11 -2
  298. data/vendor/libgit2/src/repository.c +227 -172
  299. data/vendor/libgit2/src/repository.h +52 -40
  300. data/vendor/libgit2/src/reset.c +7 -7
  301. data/vendor/libgit2/src/revert.c +11 -6
  302. data/vendor/libgit2/src/revparse.c +46 -46
  303. data/vendor/libgit2/src/revwalk.c +89 -54
  304. data/vendor/libgit2/src/revwalk.h +20 -0
  305. data/vendor/libgit2/src/settings.c +22 -9
  306. data/vendor/libgit2/src/signature.c +15 -13
  307. data/vendor/libgit2/src/sortedcache.c +22 -36
  308. data/vendor/libgit2/src/sortedcache.h +1 -1
  309. data/vendor/libgit2/src/stash.c +56 -76
  310. data/vendor/libgit2/src/status.c +27 -21
  311. data/vendor/libgit2/src/stream.h +17 -2
  312. data/vendor/libgit2/src/streams/mbedtls.c +100 -80
  313. data/vendor/libgit2/src/streams/mbedtls.h +5 -2
  314. data/vendor/libgit2/src/streams/openssl.c +93 -81
  315. data/vendor/libgit2/src/streams/openssl.h +5 -2
  316. data/vendor/libgit2/src/streams/registry.c +118 -0
  317. data/vendor/libgit2/src/streams/registry.h +19 -0
  318. data/vendor/libgit2/src/streams/socket.c +55 -30
  319. data/vendor/libgit2/src/streams/stransport.c +57 -32
  320. data/vendor/libgit2/src/streams/stransport.h +5 -0
  321. data/vendor/libgit2/src/streams/tls.c +48 -20
  322. data/vendor/libgit2/src/streams/tls.h +12 -4
  323. data/vendor/libgit2/src/strmap.c +47 -74
  324. data/vendor/libgit2/src/strmap.h +108 -33
  325. data/vendor/libgit2/src/submodule.c +190 -169
  326. data/vendor/libgit2/src/submodule.h +1 -1
  327. data/vendor/libgit2/src/sysdir.c +25 -15
  328. data/vendor/libgit2/src/tag.c +39 -26
  329. data/vendor/libgit2/src/tag.h +2 -1
  330. data/vendor/libgit2/src/trace.c +2 -2
  331. data/vendor/libgit2/src/trace.h +2 -2
  332. data/vendor/libgit2/src/trailer.c +46 -32
  333. data/vendor/libgit2/src/transaction.c +30 -29
  334. data/vendor/libgit2/src/transport.c +3 -3
  335. data/vendor/libgit2/src/transports/auth.c +14 -10
  336. data/vendor/libgit2/src/transports/auth.h +10 -3
  337. data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
  338. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  339. data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
  340. data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
  341. data/vendor/libgit2/src/transports/cred.c +24 -24
  342. data/vendor/libgit2/src/transports/git.c +25 -30
  343. data/vendor/libgit2/src/transports/http.c +871 -335
  344. data/vendor/libgit2/src/transports/http.h +2 -0
  345. data/vendor/libgit2/src/transports/local.c +28 -28
  346. data/vendor/libgit2/src/transports/smart.c +64 -46
  347. data/vendor/libgit2/src/transports/smart.h +5 -6
  348. data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
  349. data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
  350. data/vendor/libgit2/src/transports/ssh.c +76 -65
  351. data/vendor/libgit2/src/transports/winhttp.c +328 -319
  352. data/vendor/libgit2/src/tree-cache.c +21 -14
  353. data/vendor/libgit2/src/tree.c +119 -112
  354. data/vendor/libgit2/src/tree.h +1 -0
  355. data/vendor/libgit2/src/unix/map.c +3 -3
  356. data/vendor/libgit2/src/unix/posix.h +1 -11
  357. data/vendor/libgit2/src/userdiff.h +3 -1
  358. data/vendor/libgit2/src/util.c +154 -93
  359. data/vendor/libgit2/src/util.h +19 -23
  360. data/vendor/libgit2/src/vector.c +15 -10
  361. data/vendor/libgit2/src/wildmatch.c +320 -0
  362. data/vendor/libgit2/src/wildmatch.h +23 -0
  363. data/vendor/libgit2/src/win32/dir.c +3 -3
  364. data/vendor/libgit2/src/win32/findfile.c +1 -1
  365. data/vendor/libgit2/src/win32/map.c +9 -11
  366. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  367. data/vendor/libgit2/src/win32/path_w32.c +113 -9
  368. data/vendor/libgit2/src/win32/path_w32.h +18 -29
  369. data/vendor/libgit2/src/win32/posix.h +1 -4
  370. data/vendor/libgit2/src/win32/posix_w32.c +69 -44
  371. data/vendor/libgit2/src/win32/precompiled.h +0 -2
  372. data/vendor/libgit2/src/win32/thread.c +5 -10
  373. data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
  374. data/vendor/libgit2/src/win32/w32_common.h +39 -0
  375. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
  376. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
  377. data/vendor/libgit2/src/win32/w32_stack.c +6 -11
  378. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  379. data/vendor/libgit2/src/win32/w32_util.c +27 -64
  380. data/vendor/libgit2/src/win32/w32_util.h +5 -49
  381. data/vendor/libgit2/src/worktree.c +44 -30
  382. data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
  383. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  384. data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
  385. data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
  386. data/vendor/libgit2/src/zstream.c +4 -4
  387. metadata +115 -38
  388. data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
  389. data/vendor/libgit2/deps/regex/config.h +0 -7
  390. data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
  391. data/vendor/libgit2/deps/regex/regex.c +0 -92
  392. data/vendor/libgit2/deps/regex/regex.h +0 -582
  393. data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
  394. data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
  395. data/vendor/libgit2/deps/regex/regexec.c +0 -4369
  396. data/vendor/libgit2/include/git2/inttypes.h +0 -309
  397. data/vendor/libgit2/include/git2/sys/time.h +0 -31
  398. data/vendor/libgit2/libgit2.pc.in +0 -13
  399. data/vendor/libgit2/src/config_file.h +0 -73
  400. data/vendor/libgit2/src/fnmatch.c +0 -248
  401. data/vendor/libgit2/src/fnmatch.h +0 -48
  402. data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
  403. data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
  404. data/vendor/libgit2/src/streams/curl.c +0 -385
  405. data/vendor/libgit2/src/streams/curl.h +0 -17
  406. /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  407. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
  408. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
  409. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
@@ -7,8 +7,6 @@
7
7
 
8
8
  #include "checkout.h"
9
9
 
10
- #include <assert.h>
11
-
12
10
  #include "git2/repository.h"
13
11
  #include "git2/refs.h"
14
12
  #include "git2/tree.h"
@@ -146,7 +144,7 @@ static int checkout_notify(
146
144
  int error = data->opts.notify_cb(
147
145
  why, path, baseline, target, workdir, data->opts.notify_payload);
148
146
 
149
- return giterr_set_after_callback_function(
147
+ return git_error_set_after_callback_function(
150
148
  error, "git_checkout notification");
151
149
  }
152
150
  }
@@ -193,7 +191,7 @@ static bool checkout_is_workdir_modified(
193
191
  bool rval = false;
194
192
 
195
193
  if (git_submodule_lookup(&sm, data->repo, wditem->path) < 0) {
196
- giterr_clear();
194
+ git_error_clear();
197
195
  return true;
198
196
  }
199
197
 
@@ -354,7 +352,7 @@ static bool wd_item_is_removable(
354
352
  static int checkout_queue_remove(checkout_data *data, const char *path)
355
353
  {
356
354
  char *copy = git_pool_strdup(&data->pool, path);
357
- GITERR_CHECK_ALLOC(copy);
355
+ GIT_ERROR_CHECK_ALLOC(copy);
358
356
  return git_vector_insert(&data->removes, copy);
359
357
  }
360
358
 
@@ -492,7 +490,7 @@ static int checkout_action_with_wd(
492
490
  switch (delta->status) {
493
491
  case GIT_DELTA_UNMODIFIED: /* case 14/15 or 33 */
494
492
  if (checkout_is_workdir_modified(data, &delta->old_file, &delta->new_file, wd)) {
495
- GITERR_CHECK_ERROR(
493
+ GIT_ERROR_CHECK_ERROR(
496
494
  checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, wd) );
497
495
  *action = CHECKOUT_ACTION_IF(FORCE, UPDATE_BLOB, NONE);
498
496
  }
@@ -561,7 +559,7 @@ static int checkout_action_with_wd_blocker(
561
559
  switch (delta->status) {
562
560
  case GIT_DELTA_UNMODIFIED:
563
561
  /* should show delta as dirty / deleted */
564
- GITERR_CHECK_ERROR(
562
+ GIT_ERROR_CHECK_ERROR(
565
563
  checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, wd) );
566
564
  *action = CHECKOUT_ACTION_IF(FORCE, REMOVE_AND_UPDATE, NONE);
567
565
  break;
@@ -594,9 +592,9 @@ static int checkout_action_with_wd_dir(
594
592
 
595
593
  switch (delta->status) {
596
594
  case GIT_DELTA_UNMODIFIED: /* case 19 or 24 (or 34 but not really) */
597
- GITERR_CHECK_ERROR(
595
+ GIT_ERROR_CHECK_ERROR(
598
596
  checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, NULL));
599
- GITERR_CHECK_ERROR(
597
+ GIT_ERROR_CHECK_ERROR(
600
598
  checkout_notify(data, GIT_CHECKOUT_NOTIFY_UNTRACKED, NULL, wd));
601
599
  *action = CHECKOUT_ACTION_IF(FORCE, REMOVE_AND_UPDATE, NONE);
602
600
  break;
@@ -611,7 +609,7 @@ static int checkout_action_with_wd_dir(
611
609
  break;
612
610
  case GIT_DELTA_DELETED: /* case 11 (and 27 for dir) */
613
611
  if (delta->old_file.mode != GIT_FILEMODE_TREE)
614
- GITERR_CHECK_ERROR(
612
+ GIT_ERROR_CHECK_ERROR(
615
613
  checkout_notify(data, GIT_CHECKOUT_NOTIFY_UNTRACKED, NULL, wd));
616
614
  break;
617
615
  case GIT_DELTA_TYPECHANGE: /* case 24 or 31 */
@@ -902,7 +900,7 @@ static int checkout_conflict_append_update(
902
900
  int error;
903
901
 
904
902
  conflict = git__calloc(1, sizeof(checkout_conflictdata));
905
- GITERR_CHECK_ALLOC(conflict);
903
+ GIT_ERROR_CHECK_ALLOC(conflict);
906
904
 
907
905
  conflict->ancestor = ancestor;
908
906
  conflict->ours = ours;
@@ -1044,20 +1042,20 @@ static int checkout_conflicts_load_byname_entry(
1044
1042
  *theirs_out = NULL;
1045
1043
 
1046
1044
  if (!name_entry->ancestor) {
1047
- giterr_set(GITERR_INDEX, "a NAME entry exists without an ancestor");
1045
+ git_error_set(GIT_ERROR_INDEX, "a NAME entry exists without an ancestor");
1048
1046
  error = -1;
1049
1047
  goto done;
1050
1048
  }
1051
1049
 
1052
1050
  if (!name_entry->ours && !name_entry->theirs) {
1053
- giterr_set(GITERR_INDEX, "a NAME entry exists without an ours or theirs");
1051
+ git_error_set(GIT_ERROR_INDEX, "a NAME entry exists without an ours or theirs");
1054
1052
  error = -1;
1055
1053
  goto done;
1056
1054
  }
1057
1055
 
1058
1056
  if ((ancestor = checkout_conflicts_search_ancestor(data,
1059
1057
  name_entry->ancestor)) == NULL) {
1060
- giterr_set(GITERR_INDEX,
1058
+ git_error_set(GIT_ERROR_INDEX,
1061
1059
  "a NAME entry referenced ancestor entry '%s' which does not exist in the main index",
1062
1060
  name_entry->ancestor);
1063
1061
  error = -1;
@@ -1069,7 +1067,7 @@ static int checkout_conflicts_load_byname_entry(
1069
1067
  ours = ancestor;
1070
1068
  else if ((ours = checkout_conflicts_search_branch(data, name_entry->ours)) == NULL ||
1071
1069
  ours->ours == NULL) {
1072
- giterr_set(GITERR_INDEX,
1070
+ git_error_set(GIT_ERROR_INDEX,
1073
1071
  "a NAME entry referenced our entry '%s' which does not exist in the main index",
1074
1072
  name_entry->ours);
1075
1073
  error = -1;
@@ -1084,7 +1082,7 @@ static int checkout_conflicts_load_byname_entry(
1084
1082
  theirs = ours;
1085
1083
  else if ((theirs = checkout_conflicts_search_branch(data, name_entry->theirs)) == NULL ||
1086
1084
  theirs->theirs == NULL) {
1087
- giterr_set(GITERR_INDEX,
1085
+ git_error_set(GIT_ERROR_INDEX,
1088
1086
  "a NAME entry referenced their entry '%s' which does not exist in the main index",
1089
1087
  name_entry->theirs);
1090
1088
  error = -1;
@@ -1183,7 +1181,7 @@ static int checkout_conflicts_mark_directoryfile(
1183
1181
 
1184
1182
  if ((error = git_index_find(&j, index, path)) < 0) {
1185
1183
  if (error == GIT_ENOTFOUND)
1186
- giterr_set(GITERR_INDEX,
1184
+ git_error_set(GIT_ERROR_INDEX,
1187
1185
  "index inconsistency, could not find entry for expected conflict '%s'", path);
1188
1186
 
1189
1187
  goto done;
@@ -1191,7 +1189,7 @@ static int checkout_conflicts_mark_directoryfile(
1191
1189
 
1192
1190
  for (; j < len; j++) {
1193
1191
  if ((entry = git_index_get_byindex(index, j)) == NULL) {
1194
- giterr_set(GITERR_INDEX,
1192
+ git_error_set(GIT_ERROR_INDEX,
1195
1193
  "index inconsistency, truncated index while loading expected conflict '%s'", path);
1196
1194
  error = -1;
1197
1195
  goto done;
@@ -1252,7 +1250,7 @@ static int checkout_conflict_append_remove(
1252
1250
  else
1253
1251
  abort();
1254
1252
 
1255
- GITERR_CHECK_ALLOC(name);
1253
+ GIT_ERROR_CHECK_ALLOC(name);
1256
1254
 
1257
1255
  return git_vector_insert(&data->remove_conflicts, (char *)name);
1258
1256
  }
@@ -1277,14 +1275,14 @@ static int checkout_verify_paths(
1277
1275
 
1278
1276
  if (action & CHECKOUT_ACTION__REMOVE) {
1279
1277
  if (!git_path_isvalid(repo, delta->old_file.path, delta->old_file.mode, flags)) {
1280
- giterr_set(GITERR_CHECKOUT, "cannot remove invalid path '%s'", delta->old_file.path);
1278
+ git_error_set(GIT_ERROR_CHECKOUT, "cannot remove invalid path '%s'", delta->old_file.path);
1281
1279
  return -1;
1282
1280
  }
1283
1281
  }
1284
1282
 
1285
1283
  if (action & ~CHECKOUT_ACTION__REMOVE) {
1286
1284
  if (!git_path_isvalid(repo, delta->new_file.path, delta->new_file.mode, flags)) {
1287
- giterr_set(GITERR_CHECKOUT, "cannot checkout to invalid path '%s'", delta->new_file.path);
1285
+ git_error_set(GIT_ERROR_CHECKOUT, "cannot checkout to invalid path '%s'", delta->new_file.path);
1288
1286
  return -1;
1289
1287
  }
1290
1288
  }
@@ -1354,7 +1352,7 @@ static int checkout_get_actions(
1354
1352
  if (counts[CHECKOUT_ACTION__CONFLICT] > 0 &&
1355
1353
  (data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) == 0)
1356
1354
  {
1357
- giterr_set(GITERR_CHECKOUT, "%"PRIuZ" %s checkout",
1355
+ git_error_set(GIT_ERROR_CHECKOUT, "%"PRIuZ" %s checkout",
1358
1356
  counts[CHECKOUT_ACTION__CONFLICT],
1359
1357
  counts[CHECKOUT_ACTION__CONFLICT] == 1 ?
1360
1358
  "conflict prevents" : "conflicts prevent");
@@ -1391,7 +1389,7 @@ static bool should_remove_existing(checkout_data *data)
1391
1389
  {
1392
1390
  int ignorecase;
1393
1391
 
1394
- if (git_repository__cvar(&ignorecase, data->repo, GIT_CVAR_IGNORECASE) < 0) {
1392
+ if (git_repository__configmap_lookup(&ignorecase, data->repo, GIT_CONFIGMAP_IGNORECASE) < 0) {
1395
1393
  ignorecase = 0;
1396
1394
  }
1397
1395
 
@@ -1453,10 +1451,10 @@ static int mkpath2file(
1453
1451
  */
1454
1452
  error = git_futils_rmdir_r(path, NULL, GIT_RMDIR_REMOVE_FILES);
1455
1453
  } else if (errno != ENOENT) {
1456
- giterr_set(GITERR_OS, "failed to stat '%s'", path);
1454
+ git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
1457
1455
  return GIT_EEXISTS;
1458
1456
  } else {
1459
- giterr_clear();
1457
+ git_error_clear();
1460
1458
  }
1461
1459
  }
1462
1460
 
@@ -1477,7 +1475,7 @@ static int checkout_stream_write(
1477
1475
  int ret;
1478
1476
 
1479
1477
  if ((ret = p_write(stream->fd, buffer, len)) < 0)
1480
- giterr_set(GITERR_OS, "could not write to '%s'", stream->path);
1478
+ git_error_set(GIT_ERROR_OS, "could not write to '%s'", stream->path);
1481
1479
 
1482
1480
  return ret;
1483
1481
  }
@@ -1526,7 +1524,7 @@ static int blob_content_to_file(
1526
1524
  mode = GIT_FILEMODE_BLOB;
1527
1525
 
1528
1526
  if ((fd = p_open(path, flags, mode)) < 0) {
1529
- giterr_set(GITERR_OS, "could not open '%s' for writing", path);
1527
+ git_error_set(GIT_ERROR_OS, "could not open '%s' for writing", path);
1530
1528
  return fd;
1531
1529
  }
1532
1530
 
@@ -1563,7 +1561,7 @@ static int blob_content_to_file(
1563
1561
  data->perfdata.stat_calls++;
1564
1562
 
1565
1563
  if ((error = p_stat(path, st)) < 0) {
1566
- giterr_set(GITERR_OS, "failed to stat '%s'", path);
1564
+ git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
1567
1565
  return error;
1568
1566
  }
1569
1567
 
@@ -1590,7 +1588,7 @@ static int blob_content_to_link(
1590
1588
 
1591
1589
  if (data->can_symlink) {
1592
1590
  if ((error = p_symlink(git_buf_cstr(&linktarget), path)) < 0)
1593
- giterr_set(GITERR_OS, "could not create symlink %s", path);
1591
+ git_error_set(GIT_ERROR_OS, "could not create symlink %s", path);
1594
1592
  } else {
1595
1593
  error = git_futils_fake_symlink(git_buf_cstr(&linktarget), path);
1596
1594
  }
@@ -1599,7 +1597,7 @@ static int blob_content_to_link(
1599
1597
  data->perfdata.stat_calls++;
1600
1598
 
1601
1599
  if ((error = p_lstat(path, st)) < 0)
1602
- giterr_set(GITERR_CHECKOUT, "could not stat symlink %s", path);
1600
+ git_error_set(GIT_ERROR_CHECKOUT, "could not stat symlink %s", path);
1603
1601
 
1604
1602
  st->st_mode = GIT_FILEMODE_LINK;
1605
1603
  }
@@ -1643,8 +1641,8 @@ static int checkout_submodule_update_index(
1643
1641
 
1644
1642
  data->perfdata.stat_calls++;
1645
1643
  if (p_stat(fullpath->ptr, &st) < 0) {
1646
- giterr_set(
1647
- GITERR_CHECKOUT, "could not stat submodule %s\n", file->path);
1644
+ git_error_set(
1645
+ GIT_ERROR_CHECKOUT, "could not stat submodule %s\n", file->path);
1648
1646
  return GIT_ENOTFOUND;
1649
1647
  }
1650
1648
 
@@ -1675,7 +1673,7 @@ static int checkout_submodule(
1675
1673
  * have a .gitmodules - core Git just makes an empty directory
1676
1674
  */
1677
1675
  if (error == GIT_ENOTFOUND) {
1678
- giterr_clear();
1676
+ git_error_clear();
1679
1677
  return checkout_submodule_update_index(data, file);
1680
1678
  }
1681
1679
 
@@ -1717,7 +1715,7 @@ static int checkout_safe_for_update_only(
1717
1715
  return 0;
1718
1716
 
1719
1717
  /* otherwise, stat error and no update */
1720
- giterr_set(GITERR_OS, "failed to stat '%s'", path);
1718
+ git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
1721
1719
  return -1;
1722
1720
  }
1723
1721
 
@@ -1756,7 +1754,7 @@ static int checkout_write_content(
1756
1754
  if ((data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) != 0 &&
1757
1755
  (error == GIT_ENOTFOUND || error == GIT_EEXISTS))
1758
1756
  {
1759
- giterr_clear();
1757
+ git_error_clear();
1760
1758
  error = 0;
1761
1759
  }
1762
1760
 
@@ -1863,7 +1861,7 @@ static int checkout_deferred_remove(git_repository *repo, const char *path)
1863
1861
 
1864
1862
  if (error == GIT_ENOTFOUND) {
1865
1863
  error = 0;
1866
- giterr_clear();
1864
+ git_error_clear();
1867
1865
  }
1868
1866
 
1869
1867
  return error;
@@ -1893,11 +1891,18 @@ static int checkout_create_the_new(
1893
1891
  return error;
1894
1892
  }
1895
1893
 
1896
- if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB) {
1897
- error = checkout_blob(data, &delta->new_file);
1898
- if (error < 0)
1894
+ if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB && !S_ISLNK(delta->new_file.mode)) {
1895
+ if ((error = checkout_blob(data, &delta->new_file)) < 0)
1899
1896
  return error;
1897
+ data->completed_steps++;
1898
+ report_progress(data, delta->new_file.path);
1899
+ }
1900
+ }
1900
1901
 
1902
+ git_vector_foreach(&data->diff->deltas, i, delta) {
1903
+ if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB && S_ISLNK(delta->new_file.mode)) {
1904
+ if ((error = checkout_blob(data, &delta->new_file)) < 0)
1905
+ return error;
1901
1906
  data->completed_steps++;
1902
1907
  report_progress(data, delta->new_file.path);
1903
1908
  }
@@ -1944,7 +1949,7 @@ static int checkout_lookup_head_tree(git_tree **out, git_repository *repo)
1944
1949
  git_object *head;
1945
1950
 
1946
1951
  if (!(error = git_repository_head(&ref, repo)) &&
1947
- !(error = git_reference_peel(&head, ref, GIT_OBJ_TREE)))
1952
+ !(error = git_reference_peel(&head, ref, GIT_OBJECT_TREE)))
1948
1953
  *out = (git_tree *)head;
1949
1954
 
1950
1955
  git_reference_free(ref);
@@ -1989,7 +1994,7 @@ static int checkout_path_suffixed(git_buf *path, const char *suffix)
1989
1994
  if (i == INT_MAX) {
1990
1995
  git_buf_truncate(path, path_len);
1991
1996
 
1992
- giterr_set(GITERR_CHECKOUT, "could not write '%s': working directory file exists", path->ptr);
1997
+ git_error_set(GIT_ERROR_CHECKOUT, "could not write '%s': working directory file exists", path->ptr);
1993
1998
  return GIT_EEXISTS;
1994
1999
  }
1995
2000
 
@@ -2123,7 +2128,7 @@ static int checkout_write_merge(
2123
2128
  goto done;
2124
2129
 
2125
2130
  if (result.path == NULL || result.mode == 0) {
2126
- giterr_set(GITERR_CHECKOUT, "could not merge contents of file");
2131
+ git_error_set(GIT_ERROR_CHECKOUT, "could not merge contents of file");
2127
2132
  error = GIT_ECONFLICT;
2128
2133
  goto done;
2129
2134
  }
@@ -2179,7 +2184,7 @@ static int checkout_conflict_add(
2179
2184
  int error = git_index_remove(data->index, conflict->path, 0);
2180
2185
 
2181
2186
  if (error == GIT_ENOTFOUND)
2182
- giterr_clear();
2187
+ git_error_clear();
2183
2188
  else if (error < 0)
2184
2189
  return error;
2185
2190
 
@@ -2370,7 +2375,7 @@ static int checkout_data_init(
2370
2375
  memset(data, 0, sizeof(*data));
2371
2376
 
2372
2377
  if (!repo) {
2373
- giterr_set(GITERR_CHECKOUT, "cannot checkout nothing");
2378
+ git_error_set(GIT_ERROR_CHECKOUT, "cannot checkout nothing");
2374
2379
  return -1;
2375
2380
  }
2376
2381
 
@@ -2381,7 +2386,7 @@ static int checkout_data_init(
2381
2386
  data->repo = repo;
2382
2387
  data->target = target;
2383
2388
 
2384
- GITERR_CHECK_VERSION(
2389
+ GIT_ERROR_CHECK_VERSION(
2385
2390
  proposed, GIT_CHECKOUT_OPTIONS_VERSION, "git_checkout_options");
2386
2391
 
2387
2392
  if (!proposed)
@@ -2424,7 +2429,7 @@ static int checkout_data_init(
2424
2429
  */
2425
2430
  if (git_index_has_conflicts(data->index)) {
2426
2431
  error = GIT_ECONFLICT;
2427
- giterr_set(GITERR_CHECKOUT,
2432
+ git_error_set(GIT_ERROR_CHECKOUT,
2428
2433
  "unresolved conflicts exist in the index");
2429
2434
  goto cleanup;
2430
2435
  }
@@ -2463,12 +2468,12 @@ static int checkout_data_init(
2463
2468
 
2464
2469
  data->pfx = git_pathspec_prefix(&data->opts.paths);
2465
2470
 
2466
- if ((error = git_repository__cvar(
2467
- &data->can_symlink, repo, GIT_CVAR_SYMLINKS)) < 0)
2471
+ if ((error = git_repository__configmap_lookup(
2472
+ &data->can_symlink, repo, GIT_CONFIGMAP_SYMLINKS)) < 0)
2468
2473
  goto cleanup;
2469
2474
 
2470
- if ((error = git_repository__cvar(
2471
- &data->respect_filemode, repo, GIT_CVAR_FILEMODE)) < 0)
2475
+ if ((error = git_repository__configmap_lookup(
2476
+ &data->respect_filemode, repo, GIT_CONFIGMAP_FILEMODE)) < 0)
2472
2477
  goto cleanup;
2473
2478
 
2474
2479
  if (!data->opts.baseline && !data->opts.baseline_index) {
@@ -2483,7 +2488,7 @@ static int checkout_data_init(
2483
2488
 
2484
2489
  if (error == GIT_EUNBORNBRANCH) {
2485
2490
  error = 0;
2486
- giterr_clear();
2491
+ git_error_clear();
2487
2492
  }
2488
2493
 
2489
2494
  if (error < 0)
@@ -2506,7 +2511,7 @@ static int checkout_data_init(
2506
2511
  else if (strcmp(conflict_style->value, "diff3") == 0)
2507
2512
  data->opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_DIFF3;
2508
2513
  else {
2509
- giterr_set(GITERR_CHECKOUT, "unknown style '%s' given for 'merge.conflictstyle'",
2514
+ git_error_set(GIT_ERROR_CHECKOUT, "unknown style '%s' given for 'merge.conflictstyle'",
2510
2515
  conflict_style->value);
2511
2516
  error = -1;
2512
2517
  git_config_entry_free(conflict_style);
@@ -2518,11 +2523,11 @@ static int checkout_data_init(
2518
2523
  git_pool_init(&data->pool, 1);
2519
2524
 
2520
2525
  if ((error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 ||
2521
- (error = git_vector_init(&data->remove_conflicts, 0, NULL)) < 0 ||
2522
- (error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 ||
2523
- (error = git_buf_puts(&data->target_path, data->opts.target_directory)) < 0 ||
2524
- (error = git_path_to_dir(&data->target_path)) < 0 ||
2525
- (error = git_strmap_alloc(&data->mkdir_map)) < 0)
2526
+ (error = git_vector_init(&data->remove_conflicts, 0, NULL)) < 0 ||
2527
+ (error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 ||
2528
+ (error = git_buf_puts(&data->target_path, data->opts.target_directory)) < 0 ||
2529
+ (error = git_path_to_dir(&data->target_path)) < 0 ||
2530
+ (error = git_strmap_new(&data->mkdir_map)) < 0)
2526
2531
  goto cleanup;
2527
2532
 
2528
2533
  data->target_len = git_buf_len(&data->target_path);
@@ -2688,7 +2693,7 @@ int git_checkout_index(
2688
2693
  git_iterator *index_i;
2689
2694
 
2690
2695
  if (!index && !repo) {
2691
- giterr_set(GITERR_CHECKOUT,
2696
+ git_error_set(GIT_ERROR_CHECKOUT,
2692
2697
  "must provide either repository or index to checkout");
2693
2698
  return -1;
2694
2699
  }
@@ -2696,7 +2701,7 @@ int git_checkout_index(
2696
2701
  if (index && repo &&
2697
2702
  git_index_owner(index) &&
2698
2703
  git_index_owner(index) != repo) {
2699
- giterr_set(GITERR_CHECKOUT,
2704
+ git_error_set(GIT_ERROR_CHECKOUT,
2700
2705
  "index to checkout does not match repository");
2701
2706
  return -1;
2702
2707
  } else if(index && repo && !git_index_owner(index)) {
@@ -2735,12 +2740,12 @@ int git_checkout_tree(
2735
2740
  git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
2736
2741
 
2737
2742
  if (!treeish && !repo) {
2738
- giterr_set(GITERR_CHECKOUT,
2743
+ git_error_set(GIT_ERROR_CHECKOUT,
2739
2744
  "must provide either repository or tree to checkout");
2740
2745
  return -1;
2741
2746
  }
2742
2747
  if (treeish && repo && git_object_owner(treeish) != repo) {
2743
- giterr_set(GITERR_CHECKOUT,
2748
+ git_error_set(GIT_ERROR_CHECKOUT,
2744
2749
  "object to checkout does not match repository");
2745
2750
  return -1;
2746
2751
  }
@@ -2749,17 +2754,17 @@ int git_checkout_tree(
2749
2754
  repo = git_object_owner(treeish);
2750
2755
 
2751
2756
  if (treeish) {
2752
- if (git_object_peel((git_object **)&tree, treeish, GIT_OBJ_TREE) < 0) {
2753
- giterr_set(
2754
- GITERR_CHECKOUT, "provided object cannot be peeled to a tree");
2757
+ if (git_object_peel((git_object **)&tree, treeish, GIT_OBJECT_TREE) < 0) {
2758
+ git_error_set(
2759
+ GIT_ERROR_CHECKOUT, "provided object cannot be peeled to a tree");
2755
2760
  return -1;
2756
2761
  }
2757
2762
  }
2758
2763
  else {
2759
2764
  if ((error = checkout_lookup_head_tree(&tree, repo)) < 0) {
2760
2765
  if (error != GIT_EUNBORNBRANCH)
2761
- giterr_set(
2762
- GITERR_CHECKOUT,
2766
+ git_error_set(
2767
+ GIT_ERROR_CHECKOUT,
2763
2768
  "HEAD could not be peeled to a tree and no treeish given");
2764
2769
  return error;
2765
2770
  }
@@ -2791,9 +2796,14 @@ int git_checkout_head(
2791
2796
  return git_checkout_tree(repo, NULL, opts);
2792
2797
  }
2793
2798
 
2794
- int git_checkout_init_options(git_checkout_options *opts, unsigned int version)
2799
+ int git_checkout_options_init(git_checkout_options *opts, unsigned int version)
2795
2800
  {
2796
2801
  GIT_INIT_STRUCTURE_FROM_TEMPLATE(
2797
2802
  opts, version, git_checkout_options, GIT_CHECKOUT_OPTIONS_INIT);
2798
2803
  return 0;
2799
2804
  }
2805
+
2806
+ int git_checkout_init_options(git_checkout_options *opts, unsigned int version)
2807
+ {
2808
+ return git_checkout_options_init(opts, version);
2809
+ }
@@ -30,7 +30,7 @@ static int write_cherrypick_head(
30
30
  int error = 0;
31
31
 
32
32
  if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
33
- (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_CHERRYPICK_FILE_MODE)) >= 0 &&
33
+ (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) >= 0 &&
34
34
  (error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0)
35
35
  error = git_filebuf_commit(&file);
36
36
 
@@ -51,7 +51,7 @@ static int write_merge_msg(
51
51
  int error = 0;
52
52
 
53
53
  if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
54
- (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_CHERRYPICK_FILE_MODE)) < 0 ||
54
+ (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) < 0 ||
55
55
  (error = git_filebuf_printf(&file, "%s", commit_msg)) < 0)
56
56
  goto cleanup;
57
57
 
@@ -108,7 +108,7 @@ static int cherrypick_seterr(git_commit *commit, const char *fmt)
108
108
  {
109
109
  char commit_oidstr[GIT_OID_HEXSZ + 1];
110
110
 
111
- giterr_set(GITERR_CHERRYPICK, fmt,
111
+ git_error_set(GIT_ERROR_CHERRYPICK, fmt,
112
112
  git_oid_tostr(commit_oidstr, GIT_OID_HEXSZ + 1, git_commit_id(commit)));
113
113
 
114
114
  return -1;
@@ -179,7 +179,7 @@ int git_cherrypick(
179
179
 
180
180
  assert(repo && commit);
181
181
 
182
- GITERR_CHECK_VERSION(given_opts, GIT_CHERRYPICK_OPTIONS_VERSION, "git_cherrypick_options");
182
+ GIT_ERROR_CHECK_VERSION(given_opts, GIT_CHERRYPICK_OPTIONS_VERSION, "git_cherrypick_options");
183
183
 
184
184
  if ((error = git_repository__ensure_not_bare(repo, "cherry-pick")) < 0)
185
185
  return error;
@@ -198,7 +198,7 @@ int git_cherrypick(
198
198
  (error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 ||
199
199
  (error = write_cherrypick_head(repo, commit_oidstr)) < 0 ||
200
200
  (error = git_repository_head(&our_ref, repo)) < 0 ||
201
- (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 ||
201
+ (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJECT_COMMIT)) < 0 ||
202
202
  (error = git_cherrypick_commit(&index, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 ||
203
203
  (error = git_merge__check_result(repo, index)) < 0 ||
204
204
  (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 ||
@@ -221,10 +221,16 @@ done:
221
221
  return error;
222
222
  }
223
223
 
224
- int git_cherrypick_init_options(
224
+ int git_cherrypick_options_init(
225
225
  git_cherrypick_options *opts, unsigned int version)
226
226
  {
227
227
  GIT_INIT_STRUCTURE_FROM_TEMPLATE(
228
228
  opts, version, git_cherrypick_options, GIT_CHERRYPICK_OPTIONS_INIT);
229
229
  return 0;
230
230
  }
231
+
232
+ int git_cherrypick_init_options(
233
+ git_cherrypick_options *opts, unsigned int version)
234
+ {
235
+ return git_cherrypick_options_init(opts, version);
236
+ }
@@ -7,8 +7,6 @@
7
7
 
8
8
  #include "clone.h"
9
9
 
10
- #include <assert.h>
11
-
12
10
  #include "git2/clone.h"
13
11
  #include "git2/remote.h"
14
12
  #include "git2/revparse.h"
@@ -19,7 +17,7 @@
19
17
  #include "git2/tree.h"
20
18
 
21
19
  #include "remote.h"
22
- #include "fileops.h"
20
+ #include "futils.h"
23
21
  #include "refs.h"
24
22
  #include "path.h"
25
23
  #include "repository.h"
@@ -176,7 +174,7 @@ static int update_head_to_remote(
176
174
  refspec = git_remote__matching_refspec(remote, git_buf_cstr(&branch));
177
175
 
178
176
  if (refspec == NULL) {
179
- giterr_set(GITERR_NET, "the remote's default branch does not fit the refspec configuration");
177
+ git_error_set(GIT_ERROR_NET, "the remote's default branch does not fit the refspec configuration");
180
178
  error = GIT_EINVALIDSPEC;
181
179
  goto cleanup;
182
180
  }
@@ -332,7 +330,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
332
330
  assert(repo && _remote);
333
331
 
334
332
  if (!git_repository_is_empty(repo)) {
335
- giterr_set(GITERR_INVALID, "the repository is not empty");
333
+ git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
336
334
  return -1;
337
335
  }
338
336
 
@@ -382,11 +380,12 @@ done:
382
380
  return is_local;
383
381
  }
384
382
 
385
- int git_clone(
383
+ static int git__clone(
386
384
  git_repository **out,
387
385
  const char *url,
388
386
  const char *local_path,
389
- const git_clone_options *_options)
387
+ const git_clone_options *_options,
388
+ int use_existing)
390
389
  {
391
390
  int error = 0;
392
391
  git_repository *repo = NULL;
@@ -400,11 +399,11 @@ int git_clone(
400
399
  if (_options)
401
400
  memcpy(&options, _options, sizeof(git_clone_options));
402
401
 
403
- GITERR_CHECK_VERSION(&options, GIT_CLONE_OPTIONS_VERSION, "git_clone_options");
402
+ GIT_ERROR_CHECK_VERSION(&options, GIT_CLONE_OPTIONS_VERSION, "git_clone_options");
404
403
 
405
404
  /* Only clone to a new directory or an empty directory */
406
- if (git_path_exists(local_path) && !git_path_is_empty_dir(local_path)) {
407
- giterr_set(GITERR_INVALID,
405
+ if (git_path_exists(local_path) && !use_existing && !git_path_is_empty_dir(local_path)) {
406
+ git_error_set(GIT_ERROR_INVALID,
408
407
  "'%s' exists and is not an empty directory", local_path);
409
408
  return GIT_EEXISTS;
410
409
  }
@@ -441,27 +440,50 @@ int git_clone(
441
440
 
442
441
  if (error != 0) {
443
442
  git_error_state last_error = {0};
444
- giterr_state_capture(&last_error, error);
443
+ git_error_state_capture(&last_error, error);
445
444
 
446
445
  git_repository_free(repo);
447
446
  repo = NULL;
448
447
 
449
448
  (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
450
449
 
451
- giterr_state_restore(&last_error);
450
+ git_error_state_restore(&last_error);
452
451
  }
453
452
 
454
453
  *out = repo;
455
454
  return error;
456
455
  }
457
456
 
458
- int git_clone_init_options(git_clone_options *opts, unsigned int version)
457
+ int git_clone(
458
+ git_repository **out,
459
+ const char *url,
460
+ const char *local_path,
461
+ const git_clone_options *_options)
462
+ {
463
+ return git__clone(out, url, local_path, _options, 0);
464
+ }
465
+
466
+ int git_clone__submodule(
467
+ git_repository **out,
468
+ const char *url,
469
+ const char *local_path,
470
+ const git_clone_options *_options)
471
+ {
472
+ return git__clone(out, url, local_path, _options, 1);
473
+ }
474
+
475
+ int git_clone_options_init(git_clone_options *opts, unsigned int version)
459
476
  {
460
477
  GIT_INIT_STRUCTURE_FROM_TEMPLATE(
461
478
  opts, version, git_clone_options, GIT_CLONE_OPTIONS_INIT);
462
479
  return 0;
463
480
  }
464
481
 
482
+ int git_clone_init_options(git_clone_options *opts, unsigned int version)
483
+ {
484
+ return git_clone_options_init(opts, version);
485
+ }
486
+
465
487
  static bool can_link(const char *src, const char *dst, int link)
466
488
  {
467
489
  #ifdef GIT_WIN32
@@ -496,7 +518,7 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
496
518
  assert(repo && remote);
497
519
 
498
520
  if (!git_repository_is_empty(repo)) {
499
- giterr_set(GITERR_INVALID, "the repository is not empty");
521
+ git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
500
522
  return -1;
501
523
  }
502
524
 
@@ -11,6 +11,10 @@
11
11
 
12
12
  #include "git2/clone.h"
13
13
 
14
+ extern int git_clone__submodule(git_repository **out,
15
+ const char *url, const char *local_path,
16
+ const git_clone_options *_options);
17
+
14
18
  extern int git_clone__should_clone_local(const char *url, git_clone_local_t local);
15
19
 
16
20
  #endif