rugged 1.3.2.3 → 1.4.2

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 (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
@@ -278,7 +278,7 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
278
278
  return 0;
279
279
  }
280
280
 
281
- int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
281
+ int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
282
282
  {
283
283
  static const unsigned char pad[64] = { 0x80 };
284
284
  unsigned int padlen[2];
@@ -294,7 +294,7 @@ int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
294
294
 
295
295
  /* Output hash */
296
296
  for (i = 0; i < 5; i++)
297
- put_be32(out->id + i*4, ctx->H[i]);
297
+ put_be32(out + i*4, ctx->H[i]);
298
298
 
299
299
  return 0;
300
300
  }
@@ -38,9 +38,9 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
38
38
  return 0;
39
39
  }
40
40
 
41
- int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
41
+ int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
42
42
  {
43
43
  GIT_ASSERT_ARG(ctx);
44
- mbedtls_sha1_finish(&ctx->c, out->id);
44
+ mbedtls_sha1_finish(&ctx->c, out);
45
45
  return 0;
46
46
  }
@@ -46,11 +46,11 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
46
46
  return 0;
47
47
  }
48
48
 
49
- int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
49
+ int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
50
50
  {
51
51
  GIT_ASSERT_ARG(ctx);
52
52
 
53
- if (SHA1_Final(out->id, &ctx->c) != 1) {
53
+ if (SHA1_Final(out, &ctx->c) != 1) {
54
54
  git_error_set(GIT_ERROR_SHA1, "hash_openssl: failed to finalize hash");
55
55
  return -1;
56
56
  }
@@ -70,7 +70,7 @@
70
70
  /* Not under GCC-alike or glibc */
71
71
  #elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
72
72
  /*
73
- * *BSD and newlib (embeded linux, cygwin, etc).
73
+ * *BSD and newlib (embedded linux, cygwin, etc).
74
74
  * the defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN) part prevents
75
75
  * this condition from matching with Solaris/sparc.
76
76
  * (Solaris defines only one endian macro)
@@ -181,14 +181,14 @@ GIT_INLINE(int) hash_cryptoapi_update(git_hash_sha1_ctx *ctx, const void *_data,
181
181
  return 0;
182
182
  }
183
183
 
184
- GIT_INLINE(int) hash_cryptoapi_final(git_oid *out, git_hash_sha1_ctx *ctx)
184
+ GIT_INLINE(int) hash_cryptoapi_final(unsigned char *out, git_hash_sha1_ctx *ctx)
185
185
  {
186
- DWORD len = 20;
186
+ DWORD len = GIT_HASH_SHA1_SIZE;
187
187
  int error = 0;
188
188
 
189
189
  GIT_ASSERT(ctx->ctx.cryptoapi.valid);
190
190
 
191
- if (!CryptGetHashParam(ctx->ctx.cryptoapi.hash_handle, HP_HASHVAL, out->id, &len, 0)) {
191
+ if (!CryptGetHashParam(ctx->ctx.cryptoapi.hash_handle, HP_HASHVAL, out, &len, 0)) {
192
192
  git_error_set(GIT_ERROR_OS, "legacy hash data could not be finished");
193
193
  error = -1;
194
194
  }
@@ -262,9 +262,9 @@ GIT_INLINE(int) hash_cng_update(git_hash_sha1_ctx *ctx, const void *_data, size_
262
262
  return 0;
263
263
  }
264
264
 
265
- GIT_INLINE(int) hash_cng_final(git_oid *out, git_hash_sha1_ctx *ctx)
265
+ GIT_INLINE(int) hash_cng_final(unsigned char *out, git_hash_sha1_ctx *ctx)
266
266
  {
267
- if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, out->id, GIT_OID_RAWSZ, 0) < 0) {
267
+ if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, out, GIT_HASH_SHA1_SIZE, 0) < 0) {
268
268
  git_error_set(GIT_ERROR_OS, "hash could not be finished");
269
269
  return -1;
270
270
  }
@@ -315,7 +315,7 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
315
315
  return (ctx->type == CNG) ? hash_cng_update(ctx, data, len) : hash_cryptoapi_update(ctx, data, len);
316
316
  }
317
317
 
318
- int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
318
+ int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
319
319
  {
320
320
  GIT_ASSERT_ARG(ctx);
321
321
  GIT_ASSERT_ARG(ctx->type);
@@ -26,6 +26,8 @@ typedef struct git_hash_sha1_ctx git_hash_sha1_ctx;
26
26
  # include "sha1/generic.h"
27
27
  #endif
28
28
 
29
+ #define GIT_HASH_SHA1_SIZE 20
30
+
29
31
  int git_hash_sha1_global_init(void);
30
32
 
31
33
  int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx);
@@ -33,6 +35,6 @@ void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx);
33
35
 
34
36
  int git_hash_sha1_init(git_hash_sha1_ctx *c);
35
37
  int git_hash_sha1_update(git_hash_sha1_ctx *c, const void *data, size_t len);
36
- int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *c);
38
+ int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *c);
37
39
 
38
40
  #endif
@@ -12,71 +12,83 @@ int git_hash_global_init(void)
12
12
  return git_hash_sha1_global_init();
13
13
  }
14
14
 
15
- int git_hash_ctx_init(git_hash_ctx *ctx)
15
+ int git_hash_ctx_init(git_hash_ctx *ctx, git_hash_algorithm_t algorithm)
16
16
  {
17
17
  int error;
18
18
 
19
- if ((error = git_hash_sha1_ctx_init(&ctx->ctx.sha1)) < 0)
20
- return error;
21
-
22
- ctx->algo = GIT_HASH_ALGO_SHA1;
19
+ switch (algorithm) {
20
+ case GIT_HASH_ALGORITHM_SHA1:
21
+ error = git_hash_sha1_ctx_init(&ctx->ctx.sha1);
22
+ break;
23
+ default:
24
+ git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
25
+ error = -1;
26
+ }
23
27
 
24
- return 0;
28
+ ctx->algorithm = algorithm;
29
+ return error;
25
30
  }
26
31
 
27
32
  void git_hash_ctx_cleanup(git_hash_ctx *ctx)
28
33
  {
29
- switch (ctx->algo) {
30
- case GIT_HASH_ALGO_SHA1:
31
- git_hash_sha1_ctx_cleanup(&ctx->ctx.sha1);
32
- return;
33
- default:
34
- /* unreachable */ ;
34
+ switch (ctx->algorithm) {
35
+ case GIT_HASH_ALGORITHM_SHA1:
36
+ git_hash_sha1_ctx_cleanup(&ctx->ctx.sha1);
37
+ return;
38
+ default:
39
+ /* unreachable */ ;
35
40
  }
36
41
  }
37
42
 
38
43
  int git_hash_init(git_hash_ctx *ctx)
39
44
  {
40
- switch (ctx->algo) {
41
- case GIT_HASH_ALGO_SHA1:
42
- return git_hash_sha1_init(&ctx->ctx.sha1);
43
- default:
44
- /* unreachable */ ;
45
+ switch (ctx->algorithm) {
46
+ case GIT_HASH_ALGORITHM_SHA1:
47
+ return git_hash_sha1_init(&ctx->ctx.sha1);
48
+ default:
49
+ /* unreachable */ ;
45
50
  }
46
- GIT_ASSERT(0);
51
+
52
+ git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
47
53
  return -1;
48
54
  }
49
55
 
50
56
  int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
51
57
  {
52
- switch (ctx->algo) {
53
- case GIT_HASH_ALGO_SHA1:
54
- return git_hash_sha1_update(&ctx->ctx.sha1, data, len);
55
- default:
56
- /* unreachable */ ;
58
+ switch (ctx->algorithm) {
59
+ case GIT_HASH_ALGORITHM_SHA1:
60
+ return git_hash_sha1_update(&ctx->ctx.sha1, data, len);
61
+ default:
62
+ /* unreachable */ ;
57
63
  }
58
- GIT_ASSERT(0);
64
+
65
+ git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
59
66
  return -1;
60
67
  }
61
68
 
62
- int git_hash_final(git_oid *out, git_hash_ctx *ctx)
69
+ int git_hash_final(unsigned char *out, git_hash_ctx *ctx)
63
70
  {
64
- switch (ctx->algo) {
65
- case GIT_HASH_ALGO_SHA1:
66
- return git_hash_sha1_final(out, &ctx->ctx.sha1);
67
- default:
68
- /* unreachable */ ;
71
+ switch (ctx->algorithm) {
72
+ case GIT_HASH_ALGORITHM_SHA1:
73
+ return git_hash_sha1_final(out, &ctx->ctx.sha1);
74
+ default:
75
+ /* unreachable */ ;
69
76
  }
70
- GIT_ASSERT(0);
77
+
78
+ git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
71
79
  return -1;
72
80
  }
73
81
 
74
- int git_hash_buf(git_oid *out, const void *data, size_t len)
82
+ int git_hash_buf(
83
+ unsigned char *out,
84
+ const void *data,
85
+ size_t len,
86
+ git_hash_algorithm_t algorithm)
75
87
  {
76
88
  git_hash_ctx ctx;
77
89
  int error = 0;
78
90
 
79
- if (git_hash_ctx_init(&ctx) < 0)
91
+ if (git_hash_ctx_init(&ctx, algorithm) < 0)
80
92
  return -1;
81
93
 
82
94
  if ((error = git_hash_update(&ctx, data, len)) >= 0)
@@ -87,13 +99,17 @@ int git_hash_buf(git_oid *out, const void *data, size_t len)
87
99
  return error;
88
100
  }
89
101
 
90
- int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n)
102
+ int git_hash_vec(
103
+ unsigned char *out,
104
+ git_str_vec *vec,
105
+ size_t n,
106
+ git_hash_algorithm_t algorithm)
91
107
  {
92
108
  git_hash_ctx ctx;
93
109
  size_t i;
94
110
  int error = 0;
95
111
 
96
- if (git_hash_ctx_init(&ctx) < 0)
112
+ if (git_hash_ctx_init(&ctx, algorithm) < 0)
97
113
  return -1;
98
114
 
99
115
  for (i = 0; i < n; i++) {
@@ -108,3 +124,19 @@ done:
108
124
 
109
125
  return error;
110
126
  }
127
+
128
+ int git_hash_fmt(char *out, unsigned char *hash, size_t hash_len)
129
+ {
130
+ static char hex[] = "0123456789abcdef";
131
+ char *str = out;
132
+ size_t i;
133
+
134
+ for (i = 0; i < hash_len; i++) {
135
+ *str++ = hex[hash[i] >> 4];
136
+ *str++ = hex[hash[i] & 0x0f];
137
+ }
138
+
139
+ *str++ = '\0';
140
+
141
+ return 0;
142
+ }
@@ -10,37 +10,37 @@
10
10
 
11
11
  #include "common.h"
12
12
 
13
- #include "git2/oid.h"
13
+ #include "hash/sha1.h"
14
14
 
15
15
  typedef struct {
16
16
  void *data;
17
17
  size_t len;
18
- } git_buf_vec;
18
+ } git_str_vec;
19
19
 
20
20
  typedef enum {
21
- GIT_HASH_ALGO_UNKNOWN = 0,
22
- GIT_HASH_ALGO_SHA1,
23
- } git_hash_algo_t;
24
-
25
- #include "hash/sha1.h"
21
+ GIT_HASH_ALGORITHM_NONE = 0,
22
+ GIT_HASH_ALGORITHM_SHA1
23
+ } git_hash_algorithm_t;
26
24
 
27
25
  typedef struct git_hash_ctx {
28
26
  union {
29
27
  git_hash_sha1_ctx sha1;
30
28
  } ctx;
31
- git_hash_algo_t algo;
29
+ git_hash_algorithm_t algorithm;
32
30
  } git_hash_ctx;
33
31
 
34
32
  int git_hash_global_init(void);
35
33
 
36
- int git_hash_ctx_init(git_hash_ctx *ctx);
34
+ int git_hash_ctx_init(git_hash_ctx *ctx, git_hash_algorithm_t algorithm);
37
35
  void git_hash_ctx_cleanup(git_hash_ctx *ctx);
38
36
 
39
37
  int git_hash_init(git_hash_ctx *c);
40
38
  int git_hash_update(git_hash_ctx *c, const void *data, size_t len);
41
- int git_hash_final(git_oid *out, git_hash_ctx *c);
39
+ int git_hash_final(unsigned char *out, git_hash_ctx *c);
40
+
41
+ int git_hash_buf(unsigned char *out, const void *data, size_t len, git_hash_algorithm_t algorithm);
42
+ int git_hash_vec(unsigned char *out, git_str_vec *vec, size_t n, git_hash_algorithm_t algorithm);
42
43
 
43
- int git_hash_buf(git_oid *out, const void *data, size_t len);
44
- int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n);
44
+ int git_hash_fmt(char *out, unsigned char *hash, size_t hash_len);
45
45
 
46
46
  #endif
@@ -9,7 +9,7 @@
9
9
 
10
10
  #include "git2/sys/filter.h"
11
11
  #include "filter.h"
12
- #include "buffer.h"
12
+ #include "str.h"
13
13
 
14
14
  static int ident_find_id(
15
15
  const char **id_start, const char **id_end, const char *start, size_t len)
@@ -40,7 +40,7 @@ static int ident_find_id(
40
40
  }
41
41
 
42
42
  static int ident_insert_id(
43
- git_buf *to, const git_buf *from, const git_filter_source *src)
43
+ git_str *to, const git_str *from, const git_filter_source *src)
44
44
  {
45
45
  char oid[GIT_OID_HEXSZ+1];
46
46
  const char *id_start, *id_end, *from_end = from->ptr + from->size;
@@ -60,20 +60,20 @@ static int ident_insert_id(
60
60
  5 /* "$Id: " */ + GIT_OID_HEXSZ + 2 /* " $" */ +
61
61
  (size_t)(from_end - id_end);
62
62
 
63
- if (git_buf_grow(to, need_size) < 0)
63
+ if (git_str_grow(to, need_size) < 0)
64
64
  return -1;
65
65
 
66
- git_buf_set(to, from->ptr, (size_t)(id_start - from->ptr));
67
- git_buf_put(to, "$Id: ", 5);
68
- git_buf_put(to, oid, GIT_OID_HEXSZ);
69
- git_buf_put(to, " $", 2);
70
- git_buf_put(to, id_end, (size_t)(from_end - id_end));
66
+ git_str_set(to, from->ptr, (size_t)(id_start - from->ptr));
67
+ git_str_put(to, "$Id: ", 5);
68
+ git_str_put(to, oid, GIT_OID_HEXSZ);
69
+ git_str_put(to, " $", 2);
70
+ git_str_put(to, id_end, (size_t)(from_end - id_end));
71
71
 
72
- return git_buf_oom(to) ? -1 : 0;
72
+ return git_str_oom(to) ? -1 : 0;
73
73
  }
74
74
 
75
75
  static int ident_remove_id(
76
- git_buf *to, const git_buf *from)
76
+ git_str *to, const git_str *from)
77
77
  {
78
78
  const char *id_start, *id_end, *from_end = from->ptr + from->size;
79
79
  size_t need_size;
@@ -84,27 +84,27 @@ static int ident_remove_id(
84
84
  need_size = (size_t)(id_start - from->ptr) +
85
85
  4 /* "$Id$" */ + (size_t)(from_end - id_end);
86
86
 
87
- if (git_buf_grow(to, need_size) < 0)
87
+ if (git_str_grow(to, need_size) < 0)
88
88
  return -1;
89
89
 
90
- git_buf_set(to, from->ptr, (size_t)(id_start - from->ptr));
91
- git_buf_put(to, "$Id$", 4);
92
- git_buf_put(to, id_end, (size_t)(from_end - id_end));
90
+ git_str_set(to, from->ptr, (size_t)(id_start - from->ptr));
91
+ git_str_put(to, "$Id$", 4);
92
+ git_str_put(to, id_end, (size_t)(from_end - id_end));
93
93
 
94
- return git_buf_oom(to) ? -1 : 0;
94
+ return git_str_oom(to) ? -1 : 0;
95
95
  }
96
96
 
97
97
  static int ident_apply(
98
98
  git_filter *self,
99
99
  void **payload,
100
- git_buf *to,
101
- const git_buf *from,
100
+ git_str *to,
101
+ const git_str *from,
102
102
  const git_filter_source *src)
103
103
  {
104
104
  GIT_UNUSED(self); GIT_UNUSED(payload);
105
105
 
106
106
  /* Don't filter binary files */
107
- if (git_buf_is_binary(from))
107
+ if (git_str_is_binary(from))
108
108
  return GIT_PASSTHROUGH;
109
109
 
110
110
  if (git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
@@ -10,9 +10,10 @@
10
10
  #include "git2/ignore.h"
11
11
  #include "common.h"
12
12
  #include "attrcache.h"
13
- #include "path.h"
13
+ #include "fs_path.h"
14
14
  #include "config.h"
15
15
  #include "wildmatch.h"
16
+ #include "path.h"
16
17
 
17
18
  #define GIT_IGNORE_INTERNAL "[internal]exclude"
18
19
 
@@ -105,7 +106,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
105
106
  size_t i;
106
107
  git_attr_fnmatch *rule;
107
108
  char *path;
108
- git_buf buf = GIT_BUF_INIT;
109
+ git_str buf = GIT_STR_INIT;
109
110
 
110
111
  *out = 0;
111
112
 
@@ -115,12 +116,12 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
115
116
 
116
117
  /* path of the file relative to the workdir, so we match the rules in subdirs */
117
118
  if (match->containing_dir) {
118
- git_buf_puts(&buf, match->containing_dir);
119
+ git_str_puts(&buf, match->containing_dir);
119
120
  }
120
- if (git_buf_puts(&buf, match->pattern) < 0)
121
+ if (git_str_puts(&buf, match->pattern) < 0)
121
122
  return -1;
122
123
 
123
- path = git_buf_detach(&buf);
124
+ path = git_str_detach(&buf);
124
125
 
125
126
  git_vector_foreach(rules, i, rule) {
126
127
  if (!(rule->flags & GIT_ATTR_FNMATCH_HASWILD)) {
@@ -133,12 +134,12 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
133
134
  continue;
134
135
  }
135
136
 
136
- git_buf_clear(&buf);
137
+ git_str_clear(&buf);
137
138
  if (rule->containing_dir)
138
- git_buf_puts(&buf, rule->containing_dir);
139
- git_buf_puts(&buf, rule->pattern);
139
+ git_str_puts(&buf, rule->containing_dir);
140
+ git_str_puts(&buf, rule->pattern);
140
141
 
141
- if (git_buf_oom(&buf))
142
+ if (git_str_oom(&buf))
142
143
  goto out;
143
144
 
144
145
  /*
@@ -151,7 +152,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
151
152
  effective_flags &= ~WM_PATHNAME;
152
153
 
153
154
  /* if we found a match, we want to keep this rule */
154
- if ((wildmatch(git_buf_cstr(&buf), path, effective_flags)) == WM_MATCH) {
155
+ if ((wildmatch(git_str_cstr(&buf), path, effective_flags)) == WM_MATCH) {
155
156
  *out = 1;
156
157
  error = 0;
157
158
  goto out;
@@ -162,7 +163,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
162
163
 
163
164
  out:
164
165
  git__free(path);
165
- git_buf_dispose(&buf);
166
+ git_str_dispose(&buf);
166
167
  return error;
167
168
  }
168
169
 
@@ -181,7 +182,7 @@ static int parse_ignore_file(
181
182
 
182
183
  /* if subdir file path, convert context for file paths */
183
184
  if (attrs->entry &&
184
- git_path_root(attrs->entry->path) < 0 &&
185
+ git_fs_path_root(attrs->entry->path) < 0 &&
185
186
  !git__suffixcmp(attrs->entry->path, "/" GIT_IGNORE_FILE))
186
187
  context = attrs->entry->path;
187
188
 
@@ -295,7 +296,7 @@ int git_ignore__for_path(
295
296
  {
296
297
  int error = 0;
297
298
  const char *workdir = git_repository_workdir(repo);
298
- git_buf infopath = GIT_BUF_INIT;
299
+ git_str infopath = GIT_STR_INIT;
299
300
 
300
301
  GIT_ASSERT_ARG(repo);
301
302
  GIT_ASSERT_ARG(ignores);
@@ -313,21 +314,21 @@ int git_ignore__for_path(
313
314
  goto cleanup;
314
315
 
315
316
  /* given a unrooted path in a non-bare repo, resolve it */
316
- if (workdir && git_path_root(path) < 0) {
317
- git_buf local = GIT_BUF_INIT;
318
-
319
- if ((error = git_path_dirname_r(&local, path)) < 0 ||
320
- (error = git_path_resolve_relative(&local, 0)) < 0 ||
321
- (error = git_path_to_dir(&local)) < 0 ||
322
- (error = git_buf_joinpath(&ignores->dir, workdir, local.ptr)) < 0 ||
323
- (error = git_path_validate_workdir_buf(repo, &ignores->dir)) < 0) {
317
+ if (workdir && git_fs_path_root(path) < 0) {
318
+ git_str local = GIT_STR_INIT;
319
+
320
+ if ((error = git_fs_path_dirname_r(&local, path)) < 0 ||
321
+ (error = git_fs_path_resolve_relative(&local, 0)) < 0 ||
322
+ (error = git_fs_path_to_dir(&local)) < 0 ||
323
+ (error = git_str_joinpath(&ignores->dir, workdir, local.ptr)) < 0 ||
324
+ (error = git_path_validate_str_length(repo, &ignores->dir)) < 0) {
324
325
  /* Nothing, we just want to stop on the first error */
325
326
  }
326
327
 
327
- git_buf_dispose(&local);
328
+ git_str_dispose(&local);
328
329
  } else {
329
- if (!(error = git_buf_joinpath(&ignores->dir, path, "")))
330
- error = git_path_validate_filesystem(ignores->dir.ptr, ignores->dir.size);
330
+ if (!(error = git_str_joinpath(&ignores->dir, path, "")))
331
+ error = git_path_validate_str_length(NULL, &ignores->dir);
331
332
  }
332
333
 
333
334
  if (error < 0)
@@ -342,14 +343,14 @@ int git_ignore__for_path(
342
343
 
343
344
  /* load .gitignore up the path */
344
345
  if (workdir != NULL) {
345
- error = git_path_walk_up(
346
+ error = git_fs_path_walk_up(
346
347
  &ignores->dir, workdir, push_one_ignore, ignores);
347
348
  if (error < 0)
348
349
  goto cleanup;
349
350
  }
350
351
 
351
352
  /* load .git/info/exclude if possible */
352
- if ((error = git_repository_item_path(&infopath, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
353
+ if ((error = git_repository__item_path(&infopath, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
353
354
  (error = push_ignore_file(ignores, &ignores->ign_global, infopath.ptr, GIT_IGNORE_FILE_INREPO)) < 0) {
354
355
  if (error != GIT_ENOTFOUND)
355
356
  goto cleanup;
@@ -363,7 +364,7 @@ int git_ignore__for_path(
363
364
  git_repository_attr_cache(repo)->cfg_excl_file);
364
365
 
365
366
  cleanup:
366
- git_buf_dispose(&infopath);
367
+ git_str_dispose(&infopath);
367
368
  if (error < 0)
368
369
  git_ignore__free(ignores);
369
370
 
@@ -372,7 +373,7 @@ cleanup:
372
373
 
373
374
  int git_ignore__push_dir(git_ignores *ign, const char *dir)
374
375
  {
375
- if (git_buf_joinpath(&ign->dir, ign->dir.ptr, dir) < 0)
376
+ if (git_str_joinpath(&ign->dir, ign->dir.ptr, dir) < 0)
376
377
  return -1;
377
378
 
378
379
  ign->depth++;
@@ -409,8 +410,8 @@ int git_ignore__pop_dir(git_ignores *ign)
409
410
  }
410
411
 
411
412
  if (--ign->depth > 0) {
412
- git_buf_rtruncate_at_char(&ign->dir, '/');
413
- git_path_to_dir(&ign->dir);
413
+ git_str_rtruncate_at_char(&ign->dir, '/');
414
+ git_fs_path_to_dir(&ign->dir);
414
415
  }
415
416
 
416
417
  return 0;
@@ -435,7 +436,7 @@ void git_ignore__free(git_ignores *ignores)
435
436
  }
436
437
  git_vector_free(&ignores->ign_global);
437
438
 
438
- git_buf_dispose(&ignores->dir);
439
+ git_str_dispose(&ignores->dir);
439
440
  }
440
441
 
441
442
  static bool ignore_lookup_in_rules(
@@ -604,7 +605,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
604
605
  size_t i;
605
606
  git_attr_fnmatch *match;
606
607
  int ignored;
607
- git_buf path = GIT_BUF_INIT;
608
+ git_str path = GIT_STR_INIT;
608
609
  const char *filename;
609
610
  git_index *idx;
610
611
 
@@ -629,7 +630,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
629
630
  break;
630
631
 
631
632
  /* is there a file on disk that matches this exactly? */
632
- if (!git_path_isfile(path.ptr))
633
+ if (!git_fs_path_isfile(path.ptr))
633
634
  continue;
634
635
 
635
636
  /* is that file ignored? */
@@ -645,7 +646,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
645
646
  }
646
647
 
647
648
  git_index_free(idx);
648
- git_buf_dispose(&path);
649
+ git_str_dispose(&path);
649
650
 
650
651
  return error;
651
652
  }
@@ -26,7 +26,7 @@
26
26
  */
27
27
  typedef struct {
28
28
  git_repository *repo;
29
- git_buf dir; /* current directory reflected in ign_path */
29
+ git_str dir; /* current directory reflected in ign_path */
30
30
  git_attr_file *ign_internal;
31
31
  git_vector ign_path;
32
32
  git_vector ign_global;
@@ -48,7 +48,7 @@ enum {
48
48
  GIT_IGNORE_UNCHECKED = -2,
49
49
  GIT_IGNORE_NOTFOUND = -1,
50
50
  GIT_IGNORE_FALSE = 0,
51
- GIT_IGNORE_TRUE = 1,
51
+ GIT_IGNORE_TRUE = 1
52
52
  };
53
53
 
54
54
  extern int git_ignore__lookup(int *out, git_ignores *ign, const char *path, git_dir_flag dir_flag);