rugged 0.27.7 → 0.27.10

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 (409) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/AUTHORS +1 -0
  4. data/vendor/libgit2/CMakeLists.txt +99 -51
  5. data/vendor/libgit2/COPYING +28 -0
  6. data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
  7. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
  8. data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
  9. data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
  10. data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
  11. data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
  12. data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
  13. data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
  14. data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
  15. data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
  16. data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
  17. data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
  18. data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
  19. data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
  20. data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
  21. data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
  22. data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
  23. data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
  24. data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
  25. data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
  26. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
  27. data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
  28. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
  29. data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
  30. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
  31. data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
  32. data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
  33. data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
  34. data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
  35. data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
  36. data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
  37. data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
  38. data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
  39. data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
  40. data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
  41. data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
  42. data/vendor/libgit2/deps/pcre/COPYING +5 -0
  43. data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
  44. data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
  45. data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
  46. data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
  47. data/vendor/libgit2/deps/pcre/config.h.in +57 -0
  48. data/vendor/libgit2/deps/pcre/pcre.h +641 -0
  49. data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
  50. data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
  51. data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
  52. data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
  53. data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
  54. data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
  55. data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
  56. data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
  57. data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
  58. data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
  59. data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
  60. data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
  61. data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
  62. data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
  63. data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
  64. data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
  65. data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
  66. data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
  67. data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
  68. data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
  69. data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
  70. data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
  71. data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
  72. data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
  73. data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
  74. data/vendor/libgit2/deps/pcre/ucp.h +224 -0
  75. data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
  76. data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
  77. data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
  78. data/vendor/libgit2/deps/zlib/COPYING +27 -0
  79. data/vendor/libgit2/deps/zlib/adler32.c +0 -7
  80. data/vendor/libgit2/deps/zlib/crc32.c +0 -7
  81. data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
  82. data/vendor/libgit2/include/git2/apply.h +149 -0
  83. data/vendor/libgit2/include/git2/attr.h +20 -13
  84. data/vendor/libgit2/include/git2/blame.h +4 -4
  85. data/vendor/libgit2/include/git2/blob.h +44 -12
  86. data/vendor/libgit2/include/git2/buffer.h +20 -26
  87. data/vendor/libgit2/include/git2/cert.h +135 -0
  88. data/vendor/libgit2/include/git2/checkout.h +53 -21
  89. data/vendor/libgit2/include/git2/cherrypick.h +3 -3
  90. data/vendor/libgit2/include/git2/clone.h +5 -5
  91. data/vendor/libgit2/include/git2/commit.h +25 -3
  92. data/vendor/libgit2/include/git2/common.h +35 -10
  93. data/vendor/libgit2/include/git2/config.h +29 -19
  94. data/vendor/libgit2/include/git2/cred.h +308 -0
  95. data/vendor/libgit2/include/git2/deprecated.h +493 -0
  96. data/vendor/libgit2/include/git2/describe.h +4 -4
  97. data/vendor/libgit2/include/git2/diff.h +177 -135
  98. data/vendor/libgit2/include/git2/errors.h +53 -46
  99. data/vendor/libgit2/include/git2/filter.h +8 -0
  100. data/vendor/libgit2/include/git2/index.h +74 -52
  101. data/vendor/libgit2/include/git2/indexer.h +76 -6
  102. data/vendor/libgit2/include/git2/merge.h +25 -10
  103. data/vendor/libgit2/include/git2/net.h +0 -5
  104. data/vendor/libgit2/include/git2/notes.h +1 -1
  105. data/vendor/libgit2/include/git2/object.h +17 -29
  106. data/vendor/libgit2/include/git2/odb.h +12 -11
  107. data/vendor/libgit2/include/git2/odb_backend.h +10 -9
  108. data/vendor/libgit2/include/git2/oid.h +2 -2
  109. data/vendor/libgit2/include/git2/pack.h +14 -3
  110. data/vendor/libgit2/include/git2/proxy.h +5 -3
  111. data/vendor/libgit2/include/git2/rebase.h +46 -2
  112. data/vendor/libgit2/include/git2/refs.h +34 -16
  113. data/vendor/libgit2/include/git2/remote.h +111 -14
  114. data/vendor/libgit2/include/git2/repository.h +69 -34
  115. data/vendor/libgit2/include/git2/revert.h +1 -1
  116. data/vendor/libgit2/include/git2/revwalk.h +7 -7
  117. data/vendor/libgit2/include/git2/signature.h +2 -2
  118. data/vendor/libgit2/include/git2/stash.h +5 -5
  119. data/vendor/libgit2/include/git2/status.h +26 -17
  120. data/vendor/libgit2/include/git2/submodule.h +23 -6
  121. data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
  122. data/vendor/libgit2/include/git2/sys/commit.h +1 -1
  123. data/vendor/libgit2/include/git2/sys/config.h +13 -13
  124. data/vendor/libgit2/include/git2/sys/cred.h +90 -0
  125. data/vendor/libgit2/include/git2/sys/filter.h +6 -6
  126. data/vendor/libgit2/include/git2/sys/merge.h +3 -3
  127. data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
  128. data/vendor/libgit2/include/git2/sys/path.h +14 -5
  129. data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
  130. data/vendor/libgit2/include/git2/sys/repository.h +5 -1
  131. data/vendor/libgit2/include/git2/sys/stream.h +92 -12
  132. data/vendor/libgit2/include/git2/sys/transport.h +129 -83
  133. data/vendor/libgit2/include/git2/tag.h +13 -4
  134. data/vendor/libgit2/include/git2/trace.h +2 -2
  135. data/vendor/libgit2/include/git2/transport.h +11 -311
  136. data/vendor/libgit2/include/git2/tree.h +4 -4
  137. data/vendor/libgit2/include/git2/types.h +25 -106
  138. data/vendor/libgit2/include/git2/version.h +3 -3
  139. data/vendor/libgit2/include/git2/worktree.h +5 -5
  140. data/vendor/libgit2/include/git2.h +4 -0
  141. data/vendor/libgit2/src/CMakeLists.txt +104 -235
  142. data/vendor/libgit2/src/alloc.c +14 -18
  143. data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
  144. data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
  145. data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
  146. data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
  147. data/vendor/libgit2/src/annotated_commit.c +18 -11
  148. data/vendor/libgit2/src/apply.c +535 -28
  149. data/vendor/libgit2/src/apply.h +3 -1
  150. data/vendor/libgit2/src/array.h +2 -2
  151. data/vendor/libgit2/src/attr.c +77 -71
  152. data/vendor/libgit2/src/attr_file.c +203 -117
  153. data/vendor/libgit2/src/attr_file.h +9 -9
  154. data/vendor/libgit2/src/attrcache.c +49 -51
  155. data/vendor/libgit2/src/attrcache.h +2 -1
  156. data/vendor/libgit2/src/blame.c +38 -18
  157. data/vendor/libgit2/src/blame.h +1 -1
  158. data/vendor/libgit2/src/blame_git.c +29 -15
  159. data/vendor/libgit2/src/blob.c +123 -37
  160. data/vendor/libgit2/src/blob.h +19 -2
  161. data/vendor/libgit2/src/branch.c +47 -23
  162. data/vendor/libgit2/src/buf_text.c +7 -6
  163. data/vendor/libgit2/src/buffer.c +60 -53
  164. data/vendor/libgit2/src/cache.c +38 -45
  165. data/vendor/libgit2/src/cache.h +3 -3
  166. data/vendor/libgit2/src/cc-compat.h +20 -3
  167. data/vendor/libgit2/src/checkout.c +77 -67
  168. data/vendor/libgit2/src/cherrypick.c +12 -6
  169. data/vendor/libgit2/src/clone.c +36 -14
  170. data/vendor/libgit2/src/clone.h +4 -0
  171. data/vendor/libgit2/src/commit.c +103 -48
  172. data/vendor/libgit2/src/commit.h +7 -0
  173. data/vendor/libgit2/src/commit_list.c +36 -78
  174. data/vendor/libgit2/src/commit_list.h +2 -2
  175. data/vendor/libgit2/src/common.h +24 -90
  176. data/vendor/libgit2/src/config.c +203 -176
  177. data/vendor/libgit2/src/config.h +8 -20
  178. data/vendor/libgit2/src/config_backend.h +96 -0
  179. data/vendor/libgit2/src/config_cache.c +41 -35
  180. data/vendor/libgit2/src/config_entries.c +229 -0
  181. data/vendor/libgit2/src/config_entries.h +24 -0
  182. data/vendor/libgit2/src/config_file.c +422 -680
  183. data/vendor/libgit2/src/config_mem.c +220 -0
  184. data/vendor/libgit2/src/config_parse.c +96 -68
  185. data/vendor/libgit2/src/config_parse.h +15 -14
  186. data/vendor/libgit2/src/config_snapshot.c +206 -0
  187. data/vendor/libgit2/src/crlf.c +219 -196
  188. data/vendor/libgit2/src/delta.c +25 -18
  189. data/vendor/libgit2/src/describe.c +42 -41
  190. data/vendor/libgit2/src/diff.c +52 -67
  191. data/vendor/libgit2/src/diff.h +2 -1
  192. data/vendor/libgit2/src/diff_driver.c +44 -46
  193. data/vendor/libgit2/src/diff_file.c +16 -14
  194. data/vendor/libgit2/src/diff_file.h +1 -1
  195. data/vendor/libgit2/src/diff_generate.c +158 -103
  196. data/vendor/libgit2/src/diff_generate.h +3 -3
  197. data/vendor/libgit2/src/diff_parse.c +4 -4
  198. data/vendor/libgit2/src/diff_print.c +34 -22
  199. data/vendor/libgit2/src/diff_stats.c +22 -7
  200. data/vendor/libgit2/src/diff_tform.c +18 -16
  201. data/vendor/libgit2/src/diff_xdiff.c +3 -3
  202. data/vendor/libgit2/src/errors.c +51 -39
  203. data/vendor/libgit2/src/errors.h +81 -0
  204. data/vendor/libgit2/src/features.h.in +9 -3
  205. data/vendor/libgit2/src/fetch.c +8 -3
  206. data/vendor/libgit2/src/fetchhead.c +12 -12
  207. data/vendor/libgit2/src/filebuf.c +28 -32
  208. data/vendor/libgit2/src/filebuf.h +2 -2
  209. data/vendor/libgit2/src/filter.c +47 -33
  210. data/vendor/libgit2/src/filter.h +0 -10
  211. data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
  212. data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
  213. data/vendor/libgit2/src/global.c +35 -55
  214. data/vendor/libgit2/src/global.h +0 -2
  215. data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
  216. data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
  217. data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
  218. data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
  219. data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
  220. data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
  221. data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
  222. data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
  223. data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
  224. data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
  225. data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
  226. data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
  227. data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
  228. data/vendor/libgit2/src/hash/sha1.h +38 -0
  229. data/vendor/libgit2/src/hash.c +61 -0
  230. data/vendor/libgit2/src/hash.h +20 -21
  231. data/vendor/libgit2/src/hashsig.c +5 -5
  232. data/vendor/libgit2/src/idxmap.c +107 -61
  233. data/vendor/libgit2/src/idxmap.h +153 -31
  234. data/vendor/libgit2/src/ignore.c +38 -42
  235. data/vendor/libgit2/src/index.c +264 -199
  236. data/vendor/libgit2/src/index.h +7 -1
  237. data/vendor/libgit2/src/indexer.c +338 -167
  238. data/vendor/libgit2/src/integer.h +71 -26
  239. data/vendor/libgit2/src/iterator.c +134 -62
  240. data/vendor/libgit2/src/iterator.h +15 -0
  241. data/vendor/libgit2/src/mailmap.c +8 -8
  242. data/vendor/libgit2/src/map.h +1 -1
  243. data/vendor/libgit2/src/merge.c +137 -93
  244. data/vendor/libgit2/src/merge_driver.c +11 -11
  245. data/vendor/libgit2/src/merge_file.c +2 -2
  246. data/vendor/libgit2/src/mwindow.c +24 -29
  247. data/vendor/libgit2/src/mwindow.h +4 -4
  248. data/vendor/libgit2/src/net.c +184 -0
  249. data/vendor/libgit2/src/net.h +36 -0
  250. data/vendor/libgit2/src/netops.c +55 -156
  251. data/vendor/libgit2/src/netops.h +3 -23
  252. data/vendor/libgit2/src/notes.c +14 -9
  253. data/vendor/libgit2/src/object.c +120 -69
  254. data/vendor/libgit2/src/object.h +22 -9
  255. data/vendor/libgit2/src/object_api.c +8 -8
  256. data/vendor/libgit2/src/odb.c +111 -88
  257. data/vendor/libgit2/src/odb.h +8 -7
  258. data/vendor/libgit2/src/odb_loose.c +58 -47
  259. data/vendor/libgit2/src/odb_mempack.c +21 -34
  260. data/vendor/libgit2/src/odb_pack.c +17 -13
  261. data/vendor/libgit2/src/offmap.c +53 -35
  262. data/vendor/libgit2/src/offmap.h +108 -21
  263. data/vendor/libgit2/src/oid.c +12 -7
  264. data/vendor/libgit2/src/oidmap.c +49 -47
  265. data/vendor/libgit2/src/oidmap.h +101 -24
  266. data/vendor/libgit2/src/pack-objects.c +87 -86
  267. data/vendor/libgit2/src/pack-objects.h +2 -8
  268. data/vendor/libgit2/src/pack.c +94 -96
  269. data/vendor/libgit2/src/pack.h +16 -18
  270. data/vendor/libgit2/src/parse.c +17 -4
  271. data/vendor/libgit2/src/parse.h +3 -3
  272. data/vendor/libgit2/src/patch.c +3 -3
  273. data/vendor/libgit2/src/patch_generate.c +18 -18
  274. data/vendor/libgit2/src/patch_parse.c +147 -79
  275. data/vendor/libgit2/src/path.c +207 -62
  276. data/vendor/libgit2/src/path.h +14 -0
  277. data/vendor/libgit2/src/pathspec.c +18 -18
  278. data/vendor/libgit2/src/pool.c +26 -22
  279. data/vendor/libgit2/src/pool.h +7 -7
  280. data/vendor/libgit2/src/posix.c +10 -10
  281. data/vendor/libgit2/src/posix.h +12 -1
  282. data/vendor/libgit2/src/proxy.c +8 -3
  283. data/vendor/libgit2/src/push.c +35 -29
  284. data/vendor/libgit2/src/push.h +2 -1
  285. data/vendor/libgit2/src/reader.c +265 -0
  286. data/vendor/libgit2/src/reader.h +107 -0
  287. data/vendor/libgit2/src/rebase.c +97 -38
  288. data/vendor/libgit2/src/refdb.c +15 -3
  289. data/vendor/libgit2/src/refdb_fs.c +318 -222
  290. data/vendor/libgit2/src/reflog.c +13 -15
  291. data/vendor/libgit2/src/refs.c +122 -89
  292. data/vendor/libgit2/src/refs.h +5 -3
  293. data/vendor/libgit2/src/refspec.c +27 -33
  294. data/vendor/libgit2/src/regexp.c +221 -0
  295. data/vendor/libgit2/src/regexp.h +97 -0
  296. data/vendor/libgit2/src/remote.c +229 -178
  297. data/vendor/libgit2/src/remote.h +11 -2
  298. data/vendor/libgit2/src/repository.c +227 -172
  299. data/vendor/libgit2/src/repository.h +52 -40
  300. data/vendor/libgit2/src/reset.c +7 -7
  301. data/vendor/libgit2/src/revert.c +11 -6
  302. data/vendor/libgit2/src/revparse.c +46 -46
  303. data/vendor/libgit2/src/revwalk.c +89 -54
  304. data/vendor/libgit2/src/revwalk.h +20 -0
  305. data/vendor/libgit2/src/settings.c +22 -9
  306. data/vendor/libgit2/src/signature.c +15 -13
  307. data/vendor/libgit2/src/sortedcache.c +22 -36
  308. data/vendor/libgit2/src/sortedcache.h +1 -1
  309. data/vendor/libgit2/src/stash.c +56 -76
  310. data/vendor/libgit2/src/status.c +27 -21
  311. data/vendor/libgit2/src/stream.h +17 -2
  312. data/vendor/libgit2/src/streams/mbedtls.c +100 -80
  313. data/vendor/libgit2/src/streams/mbedtls.h +5 -2
  314. data/vendor/libgit2/src/streams/openssl.c +93 -81
  315. data/vendor/libgit2/src/streams/openssl.h +5 -2
  316. data/vendor/libgit2/src/streams/registry.c +118 -0
  317. data/vendor/libgit2/src/streams/registry.h +19 -0
  318. data/vendor/libgit2/src/streams/socket.c +55 -30
  319. data/vendor/libgit2/src/streams/stransport.c +57 -32
  320. data/vendor/libgit2/src/streams/stransport.h +5 -0
  321. data/vendor/libgit2/src/streams/tls.c +48 -20
  322. data/vendor/libgit2/src/streams/tls.h +12 -4
  323. data/vendor/libgit2/src/strmap.c +47 -74
  324. data/vendor/libgit2/src/strmap.h +108 -33
  325. data/vendor/libgit2/src/submodule.c +190 -169
  326. data/vendor/libgit2/src/submodule.h +1 -1
  327. data/vendor/libgit2/src/sysdir.c +25 -15
  328. data/vendor/libgit2/src/tag.c +39 -26
  329. data/vendor/libgit2/src/tag.h +2 -1
  330. data/vendor/libgit2/src/trace.c +2 -2
  331. data/vendor/libgit2/src/trace.h +2 -2
  332. data/vendor/libgit2/src/trailer.c +46 -32
  333. data/vendor/libgit2/src/transaction.c +30 -29
  334. data/vendor/libgit2/src/transport.c +3 -3
  335. data/vendor/libgit2/src/transports/auth.c +14 -10
  336. data/vendor/libgit2/src/transports/auth.h +10 -3
  337. data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
  338. data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
  339. data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
  340. data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
  341. data/vendor/libgit2/src/transports/cred.c +24 -24
  342. data/vendor/libgit2/src/transports/git.c +25 -30
  343. data/vendor/libgit2/src/transports/http.c +871 -335
  344. data/vendor/libgit2/src/transports/http.h +2 -0
  345. data/vendor/libgit2/src/transports/local.c +28 -28
  346. data/vendor/libgit2/src/transports/smart.c +64 -46
  347. data/vendor/libgit2/src/transports/smart.h +5 -6
  348. data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
  349. data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
  350. data/vendor/libgit2/src/transports/ssh.c +76 -65
  351. data/vendor/libgit2/src/transports/winhttp.c +328 -319
  352. data/vendor/libgit2/src/tree-cache.c +21 -14
  353. data/vendor/libgit2/src/tree.c +119 -112
  354. data/vendor/libgit2/src/tree.h +1 -0
  355. data/vendor/libgit2/src/unix/map.c +3 -3
  356. data/vendor/libgit2/src/unix/posix.h +1 -11
  357. data/vendor/libgit2/src/userdiff.h +3 -1
  358. data/vendor/libgit2/src/util.c +154 -93
  359. data/vendor/libgit2/src/util.h +19 -23
  360. data/vendor/libgit2/src/vector.c +15 -10
  361. data/vendor/libgit2/src/wildmatch.c +320 -0
  362. data/vendor/libgit2/src/wildmatch.h +23 -0
  363. data/vendor/libgit2/src/win32/dir.c +3 -3
  364. data/vendor/libgit2/src/win32/findfile.c +1 -1
  365. data/vendor/libgit2/src/win32/map.c +9 -11
  366. data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
  367. data/vendor/libgit2/src/win32/path_w32.c +113 -9
  368. data/vendor/libgit2/src/win32/path_w32.h +18 -29
  369. data/vendor/libgit2/src/win32/posix.h +1 -4
  370. data/vendor/libgit2/src/win32/posix_w32.c +69 -44
  371. data/vendor/libgit2/src/win32/precompiled.h +0 -2
  372. data/vendor/libgit2/src/win32/thread.c +5 -10
  373. data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
  374. data/vendor/libgit2/src/win32/w32_common.h +39 -0
  375. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
  376. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
  377. data/vendor/libgit2/src/win32/w32_stack.c +6 -11
  378. data/vendor/libgit2/src/win32/w32_stack.h +3 -3
  379. data/vendor/libgit2/src/win32/w32_util.c +27 -64
  380. data/vendor/libgit2/src/win32/w32_util.h +5 -49
  381. data/vendor/libgit2/src/worktree.c +44 -30
  382. data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
  383. data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
  384. data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
  385. data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
  386. data/vendor/libgit2/src/zstream.c +4 -4
  387. metadata +115 -38
  388. data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
  389. data/vendor/libgit2/deps/regex/config.h +0 -7
  390. data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
  391. data/vendor/libgit2/deps/regex/regex.c +0 -92
  392. data/vendor/libgit2/deps/regex/regex.h +0 -582
  393. data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
  394. data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
  395. data/vendor/libgit2/deps/regex/regexec.c +0 -4369
  396. data/vendor/libgit2/include/git2/inttypes.h +0 -309
  397. data/vendor/libgit2/include/git2/sys/time.h +0 -31
  398. data/vendor/libgit2/libgit2.pc.in +0 -13
  399. data/vendor/libgit2/src/config_file.h +0 -73
  400. data/vendor/libgit2/src/fnmatch.c +0 -248
  401. data/vendor/libgit2/src/fnmatch.h +0 -48
  402. data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
  403. data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
  404. data/vendor/libgit2/src/streams/curl.c +0 -385
  405. data/vendor/libgit2/src/streams/curl.h +0 -17
  406. /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
  407. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
  408. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
  409. /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
@@ -15,7 +15,7 @@
15
15
  #include "buf_text.h"
16
16
  #include "vector.h"
17
17
  #include "posix.h"
18
- #include "config_file.h"
18
+ #include "config_backend.h"
19
19
  #include "config.h"
20
20
  #include "repository.h"
21
21
  #include "tree.h"
@@ -23,31 +23,32 @@
23
23
  #include "path.h"
24
24
  #include "index.h"
25
25
  #include "worktree.h"
26
+ #include "clone.h"
26
27
 
27
28
  #define GIT_MODULES_FILE ".gitmodules"
28
29
 
29
- static git_cvar_map _sm_update_map[] = {
30
- {GIT_CVAR_STRING, "checkout", GIT_SUBMODULE_UPDATE_CHECKOUT},
31
- {GIT_CVAR_STRING, "rebase", GIT_SUBMODULE_UPDATE_REBASE},
32
- {GIT_CVAR_STRING, "merge", GIT_SUBMODULE_UPDATE_MERGE},
33
- {GIT_CVAR_STRING, "none", GIT_SUBMODULE_UPDATE_NONE},
34
- {GIT_CVAR_FALSE, NULL, GIT_SUBMODULE_UPDATE_NONE},
35
- {GIT_CVAR_TRUE, NULL, GIT_SUBMODULE_UPDATE_CHECKOUT},
30
+ static git_configmap _sm_update_map[] = {
31
+ {GIT_CONFIGMAP_STRING, "checkout", GIT_SUBMODULE_UPDATE_CHECKOUT},
32
+ {GIT_CONFIGMAP_STRING, "rebase", GIT_SUBMODULE_UPDATE_REBASE},
33
+ {GIT_CONFIGMAP_STRING, "merge", GIT_SUBMODULE_UPDATE_MERGE},
34
+ {GIT_CONFIGMAP_STRING, "none", GIT_SUBMODULE_UPDATE_NONE},
35
+ {GIT_CONFIGMAP_FALSE, NULL, GIT_SUBMODULE_UPDATE_NONE},
36
+ {GIT_CONFIGMAP_TRUE, NULL, GIT_SUBMODULE_UPDATE_CHECKOUT},
36
37
  };
37
38
 
38
- static git_cvar_map _sm_ignore_map[] = {
39
- {GIT_CVAR_STRING, "none", GIT_SUBMODULE_IGNORE_NONE},
40
- {GIT_CVAR_STRING, "untracked", GIT_SUBMODULE_IGNORE_UNTRACKED},
41
- {GIT_CVAR_STRING, "dirty", GIT_SUBMODULE_IGNORE_DIRTY},
42
- {GIT_CVAR_STRING, "all", GIT_SUBMODULE_IGNORE_ALL},
43
- {GIT_CVAR_FALSE, NULL, GIT_SUBMODULE_IGNORE_NONE},
44
- {GIT_CVAR_TRUE, NULL, GIT_SUBMODULE_IGNORE_ALL},
39
+ static git_configmap _sm_ignore_map[] = {
40
+ {GIT_CONFIGMAP_STRING, "none", GIT_SUBMODULE_IGNORE_NONE},
41
+ {GIT_CONFIGMAP_STRING, "untracked", GIT_SUBMODULE_IGNORE_UNTRACKED},
42
+ {GIT_CONFIGMAP_STRING, "dirty", GIT_SUBMODULE_IGNORE_DIRTY},
43
+ {GIT_CONFIGMAP_STRING, "all", GIT_SUBMODULE_IGNORE_ALL},
44
+ {GIT_CONFIGMAP_FALSE, NULL, GIT_SUBMODULE_IGNORE_NONE},
45
+ {GIT_CONFIGMAP_TRUE, NULL, GIT_SUBMODULE_IGNORE_ALL},
45
46
  };
46
47
 
47
- static git_cvar_map _sm_recurse_map[] = {
48
- {GIT_CVAR_STRING, "on-demand", GIT_SUBMODULE_RECURSE_ONDEMAND},
49
- {GIT_CVAR_FALSE, NULL, GIT_SUBMODULE_RECURSE_NO},
50
- {GIT_CVAR_TRUE, NULL, GIT_SUBMODULE_RECURSE_YES},
48
+ static git_configmap _sm_recurse_map[] = {
49
+ {GIT_CONFIGMAP_STRING, "on-demand", GIT_SUBMODULE_RECURSE_ONDEMAND},
50
+ {GIT_CONFIGMAP_FALSE, NULL, GIT_SUBMODULE_RECURSE_NO},
51
+ {GIT_CONFIGMAP_TRUE, NULL, GIT_SUBMODULE_RECURSE_YES},
51
52
  };
52
53
 
53
54
  enum {
@@ -60,35 +61,6 @@ enum {
60
61
  GITMODULES_CREATE = 1,
61
62
  };
62
63
 
63
- static kh_inline khint_t str_hash_no_trailing_slash(const char *s)
64
- {
65
- khint_t h;
66
-
67
- for (h = 0; *s; ++s)
68
- if (s[1] != '\0' || *s != '/')
69
- h = (h << 5) - h + *s;
70
-
71
- return h;
72
- }
73
-
74
- static kh_inline int str_equal_no_trailing_slash(const char *a, const char *b)
75
- {
76
- size_t alen = a ? strlen(a) : 0;
77
- size_t blen = b ? strlen(b) : 0;
78
-
79
- if (alen > 0 && a[alen - 1] == '/')
80
- alen--;
81
- if (blen > 0 && b[blen - 1] == '/')
82
- blen--;
83
-
84
- return (alen == 0 && blen == 0) ||
85
- (alen == blen && strncmp(a, b, alen) == 0);
86
- }
87
-
88
- __KHASH_IMPL(
89
- str, static kh_inline, const char *, void *, 1,
90
- str_hash_no_trailing_slash, str_equal_no_trailing_slash)
91
-
92
64
  static int submodule_alloc(git_submodule **out, git_repository *repo, const char *name);
93
65
  static git_config_backend *open_gitmodules(git_repository *repo, int gitmod);
94
66
  static int gitmodules_snapshot(git_config **snap, git_repository *repo);
@@ -124,7 +96,7 @@ static void submodule_set_lookup_error(int error, const char *name)
124
96
  if (!error)
125
97
  return;
126
98
 
127
- giterr_set(GITERR_SUBMODULE, (error == GIT_ENOTFOUND) ?
99
+ git_error_set(GIT_ERROR_SUBMODULE, (error == GIT_ENOTFOUND) ?
128
100
  "no submodule named '%s'" :
129
101
  "submodule '%s' has not been added yet", name);
130
102
  }
@@ -143,7 +115,7 @@ static int find_by_path(const git_config_entry *entry, void *payload)
143
115
  fdot = strchr(entry->name, '.');
144
116
  ldot = strrchr(entry->name, '.');
145
117
  data->name = git__strndup(fdot + 1, ldot - fdot - 1);
146
- GITERR_CHECK_ALLOC(data->name);
118
+ GIT_ERROR_CHECK_ALLOC(data->name);
147
119
  }
148
120
 
149
121
  return 0;
@@ -165,7 +137,7 @@ static int is_path_occupied(bool *occupied, git_repository *repo, const char *pa
165
137
 
166
138
  if ((error = git_index_find(NULL, index, path)) != GIT_ENOTFOUND) {
167
139
  if (!error) {
168
- giterr_set(GITERR_SUBMODULE,
140
+ git_error_set(GIT_ERROR_SUBMODULE,
169
141
  "File '%s' already exists in the index", path);
170
142
  *occupied = true;
171
143
  }
@@ -180,7 +152,7 @@ static int is_path_occupied(bool *occupied, git_repository *repo, const char *pa
180
152
 
181
153
  if ((error = git_index_find_prefix(NULL, index, dir.ptr)) != GIT_ENOTFOUND) {
182
154
  if (!error) {
183
- giterr_set(GITERR_SUBMODULE,
155
+ git_error_set(GIT_ERROR_SUBMODULE,
184
156
  "Directory '%s' already exists in the index", path);
185
157
  *occupied = true;
186
158
  }
@@ -199,13 +171,15 @@ out:
199
171
  */
200
172
  static void free_submodule_names(git_strmap *names)
201
173
  {
202
- git_buf *name;
174
+ const char *key;
175
+ char *value;
203
176
 
204
177
  if (names == NULL)
205
178
  return;
206
179
 
207
- git_strmap_foreach_value(names, name, {
208
- git__free(name);
180
+ git_strmap_foreach(names, key, value, {
181
+ git__free((char *) key);
182
+ git__free(value);
209
183
  });
210
184
  git_strmap_free(names);
211
185
 
@@ -224,24 +198,23 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
224
198
  git_config_entry *entry;
225
199
  git_buf buf = GIT_BUF_INIT;
226
200
  git_strmap *names;
227
- int rval, isvalid;
228
- int error = 0;
201
+ int isvalid, error;
229
202
 
230
203
  *out = NULL;
231
204
 
232
- if ((error = git_strmap_alloc(&names)) < 0)
205
+ if ((error = git_strmap_new(&names)) < 0)
233
206
  goto out;
234
207
 
235
208
  if ((error = git_config_iterator_glob_new(&iter, cfg, key)) < 0)
236
209
  goto out;
237
210
 
238
- while (git_config_next(&entry, iter) == 0) {
211
+ while ((error = git_config_next(&entry, iter)) == 0) {
239
212
  const char *fdot, *ldot;
240
213
  fdot = strchr(entry->name, '.');
241
214
  ldot = strrchr(entry->name, '.');
242
215
 
243
216
  if (git_strmap_exists(names, entry->value)) {
244
- giterr_set(GITERR_SUBMODULE,
217
+ git_error_set(GIT_ERROR_SUBMODULE,
245
218
  "duplicated submodule path '%s'", entry->value);
246
219
  error = -1;
247
220
  goto out;
@@ -257,10 +230,10 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
257
230
  if (!isvalid)
258
231
  continue;
259
232
 
260
- git_strmap_insert(names, entry->value, git_buf_detach(&buf), &rval);
261
- if (rval < 0) {
262
- giterr_set(GITERR_NOMEMORY, "error inserting submodule into hash table");
263
- return -1;
233
+ if ((error = git_strmap_set(names, git__strdup(entry->value), git_buf_detach(&buf))) < 0) {
234
+ git_error_set(GIT_ERROR_NOMEMORY, "error inserting submodule into hash table");
235
+ error = -1;
236
+ goto out;
264
237
  }
265
238
  }
266
239
  if (error == GIT_ITEROVER)
@@ -288,15 +261,14 @@ int git_submodule_lookup(
288
261
  assert(repo && name);
289
262
 
290
263
  if (repo->is_bare) {
291
- giterr_set(GITERR_SUBMODULE, "cannot get submodules without a working tree");
264
+ git_error_set(GIT_ERROR_SUBMODULE, "cannot get submodules without a working tree");
292
265
  return -1;
293
266
  }
294
267
 
295
268
  if (repo->submodule_cache != NULL) {
296
- khiter_t pos = git_strmap_lookup_index(repo->submodule_cache, name);
297
- if (git_strmap_valid_index(repo->submodule_cache, pos)) {
269
+ if ((sm = git_strmap_get(repo->submodule_cache, name)) != NULL) {
298
270
  if (out) {
299
- *out = git_strmap_value_at(repo->submodule_cache, pos);
271
+ *out = sm;
300
272
  GIT_REFCOUNT_INC(*out);
301
273
  }
302
274
  return 0;
@@ -332,9 +304,9 @@ int git_submodule_lookup(
332
304
  mods = open_gitmodules(repo, GITMODULES_EXISTING);
333
305
 
334
306
  if (mods)
335
- error = git_config_file_foreach_match(mods, pattern, find_by_path, &data);
307
+ error = git_config_backend_foreach_match(mods, pattern, find_by_path, &data);
336
308
 
337
- git_config_file_free(mods);
309
+ git_config_backend_free(mods);
338
310
 
339
311
  if (error < 0) {
340
312
  git_submodule_free(sm);
@@ -421,30 +393,21 @@ static void submodule_free_dup(void *sm)
421
393
 
422
394
  static int submodule_get_or_create(git_submodule **out, git_repository *repo, git_strmap *map, const char *name)
423
395
  {
424
- int error = 0;
425
- khiter_t pos;
426
396
  git_submodule *sm = NULL;
397
+ int error;
427
398
 
428
- pos = git_strmap_lookup_index(map, name);
429
- if (git_strmap_valid_index(map, pos)) {
430
- sm = git_strmap_value_at(map, pos);
399
+ if ((sm = git_strmap_get(map, name)) != NULL)
431
400
  goto done;
432
- }
433
401
 
434
402
  /* if the submodule doesn't exist yet in the map, create it */
435
403
  if ((error = submodule_alloc(&sm, repo, name)) < 0)
436
404
  return error;
437
405
 
438
- pos = git_strmap_put(map, sm->name, &error);
439
- /* nobody can beat us to adding it */
440
- assert(error != 0);
441
- if (error < 0) {
406
+ if ((error = git_strmap_set(map, sm->name, sm)) < 0) {
442
407
  git_submodule_free(sm);
443
408
  return error;
444
409
  }
445
410
 
446
- git_strmap_set_value_at(map, pos, sm);
447
-
448
411
  done:
449
412
  GIT_REFCOUNT_INC(sm);
450
413
  *out = sm;
@@ -465,26 +428,18 @@ static int submodules_from_index(git_strmap *map, git_index *idx, git_config *cf
465
428
  goto done;
466
429
 
467
430
  while (!(error = git_iterator_advance(&entry, i))) {
468
- khiter_t pos = git_strmap_lookup_index(map, entry->path);
469
431
  git_submodule *sm;
470
432
 
471
- if (git_strmap_valid_index(map, pos)) {
472
- sm = git_strmap_value_at(map, pos);
473
-
433
+ if ((sm = git_strmap_get(map, entry->path)) != NULL) {
474
434
  if (S_ISGITLINK(entry->mode))
475
435
  submodule_update_from_index_entry(sm, entry);
476
436
  else
477
437
  sm->flags |= GIT_SUBMODULE_STATUS__INDEX_NOT_SUBMODULE;
478
438
  } else if (S_ISGITLINK(entry->mode)) {
479
- khiter_t name_pos;
480
439
  const char *name;
481
440
 
482
- name_pos = git_strmap_lookup_index(names, entry->path);
483
- if (git_strmap_valid_index(names, name_pos)) {
484
- name = git_strmap_value_at(names, name_pos);
485
- } else {
441
+ if ((name = git_strmap_get(names, entry->path)) == NULL)
486
442
  name = entry->path;
487
- }
488
443
 
489
444
  if (!submodule_get_or_create(&sm, git_index_owner(idx), map, name)) {
490
445
  submodule_update_from_index_entry(sm, entry);
@@ -517,26 +472,18 @@ static int submodules_from_head(git_strmap *map, git_tree *head, git_config *cfg
517
472
  goto done;
518
473
 
519
474
  while (!(error = git_iterator_advance(&entry, i))) {
520
- khiter_t pos = git_strmap_lookup_index(map, entry->path);
521
475
  git_submodule *sm;
522
476
 
523
- if (git_strmap_valid_index(map, pos)) {
524
- sm = git_strmap_value_at(map, pos);
525
-
477
+ if ((sm = git_strmap_get(map, entry->path)) != NULL) {
526
478
  if (S_ISGITLINK(entry->mode))
527
479
  submodule_update_from_head_data(sm, entry->mode, &entry->id);
528
480
  else
529
481
  sm->flags |= GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE;
530
482
  } else if (S_ISGITLINK(entry->mode)) {
531
- khiter_t name_pos;
532
483
  const char *name;
533
484
 
534
- name_pos = git_strmap_lookup_index(names, entry->path);
535
- if (git_strmap_valid_index(names, name_pos)) {
536
- name = git_strmap_value_at(names, name_pos);
537
- } else {
485
+ if ((name = git_strmap_get(names, entry->path)) == NULL)
538
486
  name = entry->path;
539
- }
540
487
 
541
488
  if (!submodule_get_or_create(&sm, git_tree_owner(head), map, name)) {
542
489
  submodule_update_from_head_data(
@@ -577,9 +524,9 @@ int git_submodule__map(git_repository *repo, git_strmap *map)
577
524
 
578
525
  /* get sources that we will need to check */
579
526
  if (git_repository_index(&idx, repo) < 0)
580
- giterr_clear();
527
+ git_error_clear();
581
528
  if (git_repository_head_tree(&head, repo) < 0)
582
- giterr_clear();
529
+ git_error_clear();
583
530
 
584
531
  wd = git_repository_workdir(repo);
585
532
  if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0)
@@ -640,18 +587,18 @@ int git_submodule_foreach(
640
587
  size_t i;
641
588
 
642
589
  if (repo->is_bare) {
643
- giterr_set(GITERR_SUBMODULE, "cannot get submodules without a working tree");
590
+ git_error_set(GIT_ERROR_SUBMODULE, "cannot get submodules without a working tree");
644
591
  return -1;
645
592
  }
646
593
 
647
- if ((error = git_strmap_alloc(&submodules)) < 0)
594
+ if ((error = git_strmap_new(&submodules)) < 0)
648
595
  return error;
649
596
 
650
597
  if ((error = git_submodule__map(repo, submodules)) < 0)
651
598
  goto done;
652
599
 
653
600
  if (!(error = git_vector_init(
654
- &snapshot, git_strmap_num_entries(submodules), submodule_cmp))) {
601
+ &snapshot, git_strmap_size(submodules), submodule_cmp))) {
655
602
 
656
603
  git_strmap_foreach_value(submodules, sm, {
657
604
  if ((error = git_vector_insert(&snapshot, sm)) < 0)
@@ -667,7 +614,7 @@ int git_submodule_foreach(
667
614
 
668
615
  git_vector_foreach(&snapshot, i, sm) {
669
616
  if ((error = callback(sm, sm->name, payload)) != 0) {
670
- giterr_set_after_callback(error);
617
+ git_error_set_after_callback(error);
671
618
  break;
672
619
  }
673
620
  }
@@ -756,9 +703,9 @@ int git_submodule_add_setup(
756
703
  /* see if there is already an entry for this submodule */
757
704
 
758
705
  if (git_submodule_lookup(NULL, repo, path) < 0)
759
- giterr_clear();
706
+ git_error_clear();
760
707
  else {
761
- giterr_set(GITERR_SUBMODULE,
708
+ git_error_set(GIT_ERROR_SUBMODULE,
762
709
  "attempt to add submodule '%s' that already exists", path);
763
710
  return GIT_EEXISTS;
764
711
  }
@@ -769,7 +716,7 @@ int git_submodule_add_setup(
769
716
  path += strlen(git_repository_workdir(repo));
770
717
 
771
718
  if (git_path_root(path) >= 0) {
772
- giterr_set(GITERR_SUBMODULE, "submodule path must be a relative path");
719
+ git_error_set(GIT_ERROR_SUBMODULE, "submodule path must be a relative path");
773
720
  error = -1;
774
721
  goto cleanup;
775
722
  }
@@ -785,17 +732,17 @@ int git_submodule_add_setup(
785
732
  /* update .gitmodules */
786
733
 
787
734
  if (!(mods = open_gitmodules(repo, GITMODULES_CREATE))) {
788
- giterr_set(GITERR_SUBMODULE,
735
+ git_error_set(GIT_ERROR_SUBMODULE,
789
736
  "adding submodules to a bare repository is not supported");
790
737
  return -1;
791
738
  }
792
739
 
793
740
  if ((error = git_buf_printf(&name, "submodule.%s.path", path)) < 0 ||
794
- (error = git_config_file_set_string(mods, name.ptr, path)) < 0)
741
+ (error = git_config_backend_set_string(mods, name.ptr, path)) < 0)
795
742
  goto cleanup;
796
743
 
797
744
  if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 ||
798
- (error = git_config_file_set_string(mods, name.ptr, url)) < 0)
745
+ (error = git_config_backend_set_string(mods, name.ptr, url)) < 0)
799
746
  goto cleanup;
800
747
 
801
748
  git_buf_clear(&name);
@@ -833,7 +780,7 @@ cleanup:
833
780
  if (out != NULL)
834
781
  *out = sm;
835
782
 
836
- git_config_file_free(mods);
783
+ git_config_backend_free(mods);
837
784
  git_repository_free(subrepo);
838
785
  git_buf_dispose(&real_url);
839
786
  git_buf_dispose(&name);
@@ -869,6 +816,64 @@ done:
869
816
  return error;
870
817
  }
871
818
 
819
+ static int clone_return_origin(git_remote **out, git_repository *repo, const char *name, const char *url, void *payload)
820
+ {
821
+ GIT_UNUSED(url);
822
+ GIT_UNUSED(payload);
823
+ return git_remote_lookup(out, repo, name);
824
+ }
825
+
826
+ static int clone_return_repo(git_repository **out, const char *path, int bare, void *payload)
827
+ {
828
+ git_submodule *sm = payload;
829
+
830
+ GIT_UNUSED(path);
831
+ GIT_UNUSED(bare);
832
+ return git_submodule_open(out, sm);
833
+ }
834
+
835
+ int git_submodule_clone(git_repository **out, git_submodule *submodule, const git_submodule_update_options *given_opts)
836
+ {
837
+ int error;
838
+ git_repository *clone;
839
+ git_buf rel_path = GIT_BUF_INIT;
840
+ git_submodule_update_options sub_opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;
841
+ git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
842
+
843
+ assert(submodule);
844
+
845
+ if (given_opts)
846
+ memcpy(&sub_opts, given_opts, sizeof(sub_opts));
847
+
848
+ GIT_ERROR_CHECK_VERSION(&sub_opts, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
849
+
850
+ memcpy(&opts.checkout_opts, &sub_opts.checkout_opts, sizeof(sub_opts.checkout_opts));
851
+ memcpy(&opts.fetch_opts, &sub_opts.fetch_opts, sizeof(sub_opts.fetch_opts));
852
+ opts.repository_cb = clone_return_repo;
853
+ opts.repository_cb_payload = submodule;
854
+ opts.remote_cb = clone_return_origin;
855
+ opts.remote_cb_payload = submodule;
856
+
857
+ git_buf_puts(&rel_path, git_repository_workdir(git_submodule_owner(submodule)));
858
+ git_buf_joinpath(&rel_path, git_buf_cstr(&rel_path), git_submodule_path(submodule));
859
+
860
+ GIT_ERROR_CHECK_ALLOC_BUF(&rel_path);
861
+
862
+ error = git_clone__submodule(&clone, git_submodule_url(submodule), git_buf_cstr(&rel_path), &opts);
863
+ if (error < 0)
864
+ goto cleanup;
865
+
866
+ if (!out)
867
+ git_repository_free(clone);
868
+ else
869
+ *out = clone;
870
+
871
+ cleanup:
872
+ git_buf_dispose(&rel_path);
873
+
874
+ return error;
875
+ }
876
+
872
877
  int git_submodule_add_finalize(git_submodule *sm)
873
878
  {
874
879
  int error;
@@ -906,7 +911,7 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index)
906
911
 
907
912
  /* read stat information for submodule working directory */
908
913
  if (p_stat(path.ptr, &st) < 0) {
909
- giterr_set(GITERR_SUBMODULE,
914
+ git_error_set(GIT_ERROR_SUBMODULE,
910
915
  "cannot add submodule without working directory");
911
916
  error = -1;
912
917
  goto cleanup;
@@ -915,11 +920,11 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index)
915
920
  memset(&entry, 0, sizeof(entry));
916
921
  entry.path = sm->path;
917
922
  git_index_entry__init_from_stat(
918
- &entry, &st, !(git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE));
923
+ &entry, &st, !(git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE));
919
924
 
920
925
  /* calling git_submodule_open will have set sm->wd_oid if possible */
921
926
  if ((sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) == 0) {
922
- giterr_set(GITERR_SUBMODULE,
927
+ git_error_set(GIT_ERROR_SUBMODULE,
923
928
  "cannot add submodule without HEAD to index");
924
929
  error = -1;
925
930
  goto cleanup;
@@ -1010,7 +1015,7 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur
1010
1015
  } else if (strchr(url, ':') != NULL || url[0] == '/') {
1011
1016
  error = git_buf_sets(out, url);
1012
1017
  } else {
1013
- giterr_set(GITERR_SUBMODULE, "invalid format for submodule URL");
1018
+ git_error_set(GIT_ERROR_SUBMODULE, "invalid format for submodule URL");
1014
1019
  error = -1;
1015
1020
  }
1016
1021
 
@@ -1032,28 +1037,28 @@ static int write_var(git_repository *repo, const char *name, const char *var, co
1032
1037
  goto cleanup;
1033
1038
 
1034
1039
  if (val)
1035
- error = git_config_file_set_string(mods, key.ptr, val);
1040
+ error = git_config_backend_set_string(mods, key.ptr, val);
1036
1041
  else
1037
- error = git_config_file_delete(mods, key.ptr);
1042
+ error = git_config_backend_delete(mods, key.ptr);
1038
1043
 
1039
1044
  git_buf_dispose(&key);
1040
1045
 
1041
1046
  cleanup:
1042
- git_config_file_free(mods);
1047
+ git_config_backend_free(mods);
1043
1048
  return error;
1044
1049
  }
1045
1050
 
1046
- static int write_mapped_var(git_repository *repo, const char *name, git_cvar_map *maps, size_t nmaps, const char *var, int ival)
1051
+ static int write_mapped_var(git_repository *repo, const char *name, git_configmap *maps, size_t nmaps, const char *var, int ival)
1047
1052
  {
1048
- git_cvar_t type;
1053
+ git_configmap_t type;
1049
1054
  const char *val;
1050
1055
 
1051
1056
  if (git_config_lookup_map_enum(&type, &val, maps, nmaps, ival) < 0) {
1052
- giterr_set(GITERR_SUBMODULE, "invalid value for %s", var);
1057
+ git_error_set(GIT_ERROR_SUBMODULE, "invalid value for %s", var);
1053
1058
  return -1;
1054
1059
  }
1055
1060
 
1056
- if (type == GIT_CVAR_TRUE)
1061
+ if (type == GIT_CONFIGMAP_TRUE)
1057
1062
  val = "true";
1058
1063
 
1059
1064
  return write_var(repo, name, var, val);
@@ -1112,7 +1117,7 @@ const git_oid *git_submodule_wd_id(git_submodule *submodule)
1112
1117
  if (!git_submodule_open_bare(&subrepo, submodule))
1113
1118
  git_repository_free(subrepo);
1114
1119
  else
1115
- giterr_clear();
1120
+ git_error_clear();
1116
1121
  }
1117
1122
 
1118
1123
  if (submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)
@@ -1228,13 +1233,18 @@ static int git_submodule_update_repo_init_cb(
1228
1233
  return submodule_repo_create(out, sm->repo, path);
1229
1234
  }
1230
1235
 
1231
- int git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version)
1236
+ int git_submodule_update_options_init(git_submodule_update_options *opts, unsigned int version)
1232
1237
  {
1233
1238
  GIT_INIT_STRUCTURE_FROM_TEMPLATE(
1234
1239
  opts, version, git_submodule_update_options, GIT_SUBMODULE_UPDATE_OPTIONS_INIT);
1235
1240
  return 0;
1236
1241
  }
1237
1242
 
1243
+ int git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version)
1244
+ {
1245
+ return git_submodule_update_options_init(opts, version);
1246
+ }
1247
+
1238
1248
  int git_submodule_update(git_submodule *sm, int init, git_submodule_update_options *_update_options)
1239
1249
  {
1240
1250
  int error;
@@ -1253,7 +1263,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
1253
1263
  if (_update_options)
1254
1264
  memcpy(&update_options, _update_options, sizeof(git_submodule_update_options));
1255
1265
 
1256
- GITERR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
1266
+ GIT_ERROR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
1257
1267
 
1258
1268
  /* Copy over the remote callbacks */
1259
1269
  memcpy(&clone_options.fetch_opts, &update_options.fetch_opts, sizeof(git_fetch_options));
@@ -1284,7 +1294,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
1284
1294
  goto done;
1285
1295
 
1286
1296
  if (!init) {
1287
- giterr_set(GITERR_SUBMODULE, "submodule is not initialized");
1297
+ git_error_set(GIT_ERROR_SUBMODULE, "submodule is not initialized");
1288
1298
  error = GIT_ERROR;
1289
1299
  goto done;
1290
1300
  }
@@ -1328,18 +1338,18 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
1328
1338
  goto done;
1329
1339
 
1330
1340
  if ((oid = git_submodule_index_id(sm)) == NULL) {
1331
- giterr_set(GITERR_SUBMODULE, "could not get ID of submodule in index");
1341
+ git_error_set(GIT_ERROR_SUBMODULE, "could not get ID of submodule in index");
1332
1342
  error = -1;
1333
1343
  goto done;
1334
1344
  }
1335
1345
 
1336
1346
  /* Look up the target commit in the submodule. */
1337
- if ((error = git_object_lookup(&target_commit, sub_repo, oid, GIT_OBJ_COMMIT)) < 0) {
1347
+ if ((error = git_object_lookup(&target_commit, sub_repo, oid, GIT_OBJECT_COMMIT)) < 0) {
1338
1348
  /* If it isn't found then fetch and try again. */
1339
1349
  if (error != GIT_ENOTFOUND || !update_options.allow_fetch ||
1340
1350
  (error = lookup_default_remote(&remote, sub_repo)) < 0 ||
1341
1351
  (error = git_remote_fetch(remote, NULL, &update_options.fetch_opts, NULL)) < 0 ||
1342
- (error = git_object_lookup(&target_commit, sub_repo, git_submodule_index_id(sm), GIT_OBJ_COMMIT)) < 0)
1352
+ (error = git_object_lookup(&target_commit, sub_repo, git_submodule_index_id(sm), GIT_OBJECT_COMMIT)) < 0)
1343
1353
  goto done;
1344
1354
  }
1345
1355
 
@@ -1372,7 +1382,7 @@ int git_submodule_init(git_submodule *sm, int overwrite)
1372
1382
  git_config *cfg = NULL;
1373
1383
 
1374
1384
  if (!sm->url) {
1375
- giterr_set(GITERR_SUBMODULE,
1385
+ git_error_set(GIT_ERROR_SUBMODULE,
1376
1386
  "no URL configured for submodule '%s'", sm->name);
1377
1387
  return -1;
1378
1388
  }
@@ -1416,7 +1426,7 @@ int git_submodule_sync(git_submodule *sm)
1416
1426
  git_repository *smrepo = NULL;
1417
1427
 
1418
1428
  if (!sm->url) {
1419
- giterr_set(GITERR_SUBMODULE,
1429
+ git_error_set(GIT_ERROR_SUBMODULE,
1420
1430
  "no URL configured for submodule '%s'", sm->name);
1421
1431
  return -1;
1422
1432
  }
@@ -1438,7 +1448,7 @@ int git_submodule_sync(git_submodule *sm)
1438
1448
  if ((error = git_repository_config__weakptr(&cfg, smrepo)) < 0)
1439
1449
  /* return error from reading submodule config */;
1440
1450
  else if ((error = lookup_head_remote_key(&remote_name, smrepo)) < 0) {
1441
- giterr_clear();
1451
+ git_error_clear();
1442
1452
  error = git_buf_sets(&key, "remote.origin.url");
1443
1453
  } else {
1444
1454
  error = git_buf_join3(
@@ -1495,7 +1505,7 @@ static int git_submodule__open(
1495
1505
  if (!git_reference_name_to_id(&sm->wd_oid, *subrepo, GIT_HEAD_FILE))
1496
1506
  sm->flags |= GIT_SUBMODULE_STATUS__WD_OID_VALID;
1497
1507
  else
1498
- giterr_clear();
1508
+ git_error_clear();
1499
1509
  } else if (git_path_exists(path.ptr)) {
1500
1510
  sm->flags |= GIT_SUBMODULE_STATUS__WD_SCANNED |
1501
1511
  GIT_SUBMODULE_STATUS_IN_WD;
@@ -1585,7 +1595,7 @@ static int submodule_update_head(git_submodule *submodule)
1585
1595
  /* if we can't look up file in current head, then done */
1586
1596
  if (git_repository_head_tree(&head, submodule->repo) < 0 ||
1587
1597
  git_tree_entry_bypath(&te, head, submodule->path) < 0)
1588
- giterr_clear();
1598
+ git_error_clear();
1589
1599
  else
1590
1600
  submodule_update_from_head_data(submodule, te->attr, git_tree_entry_id(te));
1591
1601
 
@@ -1688,12 +1698,12 @@ int git_submodule__status(
1688
1698
  if (ign == GIT_SUBMODULE_IGNORE_DIRTY) {
1689
1699
  /* git_submodule_open_bare will load WD OID data */
1690
1700
  if (git_submodule_open_bare(&smrepo, sm) < 0)
1691
- giterr_clear();
1701
+ git_error_clear();
1692
1702
  else
1693
1703
  git_repository_free(smrepo);
1694
1704
  smrepo = NULL;
1695
1705
  } else if (git_submodule_open(&smrepo, sm) < 0) {
1696
- giterr_clear();
1706
+ git_error_clear();
1697
1707
  smrepo = NULL;
1698
1708
  }
1699
1709
 
@@ -1751,12 +1761,12 @@ static int submodule_alloc(
1751
1761
  git_submodule *sm;
1752
1762
 
1753
1763
  if (!name || !(namelen = strlen(name))) {
1754
- giterr_set(GITERR_SUBMODULE, "invalid submodule name");
1764
+ git_error_set(GIT_ERROR_SUBMODULE, "invalid submodule name");
1755
1765
  return -1;
1756
1766
  }
1757
1767
 
1758
1768
  sm = git__calloc(1, sizeof(git_submodule));
1759
- GITERR_CHECK_ALLOC(sm);
1769
+ GIT_ERROR_CHECK_ALLOC(sm);
1760
1770
 
1761
1771
  sm->name = sm->path = git__strdup(name);
1762
1772
  if (!sm->name) {
@@ -1802,7 +1812,7 @@ void git_submodule_free(git_submodule *sm)
1802
1812
 
1803
1813
  static int submodule_config_error(const char *property, const char *value)
1804
1814
  {
1805
- giterr_set(GITERR_INVALID,
1815
+ git_error_set(GIT_ERROR_INVALID,
1806
1816
  "invalid value for submodule '%s' property: '%s'", property, value);
1807
1817
  return -1;
1808
1818
  }
@@ -1862,6 +1872,14 @@ static int get_value(const char **out, git_config *cfg, git_buf *buf, const char
1862
1872
  return error;
1863
1873
  }
1864
1874
 
1875
+ static bool looks_like_command_line_option(const char *s)
1876
+ {
1877
+ if (s && s[0] == '-')
1878
+ return true;
1879
+
1880
+ return false;
1881
+ }
1882
+
1865
1883
  static int submodule_read_config(git_submodule *sm, git_config *cfg)
1866
1884
  {
1867
1885
  git_buf key = GIT_BUF_INIT;
@@ -1875,24 +1893,31 @@ static int submodule_read_config(git_submodule *sm, git_config *cfg)
1875
1893
 
1876
1894
  if ((error = get_value(&value, cfg, &key, sm->name, "path")) == 0) {
1877
1895
  in_config = 1;
1896
+ /* We would warn here if we had that API */
1897
+ if (!looks_like_command_line_option(value)) {
1878
1898
  /*
1879
1899
  * TODO: if case insensitive filesystem, then the following strcmp
1880
1900
  * should be strcasecmp
1881
1901
  */
1882
- if (strcmp(sm->name, value) != 0) {
1883
- if (sm->path != sm->name)
1884
- git__free(sm->path);
1885
- sm->path = git__strdup(value);
1886
- GITERR_CHECK_ALLOC(sm->path);
1902
+ if (strcmp(sm->name, value) != 0) {
1903
+ if (sm->path != sm->name)
1904
+ git__free(sm->path);
1905
+ sm->path = git__strdup(value);
1906
+ GIT_ERROR_CHECK_ALLOC(sm->path);
1907
+ }
1908
+
1887
1909
  }
1888
1910
  } else if (error != GIT_ENOTFOUND) {
1889
1911
  goto cleanup;
1890
1912
  }
1891
1913
 
1892
1914
  if ((error = get_value(&value, cfg, &key, sm->name, "url")) == 0) {
1893
- in_config = 1;
1894
- sm->url = git__strdup(value);
1895
- GITERR_CHECK_ALLOC(sm->url);
1915
+ /* We would warn here if we had that API */
1916
+ if (!looks_like_command_line_option(value)) {
1917
+ in_config = 1;
1918
+ sm->url = git__strdup(value);
1919
+ GIT_ERROR_CHECK_ALLOC(sm->url);
1920
+ }
1896
1921
  } else if (error != GIT_ENOTFOUND) {
1897
1922
  goto cleanup;
1898
1923
  }
@@ -1900,7 +1925,7 @@ static int submodule_read_config(git_submodule *sm, git_config *cfg)
1900
1925
  if ((error = get_value(&value, cfg, &key, sm->name, "branch")) == 0) {
1901
1926
  in_config = 1;
1902
1927
  sm->branch = git__strdup(value);
1903
- GITERR_CHECK_ALLOC(sm->branch);
1928
+ GIT_ERROR_CHECK_ALLOC(sm->branch);
1904
1929
  } else if (error != GIT_ENOTFOUND) {
1905
1930
  goto cleanup;
1906
1931
  }
@@ -1946,7 +1971,6 @@ static int submodule_load_each(const git_config_entry *entry, void *payload)
1946
1971
  {
1947
1972
  lfc_data *data = payload;
1948
1973
  const char *namestart, *property;
1949
- git_strmap_iter pos;
1950
1974
  git_strmap *map = data->map;
1951
1975
  git_buf name = GIT_BUF_INIT;
1952
1976
  git_submodule *sm;
@@ -1978,8 +2002,7 @@ static int submodule_load_each(const git_config_entry *entry, void *payload)
1978
2002
  * a new submodule, load the config and insert it. If it's
1979
2003
  * already inserted, we've already loaded it, so we skip.
1980
2004
  */
1981
- pos = git_strmap_lookup_index(map, name.ptr);
1982
- if (git_strmap_valid_index(map, pos)) {
2005
+ if (git_strmap_exists(map, name.ptr)) {
1983
2006
  error = 0;
1984
2007
  goto done;
1985
2008
  }
@@ -1992,9 +2015,7 @@ static int submodule_load_each(const git_config_entry *entry, void *payload)
1992
2015
  goto done;
1993
2016
  }
1994
2017
 
1995
- git_strmap_insert(map, sm->name, sm, &error);
1996
- assert(error != 0);
1997
- if (error < 0)
2018
+ if ((error = git_strmap_set(map, sm->name, sm)) < 0)
1998
2019
  goto done;
1999
2020
 
2000
2021
  error = 0;
@@ -2069,12 +2090,12 @@ static git_config_backend *open_gitmodules(
2069
2090
  return NULL;
2070
2091
 
2071
2092
  if (okay_to_create || git_path_isfile(path.ptr)) {
2072
- /* git_config_file__ondisk should only fail if OOM */
2073
- if (git_config_file__ondisk(&mods, path.ptr) < 0)
2093
+ /* git_config_backend_from_file should only fail if OOM */
2094
+ if (git_config_backend_from_file(&mods, path.ptr) < 0)
2074
2095
  mods = NULL;
2075
2096
  /* open should only fail here if the file is malformed */
2076
- else if (git_config_file_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) {
2077
- git_config_file_free(mods);
2097
+ else if (git_config_backend_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) {
2098
+ git_config_backend_free(mods);
2078
2099
  mods = NULL;
2079
2100
  }
2080
2101
  }
@@ -2102,7 +2123,7 @@ static int lookup_head_remote_key(git_buf *remote_name, git_repository *repo)
2102
2123
  * a remote key for the local tracking branch HEAD points to.
2103
2124
  **/
2104
2125
  if (!git_reference_is_branch(head)) {
2105
- giterr_set(GITERR_INVALID,
2126
+ git_error_set(GIT_ERROR_INVALID,
2106
2127
  "HEAD does not refer to a branch.");
2107
2128
  error = GIT_ENOTFOUND;
2108
2129
  goto done;
@@ -2151,8 +2172,8 @@ static int lookup_default_remote(git_remote **remote, git_repository *repo)
2151
2172
  error = git_remote_lookup(remote, repo, "origin");
2152
2173
 
2153
2174
  if (error == GIT_ENOTFOUND)
2154
- giterr_set(
2155
- GITERR_SUBMODULE,
2175
+ git_error_set(
2176
+ GIT_ERROR_SUBMODULE,
2156
2177
  "cannot get default remote for submodule - no local tracking "
2157
2178
  "branch for HEAD and origin does not exist");
2158
2179
 
@@ -2171,7 +2192,7 @@ static int get_url_base(git_buf *url, git_repository *repo)
2171
2192
  } else if (error != GIT_ENOTFOUND)
2172
2193
  goto out;
2173
2194
  else
2174
- giterr_clear();
2195
+ git_error_clear();
2175
2196
 
2176
2197
  /* if repository does not have a default remote, use workdir instead */
2177
2198
  if (git_repository_is_worktree(repo)) {
@@ -2252,11 +2273,11 @@ static void submodule_get_wd_status(
2252
2273
 
2253
2274
  /* if we don't have an unborn head, check diff with index */
2254
2275
  if (git_repository_head_tree(&sm_head, sm_repo) < 0)
2255
- giterr_clear();
2276
+ git_error_clear();
2256
2277
  else {
2257
2278
  /* perform head to index diff on submodule */
2258
2279
  if (git_diff_tree_to_index(&diff, sm_repo, sm_head, index, &opt) < 0)
2259
- giterr_clear();
2280
+ git_error_clear();
2260
2281
  else {
2261
2282
  if (git_diff_num_deltas(diff) > 0)
2262
2283
  *status |= GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED;
@@ -2269,7 +2290,7 @@ static void submodule_get_wd_status(
2269
2290
 
2270
2291
  /* perform index-to-workdir diff on submodule */
2271
2292
  if (git_diff_index_to_workdir(&diff, sm_repo, index, &opt) < 0)
2272
- giterr_clear();
2293
+ git_error_clear();
2273
2294
  else {
2274
2295
  size_t untracked =
2275
2296
  git_diff_num_deltas_of_type(diff, GIT_DELTA_UNTRACKED);