rugged 0.16.0 → 0.17.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. data/README.md +373 -243
  2. data/Rakefile +22 -0
  3. data/ext/rugged/extconf.rb +9 -6
  4. data/ext/rugged/rugged.c +123 -31
  5. data/ext/rugged/rugged.h +11 -10
  6. data/ext/rugged/rugged_blob.c +181 -18
  7. data/ext/rugged/rugged_commit.c +196 -18
  8. data/ext/rugged/rugged_config.c +94 -5
  9. data/ext/rugged/rugged_object.c +54 -1
  10. data/ext/rugged/rugged_reference.c +203 -15
  11. data/ext/rugged/{remote.c → rugged_remote.c} +35 -10
  12. data/ext/rugged/rugged_repo.c +323 -81
  13. data/ext/rugged/rugged_revwalk.c +57 -4
  14. data/ext/rugged/rugged_signature.c +3 -3
  15. data/ext/rugged/rugged_tag.c +72 -1
  16. data/ext/rugged/rugged_tree.c +70 -2
  17. data/ext/rugged/vendor/libgit2-dist/deps/regex/config.h +7 -0
  18. data/ext/rugged/vendor/libgit2-dist/deps/regex/regcomp.c +3856 -0
  19. data/ext/rugged/vendor/libgit2-dist/deps/regex/regex.c +85 -0
  20. data/ext/rugged/vendor/libgit2-dist/deps/regex/regex.h +582 -0
  21. data/ext/rugged/vendor/libgit2-dist/deps/regex/regex_internal.c +1744 -0
  22. data/ext/rugged/vendor/libgit2-dist/deps/regex/regex_internal.h +810 -0
  23. data/ext/rugged/vendor/libgit2-dist/deps/regex/regexec.c +4369 -0
  24. data/ext/rugged/vendor/libgit2-dist/examples/diff.c +238 -0
  25. data/ext/rugged/vendor/libgit2-dist/examples/general.c +4 -4
  26. data/ext/rugged/vendor/libgit2-dist/examples/network/fetch.c +101 -85
  27. data/ext/rugged/vendor/libgit2-dist/examples/network/git2.c +7 -3
  28. data/ext/rugged/vendor/libgit2-dist/examples/network/index-pack.c +80 -25
  29. data/ext/rugged/vendor/libgit2-dist/examples/network/ls-remote.c +6 -6
  30. data/ext/rugged/vendor/libgit2-dist/include/git2/attr.h +224 -0
  31. data/ext/rugged/vendor/libgit2-dist/include/git2/blob.h +59 -5
  32. data/ext/rugged/vendor/libgit2-dist/include/git2/branch.h +114 -7
  33. data/ext/rugged/vendor/libgit2-dist/include/git2/commit.h +14 -7
  34. data/ext/rugged/vendor/libgit2-dist/include/git2/common.h +4 -3
  35. data/ext/rugged/vendor/libgit2-dist/include/git2/config.h +105 -27
  36. data/ext/rugged/vendor/libgit2-dist/include/git2/diff.h +409 -0
  37. data/ext/rugged/vendor/libgit2-dist/include/git2/errors.h +47 -82
  38. data/ext/rugged/vendor/libgit2-dist/include/git2/index.h +25 -10
  39. data/ext/rugged/vendor/libgit2-dist/include/git2/indexer.h +46 -1
  40. data/ext/rugged/vendor/libgit2-dist/include/git2/merge.h +35 -0
  41. data/ext/rugged/vendor/libgit2-dist/include/git2/net.h +1 -1
  42. data/ext/rugged/vendor/libgit2-dist/include/git2/notes.h +139 -0
  43. data/ext/rugged/vendor/libgit2-dist/include/git2/object.h +5 -5
  44. data/ext/rugged/vendor/libgit2-dist/include/git2/odb.h +13 -13
  45. data/ext/rugged/vendor/libgit2-dist/include/git2/odb_backend.h +8 -8
  46. data/ext/rugged/vendor/libgit2-dist/include/git2/oid.h +14 -9
  47. data/ext/rugged/vendor/libgit2-dist/include/git2/reflog.h +5 -5
  48. data/ext/rugged/vendor/libgit2-dist/include/git2/refs.h +37 -17
  49. data/ext/rugged/vendor/libgit2-dist/include/git2/refspec.h +17 -9
  50. data/ext/rugged/vendor/libgit2-dist/include/git2/remote.h +83 -16
  51. data/ext/rugged/vendor/libgit2-dist/include/git2/repository.h +24 -10
  52. data/ext/rugged/vendor/libgit2-dist/include/git2/reset.h +44 -0
  53. data/ext/rugged/vendor/libgit2-dist/include/git2/revparse.h +36 -0
  54. data/ext/rugged/vendor/libgit2-dist/include/git2/revwalk.h +74 -6
  55. data/ext/rugged/vendor/libgit2-dist/include/git2/signature.h +3 -3
  56. data/ext/rugged/vendor/libgit2-dist/include/git2/status.h +120 -19
  57. data/ext/rugged/vendor/libgit2-dist/include/git2/submodule.h +103 -0
  58. data/ext/rugged/vendor/libgit2-dist/include/git2/tag.h +28 -10
  59. data/ext/rugged/vendor/libgit2-dist/include/git2/threads.h +1 -1
  60. data/ext/rugged/vendor/libgit2-dist/include/git2/tree.h +13 -13
  61. data/ext/rugged/vendor/libgit2-dist/include/git2/types.h +16 -2
  62. data/ext/rugged/vendor/libgit2-dist/include/git2/version.h +3 -3
  63. data/ext/rugged/vendor/libgit2-dist/include/git2/windows.h +1 -1
  64. data/ext/rugged/vendor/libgit2-dist/include/git2.h +7 -2
  65. data/ext/rugged/vendor/libgit2-dist/src/attr.c +677 -0
  66. data/ext/rugged/vendor/libgit2-dist/src/attr.h +56 -0
  67. data/ext/rugged/vendor/libgit2-dist/src/attr_file.c +609 -0
  68. data/ext/rugged/vendor/libgit2-dist/src/attr_file.h +145 -0
  69. data/ext/rugged/vendor/libgit2-dist/src/blob.c +213 -60
  70. data/ext/rugged/vendor/libgit2-dist/src/blob.h +2 -1
  71. data/ext/rugged/vendor/libgit2-dist/src/branch.c +208 -0
  72. data/ext/rugged/vendor/libgit2-dist/src/branch.h +17 -0
  73. data/ext/rugged/vendor/libgit2-dist/src/bswap.h +1 -1
  74. data/ext/rugged/vendor/libgit2-dist/src/buffer.c +395 -46
  75. data/ext/rugged/vendor/libgit2-dist/src/buffer.h +112 -9
  76. data/ext/rugged/vendor/libgit2-dist/src/cache.c +37 -49
  77. data/ext/rugged/vendor/libgit2-dist/src/cache.h +7 -17
  78. data/ext/rugged/vendor/libgit2-dist/src/cc-compat.h +18 -16
  79. data/ext/rugged/vendor/libgit2-dist/src/commit.c +56 -90
  80. data/ext/rugged/vendor/libgit2-dist/src/commit.h +1 -1
  81. data/ext/rugged/vendor/libgit2-dist/src/common.h +12 -5
  82. data/ext/rugged/vendor/libgit2-dist/src/{win32 → compat}/fnmatch.c +1 -1
  83. data/ext/rugged/vendor/libgit2-dist/src/{win32 → compat}/fnmatch.h +3 -3
  84. data/ext/rugged/vendor/libgit2-dist/src/config.c +247 -158
  85. data/ext/rugged/vendor/libgit2-dist/src/config.h +10 -1
  86. data/ext/rugged/vendor/libgit2-dist/src/config_cache.c +94 -0
  87. data/ext/rugged/vendor/libgit2-dist/src/config_file.c +606 -496
  88. data/ext/rugged/vendor/libgit2-dist/src/config_file.h +31 -0
  89. data/ext/rugged/vendor/libgit2-dist/src/crlf.c +228 -0
  90. data/ext/rugged/vendor/libgit2-dist/src/date.c +876 -0
  91. data/ext/rugged/vendor/libgit2-dist/src/delta-apply.c +15 -9
  92. data/ext/rugged/vendor/libgit2-dist/src/delta-apply.h +2 -2
  93. data/ext/rugged/vendor/libgit2-dist/src/diff.c +814 -0
  94. data/ext/rugged/vendor/libgit2-dist/src/diff.h +43 -0
  95. data/ext/rugged/vendor/libgit2-dist/src/diff_output.c +794 -0
  96. data/ext/rugged/vendor/libgit2-dist/src/errors.c +89 -74
  97. data/ext/rugged/vendor/libgit2-dist/src/fetch.c +94 -66
  98. data/ext/rugged/vendor/libgit2-dist/src/fetch.h +5 -4
  99. data/ext/rugged/vendor/libgit2-dist/src/filebuf.c +157 -100
  100. data/ext/rugged/vendor/libgit2-dist/src/filebuf.h +22 -8
  101. data/ext/rugged/vendor/libgit2-dist/src/fileops.c +330 -206
  102. data/ext/rugged/vendor/libgit2-dist/src/fileops.h +82 -51
  103. data/ext/rugged/vendor/libgit2-dist/src/filter.c +165 -0
  104. data/ext/rugged/vendor/libgit2-dist/src/filter.h +119 -0
  105. data/ext/rugged/vendor/libgit2-dist/src/global.c +4 -4
  106. data/ext/rugged/vendor/libgit2-dist/src/global.h +4 -1
  107. data/ext/rugged/vendor/libgit2-dist/src/hash.c +1 -1
  108. data/ext/rugged/vendor/libgit2-dist/src/hash.h +1 -1
  109. data/ext/rugged/vendor/libgit2-dist/src/ignore.c +203 -0
  110. data/ext/rugged/vendor/libgit2-dist/src/ignore.h +38 -0
  111. data/ext/rugged/vendor/libgit2-dist/src/index.c +220 -169
  112. data/ext/rugged/vendor/libgit2-dist/src/index.h +5 -1
  113. data/ext/rugged/vendor/libgit2-dist/src/indexer.c +601 -102
  114. data/ext/rugged/vendor/libgit2-dist/src/iterator.c +748 -0
  115. data/ext/rugged/vendor/libgit2-dist/src/iterator.h +151 -0
  116. data/ext/rugged/vendor/libgit2-dist/src/khash.h +608 -0
  117. data/ext/rugged/vendor/libgit2-dist/src/map.h +6 -1
  118. data/ext/rugged/vendor/libgit2-dist/src/message.c +61 -0
  119. data/ext/rugged/vendor/libgit2-dist/src/message.h +14 -0
  120. data/ext/rugged/vendor/libgit2-dist/src/mwindow.c +27 -29
  121. data/ext/rugged/vendor/libgit2-dist/src/mwindow.h +4 -4
  122. data/ext/rugged/vendor/libgit2-dist/src/netops.c +375 -56
  123. data/ext/rugged/vendor/libgit2-dist/src/netops.h +12 -9
  124. data/ext/rugged/vendor/libgit2-dist/src/notes.c +548 -0
  125. data/ext/rugged/vendor/libgit2-dist/src/notes.h +28 -0
  126. data/ext/rugged/vendor/libgit2-dist/src/object.c +59 -21
  127. data/ext/rugged/vendor/libgit2-dist/src/odb.c +212 -175
  128. data/ext/rugged/vendor/libgit2-dist/src/odb.h +39 -2
  129. data/ext/rugged/vendor/libgit2-dist/src/odb_loose.c +238 -241
  130. data/ext/rugged/vendor/libgit2-dist/src/odb_pack.c +94 -106
  131. data/ext/rugged/vendor/libgit2-dist/src/oid.c +59 -60
  132. data/ext/rugged/vendor/libgit2-dist/src/oidmap.h +42 -0
  133. data/ext/rugged/vendor/libgit2-dist/src/pack.c +198 -170
  134. data/ext/rugged/vendor/libgit2-dist/src/pack.h +16 -9
  135. data/ext/rugged/vendor/libgit2-dist/src/path.c +496 -106
  136. data/ext/rugged/vendor/libgit2-dist/src/path.h +214 -20
  137. data/ext/rugged/vendor/libgit2-dist/src/pkt.c +88 -159
  138. data/ext/rugged/vendor/libgit2-dist/src/pkt.h +9 -5
  139. data/ext/rugged/vendor/libgit2-dist/src/pool.c +294 -0
  140. data/ext/rugged/vendor/libgit2-dist/src/pool.h +125 -0
  141. data/ext/rugged/vendor/libgit2-dist/src/posix.c +38 -16
  142. data/ext/rugged/vendor/libgit2-dist/src/posix.h +20 -2
  143. data/ext/rugged/vendor/libgit2-dist/src/ppc/sha1.c +1 -1
  144. data/ext/rugged/vendor/libgit2-dist/src/ppc/sha1.h +1 -1
  145. data/ext/rugged/vendor/libgit2-dist/src/pqueue.c +7 -7
  146. data/ext/rugged/vendor/libgit2-dist/src/pqueue.h +1 -1
  147. data/ext/rugged/vendor/libgit2-dist/src/protocol.c +21 -13
  148. data/ext/rugged/vendor/libgit2-dist/src/protocol.h +1 -1
  149. data/ext/rugged/vendor/libgit2-dist/src/reflog.c +125 -103
  150. data/ext/rugged/vendor/libgit2-dist/src/reflog.h +1 -1
  151. data/ext/rugged/vendor/libgit2-dist/src/refs.c +713 -640
  152. data/ext/rugged/vendor/libgit2-dist/src/refs.h +27 -3
  153. data/ext/rugged/vendor/libgit2-dist/src/refspec.c +51 -17
  154. data/ext/rugged/vendor/libgit2-dist/src/refspec.h +13 -1
  155. data/ext/rugged/vendor/libgit2-dist/src/remote.c +307 -119
  156. data/ext/rugged/vendor/libgit2-dist/src/remote.h +3 -2
  157. data/ext/rugged/vendor/libgit2-dist/src/repository.c +593 -442
  158. data/ext/rugged/vendor/libgit2-dist/src/repository.h +80 -2
  159. data/ext/rugged/vendor/libgit2-dist/src/reset.c +103 -0
  160. data/ext/rugged/vendor/libgit2-dist/src/revparse.c +753 -0
  161. data/ext/rugged/vendor/libgit2-dist/src/revwalk.c +434 -158
  162. data/ext/rugged/vendor/libgit2-dist/src/sha1.c +3 -3
  163. data/ext/rugged/vendor/libgit2-dist/src/sha1.h +2 -2
  164. data/ext/rugged/vendor/libgit2-dist/src/sha1_lookup.c +3 -2
  165. data/ext/rugged/vendor/libgit2-dist/src/sha1_lookup.h +1 -1
  166. data/ext/rugged/vendor/libgit2-dist/src/signature.c +69 -80
  167. data/ext/rugged/vendor/libgit2-dist/src/signature.h +1 -1
  168. data/ext/rugged/vendor/libgit2-dist/src/status.c +184 -638
  169. data/ext/rugged/vendor/libgit2-dist/src/strmap.h +64 -0
  170. data/ext/rugged/vendor/libgit2-dist/src/submodule.c +387 -0
  171. data/ext/rugged/vendor/libgit2-dist/src/tag.c +162 -137
  172. data/ext/rugged/vendor/libgit2-dist/src/tag.h +2 -1
  173. data/ext/rugged/vendor/libgit2-dist/src/thread-utils.c +1 -1
  174. data/ext/rugged/vendor/libgit2-dist/src/thread-utils.h +8 -8
  175. data/ext/rugged/vendor/libgit2-dist/src/transport.c +31 -19
  176. data/ext/rugged/vendor/libgit2-dist/src/transport.h +31 -11
  177. data/ext/rugged/vendor/libgit2-dist/src/transports/git.c +168 -193
  178. data/ext/rugged/vendor/libgit2-dist/src/transports/http.c +192 -241
  179. data/ext/rugged/vendor/libgit2-dist/src/transports/local.c +92 -86
  180. data/ext/rugged/vendor/libgit2-dist/src/tree-cache.c +32 -49
  181. data/ext/rugged/vendor/libgit2-dist/src/tree-cache.h +1 -1
  182. data/ext/rugged/vendor/libgit2-dist/src/tree.c +172 -145
  183. data/ext/rugged/vendor/libgit2-dist/src/tree.h +16 -2
  184. data/ext/rugged/vendor/libgit2-dist/src/tsort.c +16 -14
  185. data/ext/rugged/vendor/libgit2-dist/src/unix/map.c +8 -24
  186. data/ext/rugged/vendor/libgit2-dist/src/unix/posix.h +9 -3
  187. data/ext/rugged/vendor/libgit2-dist/src/util.c +94 -38
  188. data/ext/rugged/vendor/libgit2-dist/src/util.h +119 -13
  189. data/ext/rugged/vendor/libgit2-dist/src/vector.c +84 -31
  190. data/ext/rugged/vendor/libgit2-dist/src/vector.h +37 -4
  191. data/ext/rugged/vendor/libgit2-dist/src/win32/dir.c +81 -41
  192. data/ext/rugged/vendor/libgit2-dist/src/{dir.h → win32/dir.h} +4 -9
  193. data/ext/rugged/vendor/libgit2-dist/src/win32/map.c +19 -35
  194. data/ext/rugged/vendor/libgit2-dist/src/win32/mingw-compat.h +1 -1
  195. data/ext/rugged/vendor/libgit2-dist/src/win32/msvc-compat.h +5 -1
  196. data/ext/rugged/vendor/libgit2-dist/src/win32/posix.h +10 -8
  197. data/ext/rugged/vendor/libgit2-dist/src/win32/posix_w32.c +262 -118
  198. data/ext/rugged/vendor/libgit2-dist/src/win32/pthread.c +12 -9
  199. data/ext/rugged/vendor/libgit2-dist/src/win32/pthread.h +1 -1
  200. data/ext/rugged/vendor/libgit2-dist/src/win32/utf-conv.c +30 -26
  201. data/ext/rugged/vendor/libgit2-dist/src/win32/utf-conv.h +2 -1
  202. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiff.h +135 -0
  203. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiffi.c +572 -0
  204. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xdiffi.h +63 -0
  205. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xemit.c +253 -0
  206. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xemit.h +36 -0
  207. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xhistogram.c +371 -0
  208. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xinclude.h +46 -0
  209. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xmacros.h +54 -0
  210. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xmerge.c +619 -0
  211. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xpatience.c +358 -0
  212. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xprepare.c +483 -0
  213. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xprepare.h +34 -0
  214. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xtypes.h +67 -0
  215. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xutils.c +419 -0
  216. data/ext/rugged/vendor/libgit2-dist/src/xdiff/xutils.h +49 -0
  217. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/attr_expect.h +43 -0
  218. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/file.c +226 -0
  219. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/flags.c +108 -0
  220. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/lookup.c +262 -0
  221. data/ext/rugged/vendor/libgit2-dist/tests-clar/attr/repo.c +273 -0
  222. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/buf/basic.c +5 -5
  223. data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_helpers.c +181 -0
  224. data/ext/rugged/vendor/libgit2-dist/tests-clar/clar_libgit2.h +55 -0
  225. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/commit.c +44 -0
  226. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/parse.c +350 -0
  227. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/signature.c +65 -0
  228. data/ext/rugged/vendor/libgit2-dist/tests-clar/commit/write.c +140 -0
  229. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/add.c +3 -3
  230. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/multivar.c +151 -0
  231. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/new.c +5 -5
  232. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/read.c +44 -32
  233. data/ext/rugged/vendor/libgit2-dist/tests-clar/config/stress.c +61 -0
  234. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/config/write.c +20 -5
  235. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/buffer.c +613 -0
  236. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/dirent.c +39 -26
  237. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/env.c +115 -0
  238. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/errors.c +60 -0
  239. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/filebuf.c +4 -18
  240. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/hex.c +22 -0
  241. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/oid.c +6 -6
  242. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/path.c +420 -0
  243. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/pool.c +85 -0
  244. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/rmdir.c +68 -0
  245. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/string.c +1 -1
  246. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/strmap.c +102 -0
  247. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/core/strtol.c +1 -1
  248. data/ext/rugged/vendor/libgit2-dist/tests-clar/core/vector.c +191 -0
  249. data/ext/rugged/vendor/libgit2-dist/tests-clar/date/date.c +15 -0
  250. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/blob.c +254 -0
  251. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.c +104 -0
  252. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/diff_helpers.h +47 -0
  253. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/index.c +92 -0
  254. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/iterator.c +572 -0
  255. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/patch.c +99 -0
  256. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/tree.c +210 -0
  257. data/ext/rugged/vendor/libgit2-dist/tests-clar/diff/workdir.c +543 -0
  258. data/ext/rugged/vendor/libgit2-dist/tests-clar/index/read_tree.c +46 -0
  259. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/index/rename.c +2 -12
  260. data/ext/rugged/vendor/libgit2-dist/tests-clar/index/tests.c +246 -0
  261. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/createremotethenload.c +33 -0
  262. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotelocal.c +137 -0
  263. data/ext/rugged/vendor/libgit2-dist/tests-clar/network/remotes.c +183 -0
  264. data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notes.c +133 -0
  265. data/ext/rugged/vendor/libgit2-dist/tests-clar/notes/notesref.c +57 -0
  266. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/filter.c +125 -0
  267. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/fromchunks.c +87 -0
  268. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/blob/write.c +69 -0
  269. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/commit/commitstagedfile.c +126 -0
  270. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/lookup.c +63 -0
  271. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/message.c +171 -0
  272. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/chars.c +3 -14
  273. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/compare.c +4 -4
  274. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/convert.c +10 -10
  275. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/data.h +0 -0
  276. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/fromstr.c +1 -1
  277. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/hash.c +21 -17
  278. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/short.c +1 -1
  279. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/size.c +1 -1
  280. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/raw/type2string.c +14 -14
  281. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/raw/write.c +455 -0
  282. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/peel.c +56 -0
  283. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/read.c +130 -0
  284. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tag/write.c +192 -0
  285. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/object/tree/frompath.c +22 -16
  286. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/read.c +75 -0
  287. data/ext/rugged/vendor/libgit2-dist/tests-clar/object/tree/write.c +84 -0
  288. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/loose.c +1 -1
  289. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/loose_data.h +0 -0
  290. data/ext/rugged/vendor/libgit2-dist/tests-clar/odb/mixed.c +24 -0
  291. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/pack_data.h +0 -0
  292. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/packed.c +1 -1
  293. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/odb/sorting.c +1 -1
  294. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/create.c +113 -0
  295. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/delete.c +91 -0
  296. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/listall.c +78 -0
  297. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/branches/move.c +72 -0
  298. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/crashes.c +17 -0
  299. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/create.c +149 -0
  300. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/delete.c +85 -0
  301. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/list.c +53 -0
  302. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/listall.c +36 -0
  303. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/lookup.c +42 -0
  304. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/normalize.c +200 -0
  305. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/overwrite.c +136 -0
  306. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/pack.c +67 -0
  307. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/read.c +194 -0
  308. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/reflog.c +123 -0
  309. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/rename.c +339 -0
  310. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/revparse.c +174 -0
  311. data/ext/rugged/vendor/libgit2-dist/tests-clar/refs/unicode.c +42 -0
  312. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/discover.c +142 -0
  313. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/repo/getters.c +19 -1
  314. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/init.c +235 -0
  315. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/open.c +282 -0
  316. data/ext/rugged/vendor/libgit2-dist/tests-clar/repo/setters.c +80 -0
  317. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/mixed.c +47 -0
  318. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.c +10 -0
  319. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/reset_helpers.h +6 -0
  320. data/ext/rugged/vendor/libgit2-dist/tests-clar/reset/soft.c +102 -0
  321. data/ext/rugged/vendor/libgit2-dist/{tests/t05-revwalk.c → tests-clar/revwalk/basic.c} +85 -44
  322. data/ext/rugged/vendor/libgit2-dist/tests-clar/revwalk/mergebase.c +148 -0
  323. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/ignore.c +133 -0
  324. data/ext/rugged/vendor/libgit2-dist/{tests-clay → tests-clar}/status/single.c +2 -11
  325. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_data.h +202 -0
  326. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.c +49 -0
  327. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/status_helpers.h +33 -0
  328. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/submodules.c +112 -0
  329. data/ext/rugged/vendor/libgit2-dist/tests-clar/status/worktree.c +649 -0
  330. data/ext/rugged/vendor/libgit2-dist/tests-clar/threads/basic.c +20 -0
  331. data/ext/rugged/vendor/libgit2-dist.tar.gz +0 -0
  332. data/lib/rugged/commit.rb +35 -0
  333. data/lib/rugged/object.rb +7 -0
  334. data/lib/rugged/reference.rb +9 -0
  335. data/lib/rugged/repository.rb +99 -3
  336. data/lib/rugged/tag.rb +22 -0
  337. data/lib/rugged/tree.rb +8 -0
  338. data/lib/rugged/version.rb +1 -1
  339. data/lib/rugged.rb +4 -1
  340. data/test/blob_test.rb +2 -2
  341. data/test/commit_test.rb +27 -13
  342. data/test/config_test.rb +44 -0
  343. data/test/coverage/HEAD.json +1 -1
  344. data/test/fixtures/testrepo.git/config +2 -0
  345. data/test/fixtures/testrepo.git/objects/7f/043268ea43ce18e3540acaabf9e090c91965b0 +0 -0
  346. data/test/lib_test.rb +7 -0
  347. data/test/object_test.rb +3 -3
  348. data/test/reference_test.rb +46 -8
  349. data/test/remote_test.rb +8 -2
  350. data/test/repo_pack_test.rb +3 -3
  351. data/test/repo_test.rb +79 -11
  352. data/test/tag_test.rb +9 -2
  353. data/test/test_helper.rb +21 -0
  354. data/test/tree_test.rb +18 -6
  355. metadata +205 -81
  356. data/ext/rugged/vendor/libgit2-dist/include/git2/zlib.h +0 -40
  357. data/ext/rugged/vendor/libgit2-dist/src/hashtable.c +0 -243
  358. data/ext/rugged/vendor/libgit2-dist/src/hashtable.h +0 -80
  359. data/ext/rugged/vendor/libgit2-dist/tests/t00-core.c +0 -628
  360. data/ext/rugged/vendor/libgit2-dist/tests/t01-data.h +0 -322
  361. data/ext/rugged/vendor/libgit2-dist/tests/t01-rawobj.c +0 -638
  362. data/ext/rugged/vendor/libgit2-dist/tests/t03-data.h +0 -344
  363. data/ext/rugged/vendor/libgit2-dist/tests/t03-objwrite.c +0 -255
  364. data/ext/rugged/vendor/libgit2-dist/tests/t04-commit.c +0 -788
  365. data/ext/rugged/vendor/libgit2-dist/tests/t06-index.c +0 -219
  366. data/ext/rugged/vendor/libgit2-dist/tests/t07-hashtable.c +0 -192
  367. data/ext/rugged/vendor/libgit2-dist/tests/t08-tag.c +0 -357
  368. data/ext/rugged/vendor/libgit2-dist/tests/t09-tree.c +0 -221
  369. data/ext/rugged/vendor/libgit2-dist/tests/t10-refs.c +0 -1294
  370. data/ext/rugged/vendor/libgit2-dist/tests/t12-repo.c +0 -174
  371. data/ext/rugged/vendor/libgit2-dist/tests/t13-threads.c +0 -41
  372. data/ext/rugged/vendor/libgit2-dist/tests/t17-bufs.c +0 -61
  373. data/ext/rugged/vendor/libgit2-dist/tests/t18-status.c +0 -448
  374. data/ext/rugged/vendor/libgit2-dist/tests/test_helpers.c +0 -310
  375. data/ext/rugged/vendor/libgit2-dist/tests/test_helpers.h +0 -83
  376. data/ext/rugged/vendor/libgit2-dist/tests/test_lib.c +0 -198
  377. data/ext/rugged/vendor/libgit2-dist/tests/test_lib.h +0 -54
  378. data/ext/rugged/vendor/libgit2-dist/tests/test_main.c +0 -89
  379. data/ext/rugged/vendor/libgit2-dist/tests-clay/clay.h +0 -187
  380. data/ext/rugged/vendor/libgit2-dist/tests-clay/clay_libgit2.h +0 -28
  381. data/ext/rugged/vendor/libgit2-dist/tests-clay/clay_main.c +0 -1073
  382. data/ext/rugged/vendor/libgit2-dist/tests-clay/config/stress.c +0 -39
  383. data/ext/rugged/vendor/libgit2-dist/tests-clay/core/path.c +0 -139
  384. data/ext/rugged/vendor/libgit2-dist/tests-clay/core/rmdir.c +0 -50
  385. data/ext/rugged/vendor/libgit2-dist/tests-clay/core/vector.c +0 -66
  386. data/ext/rugged/vendor/libgit2-dist/tests-clay/network/remotes.c +0 -50
  387. data/ext/rugged/vendor/libgit2-dist/tests-clay/repo/init.c +0 -104
  388. data/ext/rugged/vendor/libgit2-dist/tests-clay/repo/open.c +0 -54
  389. data/ext/rugged/vendor/libgit2-dist/tests-clay/status/status_data.h +0 -48
  390. data/ext/rugged/vendor/libgit2-dist/tests-clay/status/worktree.c +0 -124
  391. data/lib/rugged/objects.rb +0 -45
  392. data/test/fixtures/testrepo.git/refs/heads/new_name +0 -1
@@ -1,1294 +0,0 @@
1
- /*
2
- * This file is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License, version 2,
4
- * as published by the Free Software Foundation.
5
- *
6
- * In addition to the permissions in the GNU General Public License,
7
- * the authors give you unlimited permission to link the compiled
8
- * version of this file into combinations with other programs,
9
- * and to distribute those combinations without any restriction
10
- * coming from the use of this file. (The General Public License
11
- * restrictions do apply in other respects; for example, they cover
12
- * modification of the file, and distribution when not linked into
13
- * a combined executable.)
14
- *
15
- * This file is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; see the file COPYING. If not, write to
22
- * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23
- * Boston, MA 02110-1301, USA.
24
- */
25
- #include "test_lib.h"
26
- #include "test_helpers.h"
27
-
28
- #include "repository.h"
29
-
30
- #include "git2/reflog.h"
31
- #include "reflog.h"
32
-
33
- static const char *loose_tag_ref_name = "refs/tags/e90810b";
34
- static const char *non_existing_tag_ref_name = "refs/tags/i-do-not-exist";
35
-
36
- BEGIN_TEST(readtag0, "lookup a loose tag reference")
37
- git_repository *repo;
38
- git_reference *reference;
39
- git_object *object;
40
- char ref_name_from_tag_name[GIT_REFNAME_MAX];
41
-
42
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
43
-
44
- must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
45
- must_be_true(git_reference_type(reference) & GIT_REF_OID);
46
- must_be_true(git_reference_is_packed(reference) == 0);
47
- must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
48
-
49
- must_pass(git_object_lookup(&object, repo, git_reference_oid(reference), GIT_OBJ_ANY));
50
- must_be_true(object != NULL);
51
- must_be_true(git_object_type(object) == GIT_OBJ_TAG);
52
-
53
- /* Ensure the name of the tag matches the name of the reference */
54
- git_path_join(ref_name_from_tag_name, GIT_REFS_TAGS_DIR, git_tag_name((git_tag *)object));
55
- must_be_true(strcmp(ref_name_from_tag_name, loose_tag_ref_name) == 0);
56
-
57
- git_object_free(object);
58
- git_repository_free(repo);
59
-
60
- git_reference_free(reference);
61
- END_TEST
62
-
63
- BEGIN_TEST(readtag1, "lookup a loose tag reference that doesn't exist")
64
- git_repository *repo;
65
- git_reference *reference;
66
-
67
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
68
- must_fail(git_reference_lookup(&reference, repo, non_existing_tag_ref_name));
69
-
70
- git_repository_free(repo);
71
-
72
- git_reference_free(reference);
73
- END_TEST
74
-
75
- static const char *head_tracker_sym_ref_name = "head-tracker";
76
- static const char *current_head_target = "refs/heads/master";
77
- static const char *current_master_tip = "a65fedf39aefe402d3bb6e24df4d4f5fe4547750";
78
-
79
- BEGIN_TEST(readsym0, "lookup a symbolic reference")
80
- git_repository *repo;
81
- git_reference *reference, *resolved_ref;
82
- git_object *object;
83
- git_oid id;
84
-
85
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
86
-
87
- must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
88
- must_be_true(git_reference_type(reference) & GIT_REF_SYMBOLIC);
89
- must_be_true(git_reference_is_packed(reference) == 0);
90
- must_be_true(strcmp(reference->name, GIT_HEAD_FILE) == 0);
91
-
92
- must_pass(git_reference_resolve(&resolved_ref, reference));
93
- must_be_true(git_reference_type(resolved_ref) == GIT_REF_OID);
94
-
95
- must_pass(git_object_lookup(&object, repo, git_reference_oid(resolved_ref), GIT_OBJ_ANY));
96
- must_be_true(object != NULL);
97
- must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
98
-
99
- git_oid_fromstr(&id, current_master_tip);
100
- must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0);
101
-
102
- git_object_free(object);
103
- git_repository_free(repo);
104
-
105
- git_reference_free(reference);
106
- git_reference_free(resolved_ref);
107
- END_TEST
108
-
109
- BEGIN_TEST(readsym1, "lookup a nested symbolic reference")
110
- git_repository *repo;
111
- git_reference *reference, *resolved_ref;
112
- git_object *object;
113
- git_oid id;
114
-
115
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
116
-
117
- must_pass(git_reference_lookup(&reference, repo, head_tracker_sym_ref_name));
118
- must_be_true(git_reference_type(reference) & GIT_REF_SYMBOLIC);
119
- must_be_true(git_reference_is_packed(reference) == 0);
120
- must_be_true(strcmp(reference->name, head_tracker_sym_ref_name) == 0);
121
-
122
- must_pass(git_reference_resolve(&resolved_ref, reference));
123
- must_be_true(git_reference_type(resolved_ref) == GIT_REF_OID);
124
-
125
- must_pass(git_object_lookup(&object, repo, git_reference_oid(resolved_ref), GIT_OBJ_ANY));
126
- must_be_true(object != NULL);
127
- must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
128
-
129
- git_oid_fromstr(&id, current_master_tip);
130
- must_be_true(git_oid_cmp(&id, git_object_id(object)) == 0);
131
-
132
- git_object_free(object);
133
- git_repository_free(repo);
134
-
135
- git_reference_free(reference);
136
- git_reference_free(resolved_ref);
137
- END_TEST
138
-
139
- BEGIN_TEST(readsym2, "lookup the HEAD and resolve the master branch")
140
- git_repository *repo;
141
- git_reference *reference, *resolved_ref, *comp_base_ref;
142
-
143
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
144
-
145
- must_pass(git_reference_lookup(&reference, repo, head_tracker_sym_ref_name));
146
- must_pass(git_reference_resolve(&comp_base_ref, reference));
147
- git_reference_free(reference);
148
-
149
- must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
150
- must_pass(git_reference_resolve(&resolved_ref, reference));
151
- must_pass(git_oid_cmp(git_reference_oid(comp_base_ref), git_reference_oid(resolved_ref)));
152
- git_reference_free(reference);
153
- git_reference_free(resolved_ref);
154
-
155
- must_pass(git_reference_lookup(&reference, repo, current_head_target));
156
- must_pass(git_reference_resolve(&resolved_ref, reference));
157
- must_pass(git_oid_cmp(git_reference_oid(comp_base_ref), git_reference_oid(resolved_ref)));
158
- git_reference_free(reference);
159
- git_reference_free(resolved_ref);
160
-
161
- git_reference_free(comp_base_ref);
162
- git_repository_free(repo);
163
- END_TEST
164
-
165
- BEGIN_TEST(readsym3, "lookup the master branch and then the HEAD")
166
- git_repository *repo;
167
- git_reference *reference, *master_ref, *resolved_ref;
168
-
169
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
170
-
171
- must_pass(git_reference_lookup(&master_ref, repo, current_head_target));
172
- must_pass(git_reference_lookup(&reference, repo, GIT_HEAD_FILE));
173
-
174
- must_pass(git_reference_resolve(&resolved_ref, reference));
175
- must_pass(git_oid_cmp(git_reference_oid(master_ref), git_reference_oid(resolved_ref)));
176
-
177
- git_repository_free(repo);
178
-
179
- git_reference_free(reference);
180
- git_reference_free(resolved_ref);
181
- git_reference_free(master_ref);
182
- END_TEST
183
-
184
- static const char *packed_head_name = "refs/heads/packed";
185
- static const char *packed_test_head_name = "refs/heads/packed-test";
186
-
187
- BEGIN_TEST(readpacked0, "lookup a packed reference")
188
- git_repository *repo;
189
- git_reference *reference;
190
- git_object *object;
191
-
192
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
193
-
194
- must_pass(git_reference_lookup(&reference, repo, packed_head_name));
195
- must_be_true(git_reference_type(reference) & GIT_REF_OID);
196
- must_be_true(git_reference_is_packed(reference));
197
- must_be_true(strcmp(reference->name, packed_head_name) == 0);
198
-
199
- must_pass(git_object_lookup(&object, repo, git_reference_oid(reference), GIT_OBJ_ANY));
200
- must_be_true(object != NULL);
201
- must_be_true(git_object_type(object) == GIT_OBJ_COMMIT);
202
-
203
- git_object_free(object);
204
- git_repository_free(repo);
205
-
206
- git_reference_free(reference);
207
- END_TEST
208
-
209
- BEGIN_TEST(readpacked1, "assure that a loose reference is looked up before a packed reference")
210
- git_repository *repo;
211
- git_reference *reference;
212
-
213
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
214
- must_pass(git_reference_lookup(&reference, repo, packed_head_name));
215
- must_pass(git_reference_lookup(&reference, repo, packed_test_head_name));
216
- must_be_true(git_reference_type(reference) & GIT_REF_OID);
217
- must_be_true(git_reference_is_packed(reference) == 0);
218
- must_be_true(strcmp(reference->name, packed_test_head_name) == 0);
219
-
220
- git_repository_free(repo);
221
-
222
- git_reference_free(reference);
223
- END_TEST
224
-
225
- BEGIN_TEST(create0, "create a new symbolic reference")
226
- git_reference *new_reference, *looked_up_ref, *resolved_ref;
227
- git_repository *repo, *repo2;
228
- git_oid id;
229
- char ref_path[GIT_PATH_MAX];
230
-
231
- const char *new_head_tracker = "another-head-tracker";
232
-
233
- git_oid_fromstr(&id, current_master_tip);
234
-
235
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
236
-
237
- /* Retrieve the physical path to the symbolic ref for further cleaning */
238
- git_path_join(ref_path, repo->path_repository, new_head_tracker);
239
-
240
- /* Create and write the new symbolic reference */
241
- must_pass(git_reference_create_symbolic(&new_reference, repo, new_head_tracker, current_head_target, 0));
242
-
243
- /* Ensure the reference can be looked-up... */
244
- must_pass(git_reference_lookup(&looked_up_ref, repo, new_head_tracker));
245
- must_be_true(git_reference_type(looked_up_ref) & GIT_REF_SYMBOLIC);
246
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
247
- must_be_true(strcmp(looked_up_ref->name, new_head_tracker) == 0);
248
-
249
- /* ...peeled.. */
250
- must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
251
- must_be_true(git_reference_type(resolved_ref) == GIT_REF_OID);
252
-
253
- /* ...and that it points to the current master tip */
254
- must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
255
-
256
- git_repository_free(repo);
257
-
258
- /* Similar test with a fresh new repository */
259
- must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
260
-
261
- must_pass(git_reference_lookup(&looked_up_ref, repo2, new_head_tracker));
262
- must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
263
- must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
264
-
265
- close_temp_repo(repo2);
266
-
267
- git_reference_free(new_reference);
268
- git_reference_free(looked_up_ref);
269
- git_reference_free(resolved_ref);
270
- END_TEST
271
-
272
- BEGIN_TEST(create1, "create a deep symbolic reference")
273
- git_reference *new_reference, *looked_up_ref, *resolved_ref;
274
- git_repository *repo;
275
- git_oid id;
276
- char ref_path[GIT_PATH_MAX];
277
-
278
- const char *new_head_tracker = "deep/rooted/tracker";
279
-
280
- git_oid_fromstr(&id, current_master_tip);
281
-
282
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
283
-
284
- git_path_join(ref_path, repo->path_repository, new_head_tracker);
285
- must_pass(git_reference_create_symbolic(&new_reference, repo, new_head_tracker, current_head_target, 0));
286
- must_pass(git_reference_lookup(&looked_up_ref, repo, new_head_tracker));
287
- must_pass(git_reference_resolve(&resolved_ref, looked_up_ref));
288
- must_be_true(git_oid_cmp(&id, git_reference_oid(resolved_ref)) == 0);
289
-
290
- close_temp_repo(repo);
291
-
292
- git_reference_free(new_reference);
293
- git_reference_free(looked_up_ref);
294
- git_reference_free(resolved_ref);
295
- END_TEST
296
-
297
- BEGIN_TEST(create2, "create a new OID reference")
298
- git_reference *new_reference, *looked_up_ref;
299
- git_repository *repo, *repo2;
300
- git_oid id;
301
- char ref_path[GIT_PATH_MAX];
302
-
303
- const char *new_head = "refs/heads/new-head";
304
-
305
- git_oid_fromstr(&id, current_master_tip);
306
-
307
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
308
-
309
- /* Retrieve the physical path to the symbolic ref for further cleaning */
310
- git_path_join(ref_path, repo->path_repository, new_head);
311
-
312
- /* Create and write the new object id reference */
313
- must_pass(git_reference_create_oid(&new_reference, repo, new_head, &id, 0));
314
-
315
- /* Ensure the reference can be looked-up... */
316
- must_pass(git_reference_lookup(&looked_up_ref, repo, new_head));
317
- must_be_true(git_reference_type(looked_up_ref) & GIT_REF_OID);
318
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
319
- must_be_true(strcmp(looked_up_ref->name, new_head) == 0);
320
-
321
- /* ...and that it points to the current master tip */
322
- must_be_true(git_oid_cmp(&id, git_reference_oid(looked_up_ref)) == 0);
323
-
324
- git_repository_free(repo);
325
-
326
- /* Similar test with a fresh new repository */
327
- must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
328
-
329
- must_pass(git_reference_lookup(&looked_up_ref, repo2, new_head));
330
- must_be_true(git_oid_cmp(&id, git_reference_oid(looked_up_ref)) == 0);
331
-
332
- close_temp_repo(repo2);
333
-
334
- git_reference_free(new_reference);
335
- git_reference_free(looked_up_ref);
336
- END_TEST
337
-
338
- BEGIN_TEST(create3, "Can not create a new OID reference which targets at an unknown id")
339
- git_reference *new_reference, *looked_up_ref;
340
- git_repository *repo;
341
- git_oid id;
342
-
343
- const char *new_head = "refs/heads/new-head";
344
-
345
- git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644");
346
-
347
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
348
-
349
- /* Create and write the new object id reference */
350
- must_fail(git_reference_create_oid(&new_reference, repo, new_head, &id, 0));
351
-
352
- /* Ensure the reference can't be looked-up... */
353
- must_fail(git_reference_lookup(&looked_up_ref, repo, new_head));
354
-
355
- git_repository_free(repo);
356
- END_TEST
357
-
358
- static const char *ref_name = "refs/heads/other";
359
- static const char *ref_master_name = "refs/heads/master";
360
- static const char *ref_branch_name = "refs/heads/branch";
361
- static const char *ref_test_name = "refs/heads/test";
362
- BEGIN_TEST(overwrite0, "Overwrite an existing symbolic reference")
363
- git_reference *ref, *branch_ref;
364
- git_repository *repo;
365
-
366
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
367
-
368
- /* The target needds to exist and we need to check the name has changed */
369
- must_pass(git_reference_create_symbolic(&branch_ref, repo, ref_branch_name, ref_master_name, 0));
370
- must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_branch_name, 0));
371
- /* Ensure it points to the right place*/
372
- must_pass(git_reference_lookup(&ref, repo, ref_name));
373
- must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
374
- must_be_true(!strcmp(git_reference_target(ref), ref_branch_name));
375
-
376
- /* Ensure we can't create it unless we force it to */
377
- must_fail(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
378
- must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 1));
379
-
380
- /* Ensure it points to the right place */
381
- must_pass(git_reference_lookup(&ref, repo, ref_name));
382
- must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
383
- must_be_true(!strcmp(git_reference_target(ref), ref_master_name));
384
-
385
- close_temp_repo(repo);
386
-
387
- git_reference_free(ref);
388
- git_reference_free(branch_ref);
389
- END_TEST
390
-
391
- BEGIN_TEST(overwrite1, "Overwrite an existing object id reference")
392
- git_reference *ref;
393
- git_repository *repo;
394
- git_oid id;
395
-
396
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
397
-
398
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
399
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
400
- git_oid_cpy(&id, git_reference_oid(ref));
401
-
402
- /* Create it */
403
- must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
404
-
405
- must_pass(git_reference_lookup(&ref, repo, ref_test_name));
406
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
407
- git_oid_cpy(&id, git_reference_oid(ref));
408
-
409
- /* Ensure we can't overwrite unless we force it */
410
- must_fail(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
411
- must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 1));
412
-
413
- /* Ensure it has been overwritten */
414
- must_pass(git_reference_lookup(&ref, repo, ref_name));
415
- must_be_true(!git_oid_cmp(&id, git_reference_oid(ref)));
416
-
417
- close_temp_repo(repo);
418
-
419
- git_reference_free(ref);
420
- END_TEST
421
-
422
- BEGIN_TEST(overwrite2, "Overwrite an existing object id reference with a symbolic one")
423
- git_reference *ref;
424
- git_repository *repo;
425
- git_oid id;
426
-
427
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
428
-
429
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
430
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
431
- git_oid_cpy(&id, git_reference_oid(ref));
432
-
433
- must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
434
- must_fail(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
435
- must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 1));
436
-
437
- /* Ensure it points to the right place */
438
- must_pass(git_reference_lookup(&ref, repo, ref_name));
439
- must_be_true(git_reference_type(ref) & GIT_REF_SYMBOLIC);
440
- must_be_true(!strcmp(git_reference_target(ref), ref_master_name));
441
-
442
- close_temp_repo(repo);
443
-
444
- git_reference_free(ref);
445
- END_TEST
446
-
447
- BEGIN_TEST(overwrite3, "Overwrite an existing symbolic reference with an object id one")
448
- git_reference *ref;
449
- git_repository *repo;
450
- git_oid id;
451
-
452
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
453
-
454
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
455
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
456
- git_oid_cpy(&id, git_reference_oid(ref));
457
-
458
- /* Create the symbolic ref */
459
- must_pass(git_reference_create_symbolic(&ref, repo, ref_name, ref_master_name, 0));
460
- /* It shouldn't overwrite unless we tell it to */
461
- must_fail(git_reference_create_oid(&ref, repo, ref_name, &id, 0));
462
- must_pass(git_reference_create_oid(&ref, repo, ref_name, &id, 1));
463
-
464
- /* Ensure it points to the right place */
465
- must_pass(git_reference_lookup(&ref, repo, ref_name));
466
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
467
- must_be_true(!git_oid_cmp(git_reference_oid(ref), &id));
468
-
469
- close_temp_repo(repo);
470
-
471
- git_reference_free(ref);
472
- END_TEST
473
-
474
- BEGIN_TEST(pack0, "create a packfile for an empty folder")
475
- git_repository *repo;
476
- char temp_path[GIT_PATH_MAX];
477
-
478
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
479
-
480
- git_path_join_n(temp_path, 3, repo->path_repository, GIT_REFS_HEADS_DIR, "empty_dir");
481
- must_pass(git_futils_mkdir_r(temp_path, GIT_REFS_DIR_MODE));
482
-
483
- must_pass(git_reference_packall(repo));
484
-
485
- close_temp_repo(repo);
486
- END_TEST
487
-
488
- BEGIN_TEST(pack1, "create a packfile from all the loose rn a repo")
489
- git_repository *repo;
490
- git_reference *reference;
491
- char temp_path[GIT_PATH_MAX];
492
-
493
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
494
-
495
- /* Ensure a known loose ref can be looked up */
496
- must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
497
- must_be_true(git_reference_is_packed(reference) == 0);
498
- must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
499
-
500
- /*
501
- * We are now trying to pack also a loose reference
502
- * called `points_to_blob`, to make sure we can properly
503
- * pack weak tags
504
- */
505
- must_pass(git_reference_packall(repo));
506
-
507
- /* Ensure the packed-refs file exists */
508
- git_path_join(temp_path, repo->path_repository, GIT_PACKEDREFS_FILE);
509
- must_pass(git_futils_exists(temp_path));
510
-
511
- /* Ensure the known ref can still be looked up but is now packed */
512
- must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
513
- must_be_true(git_reference_is_packed(reference));
514
- must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
515
-
516
- /* Ensure the known ref has been removed from the loose folder structure */
517
- git_path_join(temp_path, repo->path_repository, loose_tag_ref_name);
518
- must_pass(!git_futils_exists(temp_path));
519
-
520
- close_temp_repo(repo);
521
-
522
- git_reference_free(reference);
523
- END_TEST
524
-
525
- BEGIN_TEST(rename0, "rename a loose reference")
526
- git_reference *looked_up_ref, *another_looked_up_ref;
527
- git_repository *repo;
528
- char temp_path[GIT_PATH_MAX];
529
- const char *new_name = "refs/tags/Nemo/knows/refs.kung-fu";
530
-
531
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
532
-
533
- /* Ensure the ref doesn't exist on the file system */
534
- git_path_join(temp_path, repo->path_repository, new_name);
535
- must_pass(!git_futils_exists(temp_path));
536
-
537
- /* Retrieval of the reference to rename */
538
- must_pass(git_reference_lookup(&looked_up_ref, repo, loose_tag_ref_name));
539
-
540
- /* ... which is indeed loose */
541
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
542
-
543
- /* Now that the reference is renamed... */
544
- must_pass(git_reference_rename(looked_up_ref, new_name, 0));
545
- must_be_true(!strcmp(looked_up_ref->name, new_name));
546
-
547
- /* ...It can't be looked-up with the old name... */
548
- must_fail(git_reference_lookup(&another_looked_up_ref, repo, loose_tag_ref_name));
549
-
550
- /* ...but the new name works ok... */
551
- must_pass(git_reference_lookup(&another_looked_up_ref, repo, new_name));
552
- must_be_true(!strcmp(another_looked_up_ref->name, new_name));
553
-
554
- /* .. the ref is still loose... */
555
- must_be_true(git_reference_is_packed(another_looked_up_ref) == 0);
556
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
557
-
558
- /* ...and the ref can be found in the file system */
559
- git_path_join(temp_path, repo->path_repository, new_name);
560
- must_pass(git_futils_exists(temp_path));
561
-
562
- close_temp_repo(repo);
563
-
564
- git_reference_free(looked_up_ref);
565
- git_reference_free(another_looked_up_ref);
566
- END_TEST
567
-
568
- BEGIN_TEST(rename1, "rename a packed reference (should make it loose)")
569
- git_reference *looked_up_ref, *another_looked_up_ref;
570
- git_repository *repo;
571
- char temp_path[GIT_PATH_MAX];
572
- const char *brand_new_name = "refs/heads/brand_new_name";
573
-
574
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
575
-
576
- /* Ensure the ref doesn't exist on the file system */
577
- git_path_join(temp_path, repo->path_repository, packed_head_name);
578
- must_pass(!git_futils_exists(temp_path));
579
-
580
- /* The reference can however be looked-up... */
581
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
582
-
583
- /* .. and it's packed */
584
- must_be_true(git_reference_is_packed(looked_up_ref) != 0);
585
-
586
- /* Now that the reference is renamed... */
587
- must_pass(git_reference_rename(looked_up_ref, brand_new_name, 0));
588
- must_be_true(!strcmp(looked_up_ref->name, brand_new_name));
589
-
590
- /* ...It can't be looked-up with the old name... */
591
- must_fail(git_reference_lookup(&another_looked_up_ref, repo, packed_head_name));
592
-
593
- /* ...but the new name works ok... */
594
- must_pass(git_reference_lookup(&another_looked_up_ref, repo, brand_new_name));
595
- must_be_true(!strcmp(another_looked_up_ref->name, brand_new_name));
596
-
597
- /* .. the ref is no longer packed... */
598
- must_be_true(git_reference_is_packed(another_looked_up_ref) == 0);
599
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
600
-
601
- /* ...and the ref now happily lives in the file system */
602
- git_path_join(temp_path, repo->path_repository, brand_new_name);
603
- must_pass(git_futils_exists(temp_path));
604
-
605
- close_temp_repo(repo);
606
-
607
- git_reference_free(looked_up_ref);
608
- git_reference_free(another_looked_up_ref);
609
- END_TEST
610
-
611
- BEGIN_TEST(rename2, "renaming a packed reference does not pack another reference which happens to be in both loose and pack state")
612
- git_reference *looked_up_ref, *another_looked_up_ref;
613
- git_repository *repo;
614
- char temp_path[GIT_PATH_MAX];
615
- const char *brand_new_name = "refs/heads/brand_new_name";
616
-
617
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
618
-
619
- /* Ensure the other reference exists on the file system */
620
- git_path_join(temp_path, repo->path_repository, packed_test_head_name);
621
- must_pass(git_futils_exists(temp_path));
622
-
623
- /* Lookup the other reference */
624
- must_pass(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
625
-
626
- /* Ensure it's loose */
627
- must_be_true(git_reference_is_packed(another_looked_up_ref) == 0);
628
-
629
- /* Lookup the reference to rename */
630
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
631
-
632
- /* Ensure it's packed */
633
- must_be_true(git_reference_is_packed(looked_up_ref) != 0);
634
-
635
- /* Now that the reference is renamed... */
636
- must_pass(git_reference_rename(looked_up_ref, brand_new_name, 0));
637
-
638
- /* Lookup the other reference */
639
- must_pass(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
640
-
641
- /* Ensure it's loose */
642
- must_be_true(git_reference_is_packed(another_looked_up_ref) == 0);
643
-
644
- /* Ensure the other ref still exists on the file system */
645
- must_pass(git_futils_exists(temp_path));
646
-
647
- close_temp_repo(repo);
648
-
649
- git_reference_free(looked_up_ref);
650
- git_reference_free(another_looked_up_ref);
651
- END_TEST
652
-
653
- BEGIN_TEST(rename3, "can not rename a reference with the name of an existing reference")
654
- git_reference *looked_up_ref;
655
- git_repository *repo;
656
-
657
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
658
-
659
- /* An existing reference... */
660
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
661
-
662
- /* Can not be renamed to the name of another existing reference. */
663
- must_fail(git_reference_rename(looked_up_ref, packed_test_head_name, 0));
664
-
665
- /* Failure to rename it hasn't corrupted its state */
666
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
667
- must_be_true(!strcmp(looked_up_ref->name, packed_head_name));
668
-
669
- close_temp_repo(repo);
670
-
671
- git_reference_free(looked_up_ref);
672
- END_TEST
673
-
674
- BEGIN_TEST(rename4, "can not rename a reference with an invalid name")
675
- git_reference *looked_up_ref;
676
- git_repository *repo;
677
-
678
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
679
-
680
- /* An existing oid reference... */
681
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
682
-
683
- /* Can not be renamed with an invalid name. */
684
- must_fail(git_reference_rename(looked_up_ref, "Hello! I'm a very invalid name.", 0));
685
-
686
- /* Can not be renamed outside of the refs hierarchy. */
687
- must_fail(git_reference_rename(looked_up_ref, "i-will-sudo-you", 0));
688
-
689
- /* Failure to rename it hasn't corrupted its state */
690
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
691
- must_be_true(!strcmp(looked_up_ref->name, packed_test_head_name));
692
-
693
- close_temp_repo(repo);
694
-
695
- git_reference_free(looked_up_ref);
696
- END_TEST
697
-
698
- BEGIN_TEST(rename5, "can force-rename a packed reference with the name of an existing loose and packed reference")
699
- git_reference *looked_up_ref;
700
- git_repository *repo;
701
- git_oid oid;
702
-
703
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
704
-
705
- /* An existing reference... */
706
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
707
- git_oid_cpy(&oid, git_reference_oid(looked_up_ref));
708
-
709
- /* Can be force-renamed to the name of another existing reference. */
710
- must_pass(git_reference_rename(looked_up_ref, packed_test_head_name, 1));
711
-
712
- /* Check we actually renamed it */
713
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
714
- must_be_true(!strcmp(looked_up_ref->name, packed_test_head_name));
715
- must_be_true(!git_oid_cmp(&oid, git_reference_oid(looked_up_ref)));
716
-
717
- /* And that the previous one doesn't exist any longer */
718
- must_fail(git_reference_lookup(&looked_up_ref, repo, packed_head_name));
719
-
720
- close_temp_repo(repo);
721
-
722
- git_reference_free(looked_up_ref);
723
- END_TEST
724
-
725
- BEGIN_TEST(rename6, "can force-rename a loose reference with the name of an existing loose reference")
726
- git_reference *looked_up_ref;
727
- git_repository *repo;
728
- git_oid oid;
729
-
730
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
731
-
732
- /* An existing reference... */
733
- must_pass(git_reference_lookup(&looked_up_ref, repo, "refs/heads/br2"));
734
- git_oid_cpy(&oid, git_reference_oid(looked_up_ref));
735
-
736
- /* Can be force-renamed to the name of another existing reference. */
737
- must_pass(git_reference_rename(looked_up_ref, "refs/heads/test", 1));
738
-
739
- /* Check we actually renamed it */
740
- must_pass(git_reference_lookup(&looked_up_ref, repo, "refs/heads/test"));
741
- must_be_true(!strcmp(looked_up_ref->name, "refs/heads/test"));
742
- must_be_true(!git_oid_cmp(&oid, git_reference_oid(looked_up_ref)));
743
-
744
- /* And that the previous one doesn't exist any longer */
745
- must_fail(git_reference_lookup(&looked_up_ref, repo, "refs/heads/br2"));
746
-
747
- close_temp_repo(repo);
748
-
749
- git_reference_free(looked_up_ref);
750
- END_TEST
751
-
752
- static const char *ref_one_name = "refs/heads/one/branch";
753
- static const char *ref_one_name_new = "refs/heads/two/branch";
754
- static const char *ref_two_name = "refs/heads/two";
755
-
756
- BEGIN_TEST(rename7, "can not overwrite name of existing reference")
757
- git_reference *ref, *ref_one, *ref_one_new, *ref_two;
758
- git_repository *repo;
759
- git_oid id;
760
-
761
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
762
-
763
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
764
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
765
-
766
- git_oid_cpy(&id, git_reference_oid(ref));
767
-
768
- /* Create loose references */
769
- must_pass(git_reference_create_oid(&ref_one, repo, ref_one_name, &id, 0));
770
- must_pass(git_reference_create_oid(&ref_two, repo, ref_two_name, &id, 0));
771
-
772
- /* Pack everything */
773
- must_pass(git_reference_packall(repo));
774
-
775
- /* Attempt to create illegal reference */
776
- must_fail(git_reference_create_oid(&ref_one_new, repo, ref_one_name_new, &id, 0));
777
-
778
- /* Illegal reference couldn't be created so this is supposed to fail */
779
- must_fail(git_reference_lookup(&ref_one_new, repo, ref_one_name_new));
780
-
781
- close_temp_repo(repo);
782
-
783
- git_reference_free(ref);
784
- git_reference_free(ref_one);
785
- git_reference_free(ref_one_new);
786
- git_reference_free(ref_two);
787
- END_TEST
788
-
789
- static const char *ref_two_name_new = "refs/heads/two/two";
790
-
791
- BEGIN_TEST(rename8, "can be renamed to a new name prefixed with the old name")
792
- git_reference *ref, *ref_two, *looked_up_ref;
793
- git_repository *repo;
794
- git_oid id;
795
-
796
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
797
-
798
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
799
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
800
-
801
- git_oid_cpy(&id, git_reference_oid(ref));
802
-
803
- /* Create loose references */
804
- must_pass(git_reference_create_oid(&ref_two, repo, ref_two_name, &id, 0));
805
-
806
- /* An existing reference... */
807
- must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name));
808
-
809
- /* Can be rename to a new name starting with the old name. */
810
- must_pass(git_reference_rename(looked_up_ref, ref_two_name_new, 0));
811
-
812
- /* Check we actually renamed it */
813
- must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name_new));
814
- must_be_true(!strcmp(looked_up_ref->name, ref_two_name_new));
815
- must_fail(git_reference_lookup(&looked_up_ref, repo, ref_two_name));
816
-
817
- close_temp_repo(repo);
818
-
819
- git_reference_free(ref);
820
- git_reference_free(ref_two);
821
- git_reference_free(looked_up_ref);
822
- END_TEST
823
-
824
- BEGIN_TEST(rename9, "can move a reference to a upper reference hierarchy")
825
- git_reference *ref, *ref_two, *looked_up_ref;
826
- git_repository *repo;
827
- git_oid id;
828
-
829
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
830
-
831
- must_pass(git_reference_lookup(&ref, repo, ref_master_name));
832
- must_be_true(git_reference_type(ref) & GIT_REF_OID);
833
-
834
- git_oid_cpy(&id, git_reference_oid(ref));
835
-
836
- /* Create loose references */
837
- must_pass(git_reference_create_oid(&ref_two, repo, ref_two_name_new, &id, 0));
838
-
839
- /* An existing reference... */
840
- must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name_new));
841
-
842
- /* Can be renamed upward the reference tree. */
843
- must_pass(git_reference_rename(looked_up_ref, ref_two_name, 0));
844
-
845
- /* Check we actually renamed it */
846
- must_pass(git_reference_lookup(&looked_up_ref, repo, ref_two_name));
847
- must_be_true(!strcmp(looked_up_ref->name, ref_two_name));
848
- must_fail(git_reference_lookup(&looked_up_ref, repo, ref_two_name_new));
849
-
850
- close_temp_repo(repo);
851
- END_TEST
852
-
853
- BEGIN_TEST(delete0, "deleting a ref which is both packed and loose should remove both tracks in the filesystem")
854
- git_reference *looked_up_ref, *another_looked_up_ref;
855
- git_repository *repo;
856
- char temp_path[GIT_PATH_MAX];
857
-
858
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
859
-
860
- /* Ensure the loose reference exists on the file system */
861
- git_path_join(temp_path, repo->path_repository, packed_test_head_name);
862
- must_pass(git_futils_exists(temp_path));
863
-
864
- /* Lookup the reference */
865
- must_pass(git_reference_lookup(&looked_up_ref, repo, packed_test_head_name));
866
-
867
- /* Ensure it's the loose version that has been found */
868
- must_be_true(git_reference_is_packed(looked_up_ref) == 0);
869
-
870
- /* Now that the reference is deleted... */
871
- must_pass(git_reference_delete(looked_up_ref));
872
-
873
- /* Looking up the reference once again should not retrieve it */
874
- must_fail(git_reference_lookup(&another_looked_up_ref, repo, packed_test_head_name));
875
-
876
- /* Ensure the loose reference doesn't exist any longer on the file system */
877
- must_pass(!git_futils_exists(temp_path));
878
-
879
- close_temp_repo(repo);
880
-
881
- git_reference_free(another_looked_up_ref);
882
- END_TEST
883
-
884
- BEGIN_TEST(delete1, "can delete a just packed reference")
885
- git_reference *ref;
886
- git_repository *repo;
887
- git_oid id;
888
- const char *new_ref = "refs/heads/new_ref";
889
-
890
- git_oid_fromstr(&id, current_master_tip);
891
-
892
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
893
-
894
- /* Create and write the new object id reference */
895
- must_pass(git_reference_create_oid(&ref, repo, new_ref, &id, 0));
896
-
897
- /* Lookup the reference */
898
- must_pass(git_reference_lookup(&ref, repo, new_ref));
899
-
900
- /* Ensure it's a loose reference */
901
- must_be_true(git_reference_is_packed(ref) == 0);
902
-
903
- /* Pack all existing references */
904
- must_pass(git_reference_packall(repo));
905
-
906
- /* Reload the reference from disk */
907
- must_pass(git_reference_reload(ref));
908
-
909
- /* Ensure it's a packed reference */
910
- must_be_true(git_reference_is_packed(ref) == 1);
911
-
912
- /* This should pass */
913
- must_pass(git_reference_delete(ref));
914
-
915
- close_temp_repo(repo);
916
- END_TEST
917
-
918
- static int ensure_refname_normalized(int is_oid_ref, const char *input_refname, const char *expected_refname)
919
- {
920
- int error = GIT_SUCCESS;
921
- char buffer_out[GIT_REFNAME_MAX];
922
-
923
- if (is_oid_ref)
924
- error = git_reference__normalize_name_oid(buffer_out, sizeof(buffer_out), input_refname);
925
- else
926
- error = git_reference__normalize_name(buffer_out, sizeof(buffer_out), input_refname);
927
-
928
- if (error < GIT_SUCCESS)
929
- return error;
930
-
931
- if (expected_refname == NULL)
932
- return error;
933
-
934
- if (strcmp(buffer_out, expected_refname))
935
- error = GIT_ERROR;
936
-
937
- return error;
938
- }
939
-
940
- #define OID_REF 1
941
- #define SYM_REF 0
942
-
943
- BEGIN_TEST(normalize0, "normalize a direct (OID) reference name")
944
- must_fail(ensure_refname_normalized(OID_REF, "a", NULL));
945
- must_fail(ensure_refname_normalized(OID_REF, "", NULL));
946
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a/", NULL));
947
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a.", NULL));
948
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/a.lock", NULL));
949
- must_pass(ensure_refname_normalized(OID_REF, "refs/dummy/a", NULL));
950
- must_pass(ensure_refname_normalized(OID_REF, "refs/stash", NULL));
951
- must_pass(ensure_refname_normalized(OID_REF, "refs/tags/a", "refs/tags/a"));
952
- must_pass(ensure_refname_normalized(OID_REF, "refs/heads/a/b", "refs/heads/a/b"));
953
- must_pass(ensure_refname_normalized(OID_REF, "refs/heads/a./b", "refs/heads/a./b"));
954
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo?bar", NULL));
955
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads\foo", NULL));
956
- must_pass(ensure_refname_normalized(OID_REF, "refs/heads/v@ation", "refs/heads/v@ation"));
957
- must_pass(ensure_refname_normalized(OID_REF, "refs///heads///a", "refs/heads/a"));
958
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/.a/b", NULL));
959
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo/../bar", NULL));
960
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/foo..bar", NULL));
961
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/./foo", NULL));
962
- must_fail(ensure_refname_normalized(OID_REF, "refs/heads/v@{ation", NULL));
963
- END_TEST
964
-
965
- BEGIN_TEST(normalize1, "normalize a symbolic reference name")
966
- must_pass(ensure_refname_normalized(SYM_REF, "a", "a"));
967
- must_pass(ensure_refname_normalized(SYM_REF, "a/b", "a/b"));
968
- must_pass(ensure_refname_normalized(SYM_REF, "refs///heads///a", "refs/heads/a"));
969
- must_fail(ensure_refname_normalized(SYM_REF, "", NULL));
970
- must_fail(ensure_refname_normalized(SYM_REF, "heads\foo", NULL));
971
- END_TEST
972
-
973
- /* Ported from JGit, BSD licence.
974
- * See https://github.com/spearce/JGit/commit/e4bf8f6957bbb29362575d641d1e77a02d906739 */
975
- BEGIN_TEST(normalize2, "tests borrowed from JGit")
976
-
977
- /* EmptyString */
978
- must_fail(ensure_refname_normalized(SYM_REF, "", NULL));
979
- must_fail(ensure_refname_normalized(SYM_REF, "/", NULL));
980
-
981
- /* MustHaveTwoComponents */
982
- must_fail(ensure_refname_normalized(OID_REF, "master", NULL));
983
- must_pass(ensure_refname_normalized(SYM_REF, "heads/master", "heads/master"));
984
-
985
- /* ValidHead */
986
-
987
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/master", "refs/heads/master"));
988
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/pu", "refs/heads/pu"));
989
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/z", "refs/heads/z"));
990
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/FoO", "refs/heads/FoO"));
991
-
992
- /* ValidTag */
993
- must_pass(ensure_refname_normalized(SYM_REF, "refs/tags/v1.0", "refs/tags/v1.0"));
994
-
995
- /* NoLockSuffix */
996
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master.lock", NULL));
997
-
998
- /* NoDirectorySuffix */
999
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master/", NULL));
1000
-
1001
- /* NoSpace */
1002
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/i haz space", NULL));
1003
-
1004
- /* NoAsciiControlCharacters */
1005
- {
1006
- char c;
1007
- char buffer[GIT_REFNAME_MAX];
1008
- for (c = '\1'; c < ' '; c++) {
1009
- strncpy(buffer, "refs/heads/mast", 15);
1010
- strncpy(buffer + 15, (const char *)&c, 1);
1011
- strncpy(buffer + 16, "er", 2);
1012
- buffer[18 - 1] = '\0';
1013
- must_fail(ensure_refname_normalized(SYM_REF, buffer, NULL));
1014
- }
1015
- }
1016
-
1017
- /* NoBareDot */
1018
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/.", NULL));
1019
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/..", NULL));
1020
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/./master", NULL));
1021
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/../master", NULL));
1022
-
1023
- /* NoLeadingOrTrailingDot */
1024
- must_fail(ensure_refname_normalized(SYM_REF, ".", NULL));
1025
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/.bar", NULL));
1026
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/..bar", NULL));
1027
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/bar.", NULL));
1028
-
1029
- /* ContainsDot */
1030
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/m.a.s.t.e.r", "refs/heads/m.a.s.t.e.r"));
1031
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master..pu", NULL));
1032
-
1033
- /* NoMagicRefCharacters */
1034
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master^", NULL));
1035
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/^master", NULL));
1036
- must_fail(ensure_refname_normalized(SYM_REF, "^refs/heads/master", NULL));
1037
-
1038
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master~", NULL));
1039
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/~master", NULL));
1040
- must_fail(ensure_refname_normalized(SYM_REF, "~refs/heads/master", NULL));
1041
-
1042
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master:", NULL));
1043
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/:master", NULL));
1044
- must_fail(ensure_refname_normalized(SYM_REF, ":refs/heads/master", NULL));
1045
-
1046
- /* ShellGlob */
1047
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master?", NULL));
1048
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/?master", NULL));
1049
- must_fail(ensure_refname_normalized(SYM_REF, "?refs/heads/master", NULL));
1050
-
1051
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master[", NULL));
1052
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/[master", NULL));
1053
- must_fail(ensure_refname_normalized(SYM_REF, "[refs/heads/master", NULL));
1054
-
1055
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master*", NULL));
1056
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/*master", NULL));
1057
- must_fail(ensure_refname_normalized(SYM_REF, "*refs/heads/master", NULL));
1058
-
1059
- /* ValidSpecialCharacters */
1060
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/!", "refs/heads/!"));
1061
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/\"", "refs/heads/\""));
1062
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/#", "refs/heads/#"));
1063
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/$", "refs/heads/$"));
1064
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/%", "refs/heads/%"));
1065
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/&", "refs/heads/&"));
1066
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/'", "refs/heads/'"));
1067
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/(", "refs/heads/("));
1068
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/)", "refs/heads/)"));
1069
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/+", "refs/heads/+"));
1070
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/,", "refs/heads/,"));
1071
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/-", "refs/heads/-"));
1072
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/;", "refs/heads/;"));
1073
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/<", "refs/heads/<"));
1074
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/=", "refs/heads/="));
1075
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/>", "refs/heads/>"));
1076
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/@", "refs/heads/@"));
1077
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/]", "refs/heads/]"));
1078
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/_", "refs/heads/_"));
1079
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/`", "refs/heads/`"));
1080
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/{", "refs/heads/{"));
1081
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/|", "refs/heads/|"));
1082
- must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/}", "refs/heads/}"));
1083
-
1084
- // This is valid on UNIX, but not on Windows
1085
- // hence we make in invalid due to non-portability
1086
- //
1087
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/\\", NULL));
1088
-
1089
- /* UnicodeNames */
1090
- /*
1091
- * Currently this fails.
1092
- * must_pass(ensure_refname_normalized(SYM_REF, "refs/heads/\u00e5ngstr\u00f6m", "refs/heads/\u00e5ngstr\u00f6m"));
1093
- */
1094
-
1095
- /* RefLogQueryIsValidRef */
1096
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master@{1}", NULL));
1097
- must_fail(ensure_refname_normalized(SYM_REF, "refs/heads/master@{1.hour.ago}", NULL));
1098
- END_TEST
1099
-
1100
- BEGIN_TEST(list0, "try to list all the references in our test repo")
1101
- git_repository *repo;
1102
- git_strarray ref_list;
1103
-
1104
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
1105
- must_pass(git_reference_listall(&ref_list, repo, GIT_REF_LISTALL));
1106
-
1107
- /*{
1108
- unsigned short i;
1109
- for (i = 0; i < ref_list.count; ++i)
1110
- printf("# %s\n", ref_list.strings[i]);
1111
- }*/
1112
-
1113
- /* We have exactly 9 refs in total if we include the packed ones:
1114
- * there is a reference that exists both in the packfile and as
1115
- * loose, but we only list it once */
1116
- must_be_true(ref_list.count == 9);
1117
-
1118
- git_strarray_free(&ref_list);
1119
- git_repository_free(repo);
1120
- END_TEST
1121
-
1122
- BEGIN_TEST(list1, "try to list only the symbolic references")
1123
- git_repository *repo;
1124
- git_strarray ref_list;
1125
-
1126
- must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
1127
- must_pass(git_reference_listall(&ref_list, repo, GIT_REF_SYMBOLIC));
1128
- must_be_true(ref_list.count == 0); /* no symrefs in the test repo */
1129
-
1130
- git_strarray_free(&ref_list);
1131
- git_repository_free(repo);
1132
- END_TEST
1133
-
1134
- static const char *new_ref = "refs/heads/test-reflog";
1135
- #define commit_msg "commit: bla bla"
1136
-
1137
- static int assert_signature(git_signature *expected, git_signature *actual)
1138
- {
1139
- if (actual == NULL)
1140
- return GIT_ERROR;
1141
-
1142
- if (strcmp(expected->name, actual->name) != 0)
1143
- return GIT_ERROR;
1144
-
1145
- if (strcmp(expected->email, actual->email) != 0)
1146
- return GIT_ERROR;
1147
-
1148
- if (expected->when.offset != actual->when.offset)
1149
- return GIT_ERROR;
1150
-
1151
- if (expected->when.time != actual->when.time)
1152
- return GIT_ERROR;
1153
-
1154
- return GIT_SUCCESS;
1155
- }
1156
-
1157
- BEGIN_TEST(reflog0, "write a reflog for a given reference and ensure it can be read back")
1158
- git_repository *repo, *repo2;
1159
- git_reference *ref, *lookedup_ref;
1160
- git_oid oid;
1161
- git_signature *committer;
1162
- git_reflog *reflog;
1163
- git_reflog_entry *entry;
1164
- char oid_str[GIT_OID_HEXSZ+1];
1165
-
1166
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
1167
-
1168
- /* Create a new branch pointing at the HEAD */
1169
- git_oid_fromstr(&oid, current_master_tip);
1170
- must_pass(git_reference_create_oid(&ref, repo, new_ref, &oid, 0));
1171
- must_pass(git_reference_lookup(&ref, repo, new_ref));
1172
-
1173
- must_pass(git_signature_now(&committer, "foo", "foo@bar"));
1174
-
1175
- must_pass(git_reflog_write(ref, NULL, committer, NULL));
1176
- must_fail(git_reflog_write(ref, NULL, committer, "no ancestor NULL for an existing reflog"));
1177
- must_fail(git_reflog_write(ref, NULL, committer, "no\nnewline"));
1178
- must_pass(git_reflog_write(ref, &oid, committer, commit_msg));
1179
-
1180
- git_repository_free(repo);
1181
-
1182
- /* Reopen a new instance of the repository */
1183
- must_pass(git_repository_open(&repo2, TEMP_REPO_FOLDER));
1184
-
1185
- /* Lookup the preivously created branch */
1186
- must_pass(git_reference_lookup(&lookedup_ref, repo2, new_ref));
1187
-
1188
- /* Read and parse the reflog for this branch */
1189
- must_pass(git_reflog_read(&reflog, lookedup_ref));
1190
- must_be_true(reflog->entries.length == 2);
1191
-
1192
- entry = (git_reflog_entry *)git_vector_get(&reflog->entries, 0);
1193
- must_pass(assert_signature(committer, entry->committer));
1194
- git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_old);
1195
- must_be_true(strcmp("0000000000000000000000000000000000000000", oid_str) == 0);
1196
- git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_cur);
1197
- must_be_true(strcmp(current_master_tip, oid_str) == 0);
1198
- must_be_true(entry->msg == NULL);
1199
-
1200
- entry = (git_reflog_entry *)git_vector_get(&reflog->entries, 1);
1201
- must_pass(assert_signature(committer, entry->committer));
1202
- git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_old);
1203
- must_be_true(strcmp(current_master_tip, oid_str) == 0);
1204
- git_oid_to_string(oid_str, GIT_OID_HEXSZ+1, &entry->oid_cur);
1205
- must_be_true(strcmp(current_master_tip, oid_str) == 0);
1206
- must_be_true(strcmp(commit_msg, entry->msg) == 0);
1207
-
1208
- git_signature_free(committer);
1209
- git_reflog_free(reflog);
1210
- close_temp_repo(repo2);
1211
-
1212
- git_reference_free(ref);
1213
- git_reference_free(lookedup_ref);
1214
- END_TEST
1215
-
1216
- BEGIN_TEST(reflog1, "avoid writing an obviously wrong reflog")
1217
- git_repository *repo;
1218
- git_reference *ref;
1219
- git_oid oid;
1220
- git_signature *committer;
1221
-
1222
- must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
1223
-
1224
- /* Create a new branch pointing at the HEAD */
1225
- git_oid_fromstr(&oid, current_master_tip);
1226
- must_pass(git_reference_create_oid(&ref, repo, new_ref, &oid, 0));
1227
- must_pass(git_reference_lookup(&ref, repo, new_ref));
1228
-
1229
- must_pass(git_signature_now(&committer, "foo", "foo@bar"));
1230
-
1231
- /* Write the reflog for the new branch */
1232
- must_pass(git_reflog_write(ref, NULL, committer, NULL));
1233
-
1234
- /* Try to update the reflog with wrong information:
1235
- * It's no new reference, so the ancestor OID cannot
1236
- * be NULL. */
1237
- must_fail(git_reflog_write(ref, NULL, committer, NULL));
1238
-
1239
- git_signature_free(committer);
1240
-
1241
- close_temp_repo(repo);
1242
-
1243
- git_reference_free(ref);
1244
- END_TEST
1245
-
1246
- BEGIN_SUITE(refs)
1247
- ADD_TEST(readtag0);
1248
- ADD_TEST(readtag1);
1249
-
1250
- ADD_TEST(readsym0);
1251
- ADD_TEST(readsym1);
1252
- ADD_TEST(readsym2);
1253
- ADD_TEST(readsym3);
1254
-
1255
- ADD_TEST(readpacked0);
1256
- ADD_TEST(readpacked1);
1257
-
1258
- ADD_TEST(create0);
1259
- ADD_TEST(create1);
1260
- ADD_TEST(create2);
1261
- ADD_TEST(create3);
1262
-
1263
- ADD_TEST(overwrite0);
1264
- ADD_TEST(overwrite1);
1265
- ADD_TEST(overwrite2);
1266
- ADD_TEST(overwrite3);
1267
-
1268
- ADD_TEST(normalize0);
1269
- ADD_TEST(normalize1);
1270
- ADD_TEST(normalize2);
1271
-
1272
- ADD_TEST(pack0);
1273
- ADD_TEST(pack1);
1274
-
1275
- ADD_TEST(rename0);
1276
- ADD_TEST(rename1);
1277
- ADD_TEST(rename2);
1278
- ADD_TEST(rename3);
1279
- ADD_TEST(rename4);
1280
- ADD_TEST(rename5);
1281
- ADD_TEST(rename6);
1282
- ADD_TEST(rename7);
1283
- ADD_TEST(rename8);
1284
- ADD_TEST(rename9);
1285
-
1286
- ADD_TEST(delete0);
1287
- ADD_TEST(delete1);
1288
-
1289
- ADD_TEST(list0);
1290
- ADD_TEST(list1);
1291
-
1292
- ADD_TEST(reflog0);
1293
- ADD_TEST(reflog1);
1294
- END_SUITE