rugged 0.26.7 → 0.27.0

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 (341) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/ext/rugged/rugged_blame.c +6 -3
  4. data/ext/rugged/rugged_branch_collection.c +3 -6
  5. data/ext/rugged/rugged_commit.c +56 -0
  6. data/ext/rugged/rugged_config.c +44 -9
  7. data/ext/rugged/rugged_diff.c +3 -14
  8. data/ext/rugged/rugged_diff_hunk.c +1 -3
  9. data/ext/rugged/rugged_index.c +1 -5
  10. data/ext/rugged/rugged_note.c +1 -4
  11. data/ext/rugged/rugged_patch.c +1 -4
  12. data/ext/rugged/rugged_reference_collection.c +1 -7
  13. data/ext/rugged/rugged_remote.c +5 -8
  14. data/ext/rugged/rugged_remote_collection.c +1 -6
  15. data/ext/rugged/rugged_repo.c +16 -48
  16. data/ext/rugged/rugged_revwalk.c +7 -16
  17. data/ext/rugged/rugged_settings.c +28 -0
  18. data/ext/rugged/rugged_submodule_collection.c +3 -4
  19. data/ext/rugged/rugged_tag_collection.c +1 -5
  20. data/ext/rugged/rugged_tree.c +2 -3
  21. data/lib/rugged/repository.rb +43 -0
  22. data/lib/rugged/version.rb +1 -1
  23. data/vendor/libgit2/AUTHORS +1 -0
  24. data/vendor/libgit2/CMakeLists.txt +61 -510
  25. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +14 -0
  26. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +25 -8
  27. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +27 -8
  28. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +20 -0
  29. data/vendor/libgit2/cmake/Modules/IdeSplitSources.cmake +22 -0
  30. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +3 -0
  31. data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
  32. data/vendor/libgit2/deps/winhttp/CMakeLists.txt +26 -0
  33. data/vendor/libgit2/deps/zlib/CMakeLists.txt +4 -0
  34. data/vendor/libgit2/include/git2/config.h +29 -2
  35. data/vendor/libgit2/include/git2/describe.h +1 -1
  36. data/vendor/libgit2/include/git2/diff.h +59 -8
  37. data/vendor/libgit2/include/git2/graph.h +3 -0
  38. data/vendor/libgit2/include/git2/merge.h +6 -0
  39. data/vendor/libgit2/include/git2/message.h +43 -3
  40. data/vendor/libgit2/include/git2/notes.h +89 -0
  41. data/vendor/libgit2/include/git2/odb.h +8 -1
  42. data/vendor/libgit2/include/git2/patch.h +2 -2
  43. data/vendor/libgit2/include/git2/pathspec.h +35 -18
  44. data/vendor/libgit2/include/git2/refs.h +3 -0
  45. data/vendor/libgit2/include/git2/remote.h +34 -4
  46. data/vendor/libgit2/include/git2/repository.h +6 -6
  47. data/vendor/libgit2/include/git2/reset.h +4 -4
  48. data/vendor/libgit2/include/git2/status.h +4 -0
  49. data/vendor/libgit2/include/git2/sys/config.h +4 -1
  50. data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -1
  51. data/vendor/libgit2/include/git2/tree.h +4 -3
  52. data/vendor/libgit2/include/git2/types.h +1 -0
  53. data/vendor/libgit2/include/git2/version.h +4 -4
  54. data/vendor/libgit2/include/git2/worktree.h +1 -1
  55. data/vendor/libgit2/src/CMakeLists.txt +463 -0
  56. data/vendor/libgit2/src/annotated_commit.c +1 -1
  57. data/vendor/libgit2/src/annotated_commit.h +2 -0
  58. data/vendor/libgit2/src/apply.c +2 -1
  59. data/vendor/libgit2/src/apply.h +2 -0
  60. data/vendor/libgit2/src/attr.c +24 -4
  61. data/vendor/libgit2/src/attr.h +2 -0
  62. data/vendor/libgit2/src/attr_file.c +9 -2
  63. data/vendor/libgit2/src/attr_file.h +2 -0
  64. data/vendor/libgit2/src/attrcache.c +9 -1
  65. data/vendor/libgit2/src/attrcache.h +2 -0
  66. data/vendor/libgit2/src/blame.c +1 -0
  67. data/vendor/libgit2/src/blame.h +2 -1
  68. data/vendor/libgit2/src/blame_git.c +1 -0
  69. data/vendor/libgit2/src/blame_git.h +2 -0
  70. data/vendor/libgit2/src/blob.c +2 -2
  71. data/vendor/libgit2/src/blob.h +2 -0
  72. data/vendor/libgit2/src/branch.c +8 -1
  73. data/vendor/libgit2/src/branch.h +2 -0
  74. data/vendor/libgit2/src/buf_text.c +7 -7
  75. data/vendor/libgit2/src/buf_text.h +3 -3
  76. data/vendor/libgit2/src/buffer.c +31 -1
  77. data/vendor/libgit2/src/buffer.h +3 -0
  78. data/vendor/libgit2/src/cache.c +2 -2
  79. data/vendor/libgit2/src/cache.h +2 -0
  80. data/vendor/libgit2/src/cc-compat.h +3 -3
  81. data/vendor/libgit2/src/checkout.c +30 -19
  82. data/vendor/libgit2/src/checkout.h +2 -0
  83. data/vendor/libgit2/src/cherrypick.c +1 -0
  84. data/vendor/libgit2/src/clone.c +2 -1
  85. data/vendor/libgit2/src/clone.h +4 -0
  86. data/vendor/libgit2/src/commit.c +2 -1
  87. data/vendor/libgit2/src/commit.h +2 -0
  88. data/vendor/libgit2/src/commit_list.c +1 -1
  89. data/vendor/libgit2/src/commit_list.h +2 -0
  90. data/vendor/libgit2/src/common.h +11 -5
  91. data/vendor/libgit2/src/config.c +12 -10
  92. data/vendor/libgit2/src/config.h +2 -0
  93. data/vendor/libgit2/src/config_cache.c +1 -0
  94. data/vendor/libgit2/src/config_file.c +287 -786
  95. data/vendor/libgit2/src/config_file.h +4 -3
  96. data/vendor/libgit2/src/config_parse.c +525 -0
  97. data/vendor/libgit2/src/config_parse.h +64 -0
  98. data/vendor/libgit2/src/crlf.c +2 -1
  99. data/vendor/libgit2/src/delta.c +28 -30
  100. data/vendor/libgit2/src/delta.h +1 -0
  101. data/vendor/libgit2/src/describe.c +3 -1
  102. data/vendor/libgit2/src/diff.c +148 -2
  103. data/vendor/libgit2/src/diff.h +3 -1
  104. data/vendor/libgit2/src/diff_driver.c +12 -9
  105. data/vendor/libgit2/src/diff_driver.h +4 -1
  106. data/vendor/libgit2/src/diff_file.c +7 -4
  107. data/vendor/libgit2/src/diff_file.h +1 -0
  108. data/vendor/libgit2/src/diff_generate.c +6 -3
  109. data/vendor/libgit2/src/diff_generate.h +6 -1
  110. data/vendor/libgit2/src/diff_parse.c +5 -4
  111. data/vendor/libgit2/src/diff_parse.h +2 -0
  112. data/vendor/libgit2/src/diff_print.c +2 -0
  113. data/vendor/libgit2/src/diff_stats.c +2 -0
  114. data/vendor/libgit2/src/diff_tform.c +2 -1
  115. data/vendor/libgit2/src/diff_tform.h +4 -1
  116. data/vendor/libgit2/src/diff_xdiff.c +5 -2
  117. data/vendor/libgit2/src/diff_xdiff.h +2 -0
  118. data/vendor/libgit2/src/errors.c +2 -0
  119. data/vendor/libgit2/src/features.h.in +36 -0
  120. data/vendor/libgit2/src/fetch.c +2 -2
  121. data/vendor/libgit2/src/fetch.h +4 -0
  122. data/vendor/libgit2/src/fetchhead.c +3 -3
  123. data/vendor/libgit2/src/fetchhead.h +3 -0
  124. data/vendor/libgit2/src/filebuf.c +2 -1
  125. data/vendor/libgit2/src/filebuf.h +2 -0
  126. data/vendor/libgit2/src/fileops.c +12 -1
  127. data/vendor/libgit2/src/fileops.h +7 -1
  128. data/vendor/libgit2/src/filter.c +2 -1
  129. data/vendor/libgit2/src/filter.h +1 -0
  130. data/vendor/libgit2/src/fnmatch.c +2 -2
  131. data/vendor/libgit2/src/fnmatch.h +3 -4
  132. data/vendor/libgit2/src/global.c +4 -3
  133. data/vendor/libgit2/src/global.h +1 -5
  134. data/vendor/libgit2/src/graph.c +2 -0
  135. data/vendor/libgit2/src/hash.c +0 -1
  136. data/vendor/libgit2/src/hash.h +3 -1
  137. data/vendor/libgit2/src/hash/hash_collisiondetect.h +3 -3
  138. data/vendor/libgit2/src/hash/hash_common_crypto.h +18 -5
  139. data/vendor/libgit2/src/hash/hash_generic.c +2 -2
  140. data/vendor/libgit2/src/hash/hash_generic.h +5 -3
  141. data/vendor/libgit2/src/hash/hash_openssl.h +3 -3
  142. data/vendor/libgit2/src/hash/hash_win32.c +57 -14
  143. data/vendor/libgit2/src/hash/hash_win32.h +4 -3
  144. data/vendor/libgit2/src/hashsig.c +3 -0
  145. data/vendor/libgit2/src/ident.c +2 -0
  146. data/vendor/libgit2/src/idxmap.h +2 -1
  147. data/vendor/libgit2/src/ignore.c +14 -2
  148. data/vendor/libgit2/src/ignore.h +2 -0
  149. data/vendor/libgit2/src/index.c +20 -40
  150. data/vendor/libgit2/src/index.h +2 -0
  151. data/vendor/libgit2/src/indexer.c +13 -5
  152. data/vendor/libgit2/src/indexer.h +5 -1
  153. data/vendor/libgit2/src/integer.h +1 -1
  154. data/vendor/libgit2/src/iterator.c +44 -3
  155. data/vendor/libgit2/src/iterator.h +3 -0
  156. data/vendor/libgit2/src/map.h +1 -1
  157. data/vendor/libgit2/src/merge.c +155 -33
  158. data/vendor/libgit2/src/merge.h +2 -0
  159. data/vendor/libgit2/src/merge_driver.c +2 -2
  160. data/vendor/libgit2/src/merge_driver.h +2 -0
  161. data/vendor/libgit2/src/merge_file.c +3 -0
  162. data/vendor/libgit2/src/message.h +3 -1
  163. data/vendor/libgit2/src/mwindow.c +1 -1
  164. data/vendor/libgit2/src/mwindow.h +2 -0
  165. data/vendor/libgit2/src/netops.c +75 -62
  166. data/vendor/libgit2/src/netops.h +2 -1
  167. data/vendor/libgit2/src/notes.c +164 -48
  168. data/vendor/libgit2/src/notes.h +1 -1
  169. data/vendor/libgit2/src/object.c +14 -3
  170. data/vendor/libgit2/src/object.h +4 -0
  171. data/vendor/libgit2/src/object_api.c +3 -2
  172. data/vendor/libgit2/src/odb.c +104 -38
  173. data/vendor/libgit2/src/odb.h +3 -1
  174. data/vendor/libgit2/src/odb_loose.c +414 -267
  175. data/vendor/libgit2/src/odb_mempack.c +1 -0
  176. data/vendor/libgit2/src/odb_pack.c +2 -1
  177. data/vendor/libgit2/src/offmap.h +1 -0
  178. data/vendor/libgit2/src/oid.c +2 -1
  179. data/vendor/libgit2/src/oid.h +3 -8
  180. data/vendor/libgit2/src/oidarray.c +2 -1
  181. data/vendor/libgit2/src/oidarray.h +1 -0
  182. data/vendor/libgit2/src/oidmap.h +1 -0
  183. data/vendor/libgit2/src/pack-objects.c +5 -1
  184. data/vendor/libgit2/src/pack-objects.h +1 -1
  185. data/vendor/libgit2/src/pack.c +2 -6
  186. data/vendor/libgit2/src/pack.h +2 -1
  187. data/vendor/libgit2/src/parse.c +121 -0
  188. data/vendor/libgit2/src/parse.h +61 -0
  189. data/vendor/libgit2/src/patch.c +9 -2
  190. data/vendor/libgit2/src/patch.h +2 -0
  191. data/vendor/libgit2/src/patch_generate.c +6 -5
  192. data/vendor/libgit2/src/patch_generate.h +1 -0
  193. data/vendor/libgit2/src/patch_parse.c +265 -276
  194. data/vendor/libgit2/src/patch_parse.h +6 -11
  195. data/vendor/libgit2/src/path.c +24 -181
  196. data/vendor/libgit2/src/path.h +14 -73
  197. data/vendor/libgit2/src/pathspec.c +2 -1
  198. data/vendor/libgit2/src/pathspec.h +2 -1
  199. data/vendor/libgit2/src/pool.c +8 -0
  200. data/vendor/libgit2/src/pool.h +1 -0
  201. data/vendor/libgit2/src/posix.c +2 -1
  202. data/vendor/libgit2/src/posix.h +1 -0
  203. data/vendor/libgit2/src/pqueue.c +1 -0
  204. data/vendor/libgit2/src/pqueue.h +2 -0
  205. data/vendor/libgit2/src/proxy.c +2 -1
  206. data/vendor/libgit2/src/proxy.h +3 -1
  207. data/vendor/libgit2/src/push.c +4 -171
  208. data/vendor/libgit2/src/push.h +2 -0
  209. data/vendor/libgit2/src/rebase.c +1 -0
  210. data/vendor/libgit2/src/refdb.c +2 -3
  211. data/vendor/libgit2/src/refdb.h +2 -0
  212. data/vendor/libgit2/src/refdb_fs.c +5 -3
  213. data/vendor/libgit2/src/refdb_fs.h +4 -0
  214. data/vendor/libgit2/src/reflog.c +1 -0
  215. data/vendor/libgit2/src/reflog.h +2 -1
  216. data/vendor/libgit2/src/refs.c +1 -0
  217. data/vendor/libgit2/src/refs.h +2 -1
  218. data/vendor/libgit2/src/refspec.c +2 -2
  219. data/vendor/libgit2/src/refspec.h +2 -0
  220. data/vendor/libgit2/src/remote.c +56 -10
  221. data/vendor/libgit2/src/remote.h +2 -0
  222. data/vendor/libgit2/src/repository.c +16 -14
  223. data/vendor/libgit2/src/repository.h +2 -0
  224. data/vendor/libgit2/src/reset.c +6 -5
  225. data/vendor/libgit2/src/revert.c +1 -0
  226. data/vendor/libgit2/src/revparse.c +3 -5
  227. data/vendor/libgit2/src/revwalk.c +2 -2
  228. data/vendor/libgit2/src/revwalk.h +2 -0
  229. data/vendor/libgit2/src/settings.c +6 -8
  230. data/vendor/libgit2/src/sha1_lookup.c +2 -216
  231. data/vendor/libgit2/src/sha1_lookup.h +2 -6
  232. data/vendor/libgit2/src/signature.c +8 -3
  233. data/vendor/libgit2/src/signature.h +2 -0
  234. data/vendor/libgit2/src/sortedcache.c +7 -0
  235. data/vendor/libgit2/src/sortedcache.h +2 -0
  236. data/vendor/libgit2/src/stash.c +1 -0
  237. data/vendor/libgit2/src/status.c +14 -9
  238. data/vendor/libgit2/src/status.h +2 -0
  239. data/vendor/libgit2/src/{curl_stream.c → streams/curl.c} +2 -0
  240. data/vendor/libgit2/src/{curl_stream.h → streams/curl.h} +4 -2
  241. data/vendor/libgit2/src/{openssl_stream.c → streams/openssl.c} +47 -18
  242. data/vendor/libgit2/src/{openssl_stream.h → streams/openssl.h} +6 -2
  243. data/vendor/libgit2/src/{socket_stream.c → streams/socket.c} +2 -2
  244. data/vendor/libgit2/src/{socket_stream.h → streams/socket.h} +4 -2
  245. data/vendor/libgit2/src/{stransport_stream.c → streams/stransport.c} +4 -2
  246. data/vendor/libgit2/src/{stransport_stream.h → streams/stransport.h} +4 -2
  247. data/vendor/libgit2/src/{tls_stream.c → streams/tls.c} +4 -3
  248. data/vendor/libgit2/src/{tls_stream.h → streams/tls.h} +4 -2
  249. data/vendor/libgit2/src/submodule.c +28 -80
  250. data/vendor/libgit2/src/submodule.h +2 -13
  251. data/vendor/libgit2/src/sysdir.c +75 -8
  252. data/vendor/libgit2/src/sysdir.h +2 -1
  253. data/vendor/libgit2/src/tag.c +2 -2
  254. data/vendor/libgit2/src/tag.h +2 -0
  255. data/vendor/libgit2/src/thread-utils.c +1 -0
  256. data/vendor/libgit2/src/thread-utils.h +1 -1
  257. data/vendor/libgit2/src/trace.c +2 -2
  258. data/vendor/libgit2/src/trace.h +2 -0
  259. data/vendor/libgit2/src/trailer.c +416 -0
  260. data/vendor/libgit2/src/transaction.c +2 -1
  261. data/vendor/libgit2/src/transport.c +2 -0
  262. data/vendor/libgit2/src/transports/auth.c +2 -1
  263. data/vendor/libgit2/src/transports/auth.h +4 -3
  264. data/vendor/libgit2/src/transports/auth_negotiate.c +2 -1
  265. data/vendor/libgit2/src/transports/auth_negotiate.h +3 -3
  266. data/vendor/libgit2/src/transports/cred.c +2 -0
  267. data/vendor/libgit2/src/transports/cred.h +4 -2
  268. data/vendor/libgit2/src/transports/cred_helpers.c +1 -0
  269. data/vendor/libgit2/src/transports/git.c +3 -1
  270. data/vendor/libgit2/src/transports/http.c +10 -14
  271. data/vendor/libgit2/src/transports/http.h +23 -0
  272. data/vendor/libgit2/src/transports/local.c +23 -5
  273. data/vendor/libgit2/src/transports/smart.c +3 -1
  274. data/vendor/libgit2/src/transports/smart.h +23 -16
  275. data/vendor/libgit2/src/transports/smart_pkt.c +114 -130
  276. data/vendor/libgit2/src/transports/smart_protocol.c +26 -22
  277. data/vendor/libgit2/src/transports/ssh.c +12 -7
  278. data/vendor/libgit2/src/transports/ssh.h +4 -2
  279. data/vendor/libgit2/src/transports/winhttp.c +19 -21
  280. data/vendor/libgit2/src/tree-cache.c +1 -0
  281. data/vendor/libgit2/src/tree-cache.h +1 -0
  282. data/vendor/libgit2/src/tree.c +20 -14
  283. data/vendor/libgit2/src/tree.h +2 -0
  284. data/vendor/libgit2/src/tsort.c +0 -1
  285. data/vendor/libgit2/src/unix/map.c +4 -1
  286. data/vendor/libgit2/src/unix/posix.h +8 -4
  287. data/vendor/libgit2/src/unix/pthread.h +1 -1
  288. data/vendor/libgit2/src/unix/realpath.c +4 -1
  289. data/vendor/libgit2/src/util.c +6 -5
  290. data/vendor/libgit2/src/util.h +39 -111
  291. data/vendor/libgit2/src/varint.c +0 -1
  292. data/vendor/libgit2/src/varint.h +2 -0
  293. data/vendor/libgit2/src/vector.c +1 -1
  294. data/vendor/libgit2/src/win32/dir.c +3 -0
  295. data/vendor/libgit2/src/win32/dir.h +4 -3
  296. data/vendor/libgit2/src/win32/error.c +1 -1
  297. data/vendor/libgit2/src/win32/error.h +4 -2
  298. data/vendor/libgit2/src/win32/findfile.c +2 -1
  299. data/vendor/libgit2/src/win32/findfile.h +4 -2
  300. data/vendor/libgit2/src/win32/map.c +2 -0
  301. data/vendor/libgit2/src/win32/mingw-compat.h +3 -3
  302. data/vendor/libgit2/src/win32/msvc-compat.h +3 -3
  303. data/vendor/libgit2/src/win32/path_w32.c +7 -12
  304. data/vendor/libgit2/src/win32/path_w32.h +3 -2
  305. data/vendor/libgit2/src/win32/posix.h +2 -2
  306. data/vendor/libgit2/src/win32/posix_w32.c +11 -5
  307. data/vendor/libgit2/src/win32/precompiled.h +2 -1
  308. data/vendor/libgit2/src/win32/reparse.h +2 -2
  309. data/vendor/libgit2/src/win32/thread.c +1 -0
  310. data/vendor/libgit2/src/win32/thread.h +2 -2
  311. data/vendor/libgit2/src/win32/utf-conv.c +0 -1
  312. data/vendor/libgit2/src/win32/utf-conv.h +4 -3
  313. data/vendor/libgit2/src/win32/w32_buffer.c +1 -1
  314. data/vendor/libgit2/src/win32/w32_buffer.h +4 -2
  315. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -1
  316. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +85 -2
  317. data/vendor/libgit2/src/win32/w32_stack.c +2 -1
  318. data/vendor/libgit2/src/win32/w32_stack.h +5 -3
  319. data/vendor/libgit2/src/win32/w32_util.h +4 -2
  320. data/vendor/libgit2/src/win32/win32-compat.h +3 -3
  321. data/vendor/libgit2/src/worktree.c +4 -5
  322. data/vendor/libgit2/src/worktree.h +2 -0
  323. data/vendor/libgit2/src/xdiff/xdiff.h +22 -13
  324. data/vendor/libgit2/src/xdiff/xdiffi.c +523 -81
  325. data/vendor/libgit2/src/xdiff/xdiffi.h +2 -2
  326. data/vendor/libgit2/src/xdiff/xemit.c +63 -39
  327. data/vendor/libgit2/src/xdiff/xemit.h +2 -2
  328. data/vendor/libgit2/src/xdiff/xhistogram.c +0 -1
  329. data/vendor/libgit2/src/xdiff/xinclude.h +3 -2
  330. data/vendor/libgit2/src/xdiff/xmacros.h +2 -2
  331. data/vendor/libgit2/src/xdiff/xmerge.c +80 -20
  332. data/vendor/libgit2/src/xdiff/xpatience.c +41 -9
  333. data/vendor/libgit2/src/xdiff/xprepare.c +2 -2
  334. data/vendor/libgit2/src/xdiff/xprepare.h +2 -2
  335. data/vendor/libgit2/src/xdiff/xtypes.h +2 -2
  336. data/vendor/libgit2/src/xdiff/xutils.c +47 -27
  337. data/vendor/libgit2/src/xdiff/xutils.h +2 -5
  338. data/vendor/libgit2/src/zstream.c +65 -45
  339. data/vendor/libgit2/src/zstream.h +9 -2
  340. metadata +27 -13
  341. data/vendor/libgit2/include/git2/sys/remote.h +0 -16
@@ -51,6 +51,20 @@ GIT_EXTERN(int) git_note_iterator_new(
51
51
  git_repository *repo,
52
52
  const char *notes_ref);
53
53
 
54
+ /**
55
+ * Creates a new iterator for notes from a commit
56
+ *
57
+ * The iterator must be freed manually by the user.
58
+ *
59
+ * @param out pointer to the iterator
60
+ * @param notes_commit a pointer to the notes commit object
61
+ *
62
+ * @return 0 or an error code
63
+ */
64
+ GIT_EXTERN(int) git_note_commit_iterator_new(
65
+ git_note_iterator **out,
66
+ git_commit *notes_commit);
67
+
54
68
  /**
55
69
  * Frees an git_note_iterator
56
70
  *
@@ -94,6 +108,25 @@ GIT_EXTERN(int) git_note_read(
94
108
  const char *notes_ref,
95
109
  const git_oid *oid);
96
110
 
111
+
112
+ /**
113
+ * Read the note for an object from a note commit
114
+ *
115
+ * The note must be freed manually by the user.
116
+ *
117
+ * @param out pointer to the read note; NULL in case of error
118
+ * @param repo repository where to look up the note
119
+ * @param notes_commit a pointer to the notes commit object
120
+ * @param oid OID of the git object to read the note from
121
+ *
122
+ * @return 0 or an error code
123
+ */
124
+ GIT_EXTERN(int) git_note_commit_read(
125
+ git_note **out,
126
+ git_repository *repo,
127
+ git_commit *notes_commit,
128
+ const git_oid *oid);
129
+
97
130
  /**
98
131
  * Get the note author
99
132
  *
@@ -153,6 +186,36 @@ GIT_EXTERN(int) git_note_create(
153
186
  const char *note,
154
187
  int force);
155
188
 
189
+ /**
190
+ * Add a note for an object from a commit
191
+ *
192
+ * This function will create a notes commit for a given object,
193
+ * the commit is a dangling commit, no reference is created.
194
+ *
195
+ * @param notes_commit_out pointer to store the commit (optional);
196
+ * NULL in case of error
197
+ * @param notes_blob_out a point to the id of a note blob (optional)
198
+ * @param repo repository where the note will live
199
+ * @param parent Pointer to parent note
200
+ * or NULL if this shall start a new notes tree
201
+ * @param author signature of the notes commit author
202
+ * @param committer signature of the notes commit committer
203
+ * @param oid OID of the git object to decorate
204
+ * @param note Content of the note to add for object oid
205
+ * @param allow_note_overwrite Overwrite existing note
206
+ *
207
+ * @return 0 or an error code
208
+ */
209
+ GIT_EXTERN(int) git_note_commit_create(
210
+ git_oid *notes_commit_out,
211
+ git_oid *notes_blob_out,
212
+ git_repository *repo,
213
+ git_commit *parent,
214
+ const git_signature *author,
215
+ const git_signature *committer,
216
+ const git_oid *oid,
217
+ const char *note,
218
+ int allow_note_overwrite);
156
219
 
157
220
  /**
158
221
  * Remove the note for an object
@@ -173,6 +236,32 @@ GIT_EXTERN(int) git_note_remove(
173
236
  const git_signature *committer,
174
237
  const git_oid *oid);
175
238
 
239
+ /**
240
+ * Remove the note for an object
241
+ *
242
+ * @param notes_commit_out pointer to store the new notes commit (optional);
243
+ * NULL in case of error.
244
+ * When removing a note a new tree containing all notes
245
+ * sans the note to be removed is created and a new commit
246
+ * pointing to that tree is also created.
247
+ * In the case where the resulting tree is an empty tree
248
+ * a new commit pointing to this empty tree will be returned.
249
+ * @param repo repository where the note lives
250
+ * @param notes_commit a pointer to the notes commit object
251
+ * @param author signature of the notes commit author
252
+ * @param committer signature of the notes commit committer
253
+ * @param oid OID of the git object to remove the note from
254
+ *
255
+ * @return 0 or an error code
256
+ */
257
+ GIT_EXTERN(int) git_note_commit_remove(
258
+ git_oid *notes_commit_out,
259
+ git_repository *repo,
260
+ git_commit *notes_commit,
261
+ const git_signature *author,
262
+ const git_signature *committer,
263
+ const git_oid *oid);
264
+
176
265
  /**
177
266
  * Free a git_note object
178
267
  *
@@ -357,11 +357,18 @@ GIT_EXTERN(void) git_odb_stream_free(git_odb_stream *stream);
357
357
  * @see git_odb_stream
358
358
  *
359
359
  * @param out pointer where to store the stream
360
+ * @param len pointer where to store the length of the object
361
+ * @param type pointer where to store the type of the object
360
362
  * @param db object database where the stream will read from
361
363
  * @param oid oid of the object the stream will read from
362
364
  * @return 0 if the stream was created; error code otherwise
363
365
  */
364
- GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **out, git_odb *db, const git_oid *oid);
366
+ GIT_EXTERN(int) git_odb_open_rstream(
367
+ git_odb_stream **out,
368
+ size_t *len,
369
+ git_otype *type,
370
+ git_odb *db,
371
+ const git_oid *oid);
365
372
 
366
373
  /**
367
374
  * Open a stream for writing a pack file to the ODB.
@@ -96,7 +96,7 @@ GIT_EXTERN(int) git_patch_from_blob_and_buffer(
96
96
  git_patch **out,
97
97
  const git_blob *old_blob,
98
98
  const char *old_as_path,
99
- const char *buffer,
99
+ const void *buffer,
100
100
  size_t buffer_len,
101
101
  const char *buffer_as_path,
102
102
  const git_diff_options *opts);
@@ -124,7 +124,7 @@ GIT_EXTERN(int) git_patch_from_buffers(
124
124
  const void *old_buffer,
125
125
  size_t old_len,
126
126
  const char *old_as_path,
127
- const char *new_buffer,
127
+ const void *new_buffer,
128
128
  size_t new_len,
129
129
  const char *new_as_path,
130
130
  const git_diff_options *opts);
@@ -26,32 +26,49 @@ typedef struct git_pathspec_match_list git_pathspec_match_list;
26
26
 
27
27
  /**
28
28
  * Options controlling how pathspec match should be executed
29
- *
30
- * - GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise
31
- * match will use native case sensitivity of platform filesystem
32
- * - GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise
33
- * match will use native case sensitivity of platform filesystem
34
- * - GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple
35
- * string comparison for matching
36
- * - GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error
37
- * code GIT_ENOTFOUND if no matches are found; otherwise no matches is
38
- * still success (return 0) but `git_pathspec_match_list_entrycount`
39
- * will indicate 0 matches.
40
- * - GIT_PATHSPEC_FIND_FAILURES means that the `git_pathspec_match_list`
41
- * should track which patterns matched which files so that at the end of
42
- * the match we can identify patterns that did not match any files.
43
- * - GIT_PATHSPEC_FAILURES_ONLY means that the `git_pathspec_match_list`
44
- * does not need to keep the actual matching filenames. Use this to
45
- * just test if there were any matches at all or in combination with
46
- * GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
47
29
  */
48
30
  typedef enum {
49
31
  GIT_PATHSPEC_DEFAULT = 0,
32
+
33
+ /**
34
+ * GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise
35
+ * match will use native case sensitivity of platform filesystem
36
+ */
50
37
  GIT_PATHSPEC_IGNORE_CASE = (1u << 0),
38
+
39
+ /**
40
+ * GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise
41
+ * match will use native case sensitivity of platform filesystem
42
+ */
51
43
  GIT_PATHSPEC_USE_CASE = (1u << 1),
44
+
45
+ /**
46
+ * GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple
47
+ * string comparison for matching
48
+ */
52
49
  GIT_PATHSPEC_NO_GLOB = (1u << 2),
50
+
51
+ /**
52
+ * GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error
53
+ * code GIT_ENOTFOUND if no matches are found; otherwise no matches is
54
+ * still success (return 0) but `git_pathspec_match_list_entrycount`
55
+ * will indicate 0 matches.
56
+ */
53
57
  GIT_PATHSPEC_NO_MATCH_ERROR = (1u << 3),
58
+
59
+ /**
60
+ * GIT_PATHSPEC_FIND_FAILURES means that the `git_pathspec_match_list`
61
+ * should track which patterns matched which files so that at the end of
62
+ * the match we can identify patterns that did not match any files.
63
+ */
54
64
  GIT_PATHSPEC_FIND_FAILURES = (1u << 4),
65
+
66
+ /**
67
+ * GIT_PATHSPEC_FAILURES_ONLY means that the `git_pathspec_match_list`
68
+ * does not need to keep the actual matching filenames. Use this to
69
+ * just test if there were any matches at all or in combination with
70
+ * GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
71
+ */
55
72
  GIT_PATHSPEC_FAILURES_ONLY = (1u << 5),
56
73
  } git_pathspec_flag_t;
57
74
 
@@ -433,6 +433,9 @@ typedef int (*git_reference_foreach_name_cb)(const char *name, void *payload);
433
433
  * passed to this method. Returning a non-zero value from the callback
434
434
  * will terminate the iteration.
435
435
  *
436
+ * Note that the callback function is responsible to call `git_reference_free`
437
+ * on each reference passed to it.
438
+ *
436
439
  * @param repo Repository where to find the refs
437
440
  * @param callback Function which will be called for every listed ref
438
441
  * @param payload Additional data to pass to the callback
@@ -75,6 +75,24 @@ GIT_EXTERN(int) git_remote_create_anonymous(
75
75
  git_repository *repo,
76
76
  const char *url);
77
77
 
78
+ /**
79
+ * Create a remote without a connected local repo
80
+ *
81
+ * Create a remote with the given url in-memory. You can use this when
82
+ * you have a URL instead of a remote's name.
83
+ *
84
+ * Contrasted with git_remote_create_anonymous, a detached remote
85
+ * will not consider any repo configuration values (such as insteadof url
86
+ * substitutions).
87
+ *
88
+ * @param out pointer to the new remote objects
89
+ * @param url the remote repository's URL
90
+ * @return 0 or an error code
91
+ */
92
+ GIT_EXTERN(int) git_remote_create_detached(
93
+ git_remote **out,
94
+ const char *url);
95
+
78
96
  /**
79
97
  * Get the information for a particular remote
80
98
  *
@@ -367,6 +385,20 @@ typedef struct {
367
385
  */
368
386
  typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload);
369
387
 
388
+ /**
389
+ * Callback used to inform of the update status from the remote.
390
+ *
391
+ * Called for each updated reference on push. If `status` is
392
+ * not `NULL`, the update was rejected by the remote server
393
+ * and `status` contains the reason given.
394
+ *
395
+ * @param refname refname specifying to the remote ref
396
+ * @param status status message sent from the remote
397
+ * @param data data provided by the caller
398
+ * @return 0 on success, otherwise an error
399
+ */
400
+ typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data);
401
+
370
402
  /**
371
403
  * The callback settings structure
372
404
  *
@@ -434,11 +466,9 @@ struct git_remote_callbacks {
434
466
  git_push_transfer_progress push_transfer_progress;
435
467
 
436
468
  /**
437
- * Called for each updated reference on push. If `status` is
438
- * not `NULL`, the update was rejected by the remote server
439
- * and `status` contains the reason given.
469
+ * See documentation of git_push_update_reference_cb
440
470
  */
441
- int (*push_update_reference)(const char *refname, const char *status, void *data);
471
+ git_push_update_reference_cb push_update_reference;
442
472
 
443
473
  /**
444
474
  * Called once between the negotiation step and the upload. It
@@ -440,7 +440,7 @@ typedef enum {
440
440
  * @param item The repository item for which to retrieve the path
441
441
  * @return 0, GIT_ENOTFOUND if the path cannot exist or an error code
442
442
  */
443
- GIT_EXTERN(int) git_repository_item_path(git_buf *out, git_repository *repo, git_repository_item_t item);
443
+ GIT_EXTERN(int) git_repository_item_path(git_buf *out, const git_repository *repo, git_repository_item_t item);
444
444
 
445
445
  /**
446
446
  * Get the path of this repository
@@ -451,7 +451,7 @@ GIT_EXTERN(int) git_repository_item_path(git_buf *out, git_repository *repo, git
451
451
  * @param repo A repository object
452
452
  * @return the path to the repository
453
453
  */
454
- GIT_EXTERN(const char *) git_repository_path(git_repository *repo);
454
+ GIT_EXTERN(const char *) git_repository_path(const git_repository *repo);
455
455
 
456
456
  /**
457
457
  * Get the path of the working directory for this repository
@@ -462,7 +462,7 @@ GIT_EXTERN(const char *) git_repository_path(git_repository *repo);
462
462
  * @param repo A repository object
463
463
  * @return the path to the working dir, if it exists
464
464
  */
465
- GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
465
+ GIT_EXTERN(const char *) git_repository_workdir(const git_repository *repo);
466
466
 
467
467
  /**
468
468
  * Get the path of the shared common directory for this repository
@@ -473,7 +473,7 @@ GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
473
473
  * @param repo A repository object
474
474
  * @return the path to the common dir
475
475
  */
476
- GIT_EXTERN(const char *) git_repository_commondir(git_repository *repo);
476
+ GIT_EXTERN(const char *) git_repository_commondir(const git_repository *repo);
477
477
 
478
478
  /**
479
479
  * Set the path to the working directory for this repository
@@ -501,7 +501,7 @@ GIT_EXTERN(int) git_repository_set_workdir(
501
501
  * @param repo Repo to test
502
502
  * @return 1 if the repository is bare, 0 otherwise.
503
503
  */
504
- GIT_EXTERN(int) git_repository_is_bare(git_repository *repo);
504
+ GIT_EXTERN(int) git_repository_is_bare(const git_repository *repo);
505
505
 
506
506
  /**
507
507
  * Check if a repository is a linked work tree
@@ -509,7 +509,7 @@ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo);
509
509
  * @param repo Repo to test
510
510
  * @return 1 if the repository is a linked work tree, 0 otherwise.
511
511
  */
512
- GIT_EXTERN(int) git_repository_is_worktree(git_repository *repo);
512
+ GIT_EXTERN(int) git_repository_is_worktree(const git_repository *repo);
513
513
 
514
514
  /**
515
515
  * Get the configuration file for this repository.
@@ -61,7 +61,7 @@ typedef enum {
61
61
  */
62
62
  GIT_EXTERN(int) git_reset(
63
63
  git_repository *repo,
64
- git_object *target,
64
+ const git_object *target,
65
65
  git_reset_t reset_type,
66
66
  const git_checkout_options *checkout_opts);
67
67
 
@@ -79,7 +79,7 @@ GIT_EXTERN(int) git_reset(
79
79
  */
80
80
  GIT_EXTERN(int) git_reset_from_annotated(
81
81
  git_repository *repo,
82
- git_annotated_commit *commit,
82
+ const git_annotated_commit *commit,
83
83
  git_reset_t reset_type,
84
84
  const git_checkout_options *checkout_opts);
85
85
 
@@ -103,8 +103,8 @@ GIT_EXTERN(int) git_reset_from_annotated(
103
103
  */
104
104
  GIT_EXTERN(int) git_reset_default(
105
105
  git_repository *repo,
106
- git_object *target,
107
- git_strarray* pathspecs);
106
+ const git_object *target,
107
+ const git_strarray* pathspecs);
108
108
 
109
109
  /** @} */
110
110
  GIT_END_DECL
@@ -173,12 +173,16 @@ typedef enum {
173
173
  * The `pathspec` is an array of path patterns to match (using
174
174
  * fnmatch-style matching), or just an array of paths to match exactly if
175
175
  * `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags.
176
+ *
177
+ * The `baseline` is the tree to be used for comparison to the working directory
178
+ * and index; defaults to HEAD.
176
179
  */
177
180
  typedef struct {
178
181
  unsigned int version;
179
182
  git_status_show_t show;
180
183
  unsigned int flags;
181
184
  git_strarray pathspec;
185
+ git_tree *baseline;
182
186
  } git_status_options;
183
187
 
184
188
  #define GIT_STATUS_OPTIONS_VERSION 1
@@ -58,7 +58,7 @@ struct git_config_backend {
58
58
  struct git_config *cfg;
59
59
 
60
60
  /* Open means open the file/database and parse if necessary */
61
- int (*open)(struct git_config_backend *, git_config_level_t level);
61
+ int (*open)(struct git_config_backend *, git_config_level_t level, const git_repository *repo);
62
62
  int (*get)(struct git_config_backend *, const char *key, git_config_entry **entry);
63
63
  int (*set)(struct git_config_backend *, const char *key, const char *value);
64
64
  int (*set_multivar)(git_config_backend *cfg, const char *name, const char *regexp, const char *value);
@@ -111,6 +111,8 @@ GIT_EXTERN(int) git_config_init_backend(
111
111
  * @param cfg the configuration to add the file to
112
112
  * @param file the configuration file (backend) to add
113
113
  * @param level the priority level of the backend
114
+ * @param repo optional repository to allow parsing of
115
+ * conditional includes
114
116
  * @param force if a config file already exists for the given
115
117
  * priority level, replace it
116
118
  * @return 0 on success, GIT_EEXISTS when adding more than one file
@@ -120,6 +122,7 @@ GIT_EXTERN(int) git_config_add_backend(
120
122
  git_config *cfg,
121
123
  git_config_backend *file,
122
124
  git_config_level_t level,
125
+ const git_repository *repo,
123
126
  int force);
124
127
 
125
128
  /** @} */
@@ -56,7 +56,8 @@ struct git_odb_backend {
56
56
  git_odb_stream **, git_odb_backend *, git_off_t, git_otype);
57
57
 
58
58
  int (* readstream)(
59
- git_odb_stream **, git_odb_backend *, const git_oid *);
59
+ git_odb_stream **, size_t *, git_otype *,
60
+ git_odb_backend *, const git_oid *);
60
61
 
61
62
  int (* exists)(
62
63
  git_odb_backend *, const git_oid *);
@@ -307,9 +307,10 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(
307
307
  * pointer may not be valid past the next operation in this
308
308
  * builder. Duplicate the entry if you want to keep it.
309
309
  *
310
- * No attempt is being made to ensure that the provided oid points
311
- * to an existing git object in the object database, nor that the
312
- * attributes make sense regarding the type of the pointed at object.
310
+ * By default the entry that you are inserting will be checked for
311
+ * validity; that it exists in the object database and is of the
312
+ * correct type. If you do not want this behavior, set the
313
+ * `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` library option to false.
313
314
  *
314
315
  * @param out Pointer to store the entry (optional)
315
316
  * @param bld Tree builder
@@ -159,6 +159,7 @@ typedef struct git_packbuilder git_packbuilder;
159
159
  typedef struct git_time {
160
160
  git_time_t time; /**< time in seconds from epoch */
161
161
  int offset; /**< timezone offset, in minutes */
162
+ char sign; /**< indicator for questionable '-0000' offsets in signature */
162
163
  } git_time;
163
164
 
164
165
  /** An action signature (e.g. for committers, taggers, etc) */