rugged 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -0
  3. data/README.md +3 -3
  4. data/ext/rugged/rugged.c +7 -4
  5. data/ext/rugged/rugged_commit.c +1 -1
  6. data/ext/rugged/rugged_config.c +1 -1
  7. data/ext/rugged/rugged_object.c +1 -1
  8. data/ext/rugged/rugged_remote.c +32 -2
  9. data/ext/rugged/rugged_repo.c +13 -3
  10. data/lib/rugged/commit.rb +17 -4
  11. data/lib/rugged/repository.rb +7 -8
  12. data/lib/rugged/submodule_collection.rb +4 -4
  13. data/lib/rugged/version.rb +1 -1
  14. data/vendor/libgit2/CMakeLists.txt +41 -74
  15. data/vendor/libgit2/COPYING +109 -1
  16. data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
  17. data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +0 -0
  18. data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +0 -0
  19. data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +0 -0
  20. data/vendor/libgit2/cmake/{Modules/FindGSSFramework.cmake → FindGSSFramework.cmake} +0 -0
  21. data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
  22. data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
  23. data/vendor/libgit2/cmake/{Modules/FindPCRE.cmake → FindPCRE.cmake} +0 -0
  24. data/vendor/libgit2/cmake/{Modules/FindPCRE2.cmake → FindPCRE2.cmake} +0 -0
  25. data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
  26. data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +0 -0
  27. data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +0 -0
  28. data/vendor/libgit2/cmake/Findfutimens.cmake +14 -0
  29. data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
  30. data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
  31. data/vendor/libgit2/cmake/{Modules/PkgBuildConfig.cmake → PkgBuildConfig.cmake} +0 -0
  32. data/vendor/libgit2/cmake/{Modules/SanitizeBool.cmake → SanitizeBool.cmake} +0 -0
  33. data/vendor/libgit2/cmake/{Modules/SelectGSSAPI.cmake → SelectGSSAPI.cmake} +18 -26
  34. data/vendor/libgit2/cmake/{Modules/SelectHTTPSBackend.cmake → SelectHTTPSBackend.cmake} +29 -32
  35. data/vendor/libgit2/cmake/{Modules/SelectHashes.cmake → SelectHashes.cmake} +21 -28
  36. data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +101 -0
  37. data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
  38. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +24 -10
  39. data/vendor/libgit2/deps/ntlmclient/compat.h +0 -27
  40. data/vendor/libgit2/deps/ntlmclient/crypt.h +14 -9
  41. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +20 -20
  42. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +3 -3
  43. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +37 -36
  44. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +4 -3
  45. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +178 -51
  46. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +74 -5
  47. data/vendor/libgit2/deps/ntlmclient/ntlm.c +164 -135
  48. data/vendor/libgit2/deps/ntlmclient/ntlm.h +13 -9
  49. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +16 -3
  50. data/vendor/libgit2/deps/ntlmclient/unicode.h +10 -4
  51. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +16 -27
  52. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.h +20 -0
  53. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +28 -52
  54. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.h +22 -0
  55. data/vendor/libgit2/deps/ntlmclient/util.c +15 -1
  56. data/vendor/libgit2/deps/ntlmclient/util.h +2 -1
  57. data/vendor/libgit2/deps/pcre/LICENCE +93 -0
  58. data/vendor/libgit2/deps/pcre/pcre.h +2 -2
  59. data/vendor/libgit2/deps/pcre/pcre_compile.c +29 -17
  60. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +4 -4
  61. data/vendor/libgit2/deps/pcre/pcreposix.c +2 -3
  62. data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
  63. data/vendor/libgit2/deps/zlib/deflate.c +1 -0
  64. data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
  65. data/vendor/libgit2/include/git2/apply.h +2 -0
  66. data/vendor/libgit2/include/git2/attr.h +89 -0
  67. data/vendor/libgit2/include/git2/blame.h +95 -42
  68. data/vendor/libgit2/include/git2/blob.h +31 -3
  69. data/vendor/libgit2/include/git2/branch.h +25 -0
  70. data/vendor/libgit2/include/git2/cert.h +42 -5
  71. data/vendor/libgit2/include/git2/checkout.h +28 -12
  72. data/vendor/libgit2/include/git2/commit.h +35 -19
  73. data/vendor/libgit2/include/git2/common.h +33 -6
  74. data/vendor/libgit2/include/git2/config.h +1 -1
  75. data/vendor/libgit2/include/git2/deprecated.h +248 -8
  76. data/vendor/libgit2/include/git2/diff.h +35 -20
  77. data/vendor/libgit2/include/git2/errors.h +8 -7
  78. data/vendor/libgit2/include/git2/filter.h +57 -17
  79. data/vendor/libgit2/include/git2/graph.h +20 -2
  80. data/vendor/libgit2/include/git2/index.h +4 -5
  81. data/vendor/libgit2/include/git2/indexer.h +2 -1
  82. data/vendor/libgit2/include/git2/odb.h +44 -20
  83. data/vendor/libgit2/include/git2/pack.h +1 -1
  84. data/vendor/libgit2/include/git2/patch.h +8 -0
  85. data/vendor/libgit2/include/git2/rebase.h +25 -1
  86. data/vendor/libgit2/include/git2/refs.h +9 -5
  87. data/vendor/libgit2/include/git2/remote.h +59 -6
  88. data/vendor/libgit2/include/git2/repository.h +95 -52
  89. data/vendor/libgit2/include/git2/revparse.h +5 -5
  90. data/vendor/libgit2/include/git2/status.h +115 -59
  91. data/vendor/libgit2/include/git2/strarray.h +6 -10
  92. data/vendor/libgit2/include/git2/submodule.h +9 -0
  93. data/vendor/libgit2/include/git2/sys/commit_graph.h +174 -0
  94. data/vendor/libgit2/include/git2/sys/filter.h +49 -28
  95. data/vendor/libgit2/include/git2/sys/midx.h +74 -0
  96. data/vendor/libgit2/include/git2/sys/odb_backend.h +7 -0
  97. data/vendor/libgit2/include/git2/sys/transport.h +1 -0
  98. data/vendor/libgit2/include/git2/tag.h +12 -0
  99. data/vendor/libgit2/include/git2/transport.h +1 -1
  100. data/vendor/libgit2/include/git2/tree.h +2 -14
  101. data/vendor/libgit2/include/git2/types.h +9 -0
  102. data/vendor/libgit2/include/git2/version.h +3 -3
  103. data/vendor/libgit2/include/git2/worktree.h +1 -0
  104. data/vendor/libgit2/src/CMakeLists.txt +77 -44
  105. data/vendor/libgit2/src/alloc.c +21 -8
  106. data/vendor/libgit2/src/allocators/failalloc.c +92 -0
  107. data/vendor/libgit2/src/allocators/failalloc.h +23 -0
  108. data/vendor/libgit2/src/allocators/stdalloc.c +41 -10
  109. data/vendor/libgit2/src/allocators/win32_leakcheck.c +118 -0
  110. data/vendor/libgit2/src/allocators/{win32_crtdbg.h → win32_leakcheck.h} +3 -3
  111. data/vendor/libgit2/src/annotated_commit.c +21 -9
  112. data/vendor/libgit2/src/apply.c +21 -8
  113. data/vendor/libgit2/src/array.h +11 -11
  114. data/vendor/libgit2/src/assert_safe.h +58 -0
  115. data/vendor/libgit2/src/attr.c +181 -74
  116. data/vendor/libgit2/src/attr_file.c +92 -42
  117. data/vendor/libgit2/src/attr_file.h +32 -11
  118. data/vendor/libgit2/src/attrcache.c +44 -40
  119. data/vendor/libgit2/src/attrcache.h +4 -5
  120. data/vendor/libgit2/src/blame.c +28 -15
  121. data/vendor/libgit2/src/blame_git.c +6 -3
  122. data/vendor/libgit2/src/blob.c +46 -24
  123. data/vendor/libgit2/src/branch.c +87 -37
  124. data/vendor/libgit2/src/buffer.c +339 -27
  125. data/vendor/libgit2/src/buffer.h +153 -2
  126. data/vendor/libgit2/src/cache.c +3 -24
  127. data/vendor/libgit2/src/cache.h +7 -7
  128. data/vendor/libgit2/src/cc-compat.h +10 -2
  129. data/vendor/libgit2/src/checkout.c +97 -98
  130. data/vendor/libgit2/src/cherrypick.c +8 -2
  131. data/vendor/libgit2/src/clone.c +104 -29
  132. data/vendor/libgit2/src/commit.c +41 -28
  133. data/vendor/libgit2/src/commit_graph.c +1209 -0
  134. data/vendor/libgit2/src/commit_graph.h +162 -0
  135. data/vendor/libgit2/src/commit_list.c +46 -0
  136. data/vendor/libgit2/src/commit_list.h +2 -0
  137. data/vendor/libgit2/src/common.h +26 -2
  138. data/vendor/libgit2/src/config.c +40 -22
  139. data/vendor/libgit2/src/config_cache.c +9 -4
  140. data/vendor/libgit2/src/config_entries.c +35 -27
  141. data/vendor/libgit2/src/config_file.c +25 -8
  142. data/vendor/libgit2/src/config_parse.c +5 -7
  143. data/vendor/libgit2/src/config_snapshot.c +2 -1
  144. data/vendor/libgit2/src/crlf.c +16 -6
  145. data/vendor/libgit2/src/date.c +4 -3
  146. data/vendor/libgit2/src/delta.c +1 -1
  147. data/vendor/libgit2/src/describe.c +11 -4
  148. data/vendor/libgit2/src/diff.c +23 -19
  149. data/vendor/libgit2/src/diff_driver.c +21 -17
  150. data/vendor/libgit2/src/diff_file.c +5 -7
  151. data/vendor/libgit2/src/diff_generate.c +56 -28
  152. data/vendor/libgit2/src/diff_parse.c +2 -3
  153. data/vendor/libgit2/src/diff_print.c +81 -65
  154. data/vendor/libgit2/src/diff_stats.c +19 -16
  155. data/vendor/libgit2/src/diff_tform.c +13 -13
  156. data/vendor/libgit2/src/diff_xdiff.c +4 -2
  157. data/vendor/libgit2/src/diff_xdiff.h +1 -1
  158. data/vendor/libgit2/src/errors.c +26 -19
  159. data/vendor/libgit2/src/features.h.in +5 -1
  160. data/vendor/libgit2/src/fetch.c +7 -2
  161. data/vendor/libgit2/src/fetchhead.c +8 -4
  162. data/vendor/libgit2/src/filebuf.c +9 -7
  163. data/vendor/libgit2/src/filter.c +209 -113
  164. data/vendor/libgit2/src/filter.h +24 -5
  165. data/vendor/libgit2/src/futils.c +8 -8
  166. data/vendor/libgit2/src/futils.h +4 -4
  167. data/vendor/libgit2/src/graph.c +64 -9
  168. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +3 -3
  169. data/vendor/libgit2/src/hash/sha1/common_crypto.c +3 -3
  170. data/vendor/libgit2/src/hash/sha1/generic.h +1 -1
  171. data/vendor/libgit2/src/hash/sha1/mbedtls.c +12 -12
  172. data/vendor/libgit2/src/hash/sha1/openssl.c +3 -3
  173. data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +0 -2
  174. data/vendor/libgit2/src/hash/sha1/win32.c +15 -11
  175. data/vendor/libgit2/src/hash.c +16 -13
  176. data/vendor/libgit2/src/hash.h +1 -1
  177. data/vendor/libgit2/src/hashsig.c +23 -10
  178. data/vendor/libgit2/src/ident.c +13 -3
  179. data/vendor/libgit2/src/idxmap.c +0 -22
  180. data/vendor/libgit2/src/ignore.c +35 -19
  181. data/vendor/libgit2/src/index.c +126 -84
  182. data/vendor/libgit2/src/index.h +1 -1
  183. data/vendor/libgit2/src/indexer.c +60 -36
  184. data/vendor/libgit2/src/integer.h +79 -2
  185. data/vendor/libgit2/src/iterator.c +40 -28
  186. data/vendor/libgit2/src/iterator.h +1 -1
  187. data/vendor/libgit2/src/khash.h +2 -11
  188. data/vendor/libgit2/src/{settings.c → libgit2.c} +125 -49
  189. data/vendor/libgit2/src/libgit2.h +15 -0
  190. data/vendor/libgit2/src/mailmap.c +23 -10
  191. data/vendor/libgit2/src/map.h +3 -3
  192. data/vendor/libgit2/src/merge.c +108 -46
  193. data/vendor/libgit2/src/merge.h +2 -1
  194. data/vendor/libgit2/src/merge_driver.c +19 -13
  195. data/vendor/libgit2/src/merge_file.c +15 -9
  196. data/vendor/libgit2/src/message.c +3 -1
  197. data/vendor/libgit2/src/midx.c +879 -0
  198. data/vendor/libgit2/src/midx.h +110 -0
  199. data/vendor/libgit2/src/mwindow.c +214 -95
  200. data/vendor/libgit2/src/mwindow.h +3 -3
  201. data/vendor/libgit2/src/net.c +133 -4
  202. data/vendor/libgit2/src/net.h +16 -2
  203. data/vendor/libgit2/src/netops.c +6 -4
  204. data/vendor/libgit2/src/netops.h +2 -2
  205. data/vendor/libgit2/src/notes.c +10 -10
  206. data/vendor/libgit2/src/object.c +24 -15
  207. data/vendor/libgit2/src/odb.c +298 -57
  208. data/vendor/libgit2/src/odb.h +16 -2
  209. data/vendor/libgit2/src/odb_loose.c +31 -21
  210. data/vendor/libgit2/src/odb_mempack.c +3 -1
  211. data/vendor/libgit2/src/odb_pack.c +391 -114
  212. data/vendor/libgit2/src/oid.c +7 -4
  213. data/vendor/libgit2/src/pack-objects.c +83 -69
  214. data/vendor/libgit2/src/pack.c +383 -150
  215. data/vendor/libgit2/src/pack.h +44 -9
  216. data/vendor/libgit2/src/patch.c +14 -7
  217. data/vendor/libgit2/src/patch_generate.c +3 -5
  218. data/vendor/libgit2/src/patch_parse.c +6 -3
  219. data/vendor/libgit2/src/path.c +102 -57
  220. data/vendor/libgit2/src/path.h +79 -6
  221. data/vendor/libgit2/src/pathspec.c +12 -11
  222. data/vendor/libgit2/src/pool.c +34 -22
  223. data/vendor/libgit2/src/pool.h +9 -1
  224. data/vendor/libgit2/src/posix.c +43 -12
  225. data/vendor/libgit2/src/posix.h +9 -0
  226. data/vendor/libgit2/src/proxy.c +2 -0
  227. data/vendor/libgit2/src/push.c +2 -0
  228. data/vendor/libgit2/src/reader.c +10 -6
  229. data/vendor/libgit2/src/rebase.c +95 -49
  230. data/vendor/libgit2/src/refdb.c +165 -13
  231. data/vendor/libgit2/src/refdb.h +69 -0
  232. data/vendor/libgit2/src/refdb_fs.c +144 -152
  233. data/vendor/libgit2/src/reflog.c +21 -20
  234. data/vendor/libgit2/src/refs.c +151 -231
  235. data/vendor/libgit2/src/refs.h +2 -20
  236. data/vendor/libgit2/src/refspec.c +80 -44
  237. data/vendor/libgit2/src/regexp.c +2 -2
  238. data/vendor/libgit2/src/remote.c +312 -121
  239. data/vendor/libgit2/src/remote.h +2 -1
  240. data/vendor/libgit2/src/repository.c +351 -189
  241. data/vendor/libgit2/src/repository.h +23 -29
  242. data/vendor/libgit2/src/reset.c +7 -6
  243. data/vendor/libgit2/src/revert.c +8 -2
  244. data/vendor/libgit2/src/revparse.c +19 -13
  245. data/vendor/libgit2/src/revwalk.c +35 -20
  246. data/vendor/libgit2/src/runtime.c +162 -0
  247. data/vendor/libgit2/src/runtime.h +62 -0
  248. data/vendor/libgit2/src/{refdb_fs.h → settings.h} +3 -11
  249. data/vendor/libgit2/src/signature.c +6 -5
  250. data/vendor/libgit2/src/sortedcache.c +2 -3
  251. data/vendor/libgit2/src/sortedcache.h +10 -8
  252. data/vendor/libgit2/src/stash.c +7 -3
  253. data/vendor/libgit2/src/status.c +9 -4
  254. data/vendor/libgit2/src/strarray.c +64 -0
  255. data/vendor/libgit2/src/streams/mbedtls.c +14 -17
  256. data/vendor/libgit2/src/streams/mbedtls.h +1 -1
  257. data/vendor/libgit2/src/streams/openssl.c +113 -207
  258. data/vendor/libgit2/src/streams/openssl.h +9 -1
  259. data/vendor/libgit2/src/streams/openssl_dynamic.c +309 -0
  260. data/vendor/libgit2/src/streams/openssl_dynamic.h +348 -0
  261. data/vendor/libgit2/src/streams/openssl_legacy.c +203 -0
  262. data/vendor/libgit2/src/streams/openssl_legacy.h +63 -0
  263. data/vendor/libgit2/src/streams/registry.c +10 -9
  264. data/vendor/libgit2/src/streams/socket.c +6 -2
  265. data/vendor/libgit2/src/streams/stransport.c +6 -3
  266. data/vendor/libgit2/src/streams/tls.c +5 -3
  267. data/vendor/libgit2/src/submodule.c +134 -66
  268. data/vendor/libgit2/src/submodule.h +9 -9
  269. data/vendor/libgit2/src/sysdir.c +8 -26
  270. data/vendor/libgit2/src/sysdir.h +0 -11
  271. data/vendor/libgit2/src/tag.c +49 -11
  272. data/vendor/libgit2/src/thread.c +140 -0
  273. data/vendor/libgit2/src/thread.h +479 -0
  274. data/vendor/libgit2/src/threadstate.c +83 -0
  275. data/vendor/libgit2/src/threadstate.h +24 -0
  276. data/vendor/libgit2/src/trace.c +2 -2
  277. data/vendor/libgit2/src/trace.h +17 -13
  278. data/vendor/libgit2/src/transaction.c +21 -9
  279. data/vendor/libgit2/src/transport.c +3 -3
  280. data/vendor/libgit2/src/transports/auth.c +1 -1
  281. data/vendor/libgit2/src/transports/auth_negotiate.c +11 -4
  282. data/vendor/libgit2/src/transports/auth_ntlm.c +10 -6
  283. data/vendor/libgit2/src/transports/credential.c +17 -7
  284. data/vendor/libgit2/src/transports/credential_helpers.c +2 -0
  285. data/vendor/libgit2/src/transports/git.c +1 -3
  286. data/vendor/libgit2/src/transports/http.c +19 -17
  287. data/vendor/libgit2/src/transports/http.h +1 -0
  288. data/vendor/libgit2/src/transports/httpclient.c +84 -42
  289. data/vendor/libgit2/src/transports/httpclient.h +1 -1
  290. data/vendor/libgit2/src/transports/local.c +5 -5
  291. data/vendor/libgit2/src/transports/smart.c +14 -9
  292. data/vendor/libgit2/src/transports/smart.h +1 -1
  293. data/vendor/libgit2/src/transports/smart_protocol.c +11 -5
  294. data/vendor/libgit2/src/transports/ssh.c +51 -17
  295. data/vendor/libgit2/src/transports/winhttp.c +156 -88
  296. data/vendor/libgit2/src/tree.c +100 -77
  297. data/vendor/libgit2/src/tree.h +1 -0
  298. data/vendor/libgit2/src/tsort.c +0 -2
  299. data/vendor/libgit2/src/unix/map.c +3 -1
  300. data/vendor/libgit2/src/unix/posix.h +16 -1
  301. data/vendor/libgit2/src/unix/pthread.h +2 -1
  302. data/vendor/libgit2/src/utf8.c +150 -0
  303. data/vendor/libgit2/src/utf8.h +52 -0
  304. data/vendor/libgit2/src/util.c +74 -183
  305. data/vendor/libgit2/src/util.h +33 -39
  306. data/vendor/libgit2/src/vector.c +23 -19
  307. data/vendor/libgit2/src/vector.h +4 -2
  308. data/vendor/libgit2/src/win32/findfile.c +4 -2
  309. data/vendor/libgit2/src/win32/git2.rc +18 -3
  310. data/vendor/libgit2/src/win32/map.c +1 -1
  311. data/vendor/libgit2/src/win32/msvc-compat.h +9 -1
  312. data/vendor/libgit2/src/win32/path_w32.c +23 -25
  313. data/vendor/libgit2/src/win32/path_w32.h +0 -1
  314. data/vendor/libgit2/src/win32/posix_w32.c +77 -1
  315. data/vendor/libgit2/src/win32/precompiled.h +0 -1
  316. data/vendor/libgit2/src/win32/reparse.h +4 -4
  317. data/vendor/libgit2/src/win32/thread.c +24 -15
  318. data/vendor/libgit2/src/win32/thread.h +1 -1
  319. data/vendor/libgit2/src/win32/w32_buffer.c +3 -3
  320. data/vendor/libgit2/src/win32/w32_common.h +18 -9
  321. data/vendor/libgit2/src/win32/{w32_crtdbg_stacktrace.c → w32_leakcheck.c} +269 -33
  322. data/vendor/libgit2/src/win32/w32_leakcheck.h +222 -0
  323. data/vendor/libgit2/src/win32/w32_util.h +6 -6
  324. data/vendor/libgit2/src/worktree.c +37 -15
  325. data/vendor/libgit2/src/zstream.c +1 -1
  326. metadata +56 -38
  327. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
  328. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
  329. data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
  330. data/vendor/libgit2/src/buf_text.c +0 -316
  331. data/vendor/libgit2/src/buf_text.h +0 -122
  332. data/vendor/libgit2/src/global.c +0 -361
  333. data/vendor/libgit2/src/global.h +0 -41
  334. data/vendor/libgit2/src/thread-utils.c +0 -58
  335. data/vendor/libgit2/src/thread-utils.h +0 -246
  336. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -127
  337. data/vendor/libgit2/src/win32/w32_stack.c +0 -188
  338. data/vendor/libgit2/src/win32/w32_stack.h +0 -140
@@ -52,9 +52,8 @@ static git_diff_parsed *diff_parsed_alloc(void)
52
52
 
53
53
  diff->base.opts.flags &= ~GIT_DIFF_IGNORE_CASE;
54
54
 
55
- git_pool_init(&diff->base.pool, 1);
56
-
57
- if (git_vector_init(&diff->patches, 0, NULL) < 0 ||
55
+ if (git_pool_init(&diff->base.pool, 1) < 0 ||
56
+ git_vector_init(&diff->patches, 0, NULL) < 0 ||
58
57
  git_vector_init(&diff->base.deltas, 0, git_diff_delta__cmp) < 0) {
59
58
  git_diff_free(&diff->base);
60
59
  return NULL;
@@ -95,7 +95,7 @@ static int diff_print_info_init_frompatch(
95
95
  git_diff_line_cb cb,
96
96
  void *payload)
97
97
  {
98
- assert(patch);
98
+ GIT_ASSERT_ARG(patch);
99
99
 
100
100
  memset(pi, 0, sizeof(diff_print_info));
101
101
 
@@ -337,7 +337,7 @@ static int diff_delta_format_with_paths(
337
337
  return git_buf_printf(out, template, oldpath, newpath);
338
338
  }
339
339
 
340
- int diff_delta_format_similarity_header(
340
+ static int diff_delta_format_similarity_header(
341
341
  git_buf *out,
342
342
  const git_diff_delta *delta)
343
343
  {
@@ -351,17 +351,16 @@ int diff_delta_format_similarity_header(
351
351
  goto done;
352
352
  }
353
353
 
354
+ GIT_ASSERT(delta->status == GIT_DELTA_RENAMED || delta->status == GIT_DELTA_COPIED);
354
355
  if (delta->status == GIT_DELTA_RENAMED)
355
356
  type = "rename";
356
- else if (delta->status == GIT_DELTA_COPIED)
357
- type = "copy";
358
357
  else
359
- abort();
358
+ type = "copy";
360
359
 
361
360
  if ((error = git_buf_puts(&old_path, delta->old_file.path)) < 0 ||
362
- (error = git_buf_puts(&new_path, delta->new_file.path)) < 0 ||
363
- (error = git_buf_quote(&old_path)) < 0 ||
364
- (error = git_buf_quote(&new_path)) < 0)
361
+ (error = git_buf_puts(&new_path, delta->new_file.path)) < 0 ||
362
+ (error = git_buf_quote(&old_path)) < 0 ||
363
+ (error = git_buf_quote(&new_path)) < 0)
365
364
  goto done;
366
365
 
367
366
  git_buf_printf(out,
@@ -428,8 +427,11 @@ int git_diff_delta__format_file_header(
428
427
  git_buf_printf(out, "diff --git %s %s\n",
429
428
  old_path.ptr, new_path.ptr);
430
429
 
430
+ if (unchanged && delta->old_file.mode != delta->new_file.mode)
431
+ diff_print_modes(out, delta);
432
+
431
433
  if (delta->status == GIT_DELTA_RENAMED ||
432
- (delta->status == GIT_DELTA_COPIED && unchanged)) {
434
+ (delta->status == GIT_DELTA_COPIED && unchanged)) {
433
435
  if ((error = diff_delta_format_similarity_header(out, delta)) < 0)
434
436
  goto done;
435
437
  }
@@ -444,9 +446,6 @@ int git_diff_delta__format_file_header(
444
446
  "--- %s\n+++ %s\n", old_path.ptr, new_path.ptr);
445
447
  }
446
448
 
447
- if (unchanged && delta->old_file.mode != delta->new_file.mode)
448
- diff_print_modes(out, delta);
449
-
450
449
  if (git_buf_oom(out))
451
450
  error = -1;
452
451
 
@@ -492,6 +491,9 @@ static int format_binary(
492
491
  }
493
492
  git_buf_putc(pi->buf, '\n');
494
493
 
494
+ if (git_buf_oom(pi->buf))
495
+ return -1;
496
+
495
497
  return 0;
496
498
  }
497
499
 
@@ -502,21 +504,17 @@ static int diff_print_patch_file_binary_noshow(
502
504
  git_buf old_path = GIT_BUF_INIT, new_path = GIT_BUF_INIT;
503
505
  int error;
504
506
 
505
- if ((error = diff_delta_format_path(
506
- &old_path, old_pfx, delta->old_file.path)) < 0 ||
507
- (error = diff_delta_format_path(
508
- &new_path, new_pfx, delta->new_file.path)) < 0)
507
+ if ((error = diff_delta_format_path(&old_path, old_pfx, delta->old_file.path)) < 0 ||
508
+ (error = diff_delta_format_path(&new_path, new_pfx, delta->new_file.path)) < 0 ||
509
+ (error = diff_delta_format_with_paths(pi->buf, delta, "Binary files %s and %s differ\n",
510
+ old_path.ptr, new_path.ptr)) < 0)
509
511
  goto done;
510
512
 
511
513
  pi->line.num_lines = 1;
512
- error = diff_delta_format_with_paths(
513
- pi->buf, delta, "Binary files %s and %s differ\n",
514
- old_path.ptr, new_path.ptr);
515
514
 
516
515
  done:
517
516
  git_buf_dispose(&old_path);
518
517
  git_buf_dispose(&new_path);
519
-
520
518
  return error;
521
519
  }
522
520
 
@@ -540,10 +538,9 @@ static int diff_print_patch_file_binary(
540
538
  pi->line.num_lines++;
541
539
 
542
540
  if ((error = format_binary(pi, binary->new_file.type, binary->new_file.data,
543
- binary->new_file.datalen, binary->new_file.inflatedlen)) < 0 ||
544
- (error = format_binary(pi, binary->old_file.type, binary->old_file.data,
545
- binary->old_file.datalen, binary->old_file.inflatedlen)) < 0) {
546
-
541
+ binary->new_file.datalen, binary->new_file.inflatedlen)) < 0 ||
542
+ (error = format_binary(pi, binary->old_file.type, binary->old_file.data,
543
+ binary->old_file.datalen, binary->old_file.inflatedlen)) < 0) {
547
544
  if (error == GIT_EBUFS) {
548
545
  git_error_clear();
549
546
  git_buf_truncate(pi->buf, pre_binary_size);
@@ -580,16 +577,15 @@ static int diff_print_patch_file(
580
577
  GIT_UNUSED(progress);
581
578
 
582
579
  if (S_ISDIR(delta->new_file.mode) ||
583
- delta->status == GIT_DELTA_UNMODIFIED ||
584
- delta->status == GIT_DELTA_IGNORED ||
585
- delta->status == GIT_DELTA_UNREADABLE ||
586
- (delta->status == GIT_DELTA_UNTRACKED &&
580
+ delta->status == GIT_DELTA_UNMODIFIED ||
581
+ delta->status == GIT_DELTA_IGNORED ||
582
+ delta->status == GIT_DELTA_UNREADABLE ||
583
+ (delta->status == GIT_DELTA_UNTRACKED &&
587
584
  (pi->flags & GIT_DIFF_SHOW_UNTRACKED_CONTENT) == 0))
588
585
  return 0;
589
586
 
590
- if ((error = git_diff_delta__format_file_header(
591
- pi->buf, delta, oldpfx, newpfx,
592
- id_strlen, print_index)) < 0)
587
+ if ((error = git_diff_delta__format_file_header(pi->buf, delta, oldpfx, newpfx,
588
+ id_strlen, print_index)) < 0)
593
589
  return error;
594
590
 
595
591
  pi->line.origin = GIT_DIFF_LINE_FILE_HDR;
@@ -699,17 +695,16 @@ int git_diff_print(
699
695
  return -1;
700
696
  }
701
697
 
702
- if (!(error = diff_print_info_init_fromdiff(
703
- &pi, &buf, diff, format, print_cb, payload))) {
704
- error = git_diff_foreach(
705
- diff, print_file, print_binary, print_hunk, print_line, &pi);
698
+ if ((error = diff_print_info_init_fromdiff(&pi, &buf, diff, format, print_cb, payload)) < 0)
699
+ goto out;
706
700
 
707
- if (error) /* make sure error message is set */
708
- git_error_set_after_callback_function(error, "git_diff_print");
701
+ if ((error = git_diff_foreach(diff, print_file, print_binary, print_hunk, print_line, &pi)) != 0) {
702
+ git_error_set_after_callback_function(error, "git_diff_print");
703
+ goto out;
709
704
  }
710
705
 
706
+ out:
711
707
  git_buf_dispose(&buf);
712
-
713
708
  return error;
714
709
  }
715
710
 
@@ -728,8 +723,8 @@ int git_diff_print_callback__to_buf(
728
723
  }
729
724
 
730
725
  if (line->origin == GIT_DIFF_LINE_ADDITION ||
731
- line->origin == GIT_DIFF_LINE_DELETION ||
732
- line->origin == GIT_DIFF_LINE_CONTEXT)
726
+ line->origin == GIT_DIFF_LINE_DELETION ||
727
+ line->origin == GIT_DIFF_LINE_CONTEXT)
733
728
  git_buf_putc(output, line->origin);
734
729
 
735
730
  return git_buf_put(output, line->content, line->content_len);
@@ -742,24 +737,42 @@ int git_diff_print_callback__to_file_handle(
742
737
  void *payload)
743
738
  {
744
739
  FILE *fp = payload ? payload : stdout;
740
+ int error;
745
741
 
746
- GIT_UNUSED(delta); GIT_UNUSED(hunk);
742
+ GIT_UNUSED(delta);
743
+ GIT_UNUSED(hunk);
747
744
 
748
745
  if (line->origin == GIT_DIFF_LINE_CONTEXT ||
749
- line->origin == GIT_DIFF_LINE_ADDITION ||
750
- line->origin == GIT_DIFF_LINE_DELETION)
751
- fputc(line->origin, fp);
752
- fwrite(line->content, 1, line->content_len, fp);
746
+ line->origin == GIT_DIFF_LINE_ADDITION ||
747
+ line->origin == GIT_DIFF_LINE_DELETION) {
748
+ while ((error = fputc(line->origin, fp)) == EINTR)
749
+ continue;
750
+ if (error) {
751
+ git_error_set(GIT_ERROR_OS, "could not write status");
752
+ return -1;
753
+ }
754
+ }
755
+
756
+ if (fwrite(line->content, line->content_len, 1, fp) != 1) {
757
+ git_error_set(GIT_ERROR_OS, "could not write line");
758
+ return -1;
759
+ }
760
+
753
761
  return 0;
754
762
  }
755
763
 
756
764
  /* print a git_diff to a git_buf */
757
765
  int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format)
758
766
  {
759
- assert(out && diff);
760
- git_buf_sanitize(out);
761
- return git_diff_print(
762
- diff, format, git_diff_print_callback__to_buf, out);
767
+ int error;
768
+
769
+ GIT_ASSERT_ARG(out);
770
+ GIT_ASSERT_ARG(diff);
771
+
772
+ if ((error = git_buf_sanitize(out)) < 0)
773
+ return error;
774
+
775
+ return git_diff_print(diff, format, git_diff_print_callback__to_buf, out);
763
776
  }
764
777
 
765
778
  /* print a git_patch to an output callback */
@@ -768,35 +781,38 @@ int git_patch_print(
768
781
  git_diff_line_cb print_cb,
769
782
  void *payload)
770
783
  {
771
- int error;
772
784
  git_buf temp = GIT_BUF_INIT;
773
785
  diff_print_info pi;
786
+ int error;
774
787
 
775
- assert(patch && print_cb);
788
+ GIT_ASSERT_ARG(patch);
789
+ GIT_ASSERT_ARG(print_cb);
776
790
 
777
- if (!(error = diff_print_info_init_frompatch(
778
- &pi, &temp, patch,
779
- GIT_DIFF_FORMAT_PATCH, print_cb, payload)))
780
- {
781
- error = git_patch__invoke_callbacks(
782
- patch,
783
- diff_print_patch_file, diff_print_patch_binary,
784
- diff_print_patch_hunk, diff_print_patch_line,
785
- &pi);
791
+ if ((error = diff_print_info_init_frompatch(&pi, &temp, patch,
792
+ GIT_DIFF_FORMAT_PATCH, print_cb, payload)) < 0)
793
+ goto out;
786
794
 
787
- if (error) /* make sure error message is set */
788
- git_error_set_after_callback_function(error, "git_patch_print");
795
+ if ((error = git_patch__invoke_callbacks(patch, diff_print_patch_file, diff_print_patch_binary,
796
+ diff_print_patch_hunk, diff_print_patch_line, &pi)) < 0) {
797
+ git_error_set_after_callback_function(error, "git_patch_print");
798
+ goto out;
789
799
  }
790
800
 
801
+ out:
791
802
  git_buf_dispose(&temp);
792
-
793
803
  return error;
794
804
  }
795
805
 
796
806
  /* print a git_patch to a git_buf */
797
807
  int git_patch_to_buf(git_buf *out, git_patch *patch)
798
808
  {
799
- assert(out && patch);
800
- git_buf_sanitize(out);
809
+ int error;
810
+
811
+ GIT_ASSERT_ARG(out);
812
+ GIT_ASSERT_ARG(patch);
813
+
814
+ if ((error = git_buf_sanitize(out)) < 0)
815
+ return error;
816
+
801
817
  return git_patch_print(patch, git_diff_print_callback__to_buf, out);
802
818
  }
@@ -46,14 +46,14 @@ static int digits_for_value(size_t val)
46
46
  return count;
47
47
  }
48
48
 
49
- int git_diff_file_stats__full_to_buf(
49
+ static int diff_file_stats_full_to_buf(
50
50
  git_buf *out,
51
51
  const git_diff_delta *delta,
52
52
  const diff_file_stats *filestat,
53
53
  const git_diff_stats *stats,
54
54
  size_t width)
55
55
  {
56
- const char *old_path = NULL, *new_path = NULL;
56
+ const char *old_path = NULL, *new_path = NULL, *adddel_path = NULL;
57
57
  size_t padding;
58
58
  git_object_size_t old_size, new_size;
59
59
 
@@ -62,7 +62,7 @@ int git_diff_file_stats__full_to_buf(
62
62
  old_size = delta->old_file.size;
63
63
  new_size = delta->new_file.size;
64
64
 
65
- if (strcmp(old_path, new_path) != 0) {
65
+ if (old_path && new_path && strcmp(old_path, new_path) != 0) {
66
66
  size_t common_dirlen;
67
67
  int error;
68
68
 
@@ -82,10 +82,11 @@ int git_diff_file_stats__full_to_buf(
82
82
  if (error < 0)
83
83
  goto on_error;
84
84
  } else {
85
- if (git_buf_printf(out, " %s", old_path) < 0)
85
+ adddel_path = new_path ? new_path : old_path;
86
+ if (git_buf_printf(out, " %s", adddel_path) < 0)
86
87
  goto on_error;
87
88
 
88
- padding = stats->max_name - strlen(old_path);
89
+ padding = stats->max_name - strlen(adddel_path);
89
90
 
90
91
  if (stats->renames > 0)
91
92
  padding += strlen(DIFF_RENAME_FILE_SEPARATOR);
@@ -134,7 +135,7 @@ on_error:
134
135
  return (git_buf_oom(out) ? -1 : 0);
135
136
  }
136
137
 
137
- int git_diff_file_stats__number_to_buf(
138
+ static int diff_file_stats_number_to_buf(
138
139
  git_buf *out,
139
140
  const git_diff_delta *delta,
140
141
  const diff_file_stats *filestats)
@@ -151,7 +152,7 @@ int git_diff_file_stats__number_to_buf(
151
152
  return error;
152
153
  }
153
154
 
154
- int git_diff_file_stats__summary_to_buf(
155
+ static int diff_file_stats_summary_to_buf(
155
156
  git_buf *out,
156
157
  const git_diff_delta *delta)
157
158
  {
@@ -182,7 +183,8 @@ int git_diff_get_stats(
182
183
  git_diff_stats *stats = NULL;
183
184
  int error = 0;
184
185
 
185
- assert(out && diff);
186
+ GIT_ASSERT_ARG(out);
187
+ GIT_ASSERT_ARG(diff);
186
188
 
187
189
  stats = git__calloc(1, sizeof(git_diff_stats));
188
190
  GIT_ERROR_CHECK_ALLOC(stats);
@@ -211,7 +213,7 @@ int git_diff_get_stats(
211
213
 
212
214
  /* TODO ugh */
213
215
  namelen = strlen(delta->new_file.path);
214
- if (strcmp(delta->old_file.path, delta->new_file.path) != 0) {
216
+ if (delta->old_file.path && strcmp(delta->old_file.path, delta->new_file.path) != 0) {
215
217
  namelen += strlen(delta->old_file.path);
216
218
  stats->renames++;
217
219
  }
@@ -250,7 +252,7 @@ int git_diff_get_stats(
250
252
  size_t git_diff_stats_files_changed(
251
253
  const git_diff_stats *stats)
252
254
  {
253
- assert(stats);
255
+ GIT_ASSERT_ARG(stats);
254
256
 
255
257
  return stats->files_changed;
256
258
  }
@@ -258,7 +260,7 @@ size_t git_diff_stats_files_changed(
258
260
  size_t git_diff_stats_insertions(
259
261
  const git_diff_stats *stats)
260
262
  {
261
- assert(stats);
263
+ GIT_ASSERT_ARG(stats);
262
264
 
263
265
  return stats->insertions;
264
266
  }
@@ -266,7 +268,7 @@ size_t git_diff_stats_insertions(
266
268
  size_t git_diff_stats_deletions(
267
269
  const git_diff_stats *stats)
268
270
  {
269
- assert(stats);
271
+ GIT_ASSERT_ARG(stats);
270
272
 
271
273
  return stats->deletions;
272
274
  }
@@ -281,14 +283,15 @@ int git_diff_stats_to_buf(
281
283
  size_t i;
282
284
  const git_diff_delta *delta;
283
285
 
284
- assert(out && stats);
286
+ GIT_ASSERT_ARG(out);
287
+ GIT_ASSERT_ARG(stats);
285
288
 
286
289
  if (format & GIT_DIFF_STATS_NUMBER) {
287
290
  for (i = 0; i < stats->files_changed; ++i) {
288
291
  if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
289
292
  continue;
290
293
 
291
- error = git_diff_file_stats__number_to_buf(
294
+ error = diff_file_stats_number_to_buf(
292
295
  out, delta, &stats->filestats[i]);
293
296
  if (error < 0)
294
297
  return error;
@@ -309,7 +312,7 @@ int git_diff_stats_to_buf(
309
312
  if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
310
313
  continue;
311
314
 
312
- error = git_diff_file_stats__full_to_buf(
315
+ error = diff_file_stats_full_to_buf(
313
316
  out, delta, &stats->filestats[i], stats, width);
314
317
  if (error < 0)
315
318
  return error;
@@ -342,7 +345,7 @@ int git_diff_stats_to_buf(
342
345
  if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
343
346
  continue;
344
347
 
345
- error = git_diff_file_stats__summary_to_buf(out, delta);
348
+ error = diff_file_stats_summary_to_buf(out, delta);
346
349
  if (error < 0)
347
350
  return error;
348
351
  }
@@ -87,7 +87,7 @@ git_diff_delta *git_diff__merge_like_cgit(
87
87
  a->status == GIT_DELTA_UNREADABLE)
88
88
  return dup;
89
89
 
90
- assert(b->status != GIT_DELTA_UNMODIFIED);
90
+ GIT_ASSERT_WITH_RETVAL(b->status != GIT_DELTA_UNMODIFIED, NULL);
91
91
 
92
92
  /* A cgit exception is that the diff of a file that is only in the
93
93
  * index (i.e. not in HEAD nor workdir) is given as empty.
@@ -121,7 +121,8 @@ int git_diff__merge(
121
121
  bool ignore_case, reversed;
122
122
  unsigned int i, j;
123
123
 
124
- assert(onto && from);
124
+ GIT_ASSERT_ARG(onto);
125
+ GIT_ASSERT_ARG(from);
125
126
 
126
127
  if (!from->deltas.length)
127
128
  return 0;
@@ -136,11 +137,10 @@ int git_diff__merge(
136
137
  return -1;
137
138
  }
138
139
 
139
- if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0)
140
+ if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0 ||
141
+ git_pool_init(&onto_pool, 1) < 0)
140
142
  return -1;
141
143
 
142
- git_pool_init(&onto_pool, 1);
143
-
144
144
  for (i = 0, j = 0; i < onto->deltas.length || j < from->deltas.length; ) {
145
145
  git_diff_delta *o = GIT_VECTOR_GET(&onto->deltas, i);
146
146
  const git_diff_delta *f = GIT_VECTOR_GET(&from->deltas, j);
@@ -476,8 +476,8 @@ static int similarity_sig(
476
476
  git_diff_file *file = info->file;
477
477
 
478
478
  if (info->src == GIT_ITERATOR_WORKDIR) {
479
- if ((error = git_buf_joinpath(
480
- &info->data, git_repository_workdir(info->repo), file->path)) < 0)
479
+ if ((error = git_repository_workdir_path(
480
+ &info->data, info->repo, file->path)) < 0)
481
481
  return error;
482
482
 
483
483
  /* if path is not a regular file, just skip this item */
@@ -816,7 +816,7 @@ int git_diff_find_similar(
816
816
  diff_find_match *best_match;
817
817
  git_diff_file swap;
818
818
 
819
- assert(diff);
819
+ GIT_ASSERT_ARG(diff);
820
820
 
821
821
  if ((error = normalize_find_opts(diff, &opts, given_opts)) < 0)
822
822
  return error;
@@ -979,7 +979,7 @@ find_best_matches:
979
979
  src->flags |= GIT_DIFF_FLAG__TO_DELETE;
980
980
  num_rewrites++;
981
981
  } else {
982
- assert(delta_is_split(tgt));
982
+ GIT_ASSERT(delta_is_split(tgt));
983
983
 
984
984
  if (best_match->similarity < opts.rename_from_rewrite_threshold)
985
985
  continue;
@@ -989,7 +989,7 @@ find_best_matches:
989
989
  delta_make_rename(tgt, src, best_match->similarity);
990
990
  num_rewrites--;
991
991
 
992
- assert(src->status == GIT_DELTA_DELETED);
992
+ GIT_ASSERT(src->status == GIT_DELTA_DELETED);
993
993
  memcpy(&src->old_file, &swap, sizeof(src->old_file));
994
994
  memset(&src->new_file, 0, sizeof(src->new_file));
995
995
  src->new_file.path = src->old_file.path;
@@ -1025,7 +1025,7 @@ find_best_matches:
1025
1025
 
1026
1026
  num_updates++;
1027
1027
  } else {
1028
- assert(delta_is_split(src));
1028
+ GIT_ASSERT(delta_is_split(src));
1029
1029
 
1030
1030
  if (best_match->similarity < opts.rename_from_rewrite_threshold)
1031
1031
  continue;
@@ -1039,7 +1039,7 @@ find_best_matches:
1039
1039
  memcpy(&src->old_file, &swap, sizeof(src->old_file));
1040
1040
 
1041
1041
  /* if we've just swapped the new element into the correct
1042
- * place, clear the SPLIT flag
1042
+ * place, clear the SPLIT and RENAME_TARGET flags
1043
1043
  */
1044
1044
  if (tgt2src[s].idx == t &&
1045
1045
  tgt2src[s].similarity >
@@ -1047,7 +1047,7 @@ find_best_matches:
1047
1047
  src->status = GIT_DELTA_RENAMED;
1048
1048
  src->similarity = tgt2src[s].similarity;
1049
1049
  tgt2src[s].similarity = 0;
1050
- src->flags &= ~GIT_DIFF_FLAG__TO_SPLIT;
1050
+ src->flags &= ~(GIT_DIFF_FLAG__TO_SPLIT | GIT_DIFF_FLAG__IS_RENAME_TARGET);
1051
1051
  num_rewrites--;
1052
1052
  }
1053
1053
  /* otherwise, if we just overwrote a source, update mapping */