rugged 0.27.10 → 0.27.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +0 -1
  4. data/vendor/libgit2/CMakeLists.txt +54 -98
  5. data/vendor/libgit2/COPYING +0 -28
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +1 -15
  7. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +8 -9
  8. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  9. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  10. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  11. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +0 -6
  12. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
  13. data/vendor/libgit2/deps/http-parser/{COPYING → LICENSE-MIT} +0 -0
  14. data/vendor/libgit2/deps/http-parser/http_parser.c +6 -11
  15. data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
  16. data/vendor/libgit2/deps/regex/config.h +7 -0
  17. data/vendor/libgit2/deps/regex/regcomp.c +3857 -0
  18. data/vendor/libgit2/deps/regex/regex.c +92 -0
  19. data/vendor/libgit2/deps/regex/regex.h +582 -0
  20. data/vendor/libgit2/deps/regex/regex_internal.c +1744 -0
  21. data/vendor/libgit2/deps/regex/regex_internal.h +819 -0
  22. data/vendor/libgit2/deps/regex/regexec.c +4369 -0
  23. data/vendor/libgit2/deps/zlib/CMakeLists.txt +0 -1
  24. data/vendor/libgit2/deps/zlib/adler32.c +7 -0
  25. data/vendor/libgit2/deps/zlib/crc32.c +7 -0
  26. data/vendor/libgit2/include/git2.h +0 -5
  27. data/vendor/libgit2/include/git2/annotated_commit.h +0 -9
  28. data/vendor/libgit2/include/git2/attr.h +20 -38
  29. data/vendor/libgit2/include/git2/blame.h +25 -42
  30. data/vendor/libgit2/include/git2/blob.h +13 -45
  31. data/vendor/libgit2/include/git2/branch.h +1 -1
  32. data/vendor/libgit2/include/git2/buffer.h +16 -22
  33. data/vendor/libgit2/include/git2/checkout.h +32 -65
  34. data/vendor/libgit2/include/git2/cherrypick.h +7 -9
  35. data/vendor/libgit2/include/git2/clone.h +10 -12
  36. data/vendor/libgit2/include/git2/commit.h +3 -53
  37. data/vendor/libgit2/include/git2/common.h +8 -60
  38. data/vendor/libgit2/include/git2/config.h +19 -30
  39. data/vendor/libgit2/include/git2/describe.h +9 -32
  40. data/vendor/libgit2/include/git2/diff.h +156 -208
  41. data/vendor/libgit2/include/git2/errors.h +46 -54
  42. data/vendor/libgit2/include/git2/filter.h +0 -8
  43. data/vendor/libgit2/include/git2/ignore.h +2 -2
  44. data/vendor/libgit2/include/git2/index.h +52 -74
  45. data/vendor/libgit2/include/git2/indexer.h +6 -76
  46. data/vendor/libgit2/include/git2/inttypes.h +309 -0
  47. data/vendor/libgit2/include/git2/merge.h +18 -35
  48. data/vendor/libgit2/include/git2/net.h +5 -0
  49. data/vendor/libgit2/include/git2/notes.h +1 -1
  50. data/vendor/libgit2/include/git2/object.h +29 -17
  51. data/vendor/libgit2/include/git2/odb.h +11 -12
  52. data/vendor/libgit2/include/git2/odb_backend.h +9 -10
  53. data/vendor/libgit2/include/git2/oid.h +2 -2
  54. data/vendor/libgit2/include/git2/pack.h +3 -14
  55. data/vendor/libgit2/include/git2/proxy.h +8 -14
  56. data/vendor/libgit2/include/git2/rebase.h +6 -53
  57. data/vendor/libgit2/include/git2/refs.h +15 -33
  58. data/vendor/libgit2/include/git2/refspec.h +0 -17
  59. data/vendor/libgit2/include/git2/remote.h +24 -123
  60. data/vendor/libgit2/include/git2/repository.h +39 -76
  61. data/vendor/libgit2/include/git2/revert.h +4 -6
  62. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  63. data/vendor/libgit2/include/git2/signature.h +2 -2
  64. data/vendor/libgit2/include/git2/stash.h +12 -15
  65. data/vendor/libgit2/include/git2/status.h +20 -33
  66. data/vendor/libgit2/include/git2/submodule.h +12 -30
  67. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  68. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  69. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  70. data/vendor/libgit2/include/git2/sys/index.h +0 -3
  71. data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
  72. data/vendor/libgit2/include/git2/sys/merge.h +4 -9
  73. data/vendor/libgit2/include/git2/sys/odb_backend.h +22 -66
  74. data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -76
  75. data/vendor/libgit2/include/git2/sys/repository.h +1 -5
  76. data/vendor/libgit2/include/git2/sys/stream.h +12 -92
  77. data/vendor/libgit2/include/git2/sys/time.h +31 -0
  78. data/vendor/libgit2/include/git2/sys/transport.h +83 -129
  79. data/vendor/libgit2/include/git2/tag.h +4 -13
  80. data/vendor/libgit2/include/git2/trace.h +2 -2
  81. data/vendor/libgit2/include/git2/transaction.h +0 -1
  82. data/vendor/libgit2/include/git2/transport.h +311 -11
  83. data/vendor/libgit2/include/git2/tree.h +4 -4
  84. data/vendor/libgit2/include/git2/types.h +111 -33
  85. data/vendor/libgit2/include/git2/version.h +4 -4
  86. data/vendor/libgit2/include/git2/worktree.h +13 -48
  87. data/vendor/libgit2/libgit2.pc.in +13 -0
  88. data/vendor/libgit2/src/CMakeLists.txt +164 -96
  89. data/vendor/libgit2/src/annotated_commit.c +8 -15
  90. data/vendor/libgit2/src/apply.c +31 -537
  91. data/vendor/libgit2/src/apply.h +1 -3
  92. data/vendor/libgit2/src/array.h +2 -2
  93. data/vendor/libgit2/src/attr.c +75 -81
  94. data/vendor/libgit2/src/attr_file.c +121 -207
  95. data/vendor/libgit2/src/attr_file.h +9 -9
  96. data/vendor/libgit2/src/attrcache.c +53 -51
  97. data/vendor/libgit2/src/attrcache.h +1 -2
  98. data/vendor/libgit2/src/blame.c +20 -47
  99. data/vendor/libgit2/src/blame.h +1 -2
  100. data/vendor/libgit2/src/blame_git.c +20 -37
  101. data/vendor/libgit2/src/blob.c +42 -128
  102. data/vendor/libgit2/src/blob.h +2 -19
  103. data/vendor/libgit2/src/branch.c +43 -67
  104. data/vendor/libgit2/src/buf_text.c +6 -7
  105. data/vendor/libgit2/src/buffer.c +57 -69
  106. data/vendor/libgit2/src/buffer.h +1 -1
  107. data/vendor/libgit2/src/cache.c +45 -38
  108. data/vendor/libgit2/src/cache.h +3 -3
  109. data/vendor/libgit2/src/cc-compat.h +3 -20
  110. data/vendor/libgit2/src/checkout.c +90 -109
  111. data/vendor/libgit2/src/cherrypick.c +9 -15
  112. data/vendor/libgit2/src/clone.c +27 -49
  113. data/vendor/libgit2/src/clone.h +0 -4
  114. data/vendor/libgit2/src/commit.c +49 -117
  115. data/vendor/libgit2/src/commit.h +0 -7
  116. data/vendor/libgit2/src/commit_list.c +78 -30
  117. data/vendor/libgit2/src/commit_list.h +2 -2
  118. data/vendor/libgit2/src/common.h +91 -27
  119. data/vendor/libgit2/src/config.c +176 -194
  120. data/vendor/libgit2/src/config.h +20 -8
  121. data/vendor/libgit2/src/config_cache.c +35 -41
  122. data/vendor/libgit2/src/config_file.c +753 -439
  123. data/vendor/libgit2/src/config_file.h +73 -0
  124. data/vendor/libgit2/src/config_parse.c +63 -114
  125. data/vendor/libgit2/src/config_parse.h +16 -17
  126. data/vendor/libgit2/src/crlf.c +190 -219
  127. data/vendor/libgit2/src/delta.c +18 -25
  128. data/vendor/libgit2/src/describe.c +41 -42
  129. data/vendor/libgit2/src/diff.c +68 -53
  130. data/vendor/libgit2/src/diff.h +1 -2
  131. data/vendor/libgit2/src/diff_driver.c +49 -47
  132. data/vendor/libgit2/src/diff_file.c +17 -19
  133. data/vendor/libgit2/src/diff_file.h +1 -1
  134. data/vendor/libgit2/src/diff_generate.c +106 -162
  135. data/vendor/libgit2/src/diff_generate.h +3 -3
  136. data/vendor/libgit2/src/diff_parse.c +4 -4
  137. data/vendor/libgit2/src/diff_print.c +30 -42
  138. data/vendor/libgit2/src/diff_stats.c +7 -22
  139. data/vendor/libgit2/src/diff_tform.c +16 -16
  140. data/vendor/libgit2/src/diff_xdiff.c +3 -15
  141. data/vendor/libgit2/src/errors.c +39 -51
  142. data/vendor/libgit2/src/features.h.in +3 -11
  143. data/vendor/libgit2/src/fetch.c +5 -10
  144. data/vendor/libgit2/src/fetchhead.c +17 -17
  145. data/vendor/libgit2/src/filebuf.c +36 -32
  146. data/vendor/libgit2/src/filebuf.h +2 -2
  147. data/vendor/libgit2/src/{futils.c → fileops.c} +73 -80
  148. data/vendor/libgit2/src/{futils.h → fileops.h} +6 -6
  149. data/vendor/libgit2/src/filter.c +38 -46
  150. data/vendor/libgit2/src/filter.h +10 -0
  151. data/vendor/libgit2/src/fnmatch.c +248 -0
  152. data/vendor/libgit2/src/fnmatch.h +48 -0
  153. data/vendor/libgit2/src/global.c +63 -48
  154. data/vendor/libgit2/src/global.h +2 -0
  155. data/vendor/libgit2/src/hash.c +0 -61
  156. data/vendor/libgit2/src/hash.h +19 -20
  157. data/vendor/libgit2/src/hash/hash_collisiondetect.h +47 -0
  158. data/vendor/libgit2/src/hash/{sha1/common_crypto.c → hash_common_crypto.h} +17 -17
  159. data/vendor/libgit2/src/hash/{sha1/generic.c → hash_generic.c} +10 -22
  160. data/vendor/libgit2/src/hash/{sha1/generic.h → hash_generic.h} +10 -4
  161. data/vendor/libgit2/src/hash/hash_openssl.h +59 -0
  162. data/vendor/libgit2/src/hash/{sha1/win32.c → hash_win32.c} +37 -47
  163. data/vendor/libgit2/src/hash/{sha1/win32.h → hash_win32.h} +19 -6
  164. data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.c +3 -14
  165. data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.h +0 -0
  166. data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.c +0 -0
  167. data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.h +0 -0
  168. data/vendor/libgit2/src/hashsig.c +5 -5
  169. data/vendor/libgit2/src/idxmap.c +61 -107
  170. data/vendor/libgit2/src/idxmap.h +31 -153
  171. data/vendor/libgit2/src/ignore.c +47 -43
  172. data/vendor/libgit2/src/index.c +232 -337
  173. data/vendor/libgit2/src/index.h +1 -17
  174. data/vendor/libgit2/src/indexer.c +175 -346
  175. data/vendor/libgit2/src/integer.h +26 -71
  176. data/vendor/libgit2/src/iterator.c +70 -142
  177. data/vendor/libgit2/src/iterator.h +0 -15
  178. data/vendor/libgit2/src/khash.h +1 -3
  179. data/vendor/libgit2/src/map.h +1 -1
  180. data/vendor/libgit2/src/merge.c +100 -144
  181. data/vendor/libgit2/src/merge_driver.c +11 -11
  182. data/vendor/libgit2/src/merge_file.c +2 -2
  183. data/vendor/libgit2/src/mwindow.c +29 -24
  184. data/vendor/libgit2/src/mwindow.h +4 -4
  185. data/vendor/libgit2/src/netops.c +156 -55
  186. data/vendor/libgit2/src/netops.h +23 -3
  187. data/vendor/libgit2/src/notes.c +11 -16
  188. data/vendor/libgit2/src/object.c +69 -120
  189. data/vendor/libgit2/src/object.h +9 -22
  190. data/vendor/libgit2/src/object_api.c +8 -8
  191. data/vendor/libgit2/src/odb.c +93 -116
  192. data/vendor/libgit2/src/odb.h +7 -8
  193. data/vendor/libgit2/src/odb_loose.c +55 -62
  194. data/vendor/libgit2/src/odb_mempack.c +34 -21
  195. data/vendor/libgit2/src/odb_pack.c +14 -18
  196. data/vendor/libgit2/src/offmap.c +35 -53
  197. data/vendor/libgit2/src/offmap.h +21 -108
  198. data/vendor/libgit2/src/oid.c +7 -12
  199. data/vendor/libgit2/src/oidmap.c +47 -49
  200. data/vendor/libgit2/src/oidmap.h +24 -101
  201. data/vendor/libgit2/src/pack-objects.c +87 -88
  202. data/vendor/libgit2/src/pack-objects.h +8 -2
  203. data/vendor/libgit2/src/pack.c +101 -99
  204. data/vendor/libgit2/src/pack.h +19 -17
  205. data/vendor/libgit2/src/parse.c +0 -10
  206. data/vendor/libgit2/src/parse.h +3 -3
  207. data/vendor/libgit2/src/patch.c +4 -4
  208. data/vendor/libgit2/src/patch_generate.c +20 -20
  209. data/vendor/libgit2/src/patch_parse.c +63 -151
  210. data/vendor/libgit2/src/path.c +104 -117
  211. data/vendor/libgit2/src/path.h +71 -3
  212. data/vendor/libgit2/src/pathspec.c +19 -19
  213. data/vendor/libgit2/src/pool.c +22 -26
  214. data/vendor/libgit2/src/pool.h +7 -7
  215. data/vendor/libgit2/src/posix.c +10 -10
  216. data/vendor/libgit2/src/posix.h +1 -12
  217. data/vendor/libgit2/src/proxy.c +3 -8
  218. data/vendor/libgit2/src/push.c +31 -37
  219. data/vendor/libgit2/src/push.h +1 -2
  220. data/vendor/libgit2/src/rebase.c +59 -115
  221. data/vendor/libgit2/src/refdb.c +3 -15
  222. data/vendor/libgit2/src/refdb_fs.c +254 -381
  223. data/vendor/libgit2/src/reflog.c +15 -13
  224. data/vendor/libgit2/src/refs.c +88 -118
  225. data/vendor/libgit2/src/refs.h +3 -5
  226. data/vendor/libgit2/src/refspec.c +37 -56
  227. data/vendor/libgit2/src/refspec.h +1 -1
  228. data/vendor/libgit2/src/remote.c +215 -266
  229. data/vendor/libgit2/src/remote.h +2 -11
  230. data/vendor/libgit2/src/repository.c +225 -280
  231. data/vendor/libgit2/src/repository.h +40 -52
  232. data/vendor/libgit2/src/reset.c +8 -8
  233. data/vendor/libgit2/src/revert.c +9 -14
  234. data/vendor/libgit2/src/revparse.c +48 -47
  235. data/vendor/libgit2/src/revwalk.c +57 -120
  236. data/vendor/libgit2/src/revwalk.h +1 -22
  237. data/vendor/libgit2/src/settings.c +10 -47
  238. data/vendor/libgit2/src/signature.c +11 -11
  239. data/vendor/libgit2/src/sortedcache.c +36 -22
  240. data/vendor/libgit2/src/sortedcache.h +1 -1
  241. data/vendor/libgit2/src/stash.c +99 -125
  242. data/vendor/libgit2/src/status.c +22 -28
  243. data/vendor/libgit2/src/stream.h +2 -17
  244. data/vendor/libgit2/src/streams/curl.c +385 -0
  245. data/vendor/libgit2/src/{allocators/stdalloc.h → streams/curl.h} +5 -5
  246. data/vendor/libgit2/src/streams/openssl.c +114 -224
  247. data/vendor/libgit2/src/streams/openssl.h +108 -4
  248. data/vendor/libgit2/src/streams/socket.c +30 -55
  249. data/vendor/libgit2/src/streams/stransport.c +32 -57
  250. data/vendor/libgit2/src/streams/stransport.h +0 -5
  251. data/vendor/libgit2/src/streams/tls.c +19 -50
  252. data/vendor/libgit2/src/streams/tls.h +4 -12
  253. data/vendor/libgit2/src/strmap.c +74 -47
  254. data/vendor/libgit2/src/strmap.h +33 -108
  255. data/vendor/libgit2/src/submodule.c +216 -272
  256. data/vendor/libgit2/src/submodule.h +1 -1
  257. data/vendor/libgit2/src/sysdir.c +19 -29
  258. data/vendor/libgit2/src/tag.c +28 -41
  259. data/vendor/libgit2/src/tag.h +1 -2
  260. data/vendor/libgit2/src/trace.c +2 -2
  261. data/vendor/libgit2/src/trace.h +3 -3
  262. data/vendor/libgit2/src/trailer.c +38 -52
  263. data/vendor/libgit2/src/transaction.c +29 -30
  264. data/vendor/libgit2/src/transport.c +5 -5
  265. data/vendor/libgit2/src/transports/auth.c +11 -15
  266. data/vendor/libgit2/src/transports/auth.h +3 -10
  267. data/vendor/libgit2/src/transports/auth_negotiate.c +18 -33
  268. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  269. data/vendor/libgit2/src/transports/cred.c +24 -24
  270. data/vendor/libgit2/src/{allocators/win32_crtdbg.h → transports/cred.h} +4 -5
  271. data/vendor/libgit2/src/transports/git.c +31 -26
  272. data/vendor/libgit2/src/transports/http.c +348 -881
  273. data/vendor/libgit2/src/transports/http.h +0 -2
  274. data/vendor/libgit2/src/transports/local.c +35 -35
  275. data/vendor/libgit2/src/transports/smart.c +47 -70
  276. data/vendor/libgit2/src/transports/smart.h +4 -3
  277. data/vendor/libgit2/src/transports/smart_pkt.c +40 -43
  278. data/vendor/libgit2/src/transports/smart_protocol.c +116 -96
  279. data/vendor/libgit2/src/transports/ssh.c +66 -77
  280. data/vendor/libgit2/src/transports/winhttp.c +314 -318
  281. data/vendor/libgit2/src/tree-cache.c +12 -19
  282. data/vendor/libgit2/src/tree.c +142 -103
  283. data/vendor/libgit2/src/tree.h +12 -1
  284. data/vendor/libgit2/src/unix/map.c +3 -3
  285. data/vendor/libgit2/src/unix/posix.h +11 -1
  286. data/vendor/libgit2/src/userdiff.h +1 -3
  287. data/vendor/libgit2/src/util.c +56 -70
  288. data/vendor/libgit2/src/util.h +156 -28
  289. data/vendor/libgit2/src/vector.c +4 -4
  290. data/vendor/libgit2/src/win32/dir.c +3 -3
  291. data/vendor/libgit2/src/win32/findfile.c +3 -3
  292. data/vendor/libgit2/src/win32/map.c +11 -9
  293. data/vendor/libgit2/src/win32/msvc-compat.h +0 -6
  294. data/vendor/libgit2/src/win32/path_w32.c +9 -113
  295. data/vendor/libgit2/src/win32/path_w32.h +29 -18
  296. data/vendor/libgit2/src/win32/posix.h +4 -1
  297. data/vendor/libgit2/src/win32/posix_w32.c +45 -70
  298. data/vendor/libgit2/src/win32/precompiled.h +2 -0
  299. data/vendor/libgit2/src/win32/thread.c +10 -5
  300. data/vendor/libgit2/src/win32/w32_buffer.c +5 -9
  301. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -3
  302. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -26
  303. data/vendor/libgit2/src/win32/w32_stack.c +11 -6
  304. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  305. data/vendor/libgit2/src/win32/w32_util.c +64 -27
  306. data/vendor/libgit2/src/win32/w32_util.h +49 -5
  307. data/vendor/libgit2/src/worktree.c +60 -95
  308. data/vendor/libgit2/src/worktree.h +0 -2
  309. data/vendor/libgit2/src/xdiff/xdiffi.c +5 -7
  310. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  311. data/vendor/libgit2/src/xdiff/xmerge.c +15 -27
  312. data/vendor/libgit2/src/xdiff/xpatience.c +0 -3
  313. data/vendor/libgit2/src/zstream.c +4 -4
  314. metadata +33 -122
  315. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +0 -28
  316. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +0 -38
  317. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +0 -37
  318. data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
  319. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +0 -110
  320. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +0 -53
  321. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +0 -124
  322. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +0 -66
  323. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +0 -21
  324. data/vendor/libgit2/deps/ntlmclient/compat.h +0 -33
  325. data/vendor/libgit2/deps/ntlmclient/crypt.h +0 -64
  326. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +0 -120
  327. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +0 -18
  328. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -145
  329. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +0 -18
  330. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +0 -130
  331. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +0 -21
  332. data/vendor/libgit2/deps/ntlmclient/ntlm.c +0 -1420
  333. data/vendor/libgit2/deps/ntlmclient/ntlm.h +0 -174
  334. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +0 -320
  335. data/vendor/libgit2/deps/ntlmclient/unicode.h +0 -36
  336. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +0 -445
  337. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +0 -201
  338. data/vendor/libgit2/deps/ntlmclient/utf8.h +0 -1257
  339. data/vendor/libgit2/deps/ntlmclient/util.c +0 -21
  340. data/vendor/libgit2/deps/ntlmclient/util.h +0 -14
  341. data/vendor/libgit2/deps/pcre/CMakeLists.txt +0 -140
  342. data/vendor/libgit2/deps/pcre/COPYING +0 -5
  343. data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +0 -22
  344. data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +0 -17
  345. data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +0 -58
  346. data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +0 -29
  347. data/vendor/libgit2/deps/pcre/config.h.in +0 -57
  348. data/vendor/libgit2/deps/pcre/pcre.h +0 -641
  349. data/vendor/libgit2/deps/pcre/pcre_byte_order.c +0 -319
  350. data/vendor/libgit2/deps/pcre/pcre_chartables.c +0 -198
  351. data/vendor/libgit2/deps/pcre/pcre_compile.c +0 -9800
  352. data/vendor/libgit2/deps/pcre/pcre_config.c +0 -190
  353. data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +0 -3676
  354. data/vendor/libgit2/deps/pcre/pcre_exec.c +0 -7173
  355. data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +0 -245
  356. data/vendor/libgit2/deps/pcre/pcre_get.c +0 -669
  357. data/vendor/libgit2/deps/pcre/pcre_globals.c +0 -86
  358. data/vendor/libgit2/deps/pcre/pcre_internal.h +0 -2787
  359. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +0 -11913
  360. data/vendor/libgit2/deps/pcre/pcre_maketables.c +0 -156
  361. data/vendor/libgit2/deps/pcre/pcre_newline.c +0 -210
  362. data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +0 -94
  363. data/vendor/libgit2/deps/pcre/pcre_printint.c +0 -834
  364. data/vendor/libgit2/deps/pcre/pcre_refcount.c +0 -92
  365. data/vendor/libgit2/deps/pcre/pcre_string_utils.c +0 -211
  366. data/vendor/libgit2/deps/pcre/pcre_study.c +0 -1686
  367. data/vendor/libgit2/deps/pcre/pcre_tables.c +0 -727
  368. data/vendor/libgit2/deps/pcre/pcre_ucd.c +0 -3644
  369. data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +0 -301
  370. data/vendor/libgit2/deps/pcre/pcre_version.c +0 -98
  371. data/vendor/libgit2/deps/pcre/pcre_xclass.c +0 -268
  372. data/vendor/libgit2/deps/pcre/pcreposix.c +0 -421
  373. data/vendor/libgit2/deps/pcre/pcreposix.h +0 -117
  374. data/vendor/libgit2/deps/pcre/ucp.h +0 -224
  375. data/vendor/libgit2/deps/winhttp/COPYING.GPL +0 -993
  376. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +0 -502
  377. data/vendor/libgit2/deps/zlib/COPYING +0 -27
  378. data/vendor/libgit2/include/git2/apply.h +0 -149
  379. data/vendor/libgit2/include/git2/cert.h +0 -135
  380. data/vendor/libgit2/include/git2/cred.h +0 -308
  381. data/vendor/libgit2/include/git2/deprecated.h +0 -493
  382. data/vendor/libgit2/include/git2/mailmap.h +0 -115
  383. data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
  384. data/vendor/libgit2/include/git2/sys/cred.h +0 -90
  385. data/vendor/libgit2/include/git2/sys/path.h +0 -64
  386. data/vendor/libgit2/src/alloc.c +0 -43
  387. data/vendor/libgit2/src/alloc.h +0 -40
  388. data/vendor/libgit2/src/allocators/stdalloc.c +0 -119
  389. data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
  390. data/vendor/libgit2/src/config_backend.h +0 -96
  391. data/vendor/libgit2/src/config_entries.c +0 -229
  392. data/vendor/libgit2/src/config_entries.h +0 -24
  393. data/vendor/libgit2/src/config_mem.c +0 -220
  394. data/vendor/libgit2/src/config_snapshot.c +0 -206
  395. data/vendor/libgit2/src/errors.h +0 -81
  396. data/vendor/libgit2/src/hash/sha1.h +0 -38
  397. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +0 -48
  398. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +0 -19
  399. data/vendor/libgit2/src/hash/sha1/common_crypto.h +0 -19
  400. data/vendor/libgit2/src/hash/sha1/mbedtls.c +0 -46
  401. data/vendor/libgit2/src/hash/sha1/mbedtls.h +0 -19
  402. data/vendor/libgit2/src/hash/sha1/openssl.c +0 -59
  403. data/vendor/libgit2/src/hash/sha1/openssl.h +0 -19
  404. data/vendor/libgit2/src/mailmap.c +0 -485
  405. data/vendor/libgit2/src/mailmap.h +0 -35
  406. data/vendor/libgit2/src/net.c +0 -184
  407. data/vendor/libgit2/src/net.h +0 -36
  408. data/vendor/libgit2/src/reader.c +0 -265
  409. data/vendor/libgit2/src/reader.h +0 -107
  410. data/vendor/libgit2/src/regexp.c +0 -221
  411. data/vendor/libgit2/src/regexp.h +0 -97
  412. data/vendor/libgit2/src/streams/mbedtls.c +0 -483
  413. data/vendor/libgit2/src/streams/mbedtls.h +0 -23
  414. data/vendor/libgit2/src/streams/registry.c +0 -118
  415. data/vendor/libgit2/src/streams/registry.h +0 -19
  416. data/vendor/libgit2/src/transports/auth_ntlm.c +0 -223
  417. data/vendor/libgit2/src/transports/auth_ntlm.h +0 -35
  418. data/vendor/libgit2/src/wildmatch.c +0 -320
  419. data/vendor/libgit2/src/wildmatch.h +0 -23
  420. data/vendor/libgit2/src/win32/w32_common.h +0 -39
@@ -17,7 +17,6 @@
17
17
  #include "map.h"
18
18
  #include "mwindow.h"
19
19
  #include "odb.h"
20
- #include "offmap.h"
21
20
  #include "oidmap.h"
22
21
  #include "array.h"
23
22
 
@@ -64,14 +63,17 @@ typedef struct git_pack_cache_entry {
64
63
  } git_pack_cache_entry;
65
64
 
66
65
  struct pack_chain_elem {
67
- off64_t base_key;
68
- off64_t offset;
66
+ git_off_t base_key;
67
+ git_off_t offset;
69
68
  size_t size;
70
- git_object_t type;
69
+ git_otype type;
71
70
  };
72
71
 
73
72
  typedef git_array_t(struct pack_chain_elem) git_dependency_chain;
74
73
 
74
+ #include "offmap.h"
75
+ #include "oidmap.h"
76
+
75
77
  #define GIT_PACK_CACHE_MEMORY_LIMIT 16 * 1024 * 1024
76
78
  #define GIT_PACK_CACHE_SIZE_LIMIT 1024 * 1024 /* don't bother caching anything over 1MB */
77
79
 
@@ -108,45 +110,45 @@ struct git_pack_file {
108
110
  };
109
111
 
110
112
  struct git_pack_entry {
111
- off64_t offset;
113
+ git_off_t offset;
112
114
  git_oid sha1;
113
115
  struct git_pack_file *p;
114
116
  };
115
117
 
116
118
  typedef struct git_packfile_stream {
117
- off64_t curpos;
119
+ git_off_t curpos;
118
120
  int done;
119
121
  z_stream zstream;
120
122
  struct git_pack_file *p;
121
123
  git_mwindow *mw;
122
124
  } git_packfile_stream;
123
125
 
124
- size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_object_t type);
126
+ size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type);
125
127
 
126
128
  int git_packfile__name(char **out, const char *path);
127
129
 
128
130
  int git_packfile_unpack_header(
129
131
  size_t *size_p,
130
- git_object_t *type_p,
132
+ git_otype *type_p,
131
133
  git_mwindow_file *mwf,
132
134
  git_mwindow **w_curs,
133
- off64_t *curpos);
135
+ git_off_t *curpos);
134
136
 
135
137
  int git_packfile_resolve_header(
136
138
  size_t *size_p,
137
- git_object_t *type_p,
139
+ git_otype *type_p,
138
140
  struct git_pack_file *p,
139
- off64_t offset);
141
+ git_off_t offset);
140
142
 
141
- int git_packfile_unpack(git_rawobj *obj, struct git_pack_file *p, off64_t *obj_offset);
143
+ int git_packfile_unpack(git_rawobj *obj, struct git_pack_file *p, git_off_t *obj_offset);
142
144
 
143
- int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, off64_t curpos);
145
+ int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, git_off_t curpos);
144
146
  ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t len);
145
- void git_packfile_stream_dispose(git_packfile_stream *obj);
147
+ void git_packfile_stream_free(git_packfile_stream *obj);
146
148
 
147
- off64_t get_delta_base(struct git_pack_file *p, git_mwindow **w_curs,
148
- off64_t *curpos, git_object_t type,
149
- off64_t delta_obj_offset);
149
+ git_off_t get_delta_base(struct git_pack_file *p, git_mwindow **w_curs,
150
+ git_off_t *curpos, git_otype type,
151
+ git_off_t delta_obj_offset);
150
152
 
151
153
  void git_packfile_close(struct git_pack_file *p, bool unlink_packfile);
152
154
  void git_packfile_free(struct git_pack_file *p);
@@ -101,16 +101,6 @@ int git_parse_advance_digit(int64_t *out, git_parse_ctx *ctx, int base)
101
101
  return 0;
102
102
  }
103
103
 
104
- int git_parse_advance_oid(git_oid *out, git_parse_ctx *ctx)
105
- {
106
- if (ctx->line_len < GIT_OID_HEXSZ)
107
- return -1;
108
- if ((git_oid_fromstrn(out, ctx->line, GIT_OID_HEXSZ)) < 0)
109
- return -1;
110
- git_parse_advance_chars(ctx, GIT_OID_HEXSZ);
111
- return 0;
112
- }
113
-
114
104
  int git_parse_peek(char *out, git_parse_ctx *ctx, int flags)
115
105
  {
116
106
  size_t remain = ctx->line_len;
@@ -23,11 +23,12 @@ typedef struct {
23
23
  size_t line_num;
24
24
  } git_parse_ctx;
25
25
 
26
- #define GIT_PARSE_CTX_INIT { 0 }
27
-
28
26
  int git_parse_ctx_init(git_parse_ctx *ctx, const char *content, size_t content_len);
29
27
  void git_parse_ctx_clear(git_parse_ctx *ctx);
30
28
 
29
+ #define git_parse_err(...) \
30
+ ( giterr_set(GITERR_PATCH, __VA_ARGS__), -1 )
31
+
31
32
  #define git_parse_ctx_contains_s(ctx, str) \
32
33
  git_parse_ctx_contains(ctx, str, sizeof(str) - 1)
33
34
 
@@ -50,7 +51,6 @@ int git_parse_advance_expected(
50
51
  int git_parse_advance_ws(git_parse_ctx *ctx);
51
52
  int git_parse_advance_nl(git_parse_ctx *ctx);
52
53
  int git_parse_advance_digit(int64_t *out, git_parse_ctx *ctx, int base);
53
- int git_parse_advance_oid(git_oid *out, git_parse_ctx *ctx);
54
54
 
55
55
  enum GIT_PARSE_PEEK_FLAGS {
56
56
  GIT_PARSE_PEEK_SKIP_WHITESPACE = (1 << 0)
@@ -79,12 +79,12 @@ size_t git_patch_size(
79
79
  git_buf file_header = GIT_BUF_INIT;
80
80
 
81
81
  if (git_diff_delta__format_file_header(
82
- &file_header, patch->delta, NULL, NULL, 0, true) < 0)
83
- git_error_clear();
82
+ &file_header, patch->delta, NULL, NULL, 0) < 0)
83
+ giterr_clear();
84
84
  else
85
85
  out += git_buf_len(&file_header);
86
86
 
87
- git_buf_dispose(&file_header);
87
+ git_buf_free(&file_header);
88
88
  }
89
89
 
90
90
  return out;
@@ -141,7 +141,7 @@ size_t git_patch_num_hunks(const git_patch *patch)
141
141
 
142
142
  static int patch_error_outofrange(const char *thing)
143
143
  {
144
- git_error_set(GIT_ERROR_INVALID, "patch %s index out of range", thing);
144
+ giterr_set(GITERR_INVALID, "patch %s index out of range", thing);
145
145
  return GIT_ENOTFOUND;
146
146
  }
147
147
 
@@ -15,7 +15,7 @@
15
15
  #include "diff_xdiff.h"
16
16
  #include "delta.h"
17
17
  #include "zstream.h"
18
- #include "futils.h"
18
+ #include "fileops.h"
19
19
 
20
20
  static void diff_output_init(
21
21
  git_patch_generated_output *, const git_diff_options *, git_diff_file_cb,
@@ -84,7 +84,7 @@ static int patch_generated_normalize_options(
84
84
  const git_diff_options *opts)
85
85
  {
86
86
  if (opts) {
87
- GIT_ERROR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
87
+ GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
88
88
  memcpy(out, opts, sizeof(git_diff_options));
89
89
  } else {
90
90
  git_diff_options default_opts = GIT_DIFF_OPTIONS_INIT;
@@ -99,8 +99,8 @@ static int patch_generated_normalize_options(
99
99
  git__strdup(opts->new_prefix) :
100
100
  git__strdup(DIFF_NEW_PREFIX_DEFAULT);
101
101
 
102
- GIT_ERROR_CHECK_ALLOC(out->old_prefix);
103
- GIT_ERROR_CHECK_ALLOC(out->new_prefix);
102
+ GITERR_CHECK_ALLOC(out->old_prefix);
103
+ GITERR_CHECK_ALLOC(out->new_prefix);
104
104
 
105
105
  return 0;
106
106
  }
@@ -135,7 +135,7 @@ static int patch_generated_alloc_from_diff(
135
135
  {
136
136
  int error;
137
137
  git_patch_generated *patch = git__calloc(1, sizeof(git_patch_generated));
138
- GIT_ERROR_CHECK_ALLOC(patch);
138
+ GITERR_CHECK_ALLOC(patch);
139
139
 
140
140
  if (!(error = patch_generated_init(patch, diff, delta_index))) {
141
141
  patch->flags |= GIT_PATCH_GENERATED_ALLOCATED;
@@ -248,7 +248,7 @@ static int patch_generated_invoke_file_callback(
248
248
  if (!output->file_cb)
249
249
  return 0;
250
250
 
251
- return git_error_set_after_callback_function(
251
+ return giterr_set_after_callback_function(
252
252
  output->file_cb(patch->base.delta, progress, output->payload),
253
253
  "git_patch");
254
254
  }
@@ -314,8 +314,8 @@ static int create_binary(
314
314
  }
315
315
 
316
316
  done:
317
- git_buf_dispose(&deflate);
318
- git_buf_dispose(&delta);
317
+ git_buf_free(&deflate);
318
+ git_buf_free(&delta);
319
319
 
320
320
  return error;
321
321
  }
@@ -350,7 +350,7 @@ static int diff_binary(git_patch_generated_output *output, git_patch_generated *
350
350
  return error;
351
351
  }
352
352
 
353
- error = git_error_set_after_callback_function(
353
+ error = giterr_set_after_callback_function(
354
354
  output->binary_cb(patch->base.delta, &binary, output->payload),
355
355
  "git_patch");
356
356
 
@@ -397,7 +397,7 @@ static int diff_required(git_diff *diff, const char *action)
397
397
  {
398
398
  if (diff)
399
399
  return 0;
400
- git_error_set(GIT_ERROR_INVALID, "must provide valid diff to %s", action);
400
+ giterr_set(GITERR_INVALID, "must provide valid diff to %s", action);
401
401
  return -1;
402
402
  }
403
403
 
@@ -501,12 +501,12 @@ static int patch_generated_with_delta_alloc(
501
501
  size_t new_len = *new_path ? strlen(*new_path) : 0;
502
502
  size_t alloc_len;
503
503
 
504
- GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*pd), old_len);
505
- GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, new_len);
506
- GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2);
504
+ GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*pd), old_len);
505
+ GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, new_len);
506
+ GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2);
507
507
 
508
508
  *out = pd = git__calloc(1, alloc_len);
509
- GIT_ERROR_CHECK_ALLOC(pd);
509
+ GITERR_CHECK_ALLOC(pd);
510
510
 
511
511
  pd->patch.flags = GIT_PATCH_GENERATED_ALLOCATED;
512
512
 
@@ -708,7 +708,7 @@ int git_patch_generated_from_diff(
708
708
 
709
709
  delta = git_vector_get(&diff->deltas, idx);
710
710
  if (!delta) {
711
- git_error_set(GIT_ERROR_INVALID, "index out of range for delta in diff");
711
+ giterr_set(GITERR_INVALID, "index out of range for delta in diff");
712
712
  return GIT_ENOTFOUND;
713
713
  }
714
714
 
@@ -788,7 +788,7 @@ static int patch_generated_binary_cb(
788
788
 
789
789
  if (binary->old_file.data) {
790
790
  patch->binary.old_file.data = git__malloc(binary->old_file.datalen);
791
- GIT_ERROR_CHECK_ALLOC(patch->binary.old_file.data);
791
+ GITERR_CHECK_ALLOC(patch->binary.old_file.data);
792
792
 
793
793
  memcpy((char *)patch->binary.old_file.data,
794
794
  binary->old_file.data, binary->old_file.datalen);
@@ -796,7 +796,7 @@ static int patch_generated_binary_cb(
796
796
 
797
797
  if (binary->new_file.data) {
798
798
  patch->binary.new_file.data = git__malloc(binary->new_file.datalen);
799
- GIT_ERROR_CHECK_ALLOC(patch->binary.new_file.data);
799
+ GITERR_CHECK_ALLOC(patch->binary.new_file.data);
800
800
 
801
801
  memcpy((char *)patch->binary.new_file.data,
802
802
  binary->new_file.data, binary->new_file.datalen);
@@ -816,7 +816,7 @@ static int git_patch_hunk_cb(
816
816
  GIT_UNUSED(delta);
817
817
 
818
818
  hunk = git_array_alloc(patch->base.hunks);
819
- GIT_ERROR_CHECK_ALLOC(hunk);
819
+ GITERR_CHECK_ALLOC(hunk);
820
820
 
821
821
  memcpy(&hunk->hunk, hunk_, sizeof(hunk->hunk));
822
822
 
@@ -836,7 +836,7 @@ static int patch_generated_line_cb(
836
836
  {
837
837
  git_patch_generated *patch = payload;
838
838
  git_patch_hunk *hunk;
839
- git_diff_line *line;
839
+ git_diff_line *line;
840
840
 
841
841
  GIT_UNUSED(delta);
842
842
  GIT_UNUSED(hunk_);
@@ -845,7 +845,7 @@ static int patch_generated_line_cb(
845
845
  assert(hunk); /* programmer error if no hunk is available */
846
846
 
847
847
  line = git_array_alloc(patch->base.lines);
848
- GIT_ERROR_CHECK_ALLOC(line);
848
+ GITERR_CHECK_ALLOC(line);
849
849
 
850
850
  memcpy(line, line_, sizeof(*line));
851
851
 
@@ -33,19 +33,7 @@ typedef struct {
33
33
  char *old_prefix, *new_prefix;
34
34
  } git_patch_parsed;
35
35
 
36
- static int git_parse_err(const char *fmt, ...) GIT_FORMAT_PRINTF(1, 2);
37
- static int git_parse_err(const char *fmt, ...)
38
- {
39
- va_list ap;
40
-
41
- va_start(ap, fmt);
42
- git_error_vset(GIT_ERROR_PATCH, fmt, ap);
43
- va_end(ap);
44
-
45
- return -1;
46
- }
47
-
48
- static size_t header_path_len(git_patch_parse_ctx *ctx)
36
+ static int header_path_len(git_patch_parse_ctx *ctx)
49
37
  {
50
38
  bool inquote = 0;
51
39
  bool quoted = git_parse_ctx_contains_s(&ctx->parse_ctx, "\"");
@@ -70,36 +58,31 @@ static int parse_header_path_buf(git_buf *path, git_patch_parse_ctx *ctx, size_t
70
58
  int error;
71
59
 
72
60
  if ((error = git_buf_put(path, ctx->parse_ctx.line, path_len)) < 0)
73
- return error;
61
+ goto done;
74
62
 
75
63
  git_parse_advance_chars(&ctx->parse_ctx, path_len);
76
64
 
77
65
  git_buf_rtrim(path);
78
66
 
79
- if (path->size > 0 && path->ptr[0] == '"' &&
80
- (error = git_buf_unquote(path)) < 0)
81
- return error;
67
+ if (path->size > 0 && path->ptr[0] == '"')
68
+ error = git_buf_unquote(path);
82
69
 
83
- git_path_squash_slashes(path);
70
+ if (error < 0)
71
+ goto done;
84
72
 
85
- if (!path->size)
86
- return git_parse_err("patch contains empty path at line %"PRIuZ,
87
- ctx->parse_ctx.line_num);
73
+ git_path_squash_slashes(path);
88
74
 
89
- return 0;
75
+ done:
76
+ return error;
90
77
  }
91
78
 
92
79
  static int parse_header_path(char **out, git_patch_parse_ctx *ctx)
93
80
  {
94
81
  git_buf path = GIT_BUF_INIT;
95
- int error;
82
+ int error = parse_header_path_buf(&path, ctx, header_path_len(ctx));
96
83
 
97
- if ((error = parse_header_path_buf(&path, ctx, header_path_len(ctx))) < 0)
98
- goto out;
99
84
  *out = git_buf_detach(&path);
100
85
 
101
- out:
102
- git_buf_dispose(&path);
103
86
  return error;
104
87
  }
105
88
 
@@ -109,19 +92,13 @@ static int parse_header_git_oldpath(
109
92
  git_buf old_path = GIT_BUF_INIT;
110
93
  int error;
111
94
 
112
- if (patch->old_path) {
113
- error = git_parse_err("patch contains duplicate old path at line %"PRIuZ,
114
- ctx->parse_ctx.line_num);
115
- goto out;
116
- }
117
-
118
95
  if ((error = parse_header_path_buf(&old_path, ctx, ctx->parse_ctx.line_len - 1)) < 0)
119
96
  goto out;
120
97
 
121
98
  patch->old_path = git_buf_detach(&old_path);
122
99
 
123
100
  out:
124
- git_buf_dispose(&old_path);
101
+ git_buf_free(&old_path);
125
102
  return error;
126
103
  }
127
104
 
@@ -131,18 +108,13 @@ static int parse_header_git_newpath(
131
108
  git_buf new_path = GIT_BUF_INIT;
132
109
  int error;
133
110
 
134
- if (patch->new_path) {
135
- error = git_parse_err("patch contains duplicate new path at line %"PRIuZ,
136
- ctx->parse_ctx.line_num);
137
- goto out;
138
- }
139
-
140
111
  if ((error = parse_header_path_buf(&new_path, ctx, ctx->parse_ctx.line_len - 1)) < 0)
141
112
  goto out;
113
+
142
114
  patch->new_path = git_buf_detach(&new_path);
143
115
 
144
116
  out:
145
- git_buf_dispose(&new_path);
117
+ git_buf_free(&new_path);
146
118
  return error;
147
119
  }
148
120
 
@@ -231,9 +203,9 @@ static int parse_header_git_deletedfilemode(
231
203
  git_patch_parsed *patch,
232
204
  git_patch_parse_ctx *ctx)
233
205
  {
234
- git__free((char *)patch->base.delta->new_file.path);
206
+ git__free((char *)patch->base.delta->old_file.path);
235
207
 
236
- patch->base.delta->new_file.path = NULL;
208
+ patch->base.delta->old_file.path = NULL;
237
209
  patch->base.delta->status = GIT_DELTA_DELETED;
238
210
  patch->base.delta->nfiles = 1;
239
211
 
@@ -244,9 +216,9 @@ static int parse_header_git_newfilemode(
244
216
  git_patch_parsed *patch,
245
217
  git_patch_parse_ctx *ctx)
246
218
  {
247
- git__free((char *)patch->base.delta->old_file.path);
219
+ git__free((char *)patch->base.delta->new_file.path);
248
220
 
249
- patch->base.delta->old_file.path = NULL;
221
+ patch->base.delta->new_file.path = NULL;
250
222
  patch->base.delta->status = GIT_DELTA_ADDED;
251
223
  patch->base.delta->nfiles = 1;
252
224
 
@@ -310,7 +282,7 @@ static int parse_header_percent(uint16_t *out, git_patch_parse_ctx *ctx)
310
282
  if (val < 0 || val > 100)
311
283
  return -1;
312
284
 
313
- *out = (uint16_t)val;
285
+ *out = val;
314
286
  return 0;
315
287
  }
316
288
 
@@ -356,8 +328,7 @@ static int parse_header_start(git_patch_parsed *patch, git_patch_parse_ctx *ctx)
356
328
  * proceeed here. We then hope for the "---" and "+++" lines to fix that
357
329
  * for us.
358
330
  */
359
- if (!git_parse_ctx_contains(&ctx->parse_ctx, "\n", 1) &&
360
- !git_parse_ctx_contains(&ctx->parse_ctx, "\r\n", 2)) {
331
+ if (!git_parse_ctx_contains(&ctx->parse_ctx, "\n", 1)) {
361
332
  git_parse_advance_chars(&ctx->parse_ctx, ctx->parse_ctx.line_len - 1);
362
333
 
363
334
  git__free(patch->header_old_path);
@@ -405,7 +376,6 @@ static const parse_header_transition transitions[] = {
405
376
  { "index " , STATE_DIFF, STATE_INDEX, parse_header_git_index },
406
377
  { "index " , STATE_END, STATE_INDEX, parse_header_git_index },
407
378
 
408
- { "--- " , STATE_DIFF, STATE_PATH, parse_header_git_oldpath },
409
379
  { "--- " , STATE_INDEX, STATE_PATH, parse_header_git_oldpath },
410
380
  { "+++ " , STATE_PATH, STATE_END, parse_header_git_newpath },
411
381
  { "GIT binary patch" , STATE_INDEX, STATE_END, NULL },
@@ -423,7 +393,6 @@ static const parse_header_transition transitions[] = {
423
393
  /* Next patch */
424
394
  { "diff --git " , STATE_END, 0, NULL },
425
395
  { "@@ -" , STATE_END, 0, NULL },
426
- { "-- " , STATE_INDEX, 0, NULL },
427
396
  { "-- " , STATE_END, 0, NULL },
428
397
  };
429
398
 
@@ -491,7 +460,7 @@ done:
491
460
 
492
461
  static int parse_int(int *out, git_patch_parse_ctx *ctx)
493
462
  {
494
- int64_t num;
463
+ git_off_t num;
495
464
 
496
465
  if (git_parse_advance_digit(&num, &ctx->parse_ctx, 10) < 0 || !git__is_int(num))
497
466
  return -1;
@@ -549,19 +518,11 @@ static int parse_hunk_header(
549
518
  return 0;
550
519
 
551
520
  fail:
552
- git_error_set(GIT_ERROR_PATCH, "invalid patch hunk header at line %"PRIuZ,
521
+ giterr_set(GITERR_PATCH, "invalid patch hunk header at line %"PRIuZ,
553
522
  ctx->parse_ctx.line_num);
554
523
  return -1;
555
524
  }
556
525
 
557
- static int eof_for_origin(int origin) {
558
- if (origin == GIT_DIFF_LINE_ADDITION)
559
- return GIT_DIFF_LINE_ADD_EOFNL;
560
- if (origin == GIT_DIFF_LINE_DELETION)
561
- return GIT_DIFF_LINE_DEL_EOFNL;
562
- return GIT_DIFF_LINE_CONTEXT_EOFNL;
563
- }
564
-
565
526
  static int parse_hunk_body(
566
527
  git_patch_parsed *patch,
567
528
  git_patch_hunk *hunk,
@@ -572,7 +533,6 @@ static int parse_hunk_body(
572
533
 
573
534
  int oldlines = hunk->hunk.old_lines;
574
535
  int newlines = hunk->hunk.new_lines;
575
- int last_origin = 0;
576
536
 
577
537
  for (;
578
538
  ctx->parse_ctx.remain_len > 1 &&
@@ -580,17 +540,11 @@ static int parse_hunk_body(
580
540
  !git_parse_ctx_contains_s(&ctx->parse_ctx, "@@ -");
581
541
  git_parse_advance_line(&ctx->parse_ctx)) {
582
542
 
583
- int old_lineno, new_lineno, origin, prefix = 1;
584
543
  char c;
585
-
586
- if (git__add_int_overflow(&old_lineno, hunk->hunk.old_start, hunk->hunk.old_lines) ||
587
- git__sub_int_overflow(&old_lineno, old_lineno, oldlines) ||
588
- git__add_int_overflow(&new_lineno, hunk->hunk.new_start, hunk->hunk.new_lines) ||
589
- git__sub_int_overflow(&new_lineno, new_lineno, newlines)) {
590
- error = git_parse_err("unrepresentable line count at line %"PRIuZ,
591
- ctx->parse_ctx.line_num);
592
- goto done;
593
- }
544
+ int origin;
545
+ int prefix = 1;
546
+ int old_lineno = hunk->hunk.old_start + (hunk->hunk.old_lines - oldlines);
547
+ int new_lineno = hunk->hunk.new_start + (hunk->hunk.new_lines - newlines);
594
548
 
595
549
  if (ctx->parse_ctx.line_len == 0 || ctx->parse_ctx.line[ctx->parse_ctx.line_len - 1] != '\n') {
596
550
  error = git_parse_err("invalid patch instruction at line %"PRIuZ,
@@ -623,34 +577,18 @@ static int parse_hunk_body(
623
577
  old_lineno = -1;
624
578
  break;
625
579
 
626
- case '\\':
627
- /*
628
- * If there are no oldlines left, then this is probably
629
- * the "" marker. Do not
630
- * verify its format, as it may be localized.
631
- */
632
- if (!oldlines) {
633
- prefix = 0;
634
- origin = eof_for_origin(last_origin);
635
- old_lineno = -1;
636
- new_lineno = -1;
637
- break;
638
- }
639
- /* fall through */
640
-
641
580
  default:
642
581
  error = git_parse_err("invalid patch hunk at line %"PRIuZ, ctx->parse_ctx.line_num);
643
582
  goto done;
644
583
  }
645
584
 
646
585
  line = git_array_alloc(patch->base.lines);
647
- GIT_ERROR_CHECK_ALLOC(line);
586
+ GITERR_CHECK_ALLOC(line);
648
587
 
649
588
  memset(line, 0x0, sizeof(git_diff_line));
650
589
 
590
+ line->content = ctx->parse_ctx.line + prefix;
651
591
  line->content_len = ctx->parse_ctx.line_len - prefix;
652
- line->content = git__strndup(ctx->parse_ctx.line + prefix, line->content_len);
653
- GIT_ERROR_CHECK_ALLOC(line->content);
654
592
  line->content_offset = ctx->parse_ctx.content_len - ctx->parse_ctx.remain_len;
655
593
  line->origin = origin;
656
594
  line->num_lines = 1;
@@ -658,8 +596,6 @@ static int parse_hunk_body(
658
596
  line->new_lineno = new_lineno;
659
597
 
660
598
  hunk->line_count++;
661
-
662
- last_origin = origin;
663
599
  }
664
600
 
665
601
  if (oldlines || newlines) {
@@ -669,8 +605,7 @@ static int parse_hunk_body(
669
605
  goto done;
670
606
  }
671
607
 
672
- /*
673
- * Handle "". Only expect the leading
608
+ /* Handle "". Only expect the leading
674
609
  * backslash, though, because the rest of the string could be
675
610
  * localized. Because `diff` optimizes for the case where you
676
611
  * want to apply the patch by hand.
@@ -681,25 +616,11 @@ static int parse_hunk_body(
681
616
  line = git_array_get(patch->base.lines, git_array_size(patch->base.lines) - 1);
682
617
 
683
618
  if (line->content_len < 1) {
684
- error = git_parse_err("last line has no trailing newline");
619
+ error = git_parse_err("cannot trim trailing newline of empty line");
685
620
  goto done;
686
621
  }
687
622
 
688
- line = git_array_alloc(patch->base.lines);
689
- GIT_ERROR_CHECK_ALLOC(line);
690
-
691
- memset(line, 0x0, sizeof(git_diff_line));
692
-
693
- line->content_len = ctx->parse_ctx.line_len;
694
- line->content = git__strndup(ctx->parse_ctx.line, line->content_len);
695
- GIT_ERROR_CHECK_ALLOC(line->content);
696
- line->content_offset = ctx->parse_ctx.content_len - ctx->parse_ctx.remain_len;
697
- line->origin = eof_for_origin(last_origin);
698
- line->num_lines = 1;
699
- line->old_lineno = -1;
700
- line->new_lineno = -1;
701
-
702
- hunk->line_count++;
623
+ line->content_len--;
703
624
 
704
625
  git_parse_advance_line(&ctx->parse_ctx);
705
626
  }
@@ -729,7 +650,7 @@ static int parse_patch_header(
729
650
  * noise, continue.
730
651
  */
731
652
  if (parse_hunk_header(&hunk, ctx) < 0) {
732
- git_error_clear();
653
+ giterr_clear();
733
654
  continue;
734
655
  }
735
656
 
@@ -752,7 +673,7 @@ static int parse_patch_header(
752
673
  continue;
753
674
  }
754
675
 
755
- git_error_set(GIT_ERROR_PATCH, "no patch found");
676
+ giterr_set(GITERR_PATCH, "no patch found");
756
677
  error = GIT_ENOTFOUND;
757
678
 
758
679
  done:
@@ -765,7 +686,7 @@ static int parse_patch_binary_side(
765
686
  {
766
687
  git_diff_binary_t type = GIT_DIFF_BINARY_NONE;
767
688
  git_buf base85 = GIT_BUF_INIT, decoded = GIT_BUF_INIT;
768
- int64_t len;
689
+ git_off_t len;
769
690
  int error = 0;
770
691
 
771
692
  if (git_parse_ctx_contains_s(&ctx->parse_ctx, "literal ")) {
@@ -808,7 +729,7 @@ static int parse_patch_binary_side(
808
729
 
809
730
  encoded_len = ((decoded_len / 4) + !!(decoded_len % 4)) * 5;
810
731
 
811
- if (!encoded_len || !ctx->parse_ctx.line_len || encoded_len > ctx->parse_ctx.line_len - 1) {
732
+ if (encoded_len > ctx->parse_ctx.line_len - 1) {
812
733
  error = git_parse_err("truncated binary data at line %"PRIuZ, ctx->parse_ctx.line_num);
813
734
  goto done;
814
735
  }
@@ -836,8 +757,8 @@ static int parse_patch_binary_side(
836
757
  binary->data = git_buf_detach(&decoded);
837
758
 
838
759
  done:
839
- git_buf_dispose(&base85);
840
- git_buf_dispose(&decoded);
760
+ git_buf_free(&base85);
761
+ git_buf_free(&decoded);
841
762
  return error;
842
763
  }
843
764
 
@@ -878,23 +799,12 @@ static int parse_patch_binary_nodata(
878
799
  git_patch_parsed *patch,
879
800
  git_patch_parse_ctx *ctx)
880
801
  {
881
- const char *old = patch->old_path ? patch->old_path : patch->header_old_path;
882
- const char *new = patch->new_path ? patch->new_path : patch->header_new_path;
883
-
884
- if (!old || !new)
885
- return git_parse_err("corrupt binary data without paths at line %"PRIuZ, ctx->parse_ctx.line_num);
886
-
887
- if (patch->base.delta->status == GIT_DELTA_ADDED)
888
- old = "/dev/null";
889
- else if (patch->base.delta->status == GIT_DELTA_DELETED)
890
- new = "/dev/null";
891
-
892
802
  if (git_parse_advance_expected_str(&ctx->parse_ctx, "Binary files ") < 0 ||
893
- git_parse_advance_expected_str(&ctx->parse_ctx, old) < 0 ||
894
- git_parse_advance_expected_str(&ctx->parse_ctx, " and ") < 0 ||
895
- git_parse_advance_expected_str(&ctx->parse_ctx, new) < 0 ||
896
- git_parse_advance_expected_str(&ctx->parse_ctx, " differ") < 0 ||
897
- git_parse_advance_nl(&ctx->parse_ctx) < 0)
803
+ git_parse_advance_expected_str(&ctx->parse_ctx, patch->header_old_path) < 0 ||
804
+ git_parse_advance_expected_str(&ctx->parse_ctx, " and ") < 0 ||
805
+ git_parse_advance_expected_str(&ctx->parse_ctx, patch->header_new_path) < 0 ||
806
+ git_parse_advance_expected_str(&ctx->parse_ctx, " differ") < 0 ||
807
+ git_parse_advance_nl(&ctx->parse_ctx) < 0)
898
808
  return git_parse_err("corrupt git binary header at line %"PRIuZ, ctx->parse_ctx.line_num);
899
809
 
900
810
  patch->base.binary.contains_data = 0;
@@ -911,7 +821,7 @@ static int parse_patch_hunks(
911
821
 
912
822
  while (git_parse_ctx_contains_s(&ctx->parse_ctx, "@@ -")) {
913
823
  hunk = git_array_alloc(patch->base.hunks);
914
- GIT_ERROR_CHECK_ALLOC(hunk);
824
+ GITERR_CHECK_ALLOC(hunk);
915
825
 
916
826
  memset(hunk, 0, sizeof(git_patch_hunk));
917
827
 
@@ -1011,15 +921,21 @@ static int check_filenames(git_patch_parsed *patch)
1011
921
  return git_parse_err("missing old path");
1012
922
 
1013
923
  /* Ensure (non-renamed) paths match */
1014
- if (check_header_names(patch->header_old_path, patch->old_path, "old", added) < 0 ||
1015
- check_header_names(patch->header_new_path, patch->new_path, "new", deleted) < 0)
924
+ if (check_header_names(
925
+ patch->header_old_path, patch->old_path, "old", added) < 0 ||
926
+ check_header_names(
927
+ patch->header_new_path, patch->new_path, "new", deleted) < 0)
1016
928
  return -1;
1017
929
 
1018
- prefixed_old = (!added && patch->old_path) ? patch->old_path : patch->header_old_path;
1019
- prefixed_new = (!deleted && patch->new_path) ? patch->new_path : patch->header_new_path;
930
+ prefixed_old = (!added && patch->old_path) ? patch->old_path :
931
+ patch->header_old_path;
932
+ prefixed_new = (!deleted && patch->new_path) ? patch->new_path :
933
+ patch->header_new_path;
1020
934
 
1021
- if ((prefixed_old && check_prefix(&patch->old_prefix, &old_prefixlen, patch, prefixed_old) < 0) ||
1022
- (prefixed_new && check_prefix(&patch->new_prefix, &new_prefixlen, patch, prefixed_new) < 0))
935
+ if (check_prefix(
936
+ &patch->old_prefix, &old_prefixlen, patch, prefixed_old) < 0 ||
937
+ check_prefix(
938
+ &patch->new_prefix, &new_prefixlen, patch, prefixed_new) < 0)
1023
939
  return -1;
1024
940
 
1025
941
  /* Prefer the rename filenames as they are unambiguous and unprefixed */
@@ -1034,7 +950,7 @@ static int check_filenames(git_patch_parsed *patch)
1034
950
  patch->base.delta->new_file.path = prefixed_new + new_prefixlen;
1035
951
 
1036
952
  if (!patch->base.delta->old_file.path &&
1037
- !patch->base.delta->new_file.path)
953
+ !patch->base.delta->new_file.path)
1038
954
  return git_parse_err("git diff header lacks old / new paths");
1039
955
 
1040
956
  return 0;
@@ -1048,14 +964,14 @@ static int check_patch(git_patch_parsed *patch)
1048
964
  return -1;
1049
965
 
1050
966
  if (delta->old_file.path &&
1051
- delta->status != GIT_DELTA_DELETED &&
1052
- !delta->new_file.mode)
967
+ delta->status != GIT_DELTA_DELETED &&
968
+ !delta->new_file.mode)
1053
969
  delta->new_file.mode = delta->old_file.mode;
1054
970
 
1055
971
  if (delta->status == GIT_DELTA_MODIFIED &&
1056
- !(delta->flags & GIT_DIFF_FLAG_BINARY) &&
1057
- delta->new_file.mode == delta->old_file.mode &&
1058
- git_array_size(patch->base.hunks) == 0)
972
+ !(delta->flags & GIT_DIFF_FLAG_BINARY) &&
973
+ delta->new_file.mode == delta->old_file.mode &&
974
+ git_array_size(patch->base.hunks) == 0)
1059
975
  return git_parse_err("patch with no hunks");
1060
976
 
1061
977
  if (delta->status == GIT_DELTA_ADDED) {
@@ -1127,8 +1043,6 @@ int git_patch_parsed_from_diff(git_patch **out, git_diff *d, size_t idx)
1127
1043
  static void patch_parsed__free(git_patch *p)
1128
1044
  {
1129
1045
  git_patch_parsed *patch = (git_patch_parsed *)p;
1130
- git_diff_line *line;
1131
- size_t i;
1132
1046
 
1133
1047
  if (!patch)
1134
1048
  return;
@@ -1138,8 +1052,6 @@ static void patch_parsed__free(git_patch *p)
1138
1052
  git__free((char *)patch->base.binary.old_file.data);
1139
1053
  git__free((char *)patch->base.binary.new_file.data);
1140
1054
  git_array_clear(patch->base.hunks);
1141
- git_array_foreach(patch->base.lines, i, line)
1142
- git__free((char *) line->content);
1143
1055
  git_array_clear(patch->base.lines);
1144
1056
  git__free(patch->base.delta);
1145
1057
 
@@ -1167,7 +1079,7 @@ int git_patch_parse(
1167
1079
  *out = NULL;
1168
1080
 
1169
1081
  patch = git__calloc(1, sizeof(git_patch_parsed));
1170
- GIT_ERROR_CHECK_ALLOC(patch);
1082
+ GITERR_CHECK_ALLOC(patch);
1171
1083
 
1172
1084
  patch->ctx = ctx;
1173
1085
  GIT_REFCOUNT_INC(patch->ctx);
@@ -1175,7 +1087,7 @@ int git_patch_parse(
1175
1087
  patch->base.free_fn = patch_parsed__free;
1176
1088
 
1177
1089
  patch->base.delta = git__calloc(1, sizeof(git_diff_delta));
1178
- GIT_ERROR_CHECK_ALLOC(patch->base.delta);
1090
+ GITERR_CHECK_ALLOC(patch->base.delta);
1179
1091
 
1180
1092
  patch->base.delta->status = GIT_DELTA_MODIFIED;
1181
1093
  patch->base.delta->nfiles = 2;
@@ -1214,7 +1126,7 @@ int git_patch_from_buffer(
1214
1126
  int error;
1215
1127
 
1216
1128
  ctx = git_patch_parse_ctx_init(content, content_len, opts);
1217
- GIT_ERROR_CHECK_ALLOC(ctx);
1129
+ GITERR_CHECK_ALLOC(ctx);
1218
1130
 
1219
1131
  error = git_patch_parse(out, ctx);
1220
1132