rugged 1.3.2.3 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (329) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rugged/extconf.rb +1 -1
  3. data/ext/rugged/rugged_config.c +7 -2
  4. data/ext/rugged/rugged_remote.c +17 -0
  5. data/lib/rugged/version.rb +1 -1
  6. data/vendor/libgit2/CMakeLists.txt +103 -276
  7. data/vendor/libgit2/COPYING +36 -19
  8. data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
  9. data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
  10. data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
  11. data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
  12. data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
  13. data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
  14. data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
  15. data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
  16. data/vendor/libgit2/cmake/FindLibSSH2.cmake +5 -5
  17. data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
  18. data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
  19. data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
  20. data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
  21. data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
  22. data/vendor/libgit2/cmake/Findfutimens.cmake +8 -8
  23. data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
  24. data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
  25. data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
  26. data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
  27. data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
  28. data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
  29. data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -100
  30. data/vendor/libgit2/cmake/SelectHashes.cmake +39 -49
  31. data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
  32. data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
  33. data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
  34. data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
  35. data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +6 -6
  36. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +31 -31
  37. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +1 -1
  38. data/vendor/libgit2/deps/ntlmclient/ntlm.c +4 -4
  39. data/vendor/libgit2/deps/ntlmclient/ntlm.h +4 -4
  40. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +2 -2
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
  42. data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
  43. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  44. data/vendor/libgit2/deps/zlib/crc32.c +288 -975
  45. data/vendor/libgit2/deps/zlib/crc32.h +436 -9441
  46. data/vendor/libgit2/deps/zlib/deflate.c +31 -83
  47. data/vendor/libgit2/deps/zlib/deflate.h +15 -12
  48. data/vendor/libgit2/deps/zlib/gzguts.h +2 -3
  49. data/vendor/libgit2/deps/zlib/infback.c +1 -2
  50. data/vendor/libgit2/deps/zlib/inffast.c +14 -14
  51. data/vendor/libgit2/deps/zlib/inflate.c +8 -39
  52. data/vendor/libgit2/deps/zlib/inflate.h +2 -3
  53. data/vendor/libgit2/deps/zlib/inftrees.c +3 -3
  54. data/vendor/libgit2/deps/zlib/trees.c +48 -27
  55. data/vendor/libgit2/deps/zlib/zlib.h +100 -126
  56. data/vendor/libgit2/deps/zlib/zutil.c +2 -2
  57. data/vendor/libgit2/deps/zlib/zutil.h +9 -12
  58. data/vendor/libgit2/include/git2/apply.h +16 -2
  59. data/vendor/libgit2/include/git2/attr.h +11 -2
  60. data/vendor/libgit2/include/git2/blame.h +4 -1
  61. data/vendor/libgit2/include/git2/blob.h +14 -1
  62. data/vendor/libgit2/include/git2/branch.h +2 -0
  63. data/vendor/libgit2/include/git2/buffer.h +18 -78
  64. data/vendor/libgit2/include/git2/cert.h +2 -2
  65. data/vendor/libgit2/include/git2/checkout.h +5 -2
  66. data/vendor/libgit2/include/git2/clone.h +3 -3
  67. data/vendor/libgit2/include/git2/commit.h +2 -0
  68. data/vendor/libgit2/include/git2/common.h +5 -12
  69. data/vendor/libgit2/include/git2/config.h +19 -3
  70. data/vendor/libgit2/include/git2/credential.h +2 -1
  71. data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
  72. data/vendor/libgit2/include/git2/deprecated.h +1 -1
  73. data/vendor/libgit2/include/git2/describe.h +7 -2
  74. data/vendor/libgit2/include/git2/diff.h +17 -9
  75. data/vendor/libgit2/include/git2/email.h +1 -1
  76. data/vendor/libgit2/include/git2/errors.h +1 -2
  77. data/vendor/libgit2/include/git2/filter.h +7 -2
  78. data/vendor/libgit2/include/git2/graph.h +1 -0
  79. data/vendor/libgit2/include/git2/ignore.h +1 -1
  80. data/vendor/libgit2/include/git2/index.h +11 -5
  81. data/vendor/libgit2/include/git2/indexer.h +19 -0
  82. data/vendor/libgit2/include/git2/merge.h +23 -3
  83. data/vendor/libgit2/include/git2/message.h +2 -0
  84. data/vendor/libgit2/include/git2/object.h +23 -0
  85. data/vendor/libgit2/include/git2/odb.h +37 -7
  86. data/vendor/libgit2/include/git2/odb_backend.h +1 -1
  87. data/vendor/libgit2/include/git2/pack.h +24 -8
  88. data/vendor/libgit2/include/git2/patch.h +8 -0
  89. data/vendor/libgit2/include/git2/pathspec.h +1 -1
  90. data/vendor/libgit2/include/git2/proxy.h +1 -1
  91. data/vendor/libgit2/include/git2/rebase.h +9 -1
  92. data/vendor/libgit2/include/git2/refdb.h +3 -0
  93. data/vendor/libgit2/include/git2/reflog.h +1 -1
  94. data/vendor/libgit2/include/git2/refs.h +2 -2
  95. data/vendor/libgit2/include/git2/remote.h +184 -37
  96. data/vendor/libgit2/include/git2/repository.h +14 -9
  97. data/vendor/libgit2/include/git2/reset.h +2 -2
  98. data/vendor/libgit2/include/git2/revparse.h +1 -1
  99. data/vendor/libgit2/include/git2/revwalk.h +4 -1
  100. data/vendor/libgit2/include/git2/signature.h +1 -1
  101. data/vendor/libgit2/include/git2/stash.h +3 -3
  102. data/vendor/libgit2/include/git2/status.h +9 -3
  103. data/vendor/libgit2/include/git2/submodule.h +7 -2
  104. data/vendor/libgit2/include/git2/sys/commit_graph.h +1 -1
  105. data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -5
  106. data/vendor/libgit2/include/git2/sys/remote.h +31 -0
  107. data/vendor/libgit2/include/git2/sys/stream.h +1 -1
  108. data/vendor/libgit2/include/git2/sys/transport.h +25 -34
  109. data/vendor/libgit2/include/git2/tag.h +1 -0
  110. data/vendor/libgit2/include/git2/tree.h +4 -3
  111. data/vendor/libgit2/include/git2/types.h +7 -7
  112. data/vendor/libgit2/include/git2/version.h +3 -3
  113. data/vendor/libgit2/include/git2/worktree.h +12 -2
  114. data/vendor/libgit2/src/CMakeLists.txt +189 -315
  115. data/vendor/libgit2/src/annotated_commit.h +1 -1
  116. data/vendor/libgit2/src/apply.c +18 -18
  117. data/vendor/libgit2/src/apply.h +2 -2
  118. data/vendor/libgit2/src/attr.c +18 -18
  119. data/vendor/libgit2/src/attr_file.c +17 -17
  120. data/vendor/libgit2/src/attr_file.h +4 -4
  121. data/vendor/libgit2/src/attrcache.c +17 -12
  122. data/vendor/libgit2/src/blame_git.c +1 -1
  123. data/vendor/libgit2/src/blob.c +33 -26
  124. data/vendor/libgit2/src/blob.h +1 -1
  125. data/vendor/libgit2/src/branch.c +150 -109
  126. data/vendor/libgit2/src/branch.h +15 -3
  127. data/vendor/libgit2/src/buf.c +126 -0
  128. data/vendor/libgit2/src/buf.h +50 -0
  129. data/vendor/libgit2/src/cc-compat.h +1 -1
  130. data/vendor/libgit2/src/checkout.c +74 -68
  131. data/vendor/libgit2/src/cherrypick.c +10 -10
  132. data/vendor/libgit2/src/clone.c +66 -66
  133. data/vendor/libgit2/src/commit.c +128 -58
  134. data/vendor/libgit2/src/commit.h +24 -1
  135. data/vendor/libgit2/src/commit_graph.c +68 -53
  136. data/vendor/libgit2/src/commit_graph.h +10 -3
  137. data/vendor/libgit2/src/commit_list.c +2 -3
  138. data/vendor/libgit2/src/common.h +10 -3
  139. data/vendor/libgit2/src/config.c +99 -77
  140. data/vendor/libgit2/src/config.h +15 -2
  141. data/vendor/libgit2/src/config_file.c +103 -91
  142. data/vendor/libgit2/src/config_mem.c +9 -9
  143. data/vendor/libgit2/src/config_parse.c +27 -23
  144. data/vendor/libgit2/src/crlf.c +24 -21
  145. data/vendor/libgit2/src/date.c +10 -17
  146. data/vendor/libgit2/src/date.h +33 -0
  147. data/vendor/libgit2/src/describe.c +27 -19
  148. data/vendor/libgit2/src/diff.c +25 -8
  149. data/vendor/libgit2/src/diff.h +2 -4
  150. data/vendor/libgit2/src/diff_driver.c +34 -36
  151. data/vendor/libgit2/src/diff_driver.h +3 -3
  152. data/vendor/libgit2/src/diff_file.c +29 -20
  153. data/vendor/libgit2/src/diff_generate.c +30 -6
  154. data/vendor/libgit2/src/diff_generate.h +5 -3
  155. data/vendor/libgit2/src/diff_print.c +102 -95
  156. data/vendor/libgit2/src/diff_stats.c +40 -29
  157. data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
  158. data/vendor/libgit2/src/diff_tform.c +9 -8
  159. data/vendor/libgit2/src/diff_xdiff.c +3 -8
  160. data/vendor/libgit2/src/email.c +54 -38
  161. data/vendor/libgit2/src/email.h +1 -1
  162. data/vendor/libgit2/src/errors.c +18 -18
  163. data/vendor/libgit2/src/features.h.in +6 -1
  164. data/vendor/libgit2/src/fetch.c +69 -24
  165. data/vendor/libgit2/src/fetch.h +1 -1
  166. data/vendor/libgit2/src/fetchhead.c +19 -19
  167. data/vendor/libgit2/src/filebuf.c +28 -28
  168. data/vendor/libgit2/src/filebuf.h +1 -1
  169. data/vendor/libgit2/src/filter.c +96 -52
  170. data/vendor/libgit2/src/filter.h +26 -5
  171. data/vendor/libgit2/src/fs_path.c +1912 -0
  172. data/vendor/libgit2/src/fs_path.h +752 -0
  173. data/vendor/libgit2/src/futils.c +91 -85
  174. data/vendor/libgit2/src/futils.h +26 -14
  175. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +2 -2
  176. data/vendor/libgit2/src/hash/sha1/common_crypto.c +2 -2
  177. data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
  178. data/vendor/libgit2/src/hash/sha1/mbedtls.c +2 -2
  179. data/vendor/libgit2/src/hash/sha1/openssl.c +2 -2
  180. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +1 -1
  181. data/vendor/libgit2/src/hash/sha1/win32.c +6 -6
  182. data/vendor/libgit2/src/hash/sha1.h +3 -1
  183. data/vendor/libgit2/src/hash.c +67 -35
  184. data/vendor/libgit2/src/hash.h +12 -12
  185. data/vendor/libgit2/src/ident.c +18 -18
  186. data/vendor/libgit2/src/ignore.c +35 -34
  187. data/vendor/libgit2/src/ignore.h +2 -2
  188. data/vendor/libgit2/src/index.c +79 -80
  189. data/vendor/libgit2/src/index.h +6 -3
  190. data/vendor/libgit2/src/indexer.c +75 -57
  191. data/vendor/libgit2/src/iterator.c +64 -56
  192. data/vendor/libgit2/src/iterator.h +5 -5
  193. data/vendor/libgit2/src/khash.h +1 -1
  194. data/vendor/libgit2/src/libgit2.c +22 -19
  195. data/vendor/libgit2/src/mailmap.c +38 -36
  196. data/vendor/libgit2/src/merge.c +27 -27
  197. data/vendor/libgit2/src/merge.h +1 -14
  198. data/vendor/libgit2/src/merge_driver.c +2 -2
  199. data/vendor/libgit2/src/merge_file.c +13 -3
  200. data/vendor/libgit2/src/message.c +21 -10
  201. data/vendor/libgit2/src/midx.c +83 -66
  202. data/vendor/libgit2/src/midx.h +3 -3
  203. data/vendor/libgit2/src/mwindow.c +1 -1
  204. data/vendor/libgit2/src/net.c +278 -68
  205. data/vendor/libgit2/src/net.h +10 -3
  206. data/vendor/libgit2/src/netops.c +1 -1
  207. data/vendor/libgit2/src/netops.h +1 -1
  208. data/vendor/libgit2/src/notes.c +20 -29
  209. data/vendor/libgit2/src/object.c +49 -9
  210. data/vendor/libgit2/src/object.h +1 -1
  211. data/vendor/libgit2/src/odb.c +35 -32
  212. data/vendor/libgit2/src/odb.h +1 -1
  213. data/vendor/libgit2/src/odb_loose.c +68 -68
  214. data/vendor/libgit2/src/odb_mempack.c +18 -5
  215. data/vendor/libgit2/src/odb_pack.c +43 -43
  216. data/vendor/libgit2/src/oid.c +11 -4
  217. data/vendor/libgit2/src/oid.h +15 -0
  218. data/vendor/libgit2/src/pack-objects.c +41 -26
  219. data/vendor/libgit2/src/pack-objects.h +11 -6
  220. data/vendor/libgit2/src/pack.c +10 -10
  221. data/vendor/libgit2/src/patch.c +3 -3
  222. data/vendor/libgit2/src/patch.h +1 -0
  223. data/vendor/libgit2/src/patch_generate.c +27 -11
  224. data/vendor/libgit2/src/patch_generate.h +5 -5
  225. data/vendor/libgit2/src/patch_parse.c +24 -24
  226. data/vendor/libgit2/src/path.c +76 -1951
  227. data/vendor/libgit2/src/path.h +34 -741
  228. data/vendor/libgit2/src/pathspec.c +6 -6
  229. data/vendor/libgit2/src/pathspec.h +2 -2
  230. data/vendor/libgit2/src/posix.c +3 -3
  231. data/vendor/libgit2/src/posix.h +1 -0
  232. data/vendor/libgit2/src/pqueue.h +1 -1
  233. data/vendor/libgit2/src/proxy.c +4 -1
  234. data/vendor/libgit2/src/proxy.h +1 -1
  235. data/vendor/libgit2/src/push.c +30 -35
  236. data/vendor/libgit2/src/push.h +4 -16
  237. data/vendor/libgit2/src/rand.c +226 -0
  238. data/vendor/libgit2/src/rand.h +37 -0
  239. data/vendor/libgit2/src/reader.c +8 -8
  240. data/vendor/libgit2/src/reader.h +2 -2
  241. data/vendor/libgit2/src/rebase.c +89 -88
  242. data/vendor/libgit2/src/refdb_fs.c +447 -173
  243. data/vendor/libgit2/src/refs.c +32 -32
  244. data/vendor/libgit2/src/refs.h +2 -2
  245. data/vendor/libgit2/src/refspec.c +32 -37
  246. data/vendor/libgit2/src/refspec.h +5 -2
  247. data/vendor/libgit2/src/regexp.c +1 -1
  248. data/vendor/libgit2/src/remote.c +713 -419
  249. data/vendor/libgit2/src/remote.h +15 -10
  250. data/vendor/libgit2/src/repository.c +350 -467
  251. data/vendor/libgit2/src/repository.h +11 -10
  252. data/vendor/libgit2/src/reset.c +8 -5
  253. data/vendor/libgit2/src/revert.c +10 -10
  254. data/vendor/libgit2/src/revparse.c +48 -35
  255. data/vendor/libgit2/src/revwalk.c +7 -7
  256. data/vendor/libgit2/src/signature.c +12 -6
  257. data/vendor/libgit2/src/signature.h +1 -1
  258. data/vendor/libgit2/src/sortedcache.c +1 -1
  259. data/vendor/libgit2/src/sortedcache.h +1 -1
  260. data/vendor/libgit2/src/stash.c +36 -37
  261. data/vendor/libgit2/src/status.c +4 -1
  262. data/vendor/libgit2/src/{buffer.c → str.c} +157 -151
  263. data/vendor/libgit2/src/str.h +357 -0
  264. data/vendor/libgit2/src/streams/mbedtls.c +8 -6
  265. data/vendor/libgit2/src/streams/openssl_dynamic.h +3 -3
  266. data/vendor/libgit2/src/submodule.c +171 -159
  267. data/vendor/libgit2/src/submodule.h +1 -1
  268. data/vendor/libgit2/src/sysdir.c +68 -52
  269. data/vendor/libgit2/src/sysdir.h +15 -10
  270. data/vendor/libgit2/src/tag.c +29 -27
  271. data/vendor/libgit2/src/thread.h +3 -3
  272. data/vendor/libgit2/src/threadstate.c +3 -3
  273. data/vendor/libgit2/src/threadstate.h +1 -1
  274. data/vendor/libgit2/src/trace.c +1 -14
  275. data/vendor/libgit2/src/trace.h +5 -22
  276. data/vendor/libgit2/src/trailer.c +1 -1
  277. data/vendor/libgit2/src/transaction.c +1 -1
  278. data/vendor/libgit2/src/transport.c +10 -10
  279. data/vendor/libgit2/src/transports/auth.c +7 -9
  280. data/vendor/libgit2/src/transports/auth.h +2 -3
  281. data/vendor/libgit2/src/transports/auth_negotiate.c +12 -13
  282. data/vendor/libgit2/src/transports/auth_ntlm.c +10 -10
  283. data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
  284. data/vendor/libgit2/src/transports/git.c +9 -11
  285. data/vendor/libgit2/src/transports/http.c +37 -17
  286. data/vendor/libgit2/src/transports/http.h +2 -3
  287. data/vendor/libgit2/src/transports/httpclient.c +65 -65
  288. data/vendor/libgit2/src/transports/local.c +124 -116
  289. data/vendor/libgit2/src/transports/smart.c +51 -139
  290. data/vendor/libgit2/src/transports/smart.h +25 -31
  291. data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
  292. data/vendor/libgit2/src/transports/smart_protocol.c +57 -39
  293. data/vendor/libgit2/src/transports/ssh.c +47 -112
  294. data/vendor/libgit2/src/transports/winhttp.c +50 -56
  295. data/vendor/libgit2/src/tree-cache.c +5 -5
  296. data/vendor/libgit2/src/tree-cache.h +2 -2
  297. data/vendor/libgit2/src/tree.c +59 -48
  298. data/vendor/libgit2/src/tree.h +1 -1
  299. data/vendor/libgit2/src/unix/map.c +0 -2
  300. data/vendor/libgit2/src/unix/posix.h +1 -4
  301. data/vendor/libgit2/src/unix/realpath.c +0 -2
  302. data/vendor/libgit2/src/util.c +14 -14
  303. data/vendor/libgit2/src/util.h +2 -28
  304. data/vendor/libgit2/src/vector.h +1 -1
  305. data/vendor/libgit2/src/win32/findfile.c +172 -116
  306. data/vendor/libgit2/src/win32/findfile.h +7 -4
  307. data/vendor/libgit2/src/win32/path_w32.c +140 -9
  308. data/vendor/libgit2/src/win32/path_w32.h +2 -0
  309. data/vendor/libgit2/src/win32/posix.h +0 -1
  310. data/vendor/libgit2/src/win32/posix_w32.c +11 -27
  311. data/vendor/libgit2/src/win32/w32_buffer.c +2 -3
  312. data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
  313. data/vendor/libgit2/src/win32/w32_leakcheck.c +1 -1
  314. data/vendor/libgit2/src/worktree.c +116 -94
  315. data/vendor/libgit2/src/worktree.h +1 -1
  316. data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
  317. data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
  318. data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
  319. data/vendor/libgit2/src/xdiff/xemit.c +23 -7
  320. data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
  321. data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
  322. data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
  323. data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
  324. data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
  325. data/vendor/libgit2/src/xdiff/xutils.c +18 -7
  326. data/vendor/libgit2/src/zstream.c +5 -5
  327. data/vendor/libgit2/src/zstream.h +4 -4
  328. metadata +25 -10
  329. data/vendor/libgit2/src/buffer.h +0 -374
@@ -170,7 +170,7 @@ typedef enum {
170
170
  /** Include the necessary deflate / delta information so that `git-apply`
171
171
  * can apply given diff information to binary files.
172
172
  */
173
- GIT_DIFF_SHOW_BINARY = (1u << 30),
173
+ GIT_DIFF_SHOW_BINARY = (1u << 30)
174
174
  } git_diff_option_t;
175
175
 
176
176
  /**
@@ -208,6 +208,7 @@ typedef enum {
208
208
  GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */
209
209
  GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */
210
210
  GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */
211
+ GIT_DIFF_FLAG_VALID_SIZE = (1u << 4) /**< file size value is known correct */
211
212
  } git_diff_flag_t;
212
213
 
213
214
  /**
@@ -231,7 +232,7 @@ typedef enum {
231
232
  GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
232
233
  GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
233
234
  GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
234
- GIT_DELTA_CONFLICTED = 10, /**< entry in the index is conflicted */
235
+ GIT_DELTA_CONFLICTED = 10 /**< entry in the index is conflicted */
235
236
  } git_delta_t;
236
237
 
237
238
  /**
@@ -497,7 +498,7 @@ typedef enum {
497
498
  GIT_DIFF_BINARY_LITERAL,
498
499
 
499
500
  /** The binary data is the delta from one side to the other. */
500
- GIT_DIFF_BINARY_DELTA,
501
+ GIT_DIFF_BINARY_DELTA
501
502
  } git_diff_binary_t;
502
503
 
503
504
  /** The contents of one of the files in a binary diff. */
@@ -706,7 +707,7 @@ typedef enum {
706
707
  * GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
707
708
  * records in the final result, pass this flag to have them removed.
708
709
  */
709
- GIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16),
710
+ GIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16)
710
711
  } git_diff_find_t;
711
712
 
712
713
  /**
@@ -758,7 +759,7 @@ typedef struct {
758
759
  uint16_t copy_threshold;
759
760
 
760
761
  /**
761
- * Treshold below which similar files will be split into a delete/add pair.
762
+ * Threshold below which similar files will be split into a delete/add pair.
762
763
  * This is equivalent to the last part of the -B option. Defaults to 60.
763
764
  */
764
765
  uint16_t break_rewrite_threshold;
@@ -768,7 +769,7 @@ typedef struct {
768
769
  *
769
770
  * This is a little different from the `-l` option from Git because we
770
771
  * will still process up to this many matches before abandoning the search.
771
- * Defaults to 200.
772
+ * Defaults to 1000.
772
773
  */
773
774
  size_t rename_limit;
774
775
 
@@ -831,6 +832,7 @@ GIT_EXTERN(void) git_diff_free(git_diff *diff);
831
832
  * @param old_tree A git_tree object to diff from, or NULL for empty tree.
832
833
  * @param new_tree A git_tree object to diff to, or NULL for empty tree.
833
834
  * @param opts Structure with options to influence diff or NULL for defaults.
835
+ * @return 0 or an error code.
834
836
  */
835
837
  GIT_EXTERN(int) git_diff_tree_to_tree(
836
838
  git_diff **diff,
@@ -857,6 +859,7 @@ GIT_EXTERN(int) git_diff_tree_to_tree(
857
859
  * @param old_tree A git_tree object to diff from, or NULL for empty tree.
858
860
  * @param index The index to diff with; repo index used if NULL.
859
861
  * @param opts Structure with options to influence diff or NULL for defaults.
862
+ * @return 0 or an error code.
860
863
  */
861
864
  GIT_EXTERN(int) git_diff_tree_to_index(
862
865
  git_diff **diff,
@@ -884,6 +887,7 @@ GIT_EXTERN(int) git_diff_tree_to_index(
884
887
  * @param repo The repository.
885
888
  * @param index The index to diff from; repo index used if NULL.
886
889
  * @param opts Structure with options to influence diff or NULL for defaults.
890
+ * @return 0 or an error code.
887
891
  */
888
892
  GIT_EXTERN(int) git_diff_index_to_workdir(
889
893
  git_diff **diff,
@@ -913,6 +917,7 @@ GIT_EXTERN(int) git_diff_index_to_workdir(
913
917
  * @param repo The repository containing the tree.
914
918
  * @param old_tree A git_tree object to diff from, or NULL for empty tree.
915
919
  * @param opts Structure with options to influence diff or NULL for defaults.
920
+ * @return 0 or an error code.
916
921
  */
917
922
  GIT_EXTERN(int) git_diff_tree_to_workdir(
918
923
  git_diff **diff,
@@ -932,6 +937,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir(
932
937
  * @param repo The repository containing the tree.
933
938
  * @param old_tree A git_tree object to diff from, or NULL for empty tree.
934
939
  * @param opts Structure with options to influence diff or NULL for defaults.
940
+ * @return 0 or an error code.
935
941
  */
936
942
  GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
937
943
  git_diff **diff,
@@ -950,6 +956,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
950
956
  * @param old_index A git_index object to diff from.
951
957
  * @param new_index A git_index object to diff to.
952
958
  * @param opts Structure with options to influence diff or NULL for defaults.
959
+ * @return 0 or an error code.
953
960
  */
954
961
  GIT_EXTERN(int) git_diff_index_to_index(
955
962
  git_diff **diff,
@@ -970,6 +977,7 @@ GIT_EXTERN(int) git_diff_index_to_index(
970
977
  *
971
978
  * @param onto Diff to merge into.
972
979
  * @param from Diff to merge.
980
+ * @return 0 or an error code.
973
981
  */
974
982
  GIT_EXTERN(int) git_diff_merge(
975
983
  git_diff *onto,
@@ -1107,7 +1115,7 @@ typedef enum {
1107
1115
  GIT_DIFF_FORMAT_RAW = 3u, /**< like git diff --raw */
1108
1116
  GIT_DIFF_FORMAT_NAME_ONLY = 4u, /**< like git diff --name-only */
1109
1117
  GIT_DIFF_FORMAT_NAME_STATUS = 5u, /**< like git diff --name-status */
1110
- GIT_DIFF_FORMAT_PATCH_ID = 6u, /**< git diff as used by git patch-id */
1118
+ GIT_DIFF_FORMAT_PATCH_ID = 6u /**< git diff as used by git patch-id */
1111
1119
  } git_diff_format_t;
1112
1120
 
1113
1121
  /**
@@ -1311,13 +1319,13 @@ typedef enum {
1311
1319
  GIT_DIFF_STATS_NUMBER = (1u << 2),
1312
1320
 
1313
1321
  /** Extended header information such as creations, renames and mode changes, equivalent of `--summary` */
1314
- GIT_DIFF_STATS_INCLUDE_SUMMARY = (1u << 3),
1322
+ GIT_DIFF_STATS_INCLUDE_SUMMARY = (1u << 3)
1315
1323
  } git_diff_stats_format_t;
1316
1324
 
1317
1325
  /**
1318
1326
  * Accumulate diff statistics for all patches.
1319
1327
  *
1320
- * @param out Structure containg the diff statistics.
1328
+ * @param out Structure containing the diff statistics.
1321
1329
  * @param diff A git_diff generated by one of the above functions.
1322
1330
  * @return 0 on success; non-zero on error
1323
1331
  */
@@ -34,7 +34,7 @@ typedef enum {
34
34
  GIT_EMAIL_CREATE_ALWAYS_NUMBER = (1u << 1),
35
35
 
36
36
  /** Do not perform rename or similarity detection. */
37
- GIT_EMAIL_CREATE_NO_RENAMES = (1u << 2),
37
+ GIT_EMAIL_CREATE_NO_RENAMES = (1u << 2)
38
38
  } git_email_create_flags_t;
39
39
 
40
40
  /**
@@ -57,8 +57,7 @@ typedef enum {
57
57
  GIT_RETRY = -32, /**< Internal only */
58
58
  GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
59
59
  GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
60
- GIT_EAPPLYFAIL = -35, /**< Patch application failed */
61
- GIT_EOWNER = -36 /**< The object is not owned by the current user */
60
+ GIT_EAPPLYFAIL = -35 /**< Patch application failed */
62
61
  } git_error_code;
63
62
 
64
63
  /**
@@ -32,7 +32,7 @@ typedef enum {
32
32
  GIT_FILTER_TO_WORKTREE = 0,
33
33
  GIT_FILTER_SMUDGE = GIT_FILTER_TO_WORKTREE,
34
34
  GIT_FILTER_TO_ODB = 1,
35
- GIT_FILTER_CLEAN = GIT_FILTER_TO_ODB,
35
+ GIT_FILTER_CLEAN = GIT_FILTER_TO_ODB
36
36
  } git_filter_mode_t;
37
37
 
38
38
  /**
@@ -54,7 +54,7 @@ typedef enum {
54
54
  * Load attributes from `.gitattributes` in a given commit.
55
55
  * This can only be specified in a `git_filter_options`.
56
56
  */
57
- GIT_FILTER_ATTRIBUTES_FROM_COMMIT = (1u << 3),
57
+ GIT_FILTER_ATTRIBUTES_FROM_COMMIT = (1u << 3)
58
58
  } git_filter_flag_t;
59
59
 
60
60
  /**
@@ -196,6 +196,7 @@ GIT_EXTERN(int) git_filter_list_apply_to_buffer(
196
196
  * @param repo the repository in which to perform the filtering
197
197
  * @param path the path of the file to filter, a relative path will be
198
198
  * taken as relative to the workdir
199
+ * @return 0 or an error code.
199
200
  */
200
201
  GIT_EXTERN(int) git_filter_list_apply_to_file(
201
202
  git_buf *out,
@@ -209,6 +210,7 @@ GIT_EXTERN(int) git_filter_list_apply_to_file(
209
210
  * @param out buffer into which to store the filtered file
210
211
  * @param filters the list of filters to apply
211
212
  * @param blob the blob to filter
213
+ * @return 0 or an error code.
212
214
  */
213
215
  GIT_EXTERN(int) git_filter_list_apply_to_blob(
214
216
  git_buf *out,
@@ -222,6 +224,7 @@ GIT_EXTERN(int) git_filter_list_apply_to_blob(
222
224
  * @param buffer the buffer to filter
223
225
  * @param len the size of the buffer
224
226
  * @param target the stream into which the data will be written
227
+ * @return 0 or an error code.
225
228
  */
226
229
  GIT_EXTERN(int) git_filter_list_stream_buffer(
227
230
  git_filter_list *filters,
@@ -237,6 +240,7 @@ GIT_EXTERN(int) git_filter_list_stream_buffer(
237
240
  * @param path the path of the file to filter, a relative path will be
238
241
  * taken as relative to the workdir
239
242
  * @param target the stream into which the data will be written
243
+ * @return 0 or an error code.
240
244
  */
241
245
  GIT_EXTERN(int) git_filter_list_stream_file(
242
246
  git_filter_list *filters,
@@ -250,6 +254,7 @@ GIT_EXTERN(int) git_filter_list_stream_file(
250
254
  * @param filters the list of filters to apply
251
255
  * @param blob the blob to filter
252
256
  * @param target the stream into which the data will be written
257
+ * @return 0 or an error code.
253
258
  */
254
259
  GIT_EXTERN(int) git_filter_list_stream_blob(
255
260
  git_filter_list *filters,
@@ -33,6 +33,7 @@ GIT_BEGIN_DECL
33
33
  * @param repo the repository where the commits exist
34
34
  * @param local the commit for local
35
35
  * @param upstream the commit for upstream
36
+ * @return 0 or an error code.
36
37
  */
37
38
  GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
38
39
 
@@ -29,7 +29,7 @@ GIT_BEGIN_DECL
29
29
  * This would add three rules to the ignores.
30
30
  *
31
31
  * @param repo The repository to add ignore rules to.
32
- * @param rules Text of rules, a la the contents of a .gitignore file.
32
+ * @param rules Text of rules, the contents to add on a .gitignore file.
33
33
  * It is okay to have multiple rules in the text; if so,
34
34
  * each rule should be terminated with a newline.
35
35
  * @return 0 on success
@@ -86,7 +86,7 @@ typedef struct git_index_entry {
86
86
  */
87
87
  typedef enum {
88
88
  GIT_INDEX_ENTRY_EXTENDED = (0x4000),
89
- GIT_INDEX_ENTRY_VALID = (0x8000),
89
+ GIT_INDEX_ENTRY_VALID = (0x8000)
90
90
  } git_index_entry_flag_t;
91
91
 
92
92
  #define GIT_INDEX_ENTRY_STAGE(E) \
@@ -119,7 +119,7 @@ typedef enum {
119
119
 
120
120
  GIT_INDEX_ENTRY_EXTENDED_FLAGS = (GIT_INDEX_ENTRY_INTENT_TO_ADD | GIT_INDEX_ENTRY_SKIP_WORKTREE),
121
121
 
122
- GIT_INDEX_ENTRY_UPTODATE = (1 << 2),
122
+ GIT_INDEX_ENTRY_UPTODATE = (1 << 2)
123
123
  } git_index_entry_extended_flag_t;
124
124
 
125
125
  /** Capabilities of system that affect index actions. */
@@ -127,7 +127,7 @@ typedef enum {
127
127
  GIT_INDEX_CAPABILITY_IGNORE_CASE = 1,
128
128
  GIT_INDEX_CAPABILITY_NO_FILEMODE = 2,
129
129
  GIT_INDEX_CAPABILITY_NO_SYMLINKS = 4,
130
- GIT_INDEX_CAPABILITY_FROM_OWNER = -1,
130
+ GIT_INDEX_CAPABILITY_FROM_OWNER = -1
131
131
  } git_index_capability_t;
132
132
 
133
133
 
@@ -140,7 +140,7 @@ typedef enum {
140
140
  GIT_INDEX_ADD_DEFAULT = 0,
141
141
  GIT_INDEX_ADD_FORCE = (1u << 0),
142
142
  GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH = (1u << 1),
143
- GIT_INDEX_ADD_CHECK_PATHSPEC = (1u << 2),
143
+ GIT_INDEX_ADD_CHECK_PATHSPEC = (1u << 2)
144
144
  } git_index_add_option_t;
145
145
 
146
146
  /** Git index stage states */
@@ -163,7 +163,7 @@ typedef enum {
163
163
  GIT_INDEX_STAGE_OURS = 2,
164
164
 
165
165
  /** The "theirs" side of a conflict. */
166
- GIT_INDEX_STAGE_THEIRS = 3,
166
+ GIT_INDEX_STAGE_THEIRS = 3
167
167
  } git_index_stage_t;
168
168
 
169
169
  /**
@@ -296,6 +296,7 @@ GIT_EXTERN(int) git_index_write(git_index *index);
296
296
  */
297
297
  GIT_EXTERN(const char *) git_index_path(const git_index *index);
298
298
 
299
+ #ifndef GIT_DEPRECATE_HARD
299
300
  /**
300
301
  * Get the checksum of the index
301
302
  *
@@ -303,10 +304,12 @@ GIT_EXTERN(const char *) git_index_path(const git_index *index);
303
304
  * last 20 bytes which are the checksum itself). In cases where the
304
305
  * index does not exist on-disk, it will be zeroed out.
305
306
  *
307
+ * @deprecated this function is deprecated with no replacement
306
308
  * @param index an existing index object
307
309
  * @return a pointer to the checksum of the index
308
310
  */
309
311
  GIT_EXTERN(const git_oid *) git_index_checksum(git_index *index);
312
+ #endif
310
313
 
311
314
  /**
312
315
  * Read a tree into the index file with stats
@@ -491,6 +494,7 @@ GIT_EXTERN(int) git_index_entry_is_conflict(const git_index_entry *entry);
491
494
  *
492
495
  * @param iterator_out The newly created iterator
493
496
  * @param index The index to iterate
497
+ * @return 0 or an error code.
494
498
  */
495
499
  GIT_EXTERN(int) git_index_iterator_new(
496
500
  git_index_iterator **iterator_out,
@@ -787,6 +791,7 @@ GIT_EXTERN(int) git_index_conflict_cleanup(git_index *index);
787
791
  /**
788
792
  * Determine if the index contains entries representing file conflicts.
789
793
  *
794
+ * @param index An existing index object.
790
795
  * @return 1 if at least one conflict is found, 0 otherwise.
791
796
  */
792
797
  GIT_EXTERN(int) git_index_has_conflicts(const git_index *index);
@@ -811,6 +816,7 @@ GIT_EXTERN(int) git_index_conflict_iterator_new(
811
816
  * @param ancestor_out Pointer to store the ancestor side of the conflict
812
817
  * @param our_out Pointer to store our side of the conflict
813
818
  * @param their_out Pointer to store their side of the conflict
819
+ * @param iterator The conflict iterator.
814
820
  * @return 0 (no error), GIT_ITEROVER (iteration is done) or an error code
815
821
  * (negative value)
816
822
  */
@@ -98,6 +98,7 @@ GIT_EXTERN(int) git_indexer_options_init(
98
98
  * will be returned if there are bases missing)
99
99
  * @param opts Optional structure containing additional options. See
100
100
  * `git_indexer_options` above.
101
+ * @return 0 or an error code.
101
102
  */
102
103
  GIT_EXTERN(int) git_indexer_new(
103
104
  git_indexer **out,
@@ -113,6 +114,7 @@ GIT_EXTERN(int) git_indexer_new(
113
114
  * @param data the data to add
114
115
  * @param size the size of the data in bytes
115
116
  * @param stats stat storage
117
+ * @return 0 or an error code.
116
118
  */
117
119
  GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats);
118
120
 
@@ -122,18 +124,35 @@ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t si
122
124
  * Resolve any pending deltas and write out the index file
123
125
  *
124
126
  * @param idx the indexer
127
+ * @param stats Stat storage.
128
+ * @return 0 or an error code.
125
129
  */
126
130
  GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats);
127
131
 
132
+ #ifndef GIT_DEPRECATE_HARD
128
133
  /**
129
134
  * Get the packfile's hash
130
135
  *
131
136
  * A packfile's name is derived from the sorted hashing of all object
132
137
  * names. This is only correct after the index has been finalized.
133
138
  *
139
+ * @deprecated use git_indexer_name
134
140
  * @param idx the indexer instance
141
+ * @return the packfile's hash
135
142
  */
136
143
  GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx);
144
+ #endif
145
+
146
+ /**
147
+ * Get the unique name for the resulting packfile.
148
+ *
149
+ * The packfile's name is derived from the packfile's content.
150
+ * This is only correct after the index has been finalized.
151
+ *
152
+ * @param idx the indexer instance
153
+ * @return a NUL terminated string for the packfile name
154
+ */
155
+ GIT_EXTERN(const char *) git_indexer_name(const git_indexer *idx);
137
156
 
138
157
  /**
139
158
  * Free the indexer and its resources
@@ -92,6 +92,14 @@ typedef enum {
92
92
  * merge base to `git-merge-resolve`.
93
93
  */
94
94
  GIT_MERGE_NO_RECURSIVE = (1 << 3),
95
+
96
+ /**
97
+ * Treat this merge as if it is to produce the virtual base
98
+ * of a recursive merge. This will ensure that there are
99
+ * no conflicts, any conflicting regions will keep conflict
100
+ * markers in the merge result.
101
+ */
102
+ GIT_MERGE_VIRTUAL_BASE = (1 << 4)
95
103
  } git_merge_flag_t;
96
104
 
97
105
  /**
@@ -127,7 +135,7 @@ typedef enum {
127
135
  * which has the result of combining both files. The index will not
128
136
  * record a conflict.
129
137
  */
130
- GIT_MERGE_FILE_FAVOR_UNION = 3,
138
+ GIT_MERGE_FILE_FAVOR_UNION = 3
131
139
  } git_merge_file_favor_t;
132
140
 
133
141
  /**
@@ -160,6 +168,16 @@ typedef enum {
160
168
 
161
169
  /** Take extra time to find minimal diff */
162
170
  GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
171
+
172
+ /** Create zdiff3 ("zealous diff3")-style files */
173
+ GIT_MERGE_FILE_STYLE_ZDIFF3 = (1 << 8),
174
+
175
+ /**
176
+ * Do not produce file conflicts when common regions have
177
+ * changed; keep the conflict markers in the file and accept
178
+ * that as the merge result.
179
+ */
180
+ GIT_MERGE_FILE_ACCEPT_CONFLICTS = (1 << 9)
163
181
  } git_merge_file_flag_t;
164
182
 
165
183
  #define GIT_MERGE_CONFLICT_MARKER_SIZE 7
@@ -341,7 +359,7 @@ typedef enum {
341
359
  * a valid commit. No merge can be performed, but the caller may wish
342
360
  * to simply set HEAD to the target commit(s).
343
361
  */
344
- GIT_MERGE_ANALYSIS_UNBORN = (1 << 3),
362
+ GIT_MERGE_ANALYSIS_UNBORN = (1 << 3)
345
363
  } git_merge_analysis_t;
346
364
 
347
365
  /**
@@ -364,7 +382,7 @@ typedef enum {
364
382
  * There is a `merge.ff=only` configuration setting, suggesting that
365
383
  * the user only wants fast-forward merges.
366
384
  */
367
- GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY = (1 << 1),
385
+ GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY = (1 << 1)
368
386
  } git_merge_preference_t;
369
387
 
370
388
  /**
@@ -372,6 +390,7 @@ typedef enum {
372
390
  * merging them into the HEAD of the repository.
373
391
  *
374
392
  * @param analysis_out analysis enumeration that the result is written into
393
+ * @param preference_out One of the `git_merge_preference_t` flag.
375
394
  * @param repo the repository to merge
376
395
  * @param their_heads the heads to merge into
377
396
  * @param their_heads_len the number of heads to merge
@@ -389,6 +408,7 @@ GIT_EXTERN(int) git_merge_analysis(
389
408
  * merging them into a reference.
390
409
  *
391
410
  * @param analysis_out analysis enumeration that the result is written into
411
+ * @param preference_out One of the `git_merge_preference_t` flag.
392
412
  * @param repo the repository to merge
393
413
  * @param our_ref the reference to perform the analysis from
394
414
  * @param their_heads the heads to merge into
@@ -75,6 +75,8 @@ GIT_EXTERN(int) git_message_trailers(git_message_trailer_array *arr, const char
75
75
  /**
76
76
  * Clean's up any allocated memory in the git_message_trailer_array filled by
77
77
  * a call to git_message_trailers.
78
+ *
79
+ * @param arr The trailer to free.
78
80
  */
79
81
  GIT_EXTERN(void) git_message_trailer_array_free(git_message_trailer_array *arr);
80
82
 
@@ -221,9 +221,32 @@ GIT_EXTERN(int) git_object_peel(
221
221
  *
222
222
  * @param dest Pointer to store the copy of the object
223
223
  * @param source Original object to copy
224
+ * @return 0 or an error code
224
225
  */
225
226
  GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source);
226
227
 
228
+ /**
229
+ * Analyzes a buffer of raw object content and determines its validity.
230
+ * Tree, commit, and tag objects will be parsed and ensured that they
231
+ * are valid, parseable content. (Blobs are always valid by definition.)
232
+ * An error message will be set with an informative message if the object
233
+ * is not valid.
234
+ *
235
+ * @warning This function is experimental and its signature may change in
236
+ * the future.
237
+ *
238
+ * @param valid Output pointer to set with validity of the object content
239
+ * @param buf The contents to validate
240
+ * @param len The length of the buffer
241
+ * @param type The type of the object in the buffer
242
+ * @return 0 on success or an error code
243
+ */
244
+ GIT_EXTERN(int) git_object_rawcontent_is_valid(
245
+ int *valid,
246
+ const char *buf,
247
+ size_t len,
248
+ git_object_t type);
249
+
227
250
  /** @} */
228
251
  GIT_END_DECL
229
252
 
@@ -22,6 +22,17 @@
22
22
  */
23
23
  GIT_BEGIN_DECL
24
24
 
25
+ /** Flags controlling the behavior of ODB lookup operations */
26
+ typedef enum {
27
+ /**
28
+ * Don't call `git_odb_refresh` if the lookup fails. Useful when doing
29
+ * a batch of lookup operations for objects that may legitimately not
30
+ * exist. When using this flag, you may wish to manually call
31
+ * `git_odb_refresh` before processing a batch of objects.
32
+ */
33
+ GIT_ODB_LOOKUP_NO_REFRESH = (1 << 0)
34
+ } git_odb_lookup_flags_t;
35
+
25
36
  /**
26
37
  * Function type for callbacks from git_odb_foreach.
27
38
  */
@@ -155,6 +166,17 @@ GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_object_t *type_out, git
155
166
  */
156
167
  GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id);
157
168
 
169
+ /**
170
+ * Determine if the given object can be found in the object database, with
171
+ * extended options.
172
+ *
173
+ * @param db database to be searched for the given object.
174
+ * @param id the object to search for.
175
+ * @param flags flags affecting the lookup (see `git_odb_lookup_flags_t`)
176
+ * @return 1 if the object was found, 0 otherwise
177
+ */
178
+ GIT_EXTERN(int) git_odb_exists_ext(git_odb *db, const git_oid *id, unsigned int flags);
179
+
158
180
  /**
159
181
  * Determine if an object can be found in the object database by an
160
182
  * abbreviated object ID.
@@ -192,12 +214,13 @@ typedef struct git_odb_expand_id {
192
214
 
193
215
  /**
194
216
  * Determine if one or more objects can be found in the object database
195
- * by their abbreviated object ID and type. The given array will be
196
- * updated in place: for each abbreviated ID that is unique in the
197
- * database, and of the given type (if specified), the full object ID,
198
- * object ID length (`GIT_OID_HEXSZ`) and type will be written back to
199
- * the array. For IDs that are not found (or are ambiguous), the
200
- * array entry will be zeroed.
217
+ * by their abbreviated object ID and type.
218
+ *
219
+ * The given array will be updated in place: for each abbreviated ID that is
220
+ * unique in the database, and of the given type (if specified),
221
+ * the full object ID, object ID length (`GIT_OID_HEXSZ`) and type will be
222
+ * written back to the array. For IDs that are not found (or are ambiguous),
223
+ * the array entry will be zeroed.
201
224
  *
202
225
  * Note that since this function operates on multiple objects, the
203
226
  * underlying database will not be asked to be reloaded if an object is
@@ -323,6 +346,11 @@ GIT_EXTERN(int) git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stre
323
346
  * Read from an odb stream
324
347
  *
325
348
  * Most backends don't implement streaming reads
349
+ *
350
+ * @param stream the stream
351
+ * @param buffer a user-allocated buffer to store the data in.
352
+ * @param len the buffer's length
353
+ * @return 0 if the read succeeded, error code otherwise
326
354
  */
327
355
  GIT_EXTERN(int) git_odb_stream_read(git_odb_stream *stream, char *buffer, size_t len);
328
356
 
@@ -383,6 +411,7 @@ GIT_EXTERN(int) git_odb_open_rstream(
383
411
  * Be aware that this is called inline with network and indexing operations,
384
412
  * so performance may be affected.
385
413
  * @param progress_payload payload for the progress callback
414
+ * @return 0 or an error code.
386
415
  */
387
416
  GIT_EXTERN(int) git_odb_write_pack(
388
417
  git_odb_writepack **out,
@@ -400,6 +429,7 @@ GIT_EXTERN(int) git_odb_write_pack(
400
429
  * exist).
401
430
  *
402
431
  * @param db object database where the `multi-pack-index` file will be written.
432
+ * @return 0 or an error code.
403
433
  */
404
434
  GIT_EXTERN(int) git_odb_write_multi_pack_index(
405
435
  git_odb *db);
@@ -556,7 +586,7 @@ GIT_EXTERN(int) git_odb_get_backend(git_odb_backend **out, git_odb *odb, size_t
556
586
  /**
557
587
  * Set the git commit-graph for the ODB.
558
588
  *
559
- * After a successfull call, the ownership of the cgraph parameter will be
589
+ * After a successful call, the ownership of the cgraph parameter will be
560
590
  * transferred to libgit2, and the caller should not free it.
561
591
  *
562
592
  * The commit-graph can also be unset by explicitly passing NULL as the cgraph
@@ -71,7 +71,7 @@ GIT_EXTERN(int) git_odb_backend_one_pack(git_odb_backend **out, const char *inde
71
71
  typedef enum {
72
72
  GIT_STREAM_RDONLY = (1 << 1),
73
73
  GIT_STREAM_WRONLY = (1 << 2),
74
- GIT_STREAM_RW = (GIT_STREAM_RDONLY | GIT_STREAM_WRONLY),
74
+ GIT_STREAM_RW = (GIT_STREAM_RDONLY | GIT_STREAM_WRONLY)
75
75
  } git_odb_stream_t;
76
76
 
77
77
  /**
@@ -51,7 +51,7 @@ GIT_BEGIN_DECL
51
51
  */
52
52
  typedef enum {
53
53
  GIT_PACKBUILDER_ADDING_OBJECTS = 0,
54
- GIT_PACKBUILDER_DELTAFICATION = 1,
54
+ GIT_PACKBUILDER_DELTAFICATION = 1
55
55
  } git_packbuilder_stage_t;
56
56
 
57
57
  /**
@@ -148,6 +148,7 @@ GIT_EXTERN(int) git_packbuilder_insert_recur(git_packbuilder *pb, const git_oid
148
148
  *
149
149
  * @param buf Buffer where to write the packfile
150
150
  * @param pb The packbuilder
151
+ * @return 0 or an error code
151
152
  */
152
153
  GIT_EXTERN(int) git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb);
153
154
 
@@ -169,15 +170,30 @@ GIT_EXTERN(int) git_packbuilder_write(
169
170
  git_indexer_progress_cb progress_cb,
170
171
  void *progress_cb_payload);
171
172
 
173
+ #ifndef GIT_DEPRECATE_HARD
172
174
  /**
173
- * Get the packfile's hash
174
- *
175
- * A packfile's name is derived from the sorted hashing of all object
176
- * names. This is only correct after the packfile has been written.
177
- *
178
- * @param pb The packbuilder object
179
- */
175
+ * Get the packfile's hash
176
+ *
177
+ * A packfile's name is derived from the sorted hashing of all object
178
+ * names. This is only correct after the packfile has been written.
179
+ *
180
+ * @deprecated use git_packbuilder_name
181
+ * @param pb The packbuilder object
182
+ * @return 0 or an error code
183
+ */
180
184
  GIT_EXTERN(const git_oid *) git_packbuilder_hash(git_packbuilder *pb);
185
+ #endif
186
+
187
+ /**
188
+ * Get the unique name for the resulting packfile.
189
+ *
190
+ * The packfile's name is derived from the packfile's content.
191
+ * This is only correct after the packfile has been written.
192
+ *
193
+ * @param pb the packbuilder instance
194
+ * @return a NUL terminated string for the packfile name
195
+ */
196
+ GIT_EXTERN(const char *) git_packbuilder_name(git_packbuilder *pb);
181
197
 
182
198
  /**
183
199
  * Callback used to iterate over packed objects
@@ -139,17 +139,25 @@ GIT_EXTERN(int) git_patch_from_buffers(
139
139
 
140
140
  /**
141
141
  * Free a git_patch object.
142
+ *
143
+ * @param patch The patch to free.
142
144
  */
143
145
  GIT_EXTERN(void) git_patch_free(git_patch *patch);
144
146
 
145
147
  /**
146
148
  * Get the delta associated with a patch. This delta points to internal
147
149
  * data and you do not have to release it when you are done with it.
150
+ *
151
+ * @param patch The patch in which to get the delta.
152
+ * @return The delta associated with the patch.
148
153
  */
149
154
  GIT_EXTERN(const git_diff_delta *) git_patch_get_delta(const git_patch *patch);
150
155
 
151
156
  /**
152
157
  * Get the number of hunks in a patch
158
+ *
159
+ * @param patch The patch in which to get the number of hunks.
160
+ * @return The number of hunks of the patch.
153
161
  */
154
162
  GIT_EXTERN(size_t) git_patch_num_hunks(const git_patch *patch);
155
163