rugged 0.17.0b2 → 0.17.0.b6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (374) hide show
  1. data/Rakefile +10 -11
  2. data/ext/rugged/extconf.rb +5 -13
  3. data/ext/rugged/rugged_commit.c +2 -5
  4. data/ext/rugged/rugged_reference.c +29 -28
  5. data/ext/rugged/rugged_remote.c +1 -1
  6. data/ext/rugged/rugged_repo.c +4 -1
  7. data/ext/rugged/rugged_tree.c +20 -19
  8. data/lib/rugged/commit.rb +5 -1
  9. data/lib/rugged/repository.rb +6 -4
  10. data/lib/rugged/version.rb +1 -1
  11. data/test/config_test.rb +1 -1
  12. data/test/index_test.rb +4 -2
  13. data/test/object_test.rb +3 -3
  14. data/test/reference_test.rb +66 -1
  15. data/test/repo_test.rb +4 -4
  16. data/test/tree_test.rb +1 -1
  17. data/test/walker_test.rb +1 -1
  18. data/vendor/libgit2/Makefile.embed +42 -0
  19. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/http-parser/http_parser.c +0 -0
  20. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/http-parser/http_parser.h +0 -0
  21. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/config.h +0 -0
  22. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regcomp.c +0 -0
  23. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex.c +0 -0
  24. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex.h +0 -0
  25. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex_internal.c +0 -0
  26. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regex_internal.h +0 -0
  27. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/regex/regexec.c +0 -0
  28. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/adler32.c +0 -0
  29. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/crc32.c +0 -0
  30. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/crc32.h +0 -0
  31. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/deflate.c +0 -0
  32. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/deflate.h +0 -0
  33. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffast.c +0 -0
  34. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffast.h +0 -0
  35. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inffixed.h +0 -0
  36. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inflate.c +0 -0
  37. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inflate.h +0 -0
  38. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inftrees.c +0 -0
  39. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/inftrees.h +0 -0
  40. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/trees.c +0 -0
  41. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/trees.h +0 -0
  42. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zconf.h +0 -0
  43. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zlib.h +0 -0
  44. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zutil.c +0 -0
  45. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/deps/zlib/zutil.h +0 -0
  46. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2.h +6 -0
  47. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/attr.h +35 -20
  48. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/blob.h +1 -1
  49. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/branch.h +62 -24
  50. data/vendor/libgit2/include/git2/checkout.h +66 -0
  51. data/vendor/libgit2/include/git2/clone.h +59 -0
  52. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/commit.h +22 -3
  53. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/common.h +27 -0
  54. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/config.h +22 -4
  55. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/diff.h +20 -1
  56. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/errors.h +2 -37
  57. data/vendor/libgit2/include/git2/ignore.h +74 -0
  58. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/index.h +37 -5
  59. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/indexer.h +2 -2
  60. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/inttypes.h +0 -0
  61. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/merge.h +10 -0
  62. data/vendor/libgit2/include/git2/message.h +43 -0
  63. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/net.h +0 -0
  64. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/notes.h +24 -20
  65. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/object.h +18 -1
  66. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/odb.h +16 -1
  67. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/odb_backend.h +8 -1
  68. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/oid.h +26 -2
  69. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/reflog.h +39 -9
  70. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/refs.h +55 -3
  71. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/refspec.h +0 -0
  72. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/remote.h +68 -2
  73. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/repository.h +39 -1
  74. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/reset.h +0 -0
  75. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/revparse.h +0 -0
  76. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/revwalk.h +2 -2
  77. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/signature.h +3 -0
  78. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/status.h +5 -2
  79. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/stdint.h +0 -0
  80. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/submodule.h +0 -0
  81. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/tag.h +3 -3
  82. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/threads.h +0 -0
  83. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/tree.h +77 -20
  84. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/types.h +14 -0
  85. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/version.h +0 -0
  86. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/include/git2/windows.h +0 -0
  87. data/vendor/libgit2/src/amiga/map.c +51 -0
  88. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr.c +39 -6
  89. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr.h +1 -0
  90. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr_file.c +2 -16
  91. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/attr_file.h +4 -0
  92. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/blob.c +0 -0
  93. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/blob.h +0 -0
  94. data/vendor/libgit2/src/branch.c +294 -0
  95. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/bswap.h +0 -0
  96. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/buffer.c +40 -0
  97. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/buffer.h +22 -0
  98. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cache.c +1 -0
  99. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cache.h +0 -0
  100. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/cc-compat.h +0 -0
  101. data/vendor/libgit2/src/checkout.c +230 -0
  102. data/vendor/libgit2/src/clone.c +254 -0
  103. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/commit.c +42 -16
  104. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/commit.h +0 -0
  105. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/common.h +3 -9
  106. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/compat/fnmatch.c +0 -0
  107. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/compat/fnmatch.h +0 -0
  108. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config.c +15 -5
  109. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config.h +0 -0
  110. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_cache.c +0 -0
  111. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_file.c +86 -19
  112. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/config_file.h +16 -1
  113. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/crlf.c +92 -4
  114. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/date.c +20 -20
  115. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/delta-apply.c +0 -0
  116. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/delta-apply.h +0 -0
  117. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff.c +45 -18
  118. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff.h +0 -0
  119. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/diff_output.c +63 -46
  120. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/errors.c +0 -0
  121. data/vendor/libgit2/src/fetch.c +380 -0
  122. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fetch.h +1 -2
  123. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filebuf.c +7 -2
  124. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filebuf.h +0 -0
  125. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fileops.c +16 -1
  126. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/fileops.h +10 -0
  127. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filter.c +38 -2
  128. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/filter.h +15 -0
  129. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/global.c +5 -0
  130. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/global.h +2 -6
  131. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/hash.c +0 -0
  132. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/hash.h +0 -0
  133. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ignore.c +50 -1
  134. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ignore.h +0 -0
  135. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/index.c +95 -28
  136. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/index.h +5 -0
  137. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/indexer.c +27 -25
  138. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/iterator.c +0 -0
  139. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/iterator.h +0 -0
  140. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/khash.h +6 -4
  141. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/map.h +4 -0
  142. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/message.c +27 -2
  143. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/message.h +2 -1
  144. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/mwindow.c +54 -10
  145. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/mwindow.h +1 -1
  146. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/netops.c +48 -38
  147. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/netops.h +7 -4
  148. data/vendor/libgit2/src/notes.c +610 -0
  149. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/notes.h +0 -0
  150. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/object.c +73 -2
  151. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb.c +20 -1
  152. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb.h +0 -0
  153. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb_loose.c +89 -3
  154. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/odb_pack.c +61 -3
  155. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/oid.c +1 -6
  156. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/oidmap.h +1 -6
  157. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pack.c +49 -4
  158. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pack.h +5 -1
  159. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/path.c +144 -21
  160. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/path.h +46 -0
  161. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pkt.c +30 -8
  162. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pkt.h +0 -0
  163. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pool.c +7 -0
  164. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pool.h +7 -0
  165. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/posix.c +92 -1
  166. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/posix.h +36 -1
  167. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ppc/sha1.c +0 -0
  168. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/ppc/sha1.h +0 -0
  169. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pqueue.c +0 -0
  170. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/pqueue.h +0 -0
  171. data/vendor/libgit2/src/protocol.c +88 -0
  172. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/protocol.h +3 -9
  173. data/vendor/libgit2/src/reflog.c +489 -0
  174. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/reflog.h +3 -0
  175. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refs.c +95 -52
  176. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refs.h +0 -0
  177. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refspec.c +0 -0
  178. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/refspec.h +0 -0
  179. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/remote.c +130 -8
  180. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/remote.h +6 -0
  181. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/repository.c +167 -42
  182. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/repository.h +7 -0
  183. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/reset.c +1 -1
  184. data/vendor/libgit2/src/revparse.c +830 -0
  185. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/revwalk.c +83 -15
  186. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1.c +0 -0
  187. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1.h +5 -0
  188. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1_lookup.c +0 -0
  189. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/sha1_lookup.h +0 -0
  190. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/signature.c +19 -5
  191. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/signature.h +0 -0
  192. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/status.c +24 -18
  193. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/strmap.h +1 -1
  194. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/submodule.c +3 -3
  195. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tag.c +2 -9
  196. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tag.h +0 -0
  197. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/thread-utils.c +0 -0
  198. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/thread-utils.h +0 -0
  199. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transport.c +0 -0
  200. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transport.h +13 -9
  201. data/vendor/libgit2/src/transports/git.c +245 -0
  202. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transports/http.c +93 -336
  203. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/transports/local.c +35 -32
  204. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree-cache.c +0 -0
  205. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree-cache.h +0 -0
  206. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree.c +214 -124
  207. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tree.h +7 -3
  208. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/tsort.c +0 -0
  209. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/unix/map.c +2 -0
  210. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/unix/posix.h +2 -1
  211. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/util.c +30 -0
  212. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/util.h +13 -6
  213. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/vector.c +1 -1
  214. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/vector.h +5 -5
  215. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/dir.c +0 -0
  216. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/dir.h +0 -0
  217. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/map.c +0 -0
  218. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/mingw-compat.h +0 -0
  219. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/msvc-compat.h +0 -0
  220. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/posix.h +1 -0
  221. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/posix_w32.c +17 -1
  222. data/vendor/libgit2/src/win32/precompiled.c +1 -0
  223. data/vendor/libgit2/src/win32/precompiled.h +19 -0
  224. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/pthread.c +0 -0
  225. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/pthread.h +0 -0
  226. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/utf-conv.c +0 -0
  227. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/win32/utf-conv.h +0 -0
  228. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiff.h +0 -0
  229. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiffi.c +0 -0
  230. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xdiffi.h +0 -0
  231. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xemit.c +0 -0
  232. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xemit.h +0 -0
  233. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xhistogram.c +0 -0
  234. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xinclude.h +0 -0
  235. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xmacros.h +0 -0
  236. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xmerge.c +0 -0
  237. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xpatience.c +0 -0
  238. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xprepare.c +0 -0
  239. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xprepare.h +0 -0
  240. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xtypes.h +0 -0
  241. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xutils.c +0 -0
  242. data/{ext/rugged/vendor/libgit2-dist → vendor/libgit2}/src/xdiff/xutils.h +0 -0
  243. metadata +265 -348
  244. data/ext/rugged/vendor/libgit2-dist.tar.gz +0 -0
  245. data/ext/rugged/vendor/libgit2-dist/examples/diff.c +0 -238
  246. data/ext/rugged/vendor/libgit2-dist/examples/general.c +0 -451
  247. data/ext/rugged/vendor/libgit2-dist/examples/network/common.h +0 -14
  248. data/ext/rugged/vendor/libgit2-dist/examples/network/fetch.c +0 -113
  249. data/ext/rugged/vendor/libgit2-dist/examples/network/git2.c +0 -62
  250. data/ext/rugged/vendor/libgit2-dist/examples/network/index-pack.c +0 -102
  251. data/ext/rugged/vendor/libgit2-dist/examples/network/ls-remote.c +0 -76
  252. data/ext/rugged/vendor/libgit2-dist/examples/showindex.c +0 -43
  253. data/ext/rugged/vendor/libgit2-dist/src/branch.c +0 -208
  254. data/ext/rugged/vendor/libgit2-dist/src/branch.h +0 -17
  255. data/ext/rugged/vendor/libgit2-dist/src/fetch.c +0 -200
  256. data/ext/rugged/vendor/libgit2-dist/src/notes.c +0 -548
  257. data/ext/rugged/vendor/libgit2-dist/src/protocol.c +0 -58
  258. data/ext/rugged/vendor/libgit2-dist/src/reflog.c +0 -340
  259. data/ext/rugged/vendor/libgit2-dist/src/revparse.c +0 -748
  260. data/ext/rugged/vendor/libgit2-dist/src/transports/git.c +0 -477
  261. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/attr_expect.h +0 -43
  262. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/file.c +0 -226
  263. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/flags.c +0 -108
  264. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/lookup.c +0 -262
  265. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/repo.c +0 -273
  266. data/ext/rugged/vendor/libgit2-dist/tests-clar/buf/basic.c +0 -29
  267. data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_helpers.c +0 -181
  268. data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_libgit2.h +0 -55
  269. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/commit.c +0 -44
  270. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/parse.c +0 -350
  271. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/signature.c +0 -65
  272. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/write.c +0 -140
  273. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/add.c +0 -37
  274. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/multivar.c +0 -151
  275. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/new.c +0 -36
  276. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/read.c +0 -221
  277. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/stress.c +0 -61
  278. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/write.c +0 -92
  279. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/buffer.c +0 -613
  280. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/dirent.c +0 -235
  281. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/env.c +0 -115
  282. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/errors.c +0 -60
  283. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/filebuf.c +0 -92
  284. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/hex.c +0 -22
  285. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/oid.c +0 -18
  286. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/path.c +0 -420
  287. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/pool.c +0 -85
  288. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/rmdir.c +0 -68
  289. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/string.c +0 -28
  290. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strmap.c +0 -102
  291. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strtol.c +0 -37
  292. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/vector.c +0 -191
  293. data/ext/rugged/vendor/libgit2-dist/tests-clar/date/date.c +0 -15
  294. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/blob.c +0 -254
  295. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.c +0 -104
  296. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.h +0 -47
  297. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/index.c +0 -92
  298. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/iterator.c +0 -572
  299. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/patch.c +0 -99
  300. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/tree.c +0 -210
  301. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/workdir.c +0 -543
  302. data/ext/rugged/vendor/libgit2-dist/tests-clar/index/read_tree.c +0 -46
  303. data/ext/rugged/vendor/libgit2-dist/tests-clar/index/rename.c +0 -50
  304. data/ext/rugged/vendor/libgit2-dist/tests-clar/index/tests.c +0 -246
  305. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/createremotethenload.c +0 -33
  306. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotelocal.c +0 -137
  307. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotes.c +0 -183
  308. data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notes.c +0 -133
  309. data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notesref.c +0 -57
  310. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/filter.c +0 -125
  311. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/fromchunks.c +0 -87
  312. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/write.c +0 -69
  313. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/commit/commitstagedfile.c +0 -126
  314. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/lookup.c +0 -63
  315. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/message.c +0 -171
  316. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/chars.c +0 -41
  317. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/compare.c +0 -124
  318. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/convert.c +0 -75
  319. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/data.h +0 -323
  320. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/fromstr.c +0 -30
  321. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/hash.c +0 -166
  322. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/short.c +0 -94
  323. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/size.c +0 -13
  324. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/type2string.c +0 -54
  325. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/write.c +0 -455
  326. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/peel.c +0 -56
  327. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/read.c +0 -130
  328. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/write.c +0 -192
  329. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/frompath.c +0 -81
  330. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/read.c +0 -75
  331. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/write.c +0 -84
  332. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/loose.c +0 -84
  333. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/loose_data.h +0 -522
  334. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/mixed.c +0 -24
  335. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/pack_data.h +0 -151
  336. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/packed.c +0 -78
  337. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/sorting.c +0 -71
  338. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/create.c +0 -113
  339. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/delete.c +0 -91
  340. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/listall.c +0 -78
  341. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/move.c +0 -72
  342. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/crashes.c +0 -17
  343. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/create.c +0 -149
  344. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/delete.c +0 -85
  345. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/list.c +0 -53
  346. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/listall.c +0 -36
  347. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/lookup.c +0 -42
  348. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/normalize.c +0 -200
  349. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/overwrite.c +0 -136
  350. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/pack.c +0 -67
  351. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/read.c +0 -194
  352. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/reflog.c +0 -123
  353. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/rename.c +0 -339
  354. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/revparse.c +0 -174
  355. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/unicode.c +0 -42
  356. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/discover.c +0 -142
  357. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/getters.c +0 -86
  358. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/init.c +0 -249
  359. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/open.c +0 -282
  360. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/setters.c +0 -80
  361. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/mixed.c +0 -47
  362. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.c +0 -10
  363. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.h +0 -6
  364. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/soft.c +0 -102
  365. data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/basic.c +0 -181
  366. data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/mergebase.c +0 -148
  367. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/ignore.c +0 -147
  368. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/single.c +0 -29
  369. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_data.h +0 -202
  370. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.c +0 -49
  371. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.h +0 -33
  372. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/submodules.c +0 -112
  373. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/worktree.c +0 -649
  374. data/ext/rugged/vendor/libgit2-dist/tests-clar/threads/basic.c +0 -20
@@ -258,7 +258,6 @@ GIT_EXTERN(int) git_reference_packall(git_repository *repo);
258
258
  */
259
259
  GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo, unsigned int list_flags);
260
260
 
261
-
262
261
  /**
263
262
  * Perform an operation on each reference in the repository
264
263
  *
@@ -269,14 +268,15 @@ GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo, un
269
268
  *
270
269
  * The `callback` function will be called for each of the references
271
270
  * in the repository, and will receive the name of the reference and
272
- * the `payload` value passed to this method.
271
+ * the `payload` value passed to this method. Returning a non-zero
272
+ * value from the callback will terminate the iteration.
273
273
  *
274
274
  * @param repo Repository where to find the refs
275
275
  * @param list_flags Filtering flags for the reference
276
276
  * listing.
277
277
  * @param callback Function which will be called for every listed ref
278
278
  * @param payload Additional data to pass to the callback
279
- * @return 0 or an error code
279
+ * @return 0 on success, GIT_EUSER on non-zero callback, or error code
280
280
  */
281
281
  GIT_EXTERN(int) git_reference_foreach(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload);
282
282
 
@@ -324,6 +324,58 @@ GIT_EXTERN(void) git_reference_free(git_reference *ref);
324
324
  */
325
325
  GIT_EXTERN(int) git_reference_cmp(git_reference *ref1, git_reference *ref2);
326
326
 
327
+ /**
328
+ * Loop over all the references and issue a callback for each one
329
+ * which name matches the given glob pattern.
330
+ *
331
+ * The processed references may be filtered by type, or using
332
+ * a bitwise OR of several types. Use the magic value
333
+ * `GIT_REF_LISTALL` to obtain all references, including
334
+ * packed ones.
335
+ *
336
+ * @param repo Repository where to find the references.
337
+ *
338
+ * @param glob Glob pattern references should match.
339
+ *
340
+ * @param list_flags Filtering flags for the reference
341
+ * listing.
342
+ *
343
+ * @param callback Callback to invoke per found reference.
344
+ *
345
+ * @param payload Extra parameter to callback function.
346
+ *
347
+ * @return 0 or an error code.
348
+ */
349
+ GIT_EXTERN(int) git_reference_foreach_glob(
350
+ git_repository *repo,
351
+ const char *glob,
352
+ unsigned int list_flags,
353
+ int (*callback)(
354
+ const char *reference_name,
355
+ void *payload),
356
+ void *payload
357
+ );
358
+
359
+ /**
360
+ * Check if a reflog exists for the specified reference.
361
+ *
362
+ * @param ref A git reference
363
+ *
364
+ * @return 0 when no reflog can be found, 1 when it exists;
365
+ * otherwise an error code.
366
+ */
367
+ GIT_EXTERN(int) git_reference_has_log(git_reference *ref);
368
+
369
+ /**
370
+ * Check if a reference is a local branch.
371
+ *
372
+ * @param ref A git reference
373
+ *
374
+ * @return 1 when the reference lives in the refs/heads
375
+ * namespace; 0 otherwise.
376
+ */
377
+ GIT_EXTERN(int) git_reference_is_branch(git_reference *ref);
378
+
327
379
  /** @} */
328
380
  GIT_END_DECL
329
381
  #endif
@@ -79,6 +79,36 @@ GIT_EXTERN(const char *) git_remote_name(git_remote *remote);
79
79
  */
80
80
  GIT_EXTERN(const char *) git_remote_url(git_remote *remote);
81
81
 
82
+ /**
83
+ * Get the remote's url for pushing
84
+ *
85
+ * @param remote the remote
86
+ * @return a pointer to the url or NULL if no special url for pushing is set
87
+ */
88
+ GIT_EXTERN(const char *) git_remote_pushurl(git_remote *remote);
89
+
90
+ /**
91
+ * Set the remote's url
92
+ *
93
+ * Existing connections will not be updated.
94
+ *
95
+ * @param remote the remote
96
+ * @param url the url to set
97
+ * @return 0 or an error value
98
+ */
99
+ GIT_EXTERN(int) git_remote_set_url(git_remote *remote, const char* url);
100
+
101
+ /**
102
+ * Set the remote's url for pushing
103
+ *
104
+ * Existing connections will not be updated.
105
+ *
106
+ * @param remote the remote
107
+ * @param url the url to set or NULL to clear the pushurl
108
+ * @return 0 or an error value
109
+ */
110
+ GIT_EXTERN(int) git_remote_set_pushurl(git_remote *remote, const char* url);
111
+
82
112
  /**
83
113
  * Set the remote's fetch refspec
84
114
  *
@@ -133,9 +163,12 @@ GIT_EXTERN(int) git_remote_connect(git_remote *remote, int direction);
133
163
  * The remote (or more exactly its transport) must be connected. The
134
164
  * memory belongs to the remote.
135
165
  *
166
+ * If you a return a non-zero value from the callback, this will stop
167
+ * looping over the refs.
168
+ *
136
169
  * @param refs where to store the refs
137
170
  * @param remote the remote
138
- * @return 0 or an error code
171
+ * @return 0 on success, GIT_EUSER on non-zero callback, or error code
139
172
  */
140
173
  GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void *payload);
141
174
 
@@ -190,7 +223,7 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote);
190
223
  * @param remote the remote to update
191
224
  * @param cb callback to run on each ref update. 'a' is the old value, 'b' is then new value
192
225
  */
193
- GIT_EXTERN(int) git_remote_update_tips(git_remote *remote, int (*cb)(const char *refname, const git_oid *a, const git_oid *b));
226
+ GIT_EXTERN(int) git_remote_update_tips(git_remote *remote);
194
227
 
195
228
  /**
196
229
  * Return whether a string is a valid remote URL
@@ -238,6 +271,39 @@ GIT_EXTERN(int) git_remote_add(git_remote **out, git_repository *repo, const cha
238
271
 
239
272
  GIT_EXTERN(void) git_remote_check_cert(git_remote *remote, int check);
240
273
 
274
+ /**
275
+ * Argument to the completion callback which tells it which operation
276
+ * finished.
277
+ */
278
+ typedef enum git_remote_completion_type {
279
+ GIT_REMOTE_COMPLETION_DOWNLOAD,
280
+ GIT_REMOTE_COMPLETION_INDEXING,
281
+ GIT_REMOTE_COMPLETION_ERROR,
282
+ } git_remote_completion_type;
283
+
284
+ /**
285
+ * The callback settings structure
286
+ *
287
+ * Set the calbacks to be called by the remote.
288
+ */
289
+ struct git_remote_callbacks {
290
+ int (*progress)(const char *str, void *data);
291
+ int (*completion)(git_remote_completion_type type, void *data);
292
+ int (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data);
293
+ void *data;
294
+ };
295
+
296
+ /**
297
+ * Set the callbacks for a remote
298
+ *
299
+ * Note that the remote keeps its own copy of the data and you need to
300
+ * call this function again if you want to change the callbacks.
301
+ *
302
+ * @param remote the remote to configure
303
+ * @param callbacks a pointer to the user's callback settings
304
+ */
305
+ GIT_EXTERN(void) git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callbacks);
306
+
241
307
  /** @} */
242
308
  GIT_END_DECL
243
309
  #endif
@@ -35,6 +35,19 @@ GIT_BEGIN_DECL
35
35
  */
36
36
  GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *path);
37
37
 
38
+ /**
39
+ * Create a "fake" repository to wrap an object database
40
+ *
41
+ * Create a repository object to wrap an object database to be used
42
+ * with the API when all you have is an object database. This doesn't
43
+ * have any paths associated with it, so use with care.
44
+ *
45
+ * @param repository pointer to the repo
46
+ * @param odb the object database to wrap
47
+ * @return 0 or an error code
48
+ */
49
+ GIT_EXTERN(int) git_repository_wrap_odb(git_repository **repository, git_odb *odb);
50
+
38
51
  /**
39
52
  * Look for a git repository and copy its path in the given buffer.
40
53
  * The lookup start from base_path and walk across parent directories
@@ -194,9 +207,12 @@ GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
194
207
  *
195
208
  * @param repo A repository object
196
209
  * @param workdir The path to a working directory
210
+ * @param update_gitlink Create/update gitlink in workdir and set config
211
+ * "core.worktree" (if workdir is not the parent of the .git directory)
197
212
  * @return 0, or an error code
198
213
  */
199
- GIT_EXTERN(int) git_repository_set_workdir(git_repository *repo, const char *workdir);
214
+ GIT_EXTERN(int) git_repository_set_workdir(
215
+ git_repository *repo, const char *workdir, int update_gitlink);
200
216
 
201
217
  /**
202
218
  * Check if a repository is bare
@@ -299,6 +315,28 @@ GIT_EXTERN(int) git_repository_index(git_index **out, git_repository *repo);
299
315
  */
300
316
  GIT_EXTERN(void) git_repository_set_index(git_repository *repo, git_index *index);
301
317
 
318
+ /**
319
+ * Retrive git's prepared message
320
+ *
321
+ * Operations such as git revert/cherry-pick/merge with the -n option
322
+ * stop just short of creating a commit with the changes and save
323
+ * their prepared message in .git/MERGE_MSG so the next git-commit
324
+ * execution can present it to the user for them to amend if they
325
+ * wish.
326
+ *
327
+ * Use this function to get the contents of this file. Don't forget to
328
+ * remove the file after you create the commit.
329
+ */
330
+ GIT_EXTERN(int) git_repository_message(char *buffer, size_t len, git_repository *repo);
331
+
332
+ /**
333
+ * Remove git's prepared message.
334
+ *
335
+ * Remove the message that `git_repository_message` retrieves.
336
+ */
337
+ GIT_EXTERN(int) git_repository_message_remove(git_repository *repo);
338
+
339
+
302
340
  /** @} */
303
341
  GIT_END_DECL
304
342
  #endif
@@ -107,7 +107,7 @@ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid);
107
107
  * The OIDs pointed to by the references that match the given glob
108
108
  * pattern will be pushed to the revision walker.
109
109
  *
110
- * A leading 'refs/' is implied it not present as well as a trailing
110
+ * A leading 'refs/' is implied if not present as well as a trailing
111
111
  * '/ *' if the glob lacks '?', '*' or '['.
112
112
  *
113
113
  * @param walk the walker being used for the traversal
@@ -146,7 +146,7 @@ GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, const git_oid *oid);
146
146
  * pattern and their ancestors will be hidden from the output on the
147
147
  * revision walk.
148
148
  *
149
- * A leading 'refs/' is implied it not present as well as a trailing
149
+ * A leading 'refs/' is implied if not present as well as a trailing
150
150
  * '/ *' if the glob lacks '?', '*' or '['.
151
151
  *
152
152
  * @param walk the walker being used for the traversal
@@ -23,6 +23,9 @@ GIT_BEGIN_DECL
23
23
  * Create a new action signature. The signature must be freed
24
24
  * manually or using git_signature_free
25
25
  *
26
+ * Note: angle brackets ('<' and '>') characters are not allowed
27
+ * to be used in either the `name` or the `email` parameter.
28
+ *
26
29
  * @param sig_out new signature, in case of error NULL
27
30
  * @param name name of the person
28
31
  * @param email email of the person
@@ -38,11 +38,11 @@ enum {
38
38
  *
39
39
  * The callback is passed the path of the file, the status and the data
40
40
  * pointer passed to this function. If the callback returns something other
41
- * than 0, this function will return that value.
41
+ * than 0, this function will stop looping and return GIT_EUSER.
42
42
  *
43
43
  * @param repo a repository object
44
44
  * @param callback the function to call on each file
45
- * @return 0 on success or the return value of the callback that was non-zero
45
+ * @return 0 on success, GIT_EUSER on non-zero callback, or error code
46
46
  */
47
47
  GIT_EXTERN(int) git_status_foreach(
48
48
  git_repository *repo,
@@ -96,6 +96,8 @@ typedef enum {
96
96
  * the top-level directory will be included (with a trailing
97
97
  * slash on the entry name). Given this flag, the directory
98
98
  * itself will not be included, but all the files in it will.
99
+ * - GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given
100
+ * path will be treated as a literal path, and not as a pathspec.
99
101
  */
100
102
 
101
103
  enum {
@@ -104,6 +106,7 @@ enum {
104
106
  GIT_STATUS_OPT_INCLUDE_UNMODIFIED = (1 << 2),
105
107
  GIT_STATUS_OPT_EXCLUDE_SUBMODULES = (1 << 3),
106
108
  GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS = (1 << 4),
109
+ GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH = (1 << 5),
107
110
  };
108
111
 
109
112
  /**
@@ -46,7 +46,7 @@ GIT_INLINE(int) git_tag_lookup(git_tag **tag, git_repository *repo, const git_oi
46
46
  * @param len the length of the short identifier
47
47
  * @return 0 or an error code
48
48
  */
49
- GIT_INLINE(int) git_tag_lookup_prefix(git_tag **tag, git_repository *repo, const git_oid *id, unsigned int len)
49
+ GIT_INLINE(int) git_tag_lookup_prefix(git_tag **tag, git_repository *repo, const git_oid *id, size_t len)
50
50
  {
51
51
  return git_object_lookup_prefix((git_object **)tag, repo, id, len, (git_otype)GIT_OBJ_TAG);
52
52
  }
@@ -137,8 +137,8 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag);
137
137
  * this tag object. If `force` is true and a reference
138
138
  * already exists with the given name, it'll be replaced.
139
139
  *
140
- * The message will be cleaned up from excess whitespace
141
- * it will be made sure that the last line ends with a '\n'.
140
+ * The message will not be cleaned up. This can be achieved
141
+ * through `git_message_prettify()`.
142
142
  *
143
143
  * @param oid Pointer where to store the OID of the
144
144
  * newly created tag. If the tag already exists, this parameter
@@ -46,7 +46,11 @@ GIT_INLINE(int) git_tree_lookup(git_tree **tree, git_repository *repo, const git
46
46
  * @param len the length of the short identifier
47
47
  * @return 0 or an error code
48
48
  */
49
- GIT_INLINE(int) git_tree_lookup_prefix(git_tree **tree, git_repository *repo, const git_oid *id, unsigned int len)
49
+ GIT_INLINE(int) git_tree_lookup_prefix(
50
+ git_tree **tree,
51
+ git_repository *repo,
52
+ const git_oid *id,
53
+ size_t len)
50
54
  {
51
55
  return git_object_lookup_prefix((git_object **)tree, repo, id, len, GIT_OBJ_TREE);
52
56
  }
@@ -62,12 +66,33 @@ GIT_INLINE(int) git_tree_lookup_prefix(git_tree **tree, git_repository *repo, co
62
66
  *
63
67
  * @param tree the tree to close
64
68
  */
65
-
66
69
  GIT_INLINE(void) git_tree_free(git_tree *tree)
67
70
  {
68
71
  git_object_free((git_object *) tree);
69
72
  }
70
73
 
74
+ /**
75
+ * Free a tree entry
76
+ *
77
+ * IMPORTANT: This function is only needed for tree
78
+ * entries owned by the user, such as the ones returned
79
+ * by `git_tree_entry_dup`.
80
+ *
81
+ * @param entry The entry to free
82
+ */
83
+ GIT_EXTERN(void) git_tree_entry_free(git_tree_entry *entry);
84
+
85
+ /**
86
+ * Duplicate a tree entry
87
+ *
88
+ * Create a copy of a tree entry. The returned copy is owned
89
+ * by the user, and must be freed manually with
90
+ * `git_tree_entry_free`.
91
+ *
92
+ * @param entry A tree entry to duplicate
93
+ * @return a copy of the original entry
94
+ */
95
+ GIT_EXTERN(git_tree_entry *) git_tree_entry_dup(const git_tree_entry *entry);
71
96
 
72
97
  /**
73
98
  * Get the id of a tree.
@@ -101,15 +126,26 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(git_tree *tree, const c
101
126
  * @param idx the position in the entry list
102
127
  * @return the tree entry; NULL if not found
103
128
  */
104
- GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, unsigned int idx);
129
+ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, size_t idx);
130
+
131
+ /**
132
+ * Lookup a tree entry by SHA value.
133
+ *
134
+ * Warning: this must examine every entry in the tree, so it is not fast.
135
+ *
136
+ * @param tree a previously loaded tree.
137
+ * @param oid the sha being looked for
138
+ * @return the tree entry; NULL if not found
139
+ */
140
+ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(git_tree *tree, const git_oid *oid);
105
141
 
106
142
  /**
107
143
  * Get the UNIX file attributes of a tree entry
108
144
  *
109
145
  * @param entry a tree entry
110
- * @return attributes as an integer
146
+ * @return filemode as an integer
111
147
  */
112
- GIT_EXTERN(unsigned int) git_tree_entry_attributes(const git_tree_entry *entry);
148
+ GIT_EXTERN(git_filemode_t) git_tree_entry_filemode(const git_tree_entry *entry);
113
149
 
114
150
  /**
115
151
  * Get the filename of a tree entry
@@ -143,7 +179,10 @@ GIT_EXTERN(git_otype) git_tree_entry_type(const git_tree_entry *entry);
143
179
  * @param entry a tree entry
144
180
  * @return 0 or an error code
145
181
  */
146
- GIT_EXTERN(int) git_tree_entry_to_object(git_object **object_out, git_repository *repo, const git_tree_entry *entry);
182
+ GIT_EXTERN(int) git_tree_entry_to_object(
183
+ git_object **object_out,
184
+ git_repository *repo,
185
+ const git_tree_entry *entry);
147
186
 
148
187
  /**
149
188
  * Write a tree to the ODB from the index file
@@ -224,14 +263,25 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(git_treebuilder *bld, con
224
263
  * The optional pointer `entry_out` can be used to retrieve a
225
264
  * pointer to the newly created/updated entry.
226
265
  *
266
+ * No attempt is being made to ensure that the provided oid points
267
+ * to an existing git object in the object database, nor that the
268
+ * attributes make sense regarding the type of the pointed at object.
269
+ *
227
270
  * @param entry_out Pointer to store the entry (optional)
228
271
  * @param bld Tree builder
229
272
  * @param filename Filename of the entry
230
273
  * @param id SHA1 oid of the entry
231
- * @param attributes Folder attributes of the entry
274
+ * @param filemode Folder attributes of the entry. This parameter must
275
+ * be valued with one of the following entries: 0040000, 0100644,
276
+ * 0100755, 0120000 or 0160000.
232
277
  * @return 0 or an error code
233
278
  */
234
- GIT_EXTERN(int) git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, const char *filename, const git_oid *id, unsigned int attributes);
279
+ GIT_EXTERN(int) git_treebuilder_insert(
280
+ const git_tree_entry **entry_out,
281
+ git_treebuilder *bld,
282
+ const char *filename,
283
+ const git_oid *id,
284
+ git_filemode_t filemode);
235
285
 
236
286
  /**
237
287
  * Remove an entry from the builder by its filename
@@ -252,7 +302,10 @@ GIT_EXTERN(int) git_treebuilder_remove(git_treebuilder *bld, const char *filenam
252
302
  * @param bld Tree builder
253
303
  * @param filter Callback to filter entries
254
304
  */
255
- GIT_EXTERN(void) git_treebuilder_filter(git_treebuilder *bld, int (*filter)(const git_tree_entry *, void *), void *payload);
305
+ GIT_EXTERN(void) git_treebuilder_filter(
306
+ git_treebuilder *bld,
307
+ int (*filter)(const git_tree_entry *, void *),
308
+ void *payload);
256
309
 
257
310
  /**
258
311
  * Write the contents of the tree builder as a tree object
@@ -269,21 +322,24 @@ GIT_EXTERN(void) git_treebuilder_filter(git_treebuilder *bld, int (*filter)(cons
269
322
  GIT_EXTERN(int) git_treebuilder_write(git_oid *oid, git_repository *repo, git_treebuilder *bld);
270
323
 
271
324
  /**
272
- * Retrieve a subtree contained in a tree, given its
273
- * relative path.
325
+ * Retrieve a tree entry contained in a tree or in any
326
+ * of its subtrees, given its relative path.
274
327
  *
275
- * The returned tree is owned by the repository and
276
- * should be closed with the `git_object_free` method.
328
+ * The returned tree entry is owned by the user and must
329
+ * be freed manually with `git_tree_entry_free`.
277
330
  *
278
- * @param subtree Pointer where to store the subtree
331
+ * @param entry Pointer where to store the tree entry
279
332
  * @param root A previously loaded tree which will be the root of the relative path
280
- * @param subtree_path Path to the contained subtree
281
- * @return 0 on success; GIT_ENOTFOUND if the path does not lead to a subtree
333
+ * @param subtree_path Path to the contained entry
334
+ * @return 0 on success; GIT_ENOTFOUND if the path does not exist
282
335
  */
283
- GIT_EXTERN(int) git_tree_get_subtree(git_tree **subtree, git_tree *root, const char *subtree_path);
336
+ GIT_EXTERN(int) git_tree_entry_bypath(
337
+ git_tree_entry **entry,
338
+ git_tree *root,
339
+ const char *path);
284
340
 
285
341
  /** Callback for the tree traversal method */
286
- typedef int (*git_treewalk_cb)(const char *root, git_tree_entry *entry, void *payload);
342
+ typedef int (*git_treewalk_cb)(const char *root, const git_tree_entry *entry, void *payload);
287
343
 
288
344
  /** Tree traversal modes */
289
345
  enum git_treewalk_mode {
@@ -301,8 +357,9 @@ enum git_treewalk_mode {
301
357
  * the current (relative) root for the entry and the entry
302
358
  * data itself.
303
359
  *
304
- * If the callback returns a negative value, the passed entry
305
- * will be skipped on the traversal.
360
+ * If the callback returns a positive value, the passed entry will be
361
+ * skipped on the traversal (in pre mode). A negative value stops the
362
+ * walk.
306
363
  *
307
364
  * @param tree The tree to walk
308
365
  * @param callback Function to call on each tree entry