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
@@ -7,10 +7,11 @@
7
7
 
8
8
  #include "common.h"
9
9
 
10
- #include "buffer.h"
10
+ #include "str.h"
11
11
  #include "repository.h"
12
12
  #include "posix.h"
13
13
  #include "filebuf.h"
14
+ #include "commit.h"
14
15
  #include "merge.h"
15
16
  #include "array.h"
16
17
  #include "config.h"
@@ -52,7 +53,7 @@ typedef enum {
52
53
  GIT_REBASE_NONE = 0,
53
54
  GIT_REBASE_APPLY = 1,
54
55
  GIT_REBASE_MERGE = 2,
55
- GIT_REBASE_INTERACTIVE = 3,
56
+ GIT_REBASE_INTERACTIVE = 3
56
57
  } git_rebase_t;
57
58
 
58
59
  struct git_rebase {
@@ -63,10 +64,10 @@ struct git_rebase {
63
64
  git_rebase_t type;
64
65
  char *state_path;
65
66
 
66
- int head_detached : 1,
67
- inmemory : 1,
68
- quiet : 1,
69
- started : 1;
67
+ unsigned int head_detached:1,
68
+ inmemory:1,
69
+ quiet:1,
70
+ started:1;
70
71
 
71
72
  git_array_t(git_rebase_operation) operations;
72
73
  size_t current;
@@ -90,22 +91,22 @@ static int rebase_state_type(
90
91
  char **path_out,
91
92
  git_repository *repo)
92
93
  {
93
- git_buf path = GIT_BUF_INIT;
94
+ git_str path = GIT_STR_INIT;
94
95
  git_rebase_t type = GIT_REBASE_NONE;
95
96
 
96
- if (git_buf_joinpath(&path, repo->gitdir, REBASE_APPLY_DIR) < 0)
97
+ if (git_str_joinpath(&path, repo->gitdir, REBASE_APPLY_DIR) < 0)
97
98
  return -1;
98
99
 
99
- if (git_path_isdir(git_buf_cstr(&path))) {
100
+ if (git_fs_path_isdir(git_str_cstr(&path))) {
100
101
  type = GIT_REBASE_APPLY;
101
102
  goto done;
102
103
  }
103
104
 
104
- git_buf_clear(&path);
105
- if (git_buf_joinpath(&path, repo->gitdir, REBASE_MERGE_DIR) < 0)
105
+ git_str_clear(&path);
106
+ if (git_str_joinpath(&path, repo->gitdir, REBASE_MERGE_DIR) < 0)
106
107
  return -1;
107
108
 
108
- if (git_path_isdir(git_buf_cstr(&path))) {
109
+ if (git_fs_path_isdir(git_str_cstr(&path))) {
109
110
  type = GIT_REBASE_MERGE;
110
111
  goto done;
111
112
  }
@@ -114,36 +115,36 @@ done:
114
115
  *type_out = type;
115
116
 
116
117
  if (type != GIT_REBASE_NONE && path_out)
117
- *path_out = git_buf_detach(&path);
118
+ *path_out = git_str_detach(&path);
118
119
 
119
- git_buf_dispose(&path);
120
+ git_str_dispose(&path);
120
121
 
121
122
  return 0;
122
123
  }
123
124
 
124
125
  GIT_INLINE(int) rebase_readfile(
125
- git_buf *out,
126
- git_buf *state_path,
126
+ git_str *out,
127
+ git_str *state_path,
127
128
  const char *filename)
128
129
  {
129
130
  size_t state_path_len = state_path->size;
130
131
  int error;
131
132
 
132
- git_buf_clear(out);
133
+ git_str_clear(out);
133
134
 
134
- if ((error = git_buf_joinpath(state_path, state_path->ptr, filename)) < 0 ||
135
+ if ((error = git_str_joinpath(state_path, state_path->ptr, filename)) < 0 ||
135
136
  (error = git_futils_readbuffer(out, state_path->ptr)) < 0)
136
137
  goto done;
137
138
 
138
- git_buf_rtrim(out);
139
+ git_str_rtrim(out);
139
140
 
140
141
  done:
141
- git_buf_truncate(state_path, state_path_len);
142
+ git_str_truncate(state_path, state_path_len);
142
143
  return error;
143
144
  }
144
145
 
145
146
  GIT_INLINE(int) rebase_readint(
146
- size_t *out, git_buf *asc_out, git_buf *state_path, const char *filename)
147
+ size_t *out, git_str *asc_out, git_str *state_path, const char *filename)
147
148
  {
148
149
  int32_t num;
149
150
  const char *eol;
@@ -163,7 +164,7 @@ GIT_INLINE(int) rebase_readint(
163
164
  }
164
165
 
165
166
  GIT_INLINE(int) rebase_readoid(
166
- git_oid *out, git_buf *str_out, git_buf *state_path, const char *filename)
167
+ git_oid *out, git_str *str_out, git_str *state_path, const char *filename)
167
168
  {
168
169
  int error;
169
170
 
@@ -201,13 +202,13 @@ static git_rebase_operation *rebase_operation_alloc(
201
202
 
202
203
  static int rebase_open_merge(git_rebase *rebase)
203
204
  {
204
- git_buf state_path = GIT_BUF_INIT, buf = GIT_BUF_INIT, cmt = GIT_BUF_INIT;
205
+ git_str state_path = GIT_STR_INIT, buf = GIT_STR_INIT, cmt = GIT_STR_INIT;
205
206
  git_oid id;
206
207
  git_rebase_operation *operation;
207
208
  size_t i, msgnum = 0, end;
208
209
  int error;
209
210
 
210
- if ((error = git_buf_puts(&state_path, rebase->state_path)) < 0)
211
+ if ((error = git_str_puts(&state_path, rebase->state_path)) < 0)
211
212
  goto done;
212
213
 
213
214
  /* Read 'msgnum' if it exists (otherwise, let msgnum = 0) */
@@ -234,9 +235,9 @@ static int rebase_open_merge(git_rebase *rebase)
234
235
  GIT_ERROR_CHECK_ARRAY(rebase->operations);
235
236
 
236
237
  for (i = 0; i < end; i++) {
237
- git_buf_clear(&cmt);
238
+ git_str_clear(&cmt);
238
239
 
239
- if ((error = git_buf_printf(&cmt, "cmt.%" PRIuZ, (i+1))) < 0 ||
240
+ if ((error = git_str_printf(&cmt, "cmt.%" PRIuZ, (i+1))) < 0 ||
240
241
  (error = rebase_readoid(&id, &buf, &state_path, cmt.ptr)) < 0)
241
242
  goto done;
242
243
 
@@ -248,12 +249,12 @@ static int rebase_open_merge(git_rebase *rebase)
248
249
  if ((error = rebase_readfile(&buf, &state_path, ONTO_NAME_FILE)) < 0)
249
250
  goto done;
250
251
 
251
- rebase->onto_name = git_buf_detach(&buf);
252
+ rebase->onto_name = git_str_detach(&buf);
252
253
 
253
254
  done:
254
- git_buf_dispose(&cmt);
255
- git_buf_dispose(&state_path);
256
- git_buf_dispose(&buf);
255
+ git_str_dispose(&cmt);
256
+ git_str_dispose(&state_path);
257
+ git_str_dispose(&buf);
257
258
 
258
259
  return error;
259
260
  }
@@ -296,8 +297,8 @@ int git_rebase_open(
296
297
  const git_rebase_options *given_opts)
297
298
  {
298
299
  git_rebase *rebase;
299
- git_buf path = GIT_BUF_INIT, orig_head_name = GIT_BUF_INIT,
300
- orig_head_id = GIT_BUF_INIT, onto_id = GIT_BUF_INIT;
300
+ git_str path = GIT_STR_INIT, orig_head_name = GIT_STR_INIT,
301
+ orig_head_id = GIT_STR_INIT, onto_id = GIT_STR_INIT;
301
302
  size_t state_path_len;
302
303
  int error;
303
304
 
@@ -320,54 +321,54 @@ int git_rebase_open(
320
321
  goto done;
321
322
  }
322
323
 
323
- if ((error = git_buf_puts(&path, rebase->state_path)) < 0)
324
+ if ((error = git_str_puts(&path, rebase->state_path)) < 0)
324
325
  goto done;
325
326
 
326
- state_path_len = git_buf_len(&path);
327
+ state_path_len = git_str_len(&path);
327
328
 
328
- if ((error = git_buf_joinpath(&path, path.ptr, HEAD_NAME_FILE)) < 0 ||
329
+ if ((error = git_str_joinpath(&path, path.ptr, HEAD_NAME_FILE)) < 0 ||
329
330
  (error = git_futils_readbuffer(&orig_head_name, path.ptr)) < 0)
330
331
  goto done;
331
332
 
332
- git_buf_rtrim(&orig_head_name);
333
+ git_str_rtrim(&orig_head_name);
333
334
 
334
335
  if (strcmp(ORIG_DETACHED_HEAD, orig_head_name.ptr) == 0)
335
336
  rebase->head_detached = 1;
336
337
 
337
- git_buf_truncate(&path, state_path_len);
338
+ git_str_truncate(&path, state_path_len);
338
339
 
339
- if ((error = git_buf_joinpath(&path, path.ptr, ORIG_HEAD_FILE)) < 0)
340
+ if ((error = git_str_joinpath(&path, path.ptr, ORIG_HEAD_FILE)) < 0)
340
341
  goto done;
341
342
 
342
- if (!git_path_isfile(path.ptr)) {
343
+ if (!git_fs_path_isfile(path.ptr)) {
343
344
  /* Previous versions of git.git used 'head' here; support that. */
344
- git_buf_truncate(&path, state_path_len);
345
+ git_str_truncate(&path, state_path_len);
345
346
 
346
- if ((error = git_buf_joinpath(&path, path.ptr, HEAD_FILE)) < 0)
347
+ if ((error = git_str_joinpath(&path, path.ptr, HEAD_FILE)) < 0)
347
348
  goto done;
348
349
  }
349
350
 
350
351
  if ((error = git_futils_readbuffer(&orig_head_id, path.ptr)) < 0)
351
352
  goto done;
352
353
 
353
- git_buf_rtrim(&orig_head_id);
354
+ git_str_rtrim(&orig_head_id);
354
355
 
355
356
  if ((error = git_oid_fromstr(&rebase->orig_head_id, orig_head_id.ptr)) < 0)
356
357
  goto done;
357
358
 
358
- git_buf_truncate(&path, state_path_len);
359
+ git_str_truncate(&path, state_path_len);
359
360
 
360
- if ((error = git_buf_joinpath(&path, path.ptr, ONTO_FILE)) < 0 ||
361
+ if ((error = git_str_joinpath(&path, path.ptr, ONTO_FILE)) < 0 ||
361
362
  (error = git_futils_readbuffer(&onto_id, path.ptr)) < 0)
362
363
  goto done;
363
364
 
364
- git_buf_rtrim(&onto_id);
365
+ git_str_rtrim(&onto_id);
365
366
 
366
367
  if ((error = git_oid_fromstr(&rebase->onto_id, onto_id.ptr)) < 0)
367
368
  goto done;
368
369
 
369
370
  if (!rebase->head_detached)
370
- rebase->orig_head_name = git_buf_detach(&orig_head_name);
371
+ rebase->orig_head_name = git_str_detach(&orig_head_name);
371
372
 
372
373
  switch (rebase->type) {
373
374
  case GIT_REBASE_INTERACTIVE:
@@ -391,10 +392,10 @@ done:
391
392
  else
392
393
  git_rebase_free(rebase);
393
394
 
394
- git_buf_dispose(&path);
395
- git_buf_dispose(&orig_head_name);
396
- git_buf_dispose(&orig_head_id);
397
- git_buf_dispose(&onto_id);
395
+ git_str_dispose(&path);
396
+ git_str_dispose(&orig_head_name);
397
+ git_str_dispose(&orig_head_id);
398
+ git_str_dispose(&onto_id);
398
399
  return error;
399
400
  }
400
401
 
@@ -403,27 +404,27 @@ static int rebase_cleanup(git_rebase *rebase)
403
404
  if (!rebase || rebase->inmemory)
404
405
  return 0;
405
406
 
406
- return git_path_isdir(rebase->state_path) ?
407
+ return git_fs_path_isdir(rebase->state_path) ?
407
408
  git_futils_rmdir_r(rebase->state_path, NULL, GIT_RMDIR_REMOVE_FILES) :
408
409
  0;
409
410
  }
410
411
 
411
412
  static int rebase_setupfile(git_rebase *rebase, const char *filename, int flags, const char *fmt, ...)
412
413
  {
413
- git_buf path = GIT_BUF_INIT,
414
- contents = GIT_BUF_INIT;
414
+ git_str path = GIT_STR_INIT,
415
+ contents = GIT_STR_INIT;
415
416
  va_list ap;
416
417
  int error;
417
418
 
418
419
  va_start(ap, fmt);
419
- git_buf_vprintf(&contents, fmt, ap);
420
+ git_str_vprintf(&contents, fmt, ap);
420
421
  va_end(ap);
421
422
 
422
- if ((error = git_buf_joinpath(&path, rebase->state_path, filename)) == 0)
423
+ if ((error = git_str_joinpath(&path, rebase->state_path, filename)) == 0)
423
424
  error = git_futils_writebuffer(&contents, path.ptr, flags, REBASE_FILE_MODE);
424
425
 
425
- git_buf_dispose(&path);
426
- git_buf_dispose(&contents);
426
+ git_str_dispose(&path);
427
+ git_str_dispose(&contents);
427
428
 
428
429
  return error;
429
430
  }
@@ -440,7 +441,7 @@ static const char *rebase_onto_name(const git_annotated_commit *onto)
440
441
 
441
442
  static int rebase_setupfiles_merge(git_rebase *rebase)
442
443
  {
443
- git_buf commit_filename = GIT_BUF_INIT;
444
+ git_str commit_filename = GIT_STR_INIT;
444
445
  char id_str[GIT_OID_HEXSZ];
445
446
  git_rebase_operation *operation;
446
447
  size_t i;
@@ -453,8 +454,8 @@ static int rebase_setupfiles_merge(git_rebase *rebase)
453
454
  for (i = 0; i < git_array_size(rebase->operations); i++) {
454
455
  operation = git_array_get(rebase->operations, i);
455
456
 
456
- git_buf_clear(&commit_filename);
457
- git_buf_printf(&commit_filename, CMT_FILE_FMT, i+1);
457
+ git_str_clear(&commit_filename);
458
+ git_str_printf(&commit_filename, CMT_FILE_FMT, i+1);
458
459
 
459
460
  git_oid_fmt(id_str, &operation->id);
460
461
 
@@ -464,7 +465,7 @@ static int rebase_setupfiles_merge(git_rebase *rebase)
464
465
  }
465
466
 
466
467
  done:
467
- git_buf_dispose(&commit_filename);
468
+ git_str_dispose(&commit_filename);
468
469
  return error;
469
470
  }
470
471
 
@@ -626,16 +627,16 @@ static int rebase_init_merge(
626
627
  {
627
628
  git_reference *head_ref = NULL;
628
629
  git_commit *onto_commit = NULL;
629
- git_buf reflog = GIT_BUF_INIT;
630
- git_buf state_path = GIT_BUF_INIT;
630
+ git_str reflog = GIT_STR_INIT;
631
+ git_str state_path = GIT_STR_INIT;
631
632
  int error;
632
633
 
633
634
  GIT_UNUSED(upstream);
634
635
 
635
- if ((error = git_buf_joinpath(&state_path, repo->gitdir, REBASE_MERGE_DIR)) < 0)
636
+ if ((error = git_str_joinpath(&state_path, repo->gitdir, REBASE_MERGE_DIR)) < 0)
636
637
  goto done;
637
638
 
638
- rebase->state_path = git_buf_detach(&state_path);
639
+ rebase->state_path = git_str_detach(&state_path);
639
640
  GIT_ERROR_CHECK_ALLOC(rebase->state_path);
640
641
 
641
642
  if (branch->ref_name && strcmp(branch->ref_name, "HEAD")) {
@@ -654,7 +655,7 @@ static int rebase_init_merge(
654
655
  git_oid_cpy(&rebase->onto_id, git_annotated_commit_id(onto));
655
656
 
656
657
  if ((error = rebase_setupfiles(rebase)) < 0 ||
657
- (error = git_buf_printf(&reflog,
658
+ (error = git_str_printf(&reflog,
658
659
  "rebase: checkout %s", rebase_onto_name(onto))) < 0 ||
659
660
  (error = git_commit_lookup(
660
661
  &onto_commit, repo, git_annotated_commit_id(onto))) < 0 ||
@@ -667,8 +668,8 @@ static int rebase_init_merge(
667
668
  done:
668
669
  git_reference_free(head_ref);
669
670
  git_commit_free(onto_commit);
670
- git_buf_dispose(&reflog);
671
- git_buf_dispose(&state_path);
671
+ git_str_dispose(&reflog);
672
+ git_str_dispose(&state_path);
672
673
 
673
674
  return error;
674
675
  }
@@ -795,7 +796,7 @@ static int rebase_next_merge(
795
796
  git_rebase_operation **out,
796
797
  git_rebase *rebase)
797
798
  {
798
- git_buf path = GIT_BUF_INIT;
799
+ git_str path = GIT_STR_INIT;
799
800
  git_commit *current_commit = NULL, *parent_commit = NULL;
800
801
  git_tree *current_tree = NULL, *head_tree = NULL, *parent_tree = NULL;
801
802
  git_index *index = NULL;
@@ -848,7 +849,7 @@ done:
848
849
  git_tree_free(parent_tree);
849
850
  git_commit_free(parent_commit);
850
851
  git_commit_free(current_commit);
851
- git_buf_dispose(&path);
852
+ git_str_dispose(&path);
852
853
 
853
854
  return error;
854
855
  }
@@ -955,14 +956,14 @@ static int create_signed(
955
956
  size_t parent_count,
956
957
  const git_commit **parents)
957
958
  {
958
- git_buf commit_content = GIT_BUF_INIT,
959
- commit_signature = GIT_BUF_INIT,
960
- signature_field = GIT_BUF_INIT;
959
+ git_str commit_content = GIT_STR_INIT;
960
+ git_buf commit_signature = { NULL, 0, 0 },
961
+ signature_field = { NULL, 0, 0 };
961
962
  int error;
962
963
 
963
964
  git_error_clear();
964
965
 
965
- if ((error = git_commit_create_buffer(&commit_content,
966
+ if ((error = git_commit__create_buffer(&commit_content,
966
967
  rebase->repo, author, committer, message_encoding,
967
968
  message, tree, parent_count, parents)) < 0)
968
969
  goto done;
@@ -986,7 +987,7 @@ static int create_signed(
986
987
  done:
987
988
  git_buf_dispose(&commit_signature);
988
989
  git_buf_dispose(&signature_field);
989
- git_buf_dispose(&commit_content);
990
+ git_str_dispose(&commit_content);
990
991
  return error;
991
992
  }
992
993
  #endif
@@ -1216,13 +1217,13 @@ done:
1216
1217
  return error;
1217
1218
  }
1218
1219
 
1219
- static int notes_ref_lookup(git_buf *out, git_rebase *rebase)
1220
+ static int notes_ref_lookup(git_str *out, git_rebase *rebase)
1220
1221
  {
1221
1222
  git_config *config = NULL;
1222
1223
  int do_rewrite, error;
1223
1224
 
1224
1225
  if (rebase->options.rewrite_notes_ref) {
1225
- git_buf_attach_notowned(out,
1226
+ git_str_attach_notowned(out,
1226
1227
  rebase->options.rewrite_notes_ref,
1227
1228
  strlen(rebase->options.rewrite_notes_ref));
1228
1229
  return 0;
@@ -1239,7 +1240,7 @@ static int notes_ref_lookup(git_buf *out, git_rebase *rebase)
1239
1240
  }
1240
1241
 
1241
1242
  error = do_rewrite ?
1242
- git_config_get_string_buf(out, config, "notes.rewriteref") :
1243
+ git_config__get_string_buf(out, config, "notes.rewriteref") :
1243
1244
  GIT_ENOTFOUND;
1244
1245
 
1245
1246
  done:
@@ -1294,7 +1295,7 @@ static int rebase_copy_notes(
1294
1295
  git_rebase *rebase,
1295
1296
  const git_signature *committer)
1296
1297
  {
1297
- git_buf path = GIT_BUF_INIT, rewritten = GIT_BUF_INIT, notes_ref = GIT_BUF_INIT;
1298
+ git_str path = GIT_STR_INIT, rewritten = GIT_STR_INIT, notes_ref = GIT_STR_INIT;
1298
1299
  char *pair_list, *fromstr, *tostr, *end;
1299
1300
  git_oid from, to;
1300
1301
  unsigned int linenum = 1;
@@ -1309,7 +1310,7 @@ static int rebase_copy_notes(
1309
1310
  goto done;
1310
1311
  }
1311
1312
 
1312
- if ((error = git_buf_joinpath(&path, rebase->state_path, REWRITTEN_FILE)) < 0 ||
1313
+ if ((error = git_str_joinpath(&path, rebase->state_path, REWRITTEN_FILE)) < 0 ||
1313
1314
  (error = git_futils_readbuffer(&rewritten, path.ptr)) < 0)
1314
1315
  goto done;
1315
1316
 
@@ -1349,9 +1350,9 @@ on_error:
1349
1350
  error = -1;
1350
1351
 
1351
1352
  done:
1352
- git_buf_dispose(&rewritten);
1353
- git_buf_dispose(&path);
1354
- git_buf_dispose(&notes_ref);
1353
+ git_str_dispose(&rewritten);
1354
+ git_str_dispose(&path);
1355
+ git_str_dispose(&notes_ref);
1355
1356
 
1356
1357
  return error;
1357
1358
  }
@@ -1360,16 +1361,16 @@ static int return_to_orig_head(git_rebase *rebase)
1360
1361
  {
1361
1362
  git_reference *terminal_ref = NULL, *branch_ref = NULL, *head_ref = NULL;
1362
1363
  git_commit *terminal_commit = NULL;
1363
- git_buf branch_msg = GIT_BUF_INIT, head_msg = GIT_BUF_INIT;
1364
+ git_str branch_msg = GIT_STR_INIT, head_msg = GIT_STR_INIT;
1364
1365
  char onto[GIT_OID_HEXSZ];
1365
1366
  int error = 0;
1366
1367
 
1367
1368
  git_oid_fmt(onto, &rebase->onto_id);
1368
1369
 
1369
- if ((error = git_buf_printf(&branch_msg,
1370
+ if ((error = git_str_printf(&branch_msg,
1370
1371
  "rebase finished: %s onto %.*s",
1371
1372
  rebase->orig_head_name, GIT_OID_HEXSZ, onto)) == 0 &&
1372
- (error = git_buf_printf(&head_msg,
1373
+ (error = git_str_printf(&head_msg,
1373
1374
  "rebase finished: returning to %s",
1374
1375
  rebase->orig_head_name)) == 0 &&
1375
1376
  (error = git_repository_head(&terminal_ref, rebase->repo)) == 0 &&
@@ -1383,8 +1384,8 @@ static int return_to_orig_head(git_rebase *rebase)
1383
1384
  rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1,
1384
1385
  head_msg.ptr);
1385
1386
 
1386
- git_buf_dispose(&head_msg);
1387
- git_buf_dispose(&branch_msg);
1387
+ git_str_dispose(&head_msg);
1388
+ git_str_dispose(&branch_msg);
1388
1389
  git_commit_free(terminal_commit);
1389
1390
  git_reference_free(head_ref);
1390
1391
  git_reference_free(branch_ref);