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
@@ -38,7 +38,7 @@ struct git_blob {
38
38
  void git_blob__free(void *blob);
39
39
  int git_blob__parse(void *blob, git_odb_object *obj);
40
40
  int git_blob__parse_raw(void *blob, const char *data, size_t size);
41
- int git_blob__getbuf(git_buf *buffer, git_blob *blob);
41
+ int git_blob__getbuf(git_str *buffer, git_blob *blob);
42
42
 
43
43
  extern int git_blob__create_from_paths(
44
44
  git_oid *out_oid,
@@ -7,6 +7,7 @@
7
7
 
8
8
  #include "branch.h"
9
9
 
10
+ #include "buf.h"
10
11
  #include "commit.h"
11
12
  #include "tag.h"
12
13
  #include "config.h"
@@ -27,11 +28,11 @@ static int retrieve_branch_reference(
27
28
  git_reference *branch = NULL;
28
29
  int error = 0;
29
30
  char *prefix;
30
- git_buf ref_name = GIT_BUF_INIT;
31
+ git_str ref_name = GIT_STR_INIT;
31
32
 
32
33
  prefix = is_remote ? GIT_REFS_REMOTES_DIR : GIT_REFS_HEADS_DIR;
33
34
 
34
- if ((error = git_buf_joinpath(&ref_name, prefix, branch_name)) < 0)
35
+ if ((error = git_str_joinpath(&ref_name, prefix, branch_name)) < 0)
35
36
  /* OOM */;
36
37
  else if ((error = git_reference_lookup(&branch, repo, ref_name.ptr)) < 0)
37
38
  git_error_set(
@@ -40,7 +41,7 @@ static int retrieve_branch_reference(
40
41
 
41
42
  *branch_reference_out = branch; /* will be NULL on error */
42
43
 
43
- git_buf_dispose(&ref_name);
44
+ git_str_dispose(&ref_name);
44
45
  return error;
45
46
  }
46
47
 
@@ -62,8 +63,8 @@ static int create_branch(
62
63
  {
63
64
  int is_unmovable_head = 0;
64
65
  git_reference *branch = NULL;
65
- git_buf canonical_branch_name = GIT_BUF_INIT,
66
- log_message = GIT_BUF_INIT;
66
+ git_str canonical_branch_name = GIT_STR_INIT,
67
+ log_message = GIT_STR_INIT;
67
68
  int error = -1;
68
69
  int bare = git_repository_is_bare(repository);
69
70
 
@@ -96,22 +97,22 @@ static int create_branch(
96
97
  goto cleanup;
97
98
  }
98
99
 
99
- if (git_buf_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0)
100
+ if (git_str_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0)
100
101
  goto cleanup;
101
102
 
102
- if (git_buf_printf(&log_message, "branch: Created from %s", from) < 0)
103
+ if (git_str_printf(&log_message, "branch: Created from %s", from) < 0)
103
104
  goto cleanup;
104
105
 
105
106
  error = git_reference_create(&branch, repository,
106
- git_buf_cstr(&canonical_branch_name), git_commit_id(commit), force,
107
- git_buf_cstr(&log_message));
107
+ git_str_cstr(&canonical_branch_name), git_commit_id(commit), force,
108
+ git_str_cstr(&log_message));
108
109
 
109
110
  if (!error)
110
111
  *ref_out = branch;
111
112
 
112
113
  cleanup:
113
- git_buf_dispose(&canonical_branch_name);
114
- git_buf_dispose(&log_message);
114
+ git_str_dispose(&canonical_branch_name);
115
+ git_str_dispose(&log_message);
115
116
  return error;
116
117
  }
117
118
 
@@ -122,7 +123,10 @@ int git_branch_create(
122
123
  const git_commit *commit,
123
124
  int force)
124
125
  {
125
- return create_branch(ref_out, repository, branch_name, commit, git_oid_tostr_s(git_commit_id(commit)), force);
126
+ char commit_id[GIT_OID_HEXSZ + 1];
127
+
128
+ git_oid_tostr(commit_id, GIT_OID_HEXSZ + 1, git_commit_id(commit));
129
+ return create_branch(ref_out, repository, branch_name, commit, commit_id, force);
126
130
  }
127
131
 
128
132
  int git_branch_create_from_annotated(
@@ -174,7 +178,7 @@ int git_branch_is_checked_out(const git_reference *branch)
174
178
  int git_branch_delete(git_reference *branch)
175
179
  {
176
180
  int is_head;
177
- git_buf config_section = GIT_BUF_INIT;
181
+ git_str config_section = GIT_STR_INIT;
178
182
  int error = -1;
179
183
 
180
184
  GIT_ASSERT_ARG(branch);
@@ -200,18 +204,18 @@ int git_branch_delete(git_reference *branch)
200
204
  return -1;
201
205
  }
202
206
 
203
- if (git_buf_join(&config_section, '.', "branch",
207
+ if (git_str_join(&config_section, '.', "branch",
204
208
  git_reference_name(branch) + strlen(GIT_REFS_HEADS_DIR)) < 0)
205
209
  goto on_error;
206
210
 
207
211
  if (git_config_rename_section(
208
- git_reference_owner(branch), git_buf_cstr(&config_section), NULL) < 0)
212
+ git_reference_owner(branch), git_str_cstr(&config_section), NULL) < 0)
209
213
  goto on_error;
210
214
 
211
215
  error = git_reference_delete(branch);
212
216
 
213
217
  on_error:
214
- git_buf_dispose(&config_section);
218
+ git_str_dispose(&config_section);
215
219
  return error;
216
220
  }
217
221
 
@@ -286,10 +290,10 @@ int git_branch_move(
286
290
  const char *new_branch_name,
287
291
  int force)
288
292
  {
289
- git_buf new_reference_name = GIT_BUF_INIT,
290
- old_config_section = GIT_BUF_INIT,
291
- new_config_section = GIT_BUF_INIT,
292
- log_message = GIT_BUF_INIT;
293
+ git_str new_reference_name = GIT_STR_INIT,
294
+ old_config_section = GIT_STR_INIT,
295
+ new_config_section = GIT_STR_INIT,
296
+ log_message = GIT_STR_INIT;
293
297
  int error;
294
298
 
295
299
  GIT_ASSERT_ARG(branch);
@@ -298,35 +302,35 @@ int git_branch_move(
298
302
  if (!git_reference_is_branch(branch))
299
303
  return not_a_local_branch(git_reference_name(branch));
300
304
 
301
- if ((error = git_buf_joinpath(&new_reference_name, GIT_REFS_HEADS_DIR, new_branch_name)) < 0)
305
+ if ((error = git_str_joinpath(&new_reference_name, GIT_REFS_HEADS_DIR, new_branch_name)) < 0)
302
306
  goto done;
303
307
 
304
- if ((error = git_buf_printf(&log_message, "branch: renamed %s to %s",
305
- git_reference_name(branch), git_buf_cstr(&new_reference_name))) < 0)
308
+ if ((error = git_str_printf(&log_message, "branch: renamed %s to %s",
309
+ git_reference_name(branch), git_str_cstr(&new_reference_name))) < 0)
306
310
  goto done;
307
311
 
308
312
  /* first update ref then config so failure won't trash config */
309
313
 
310
314
  error = git_reference_rename(
311
- out, branch, git_buf_cstr(&new_reference_name), force,
312
- git_buf_cstr(&log_message));
315
+ out, branch, git_str_cstr(&new_reference_name), force,
316
+ git_str_cstr(&log_message));
313
317
  if (error < 0)
314
318
  goto done;
315
319
 
316
- git_buf_join(&old_config_section, '.', "branch",
320
+ git_str_join(&old_config_section, '.', "branch",
317
321
  git_reference_name(branch) + strlen(GIT_REFS_HEADS_DIR));
318
- git_buf_join(&new_config_section, '.', "branch", new_branch_name);
322
+ git_str_join(&new_config_section, '.', "branch", new_branch_name);
319
323
 
320
324
  error = git_config_rename_section(
321
325
  git_reference_owner(branch),
322
- git_buf_cstr(&old_config_section),
323
- git_buf_cstr(&new_config_section));
326
+ git_str_cstr(&old_config_section),
327
+ git_str_cstr(&new_config_section));
324
328
 
325
329
  done:
326
- git_buf_dispose(&new_reference_name);
327
- git_buf_dispose(&old_config_section);
328
- git_buf_dispose(&new_config_section);
329
- git_buf_dispose(&log_message);
330
+ git_str_dispose(&new_reference_name);
331
+ git_str_dispose(&old_config_section);
332
+ git_str_dispose(&new_config_section);
333
+ git_str_dispose(&log_message);
330
334
 
331
335
  return error;
332
336
  }
@@ -384,20 +388,20 @@ int git_branch_name(
384
388
  }
385
389
 
386
390
  static int retrieve_upstream_configuration(
387
- git_buf *out,
391
+ git_str *out,
388
392
  const git_config *config,
389
393
  const char *canonical_branch_name,
390
394
  const char *format)
391
395
  {
392
- git_buf buf = GIT_BUF_INIT;
396
+ git_str buf = GIT_STR_INIT;
393
397
  int error;
394
398
 
395
- if (git_buf_printf(&buf, format,
399
+ if (git_str_printf(&buf, format,
396
400
  canonical_branch_name + strlen(GIT_REFS_HEADS_DIR)) < 0)
397
401
  return -1;
398
402
 
399
- error = git_config_get_string_buf(out, config, git_buf_cstr(&buf));
400
- git_buf_dispose(&buf);
403
+ error = git_config__get_string_buf(out, config, git_str_cstr(&buf));
404
+ git_str_dispose(&buf);
401
405
  return error;
402
406
  }
403
407
 
@@ -406,20 +410,26 @@ int git_branch_upstream_name(
406
410
  git_repository *repo,
407
411
  const char *refname)
408
412
  {
409
- git_buf remote_name = GIT_BUF_INIT;
410
- git_buf merge_name = GIT_BUF_INIT;
411
- git_buf buf = GIT_BUF_INIT;
413
+ GIT_BUF_WRAP_PRIVATE(out, git_branch__upstream_name, repo, refname);
414
+ }
415
+
416
+ int git_branch__upstream_name(
417
+ git_str *out,
418
+ git_repository *repo,
419
+ const char *refname)
420
+ {
421
+ git_str remote_name = GIT_STR_INIT;
422
+ git_str merge_name = GIT_STR_INIT;
423
+ git_str buf = GIT_STR_INIT;
412
424
  int error = -1;
413
425
  git_remote *remote = NULL;
414
426
  const git_refspec *refspec;
415
427
  git_config *config;
416
428
 
417
429
  GIT_ASSERT_ARG(out);
430
+ GIT_ASSERT_ARG(repo);
418
431
  GIT_ASSERT_ARG(refname);
419
432
 
420
- if ((error = git_buf_sanitize(out)) < 0)
421
- return error;
422
-
423
433
  if (!git_reference__is_branch(refname))
424
434
  return not_a_local_branch(refname);
425
435
 
@@ -434,75 +444,109 @@ int git_branch_upstream_name(
434
444
  &merge_name, config, refname, "branch.%s.merge")) < 0)
435
445
  goto cleanup;
436
446
 
437
- if (git_buf_len(&remote_name) == 0 || git_buf_len(&merge_name) == 0) {
447
+ if (git_str_len(&remote_name) == 0 || git_str_len(&merge_name) == 0) {
438
448
  git_error_set(GIT_ERROR_REFERENCE,
439
449
  "branch '%s' does not have an upstream", refname);
440
450
  error = GIT_ENOTFOUND;
441
451
  goto cleanup;
442
452
  }
443
453
 
444
- if (strcmp(".", git_buf_cstr(&remote_name)) != 0) {
445
- if ((error = git_remote_lookup(&remote, repo, git_buf_cstr(&remote_name))) < 0)
454
+ if (strcmp(".", git_str_cstr(&remote_name)) != 0) {
455
+ if ((error = git_remote_lookup(&remote, repo, git_str_cstr(&remote_name))) < 0)
446
456
  goto cleanup;
447
457
 
448
- refspec = git_remote__matching_refspec(remote, git_buf_cstr(&merge_name));
458
+ refspec = git_remote__matching_refspec(remote, git_str_cstr(&merge_name));
449
459
  if (!refspec) {
450
460
  error = GIT_ENOTFOUND;
451
461
  goto cleanup;
452
462
  }
453
463
 
454
- if (git_refspec_transform(&buf, refspec, git_buf_cstr(&merge_name)) < 0)
464
+ if (git_refspec__transform(&buf, refspec, git_str_cstr(&merge_name)) < 0)
455
465
  goto cleanup;
456
466
  } else
457
- if (git_buf_set(&buf, git_buf_cstr(&merge_name), git_buf_len(&merge_name)) < 0)
467
+ if (git_str_set(&buf, git_str_cstr(&merge_name), git_str_len(&merge_name)) < 0)
458
468
  goto cleanup;
459
469
 
460
- error = git_buf_set(out, git_buf_cstr(&buf), git_buf_len(&buf));
470
+ git_str_swap(out, &buf);
461
471
 
462
472
  cleanup:
463
473
  git_config_free(config);
464
474
  git_remote_free(remote);
465
- git_buf_dispose(&remote_name);
466
- git_buf_dispose(&merge_name);
467
- git_buf_dispose(&buf);
475
+ git_str_dispose(&remote_name);
476
+ git_str_dispose(&merge_name);
477
+ git_str_dispose(&buf);
468
478
  return error;
469
479
  }
470
480
 
471
- static int git_branch_upstream_with_format(git_buf *buf, git_repository *repo, const char *refname, const char *format, const char *format_name)
481
+ static int git_branch_upstream_with_format(
482
+ git_str *out,
483
+ git_repository *repo,
484
+ const char *refname,
485
+ const char *format,
486
+ const char *format_name)
472
487
  {
473
- int error;
474
488
  git_config *cfg;
489
+ int error;
475
490
 
476
491
  if (!git_reference__is_branch(refname))
477
492
  return not_a_local_branch(refname);
478
493
 
479
- if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
494
+ if ((error = git_repository_config__weakptr(&cfg, repo)) < 0 ||
495
+ (error = retrieve_upstream_configuration(out, cfg, refname, format)) < 0)
480
496
  return error;
481
497
 
482
- if ((error = git_buf_sanitize(buf)) < 0 ||
483
- (error = retrieve_upstream_configuration(buf, cfg, refname, format)) < 0)
484
- return error;
485
-
486
- if (git_buf_len(buf) == 0) {
498
+ if (git_str_len(out) == 0) {
487
499
  git_error_set(GIT_ERROR_REFERENCE, "branch '%s' does not have an upstream %s", refname, format_name);
488
500
  error = GIT_ENOTFOUND;
489
- git_buf_clear(buf);
490
501
  }
491
502
 
492
503
  return error;
493
504
  }
494
505
 
495
- int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *refname)
506
+ int git_branch_upstream_remote(
507
+ git_buf *out,
508
+ git_repository *repo,
509
+ const char *refname)
510
+ {
511
+ GIT_BUF_WRAP_PRIVATE(out, git_branch__upstream_remote, repo, refname);
512
+ }
513
+
514
+ int git_branch__upstream_remote(
515
+ git_str *out,
516
+ git_repository *repo,
517
+ const char *refname)
496
518
  {
497
- return git_branch_upstream_with_format(buf, repo, refname, "branch.%s.remote", "remote");
519
+ return git_branch_upstream_with_format(out, repo, refname, "branch.%s.remote", "remote");
498
520
  }
499
521
 
500
- int git_branch_upstream_merge(git_buf *buf, git_repository *repo, const char *refname)
522
+ int git_branch_upstream_merge(
523
+ git_buf *out,
524
+ git_repository *repo,
525
+ const char *refname)
501
526
  {
502
- return git_branch_upstream_with_format(buf, repo, refname, "branch.%s.merge", "merge");
527
+ GIT_BUF_WRAP_PRIVATE(out, git_branch__upstream_merge, repo, refname);
503
528
  }
504
529
 
505
- int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refname)
530
+ int git_branch__upstream_merge(
531
+ git_str *out,
532
+ git_repository *repo,
533
+ const char *refname)
534
+ {
535
+ return git_branch_upstream_with_format(out, repo, refname, "branch.%s.merge", "merge");
536
+ }
537
+
538
+ int git_branch_remote_name(
539
+ git_buf *out,
540
+ git_repository *repo,
541
+ const char *refname)
542
+ {
543
+ GIT_BUF_WRAP_PRIVATE(out, git_branch__remote_name, repo, refname);
544
+ }
545
+
546
+ int git_branch__remote_name(
547
+ git_str *out,
548
+ git_repository *repo,
549
+ const char *refname)
506
550
  {
507
551
  git_strarray remote_list = {0};
508
552
  size_t i;
@@ -511,13 +555,10 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
511
555
  int error = 0;
512
556
  char *remote_name = NULL;
513
557
 
514
- GIT_ASSERT_ARG(buf);
558
+ GIT_ASSERT_ARG(out);
515
559
  GIT_ASSERT_ARG(repo);
516
560
  GIT_ASSERT_ARG(refname);
517
561
 
518
- if ((error = git_buf_sanitize(buf)) < 0)
519
- return error;
520
-
521
562
  /* Verify that this is a remote branch */
522
563
  if (!git_reference__is_remote(refname)) {
523
564
  git_error_set(GIT_ERROR_INVALID, "reference '%s' is not a remote branch.",
@@ -557,8 +598,8 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
557
598
  }
558
599
 
559
600
  if (remote_name) {
560
- git_buf_clear(buf);
561
- error = git_buf_puts(buf, remote_name);
601
+ git_str_clear(out);
602
+ error = git_str_puts(out, remote_name);
562
603
  } else {
563
604
  git_error_set(GIT_ERROR_REFERENCE,
564
605
  "could not determine remote for '%s'", refname);
@@ -567,7 +608,7 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
567
608
 
568
609
  cleanup:
569
610
  if (error < 0)
570
- git_buf_dispose(buf);
611
+ git_str_dispose(out);
571
612
 
572
613
  git_strarray_dispose(&remote_list);
573
614
  return error;
@@ -578,49 +619,49 @@ int git_branch_upstream(
578
619
  const git_reference *branch)
579
620
  {
580
621
  int error;
581
- git_buf tracking_name = GIT_BUF_INIT;
622
+ git_str tracking_name = GIT_STR_INIT;
582
623
 
583
- if ((error = git_branch_upstream_name(&tracking_name,
624
+ if ((error = git_branch__upstream_name(&tracking_name,
584
625
  git_reference_owner(branch), git_reference_name(branch))) < 0)
585
626
  return error;
586
627
 
587
628
  error = git_reference_lookup(
588
629
  tracking_out,
589
630
  git_reference_owner(branch),
590
- git_buf_cstr(&tracking_name));
631
+ git_str_cstr(&tracking_name));
591
632
 
592
- git_buf_dispose(&tracking_name);
633
+ git_str_dispose(&tracking_name);
593
634
  return error;
594
635
  }
595
636
 
596
637
  static int unset_upstream(git_config *config, const char *shortname)
597
638
  {
598
- git_buf buf = GIT_BUF_INIT;
639
+ git_str buf = GIT_STR_INIT;
599
640
 
600
- if (git_buf_printf(&buf, "branch.%s.remote", shortname) < 0)
641
+ if (git_str_printf(&buf, "branch.%s.remote", shortname) < 0)
601
642
  return -1;
602
643
 
603
- if (git_config_delete_entry(config, git_buf_cstr(&buf)) < 0)
644
+ if (git_config_delete_entry(config, git_str_cstr(&buf)) < 0)
604
645
  goto on_error;
605
646
 
606
- git_buf_clear(&buf);
607
- if (git_buf_printf(&buf, "branch.%s.merge", shortname) < 0)
647
+ git_str_clear(&buf);
648
+ if (git_str_printf(&buf, "branch.%s.merge", shortname) < 0)
608
649
  goto on_error;
609
650
 
610
- if (git_config_delete_entry(config, git_buf_cstr(&buf)) < 0)
651
+ if (git_config_delete_entry(config, git_str_cstr(&buf)) < 0)
611
652
  goto on_error;
612
653
 
613
- git_buf_dispose(&buf);
654
+ git_str_dispose(&buf);
614
655
  return 0;
615
656
 
616
657
  on_error:
617
- git_buf_dispose(&buf);
658
+ git_str_dispose(&buf);
618
659
  return -1;
619
660
  }
620
661
 
621
662
  int git_branch_set_upstream(git_reference *branch, const char *branch_name)
622
663
  {
623
- git_buf key = GIT_BUF_INIT, remote_name = GIT_BUF_INIT, merge_refspec = GIT_BUF_INIT;
664
+ git_str key = GIT_STR_INIT, remote_name = GIT_STR_INIT, merge_refspec = GIT_STR_INIT;
624
665
  git_reference *upstream;
625
666
  git_repository *repo;
626
667
  git_remote *remote = NULL;
@@ -662,31 +703,31 @@ int git_branch_set_upstream(git_reference *branch, const char *branch_name)
662
703
  * name on the remote is and use that.
663
704
  */
664
705
  if (local)
665
- error = git_buf_puts(&remote_name, ".");
706
+ error = git_str_puts(&remote_name, ".");
666
707
  else
667
- error = git_branch_remote_name(&remote_name, repo, git_reference_name(upstream));
708
+ error = git_branch__remote_name(&remote_name, repo, git_reference_name(upstream));
668
709
 
669
710
  if (error < 0)
670
711
  goto on_error;
671
712
 
672
- /* Update the upsteam branch config with the new name */
673
- if (git_buf_printf(&key, "branch.%s.remote", shortname) < 0)
713
+ /* Update the upstream branch config with the new name */
714
+ if (git_str_printf(&key, "branch.%s.remote", shortname) < 0)
674
715
  goto on_error;
675
716
 
676
- if (git_config_set_string(config, git_buf_cstr(&key), git_buf_cstr(&remote_name)) < 0)
717
+ if (git_config_set_string(config, git_str_cstr(&key), git_str_cstr(&remote_name)) < 0)
677
718
  goto on_error;
678
719
 
679
720
  if (local) {
680
721
  /* A local branch uses the upstream refname directly */
681
- if (git_buf_puts(&merge_refspec, git_reference_name(upstream)) < 0)
722
+ if (git_str_puts(&merge_refspec, git_reference_name(upstream)) < 0)
682
723
  goto on_error;
683
724
  } else {
684
725
  /* We transform the upstream branch name according to the remote's refspecs */
685
- if (git_remote_lookup(&remote, repo, git_buf_cstr(&remote_name)) < 0)
726
+ if (git_remote_lookup(&remote, repo, git_str_cstr(&remote_name)) < 0)
686
727
  goto on_error;
687
728
 
688
729
  fetchspec = git_remote__matching_dst_refspec(remote, git_reference_name(upstream));
689
- if (!fetchspec || git_refspec_rtransform(&merge_refspec, fetchspec, git_reference_name(upstream)) < 0)
730
+ if (!fetchspec || git_refspec__rtransform(&merge_refspec, fetchspec, git_reference_name(upstream)) < 0)
690
731
  goto on_error;
691
732
 
692
733
  git_remote_free(remote);
@@ -694,25 +735,25 @@ int git_branch_set_upstream(git_reference *branch, const char *branch_name)
694
735
  }
695
736
 
696
737
  /* Update the merge branch config with the refspec */
697
- git_buf_clear(&key);
698
- if (git_buf_printf(&key, "branch.%s.merge", shortname) < 0)
738
+ git_str_clear(&key);
739
+ if (git_str_printf(&key, "branch.%s.merge", shortname) < 0)
699
740
  goto on_error;
700
741
 
701
- if (git_config_set_string(config, git_buf_cstr(&key), git_buf_cstr(&merge_refspec)) < 0)
742
+ if (git_config_set_string(config, git_str_cstr(&key), git_str_cstr(&merge_refspec)) < 0)
702
743
  goto on_error;
703
744
 
704
745
  git_reference_free(upstream);
705
- git_buf_dispose(&key);
706
- git_buf_dispose(&remote_name);
707
- git_buf_dispose(&merge_refspec);
746
+ git_str_dispose(&key);
747
+ git_str_dispose(&remote_name);
748
+ git_str_dispose(&merge_refspec);
708
749
 
709
750
  return 0;
710
751
 
711
752
  on_error:
712
753
  git_reference_free(upstream);
713
- git_buf_dispose(&key);
714
- git_buf_dispose(&remote_name);
715
- git_buf_dispose(&merge_refspec);
754
+ git_str_dispose(&key);
755
+ git_str_dispose(&remote_name);
756
+ git_str_dispose(&merge_refspec);
716
757
  git_remote_free(remote);
717
758
 
718
759
  return -1;
@@ -749,7 +790,7 @@ int git_branch_is_head(
749
790
 
750
791
  int git_branch_name_is_valid(int *valid, const char *name)
751
792
  {
752
- git_buf ref_name = GIT_BUF_INIT;
793
+ git_str ref_name = GIT_STR_INIT;
753
794
  int error = 0;
754
795
 
755
796
  GIT_ASSERT(valid);
@@ -765,13 +806,13 @@ int git_branch_name_is_valid(int *valid, const char *name)
765
806
  if (!name || name[0] == '-' || !git__strcmp(name, "HEAD"))
766
807
  goto done;
767
808
 
768
- if ((error = git_buf_puts(&ref_name, GIT_REFS_HEADS_DIR)) < 0 ||
769
- (error = git_buf_puts(&ref_name, name)) < 0)
809
+ if ((error = git_str_puts(&ref_name, GIT_REFS_HEADS_DIR)) < 0 ||
810
+ (error = git_str_puts(&ref_name, name)) < 0)
770
811
  goto done;
771
812
 
772
813
  error = git_reference_name_is_valid(valid, ref_name.ptr);
773
814
 
774
815
  done:
775
- git_buf_dispose(&ref_name);
816
+ git_str_dispose(&ref_name);
776
817
  return error;
777
818
  }
@@ -9,10 +9,22 @@
9
9
 
10
10
  #include "common.h"
11
11
 
12
- #include "buffer.h"
12
+ #include "str.h"
13
13
 
14
- int git_branch_upstream__name(
15
- git_buf *tracking_name,
14
+ int git_branch__remote_name(
15
+ git_str *out,
16
+ git_repository *repo,
17
+ const char *refname);
18
+ int git_branch__upstream_remote(
19
+ git_str *out,
20
+ git_repository *repo,
21
+ const char *refname);
22
+ int git_branch__upstream_merge(
23
+ git_str *out,
24
+ git_repository *repo,
25
+ const char *refname);
26
+ int git_branch__upstream_name(
27
+ git_str *tracking_name,
16
28
  git_repository *repo,
17
29
  const char *canonical_branch_name);
18
30