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
@@ -15,9 +15,13 @@
15
15
 
16
16
  /**
17
17
  * @file git2/blob.h
18
- * @brief Git blob load and write routines
18
+ * @brief A blob represents a file in a git repository.
19
19
  * @defgroup git_blob Git blob load and write routines
20
20
  * @ingroup Git
21
+ *
22
+ * A blob represents a file in a git repository. This is the raw data
23
+ * as it is stored in the repository itself. Blobs may be "filtered"
24
+ * to produce the on-disk content.
21
25
  * @{
22
26
  */
23
27
  GIT_BEGIN_DECL
@@ -25,12 +29,15 @@ GIT_BEGIN_DECL
25
29
  /**
26
30
  * Lookup a blob object from a repository.
27
31
  *
28
- * @param blob pointer to the looked up blob
32
+ * @param[out] blob pointer to the looked up blob
29
33
  * @param repo the repo to use when locating the blob.
30
34
  * @param id identity of the blob to locate.
31
35
  * @return 0 or an error code
32
36
  */
33
- GIT_EXTERN(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git_oid *id);
37
+ GIT_EXTERN(int) git_blob_lookup(
38
+ git_blob **blob,
39
+ git_repository *repo,
40
+ const git_oid *id);
34
41
 
35
42
  /**
36
43
  * Lookup a blob object from a repository,
@@ -38,7 +45,7 @@ GIT_EXTERN(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git
38
45
  *
39
46
  * @see git_object_lookup_prefix
40
47
  *
41
- * @param blob pointer to the looked up blob
48
+ * @param[out] blob pointer to the looked up blob
42
49
  * @param repo the repo to use when locating the blob.
43
50
  * @param id identity of the blob to locate.
44
51
  * @param len the length of the short identifier
@@ -84,7 +91,7 @@ GIT_EXTERN(git_repository *) git_blob_owner(const git_blob *blob);
84
91
  * time.
85
92
  *
86
93
  * @param blob pointer to the blob
87
- * @return the pointer, or NULL on error
94
+ * @return @type `unsigned char *` the pointer, or NULL on error
88
95
  */
89
96
  GIT_EXTERN(const void *) git_blob_rawcontent(const git_blob *blob);
90
97
 
@@ -92,12 +99,14 @@ GIT_EXTERN(const void *) git_blob_rawcontent(const git_blob *blob);
92
99
  * Get the size in bytes of the contents of a blob
93
100
  *
94
101
  * @param blob pointer to the blob
95
- * @return size on bytes
102
+ * @return size in bytes
96
103
  */
97
104
  GIT_EXTERN(git_object_size_t) git_blob_rawsize(const git_blob *blob);
98
105
 
99
106
  /**
100
107
  * Flags to control the functionality of `git_blob_filter`.
108
+ *
109
+ * @flags
101
110
  */
102
111
  typedef enum {
103
112
  /** When set, filters will not be applied to binary files. */
@@ -128,16 +137,34 @@ typedef enum {
128
137
  * Initialize with `GIT_BLOB_FILTER_OPTIONS_INIT`. Alternatively, you can
129
138
  * use `git_blob_filter_options_init`.
130
139
  *
140
+ * @options[version] GIT_BLOB_FILTER_OPTIONS_VERSION
141
+ * @options[init_macro] GIT_BLOB_FILTER_OPTIONS_INIT
142
+ * @options[init_function] git_blob_filter_options_init
131
143
  */
132
144
  typedef struct {
145
+ /** Version number of the options structure. */
133
146
  int version;
134
147
 
135
- /** Flags to control the filtering process, see `git_blob_filter_flag_t` above */
148
+ /**
149
+ * Flags to control the filtering process, see `git_blob_filter_flag_t` above.
150
+ *
151
+ * @type[flags] git_blob_filter_flag_t
152
+ */
136
153
  uint32_t flags;
137
154
 
138
155
  #ifdef GIT_DEPRECATE_HARD
156
+ /**
157
+ * Unused and reserved for ABI compatibility.
158
+ *
159
+ * @deprecated this value should not be set
160
+ */
139
161
  void *reserved;
140
162
  #else
163
+ /**
164
+ * This value is unused and reserved for API compatibility.
165
+ *
166
+ * @deprecated this value should not be set
167
+ */
141
168
  git_oid *commit_id;
142
169
  #endif
143
170
 
@@ -148,8 +175,18 @@ typedef struct {
148
175
  git_oid attr_commit_id;
149
176
  } git_blob_filter_options;
150
177
 
178
+ /**
179
+ * The current version number for the `git_blob_filter_options` structure ABI.
180
+ */
151
181
  #define GIT_BLOB_FILTER_OPTIONS_VERSION 1
152
- #define GIT_BLOB_FILTER_OPTIONS_INIT {GIT_BLOB_FILTER_OPTIONS_VERSION, GIT_BLOB_FILTER_CHECK_FOR_BINARY}
182
+
183
+ /**
184
+ * The default values for `git_blob_filter_options`.
185
+ */
186
+ #define GIT_BLOB_FILTER_OPTIONS_INIT { \
187
+ GIT_BLOB_FILTER_OPTIONS_VERSION, \
188
+ GIT_BLOB_FILTER_CHECK_FOR_BINARY \
189
+ }
153
190
 
154
191
  /**
155
192
  * Initialize git_blob_filter_options structure
@@ -158,10 +195,12 @@ typedef struct {
158
195
  * to creating an instance with `GIT_BLOB_FILTER_OPTIONS_INIT`.
159
196
  *
160
197
  * @param opts The `git_blob_filter_options` struct to initialize.
161
- * @param version The struct version; pass `GIT_BLOB_FILTER_OPTIONS_VERSION`.
198
+ * @param version The struct version; pass GIT_BLOB_FILTER_OPTIONS_VERSION
162
199
  * @return Zero on success; -1 on failure.
163
200
  */
164
- GIT_EXTERN(int) git_blob_filter_options_init(git_blob_filter_options *opts, unsigned int version);
201
+ GIT_EXTERN(int) git_blob_filter_options_init(
202
+ git_blob_filter_options *opts,
203
+ unsigned int version);
165
204
 
166
205
  /**
167
206
  * Get a buffer with the filtered content of a blob.
@@ -171,7 +210,7 @@ GIT_EXTERN(int) git_blob_filter_options_init(git_blob_filter_options *opts, unsi
171
210
  * CRLF filtering or other types of changes depending on the file
172
211
  * attributes set for the blob and the content detected in it.
173
212
  *
174
- * The output is written into a `git_buf` which the caller must free
213
+ * The output is written into a `git_buf` which the caller must dispose
175
214
  * when done (via `git_buf_dispose`).
176
215
  *
177
216
  * If no filters need to be applied, then the `out` buffer will just
@@ -183,7 +222,7 @@ GIT_EXTERN(int) git_blob_filter_options_init(git_blob_filter_options *opts, unsi
183
222
  * @param blob Pointer to the blob
184
223
  * @param as_path Path used for file attribute lookups, etc.
185
224
  * @param opts Options to use for filtering the blob
186
- * @return 0 on success or an error code
225
+ * @return @type[enum] git_error_code 0 on success or an error code
187
226
  */
188
227
  GIT_EXTERN(int) git_blob_filter(
189
228
  git_buf *out,
@@ -192,10 +231,10 @@ GIT_EXTERN(int) git_blob_filter(
192
231
  git_blob_filter_options *opts);
193
232
 
194
233
  /**
195
- * Read a file from the working folder of a repository
196
- * and write it to the Object Database as a loose blob
234
+ * Read a file from the working folder of a repository and write it
235
+ * to the object database.
197
236
  *
198
- * @param id return the id of the written blob
237
+ * @param[out] id return the id of the written blob
199
238
  * @param repo repository where the blob will be written.
200
239
  * this repository cannot be bare
201
240
  * @param relative_path file from which the blob will be created,
@@ -205,19 +244,23 @@ GIT_EXTERN(int) git_blob_filter(
205
244
  GIT_EXTERN(int) git_blob_create_from_workdir(git_oid *id, git_repository *repo, const char *relative_path);
206
245
 
207
246
  /**
208
- * Read a file from the filesystem and write its content
209
- * to the Object Database as a loose blob
247
+ * Read a file from the filesystem (not necessarily inside the
248
+ * working folder of the repository) and write it to the object
249
+ * database.
210
250
  *
211
- * @param id return the id of the written blob
251
+ * @param[out] id return the id of the written blob
212
252
  * @param repo repository where the blob will be written.
213
253
  * this repository can be bare or not
214
254
  * @param path file from which the blob will be created
215
255
  * @return 0 or an error code
216
256
  */
217
- GIT_EXTERN(int) git_blob_create_from_disk(git_oid *id, git_repository *repo, const char *path);
257
+ GIT_EXTERN(int) git_blob_create_from_disk(
258
+ git_oid *id,
259
+ git_repository *repo,
260
+ const char *path);
218
261
 
219
262
  /**
220
- * Create a stream to write a new blob into the object db
263
+ * Create a stream to write a new blob into the object database.
221
264
  *
222
265
  * This function may need to buffer the data on disk and will in
223
266
  * general not be the right choice if you know the size of the data
@@ -234,7 +277,7 @@ GIT_EXTERN(int) git_blob_create_from_disk(git_oid *id, git_repository *repo, con
234
277
  * what git filters should be applied to the object before it is written
235
278
  * to the object database.
236
279
  *
237
- * @param out the stream into which to write
280
+ * @param[out] out the stream into which to write
238
281
  * @param repo Repository where the blob will be written.
239
282
  * This repository can be bare or not.
240
283
  * @param hintpath If not NULL, will be used to select data filters
@@ -247,11 +290,11 @@ GIT_EXTERN(int) git_blob_create_from_stream(
247
290
  const char *hintpath);
248
291
 
249
292
  /**
250
- * Close the stream and write the blob to the object db
293
+ * Close the stream and finalize writing the blob to the object database.
251
294
  *
252
295
  * The stream will be closed and freed.
253
296
  *
254
- * @param out the id of the new blob
297
+ * @param[out] out the id of the new blob
255
298
  * @param stream the stream to close
256
299
  * @return 0 or an error code
257
300
  */
@@ -260,9 +303,9 @@ GIT_EXTERN(int) git_blob_create_from_stream_commit(
260
303
  git_writestream *stream);
261
304
 
262
305
  /**
263
- * Write an in-memory buffer to the ODB as a blob
306
+ * Write an in-memory buffer to the object database as a blob.
264
307
  *
265
- * @param id return the id of the written blob
308
+ * @param[out] id return the id of the written blob
266
309
  * @param repo repository where the blob will be written
267
310
  * @param buffer data to be written into the blob
268
311
  * @param len length of the data
@@ -272,14 +315,14 @@ GIT_EXTERN(int) git_blob_create_from_buffer(
272
315
  git_oid *id, git_repository *repo, const void *buffer, size_t len);
273
316
 
274
317
  /**
275
- * Determine if the blob content is most certainly binary or not.
318
+ * Determine if the blob content is most likely binary or not.
276
319
  *
277
320
  * The heuristic used to guess if a file is binary is taken from core git:
278
321
  * Searching for NUL bytes and looking for a reasonable ratio of printable
279
322
  * to non-printable characters among the first 8000 bytes.
280
323
  *
281
324
  * @param blob The blob which content should be analyzed
282
- * @return 1 if the content of the blob is detected
325
+ * @return @type bool 1 if the content of the blob is detected
283
326
  * as binary; 0 otherwise.
284
327
  */
285
328
  GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob);
@@ -300,7 +343,7 @@ GIT_EXTERN(int) git_blob_data_is_binary(const char *data, size_t len);
300
343
  * Create an in-memory copy of a blob. The copy must be explicitly
301
344
  * free'd or it will leak.
302
345
  *
303
- * @param out Pointer to store the copy of the object
346
+ * @param[out] out Pointer to store the copy of the object
304
347
  * @param source Original object to copy
305
348
  * @return 0.
306
349
  */
@@ -13,9 +13,15 @@
13
13
 
14
14
  /**
15
15
  * @file git2/branch.h
16
- * @brief Git branch parsing routines
16
+ * @brief Branch creation and handling
17
17
  * @defgroup git_branch Git branch management
18
18
  * @ingroup Git
19
+ *
20
+ * A branch is a specific type of reference, at any particular time,
21
+ * a git working directory typically is said to have a branch "checked out",
22
+ * meaning that commits that are created will be made "on" a branch.
23
+ * This occurs by updating the branch reference to point to the new
24
+ * commit. The checked out branch is indicated by the `HEAD` meta-ref.
19
25
  * @{
20
26
  */
21
27
  GIT_BEGIN_DECL
@@ -33,18 +39,13 @@ GIT_BEGIN_DECL
33
39
  * See `git_tag_create()` for rules about valid names.
34
40
  *
35
41
  * @param out Pointer where to store the underlying reference.
36
- *
37
42
  * @param repo the repository to create the branch in.
38
- *
39
43
  * @param branch_name Name for the branch; this name is
40
- * validated for consistency. It should also not conflict with
41
- * an already existing branch name.
42
- *
44
+ * validated for consistency. It should also not conflict with
45
+ * an already existing branch name.
43
46
  * @param target Commit to which this branch should point. This object
44
- * must belong to the given `repo`.
45
- *
47
+ * must belong to the given `repo`.
46
48
  * @param force Overwrite existing branch.
47
- *
48
49
  * @return 0, GIT_EINVALIDSPEC or an error code.
49
50
  * A proper reference is written in the refs/heads namespace
50
51
  * pointing to the provided target commit.
@@ -63,15 +64,21 @@ GIT_EXTERN(int) git_branch_create(
63
64
  * commit, which lets you specify which extended sha syntax string was
64
65
  * specified by a user, allowing for more exact reflog messages.
65
66
  *
66
- * See the documentation for `git_branch_create()`.
67
- *
68
- * @see git_branch_create
67
+ * @param ref_out Pointer where to store the underlying reference.
68
+ * @param repo the repository to create the branch in.
69
+ * @param branch_name Name for the branch; this name is
70
+ * validated for consistency. It should also not conflict with
71
+ * an already existing branch name.
72
+ * @param target Annotated commit to which this branch should point. This
73
+ * object must belong to the given `repo`.
74
+ * @param force Overwrite existing branch.
75
+ * @return 0, GIT_EINVALIDSPEC or an error code.
69
76
  */
70
77
  GIT_EXTERN(int) git_branch_create_from_annotated(
71
78
  git_reference **ref_out,
72
- git_repository *repository,
79
+ git_repository *repo,
73
80
  const char *branch_name,
74
- const git_annotated_commit *commit,
81
+ const git_annotated_commit *target,
75
82
  int force);
76
83
 
77
84
  /**
@@ -222,7 +229,7 @@ GIT_EXTERN(int) git_branch_upstream(
222
229
  * @param branch the branch to configure
223
230
  * @param branch_name remote-tracking or local branch to set as upstream.
224
231
  *
225
- * @return 0 on success; GIT_ENOTFOUND if there's no branch named `branch_name`
232
+ * @return @type git_error_t 0 on success; GIT_ENOTFOUND if there's no branch named `branch_name`
226
233
  * or an error code
227
234
  */
228
235
  GIT_EXTERN(int) git_branch_set_upstream(
@@ -11,9 +11,12 @@
11
11
 
12
12
  /**
13
13
  * @file git2/buffer.h
14
- * @brief Buffer export structure
15
- *
14
+ * @brief A data structure to return data to callers
16
15
  * @ingroup Git
16
+ *
17
+ * The `git_buf` buffer is used to return arbitrary data - typically
18
+ * strings - to callers. Callers are responsible for freeing the memory
19
+ * in a buffer with the `git_buf_dispose` function.
17
20
  * @{
18
21
  */
19
22
  GIT_BEGIN_DECL
@@ -67,8 +70,7 @@ typedef struct {
67
70
  */
68
71
  GIT_EXTERN(void) git_buf_dispose(git_buf *buffer);
69
72
 
70
- GIT_END_DECL
71
-
72
73
  /** @} */
74
+ GIT_END_DECL
73
75
 
74
76
  #endif
@@ -12,7 +12,7 @@
12
12
 
13
13
  /**
14
14
  * @file git2/cert.h
15
- * @brief Git certificate objects
15
+ * @brief TLS and SSH certificate handling
16
16
  * @defgroup git_cert Certificate objects
17
17
  * @ingroup Git
18
18
  * @{
@@ -169,4 +169,5 @@ typedef struct {
169
169
 
170
170
  /** @} */
171
171
  GIT_END_DECL
172
+
172
173
  #endif
@@ -13,9 +13,13 @@
13
13
 
14
14
  /**
15
15
  * @file git2/checkout.h
16
- * @brief Git checkout routines
16
+ * @brief Update the contents of the working directory
17
17
  * @defgroup git_checkout Git checkout routines
18
18
  * @ingroup Git
19
+ *
20
+ * Update the contents of the working directory, or a subset of the
21
+ * files in the working directory, to point to the data in the index
22
+ * or a specific commit.
19
23
  * @{
20
24
  */
21
25
  GIT_BEGIN_DECL
@@ -31,17 +35,11 @@ GIT_BEGIN_DECL
31
35
  * check out, the "baseline" tree of what was checked out previously, the
32
36
  * working directory for actual files, and the index for staged changes.
33
37
  *
34
- * You give checkout one of three strategies for update:
35
- *
36
- * - `GIT_CHECKOUT_NONE` is a dry-run strategy that checks for conflicts,
37
- * etc., but doesn't make any actual changes.
38
- *
39
- * - `GIT_CHECKOUT_FORCE` is at the opposite extreme, taking any action to
40
- * make the working directory match the target (including potentially
41
- * discarding modified files).
38
+ * You give checkout one of two strategies for update:
42
39
  *
43
- * - `GIT_CHECKOUT_SAFE` is between these two options, it will only make
44
- * modifications that will not lose changes.
40
+ * - `GIT_CHECKOUT_SAFE` is the default, and similar to git's default,
41
+ * which will make modifications that will not lose changes in the
42
+ * working directory.
45
43
  *
46
44
  * | target == baseline | target != baseline |
47
45
  * ---------------------|-----------------------|----------------------|
@@ -55,6 +53,10 @@ GIT_BEGIN_DECL
55
53
  * baseline present | | |
56
54
  * ---------------------|-----------------------|----------------------|
57
55
  *
56
+ * - `GIT_CHECKOUT_FORCE` will take any action to make the working
57
+ * directory match the target (including potentially discarding
58
+ * modified files).
59
+ *
58
60
  * To emulate `git checkout`, use `GIT_CHECKOUT_SAFE` with a checkout
59
61
  * notification callback (see below) that displays information about dirty
60
62
  * files. The default behavior will cancel checkout on conflicts.
@@ -69,6 +71,9 @@ GIT_BEGIN_DECL
69
71
  *
70
72
  * There are some additional flags to modify the behavior of checkout:
71
73
  *
74
+ * - `GIT_CHECKOUT_DRY_RUN` is a dry-run strategy that checks for conflicts,
75
+ * etc., but doesn't make any actual changes.
76
+ *
72
77
  * - GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates
73
78
  * even if there are conflicts (instead of cancelling the checkout).
74
79
  *
@@ -102,29 +107,24 @@ GIT_BEGIN_DECL
102
107
  * files or folders that fold to the same name on case insensitive
103
108
  * filesystems. This can cause files to retain their existing names
104
109
  * and write through existing symbolic links.
110
+ *
111
+ * @flags
105
112
  */
106
113
  typedef enum {
107
- GIT_CHECKOUT_NONE = 0, /**< default is a dry run, no actual updates */
108
-
109
114
  /**
110
115
  * Allow safe updates that cannot overwrite uncommitted data.
111
- * If the uncommitted changes don't conflict with the checked out files,
112
- * the checkout will still proceed, leaving the changes intact.
113
- *
114
- * Mutually exclusive with GIT_CHECKOUT_FORCE.
115
- * GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.
116
+ * If the uncommitted changes don't conflict with the checked
117
+ * out files, the checkout will still proceed, leaving the
118
+ * changes intact.
116
119
  */
117
- GIT_CHECKOUT_SAFE = (1u << 0),
120
+ GIT_CHECKOUT_SAFE = 0,
118
121
 
119
122
  /**
120
- * Allow all updates to force working directory to look like index.
121
- *
122
- * Mutually exclusive with GIT_CHECKOUT_SAFE.
123
- * GIT_CHECKOUT_FORCE takes precedence over GIT_CHECKOUT_SAFE.
123
+ * Allow all updates to force working directory to look like
124
+ * the index, potentially losing data in the process.
124
125
  */
125
126
  GIT_CHECKOUT_FORCE = (1u << 1),
126
127
 
127
-
128
128
  /** Allow checkout to recreate missing files */
129
129
  GIT_CHECKOUT_RECREATE_MISSING = (1u << 2),
130
130
 
@@ -178,8 +178,9 @@ typedef enum {
178
178
  GIT_CHECKOUT_DONT_WRITE_INDEX = (1u << 23),
179
179
 
180
180
  /**
181
- * Show what would be done by a checkout. Stop after sending
182
- * notifications; don't update the working directory or index.
181
+ * Perform a "dry run", reporting what _would_ be done but
182
+ * without actually making changes in the working directory
183
+ * or the index.
183
184
  */
184
185
  GIT_CHECKOUT_DRY_RUN = (1u << 24),
185
186
 
@@ -187,6 +188,14 @@ typedef enum {
187
188
  GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3 = (1u << 25),
188
189
 
189
190
  /**
191
+ * Do not do a checkout and do not fire callbacks; this is primarily
192
+ * useful only for internal functions that will perform the
193
+ * checkout themselves but need to pass checkout options into
194
+ * another function, for example, `git_clone`.
195
+ */
196
+ GIT_CHECKOUT_NONE = (1u << 30),
197
+
198
+ /*
190
199
  * THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED
191
200
  */
192
201
 
@@ -194,7 +203,6 @@ typedef enum {
194
203
  GIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16),
195
204
  /** Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) */
196
205
  GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17)
197
-
198
206
  } git_checkout_strategy_t;
199
207
 
200
208
  /**
@@ -210,6 +218,8 @@ typedef enum {
210
218
  * Notification callbacks are made prior to modifying any files on disk,
211
219
  * so canceling on any notification will still happen prior to any files
212
220
  * being modified.
221
+ *
222
+ * @flags
213
223
  */
214
224
  typedef enum {
215
225
  GIT_CHECKOUT_NOTIFY_NONE = 0,
@@ -251,7 +261,17 @@ typedef struct {
251
261
  size_t chmod_calls;
252
262
  } git_checkout_perfdata;
253
263
 
254
- /** Checkout notification callback function */
264
+ /**
265
+ * Checkout notification callback function.
266
+ *
267
+ * @param why the notification reason
268
+ * @param path the path to the file being checked out
269
+ * @param baseline the baseline's diff file information
270
+ * @param target the checkout target diff file information
271
+ * @param workdir the working directory diff file information
272
+ * @param payload the user-supplied callback payload
273
+ * @return 0 on success, or an error code
274
+ */
255
275
  typedef int GIT_CALLBACK(git_checkout_notify_cb)(
256
276
  git_checkout_notify_t why,
257
277
  const char *path,
@@ -260,14 +280,26 @@ typedef int GIT_CALLBACK(git_checkout_notify_cb)(
260
280
  const git_diff_file *workdir,
261
281
  void *payload);
262
282
 
263
- /** Checkout progress notification function */
283
+ /**
284
+ * Checkout progress notification function.
285
+ *
286
+ * @param path the path to the file being checked out
287
+ * @param completed_steps number of checkout steps completed
288
+ * @param total_steps number of total steps in the checkout process
289
+ * @param payload the user-supplied callback payload
290
+ */
264
291
  typedef void GIT_CALLBACK(git_checkout_progress_cb)(
265
292
  const char *path,
266
293
  size_t completed_steps,
267
294
  size_t total_steps,
268
295
  void *payload);
269
296
 
270
- /** Checkout perfdata notification function */
297
+ /**
298
+ * Checkout performance data reporting function.
299
+ *
300
+ * @param perfdata the performance data for the checkout
301
+ * @param payload the user-supplied callback payload
302
+ */
271
303
  typedef void GIT_CALLBACK(git_checkout_perfdata_cb)(
272
304
  const git_checkout_perfdata *perfdata,
273
305
  void *payload);
@@ -278,10 +310,18 @@ typedef void GIT_CALLBACK(git_checkout_perfdata_cb)(
278
310
  * Initialize with `GIT_CHECKOUT_OPTIONS_INIT`. Alternatively, you can
279
311
  * use `git_checkout_options_init`.
280
312
  *
313
+ * @options[version] GIT_CHECKOUT_OPTIONS_VERSION
314
+ * @options[init_macro] GIT_CHECKOUT_OPTIONS_INIT
315
+ * @options[init_function] git_checkout_options_init
281
316
  */
282
317
  typedef struct git_checkout_options {
283
318
  unsigned int version; /**< The version */
284
319
 
320
+ /**
321
+ * Checkout strategy. Default is a safe checkout.
322
+ *
323
+ * @type[flags] git_checkout_strategy_t
324
+ */
285
325
  unsigned int checkout_strategy; /**< default will be a safe checkout */
286
326
 
287
327
  int disable_filters; /**< don't apply filters like CRLF conversion */
@@ -289,7 +329,13 @@ typedef struct git_checkout_options {
289
329
  unsigned int file_mode; /**< default is 0644 or 0755 as dictated by blob */
290
330
  int file_open_flags; /**< default is O_CREAT | O_TRUNC | O_WRONLY */
291
331
 
292
- unsigned int notify_flags; /**< see `git_checkout_notify_t` above */
332
+ /**
333
+ * Checkout notification flags specify what operations the notify
334
+ * callback is invoked for.
335
+ *
336
+ * @type[flags] git_checkout_notify_t
337
+ */
338
+ unsigned int notify_flags;
293
339
 
294
340
  /**
295
341
  * Optional callback to get notifications on specific file states.
@@ -344,8 +390,12 @@ typedef struct git_checkout_options {
344
390
  void *perfdata_payload;
345
391
  } git_checkout_options;
346
392
 
393
+
394
+ /** Current version for the `git_checkout_options` structure */
347
395
  #define GIT_CHECKOUT_OPTIONS_VERSION 1
348
- #define GIT_CHECKOUT_OPTIONS_INIT {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}
396
+
397
+ /** Static constructor for `git_checkout_options` */
398
+ #define GIT_CHECKOUT_OPTIONS_INIT { GIT_CHECKOUT_OPTIONS_VERSION }
349
399
 
350
400
  /**
351
401
  * Initialize git_checkout_options structure
@@ -414,4 +464,5 @@ GIT_EXTERN(int) git_checkout_tree(
414
464
 
415
465
  /** @} */
416
466
  GIT_END_DECL
467
+
417
468
  #endif
@@ -13,9 +13,12 @@
13
13
 
14
14
  /**
15
15
  * @file git2/cherrypick.h
16
- * @brief Git cherry-pick routines
16
+ * @brief Cherry-pick the contents of an individual commit
17
17
  * @defgroup git_cherrypick Git cherry-pick routines
18
18
  * @ingroup Git
19
+ *
20
+ * "Cherry-pick" will attempts to re-apply the changes in an
21
+ * individual commit to the current index and working directory.
19
22
  * @{
20
23
  */
21
24
  GIT_BEGIN_DECL
@@ -33,8 +36,13 @@ typedef struct {
33
36
  git_checkout_options checkout_opts; /**< Options for the checkout */
34
37
  } git_cherrypick_options;
35
38
 
39
+ /** Current version for the `git_cherrypick_options` structure */
36
40
  #define GIT_CHERRYPICK_OPTIONS_VERSION 1
37
- #define GIT_CHERRYPICK_OPTIONS_INIT {GIT_CHERRYPICK_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
41
+
42
+ /** Static constructor for `git_cherrypick_options` */
43
+ #define GIT_CHERRYPICK_OPTIONS_INIT { \
44
+ GIT_CHERRYPICK_OPTIONS_VERSION, 0, \
45
+ GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT }
38
46
 
39
47
  /**
40
48
  * Initialize git_cherrypick_options structure
@@ -89,4 +97,3 @@ GIT_EXTERN(int) git_cherrypick(
89
97
  GIT_END_DECL
90
98
 
91
99
  #endif
92
-