rugged 0.18.0.gh.de28323 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. data/README.md +9 -4
  2. data/Rakefile +1 -1
  3. data/ext/rugged/extconf.rb +10 -0
  4. data/ext/rugged/rugged.c +153 -86
  5. data/ext/rugged/rugged.h +44 -33
  6. data/ext/rugged/rugged_blob.c +288 -60
  7. data/ext/rugged/rugged_branch.c +82 -57
  8. data/ext/rugged/rugged_commit.c +83 -86
  9. data/ext/rugged/rugged_config.c +68 -68
  10. data/ext/rugged/rugged_diff.c +509 -0
  11. data/ext/rugged/rugged_diff_delta.c +94 -0
  12. data/ext/rugged/rugged_diff_hunk.c +100 -0
  13. data/ext/rugged/rugged_diff_line.c +79 -0
  14. data/ext/rugged/rugged_diff_patch.c +169 -0
  15. data/ext/rugged/rugged_index.c +539 -8
  16. data/ext/rugged/rugged_note.c +74 -80
  17. data/ext/rugged/rugged_object.c +63 -8
  18. data/ext/rugged/rugged_reference.c +231 -145
  19. data/ext/rugged/rugged_remote.c +509 -53
  20. data/ext/rugged/rugged_repo.c +572 -236
  21. data/ext/rugged/rugged_revwalk.c +59 -36
  22. data/ext/rugged/rugged_settings.c +7 -9
  23. data/ext/rugged/rugged_signature.c +7 -11
  24. data/ext/rugged/rugged_tag.c +93 -39
  25. data/ext/rugged/rugged_tree.c +321 -58
  26. data/lib/rugged.rb +1 -0
  27. data/lib/rugged/commit.rb +16 -1
  28. data/lib/rugged/console.rb +9 -0
  29. data/lib/rugged/diff.rb +19 -0
  30. data/lib/rugged/diff/delta.rb +54 -0
  31. data/lib/rugged/diff/hunk.rb +23 -0
  32. data/lib/rugged/diff/line.rb +29 -0
  33. data/lib/rugged/diff/patch.rb +28 -0
  34. data/lib/rugged/repository.rb +36 -39
  35. data/lib/rugged/version.rb +1 -1
  36. data/test/blob_test.rb +308 -1
  37. data/test/branch_test.rb +7 -0
  38. data/test/commit_test.rb +7 -10
  39. data/test/coverage/cover.rb +9 -1
  40. data/test/diff_test.rb +777 -0
  41. data/test/fixtures/archive.tar.gz +0 -0
  42. data/test/fixtures/attr/attr0 +1 -0
  43. data/test/fixtures/attr/attr1 +29 -0
  44. data/test/fixtures/attr/attr2 +21 -0
  45. data/test/fixtures/attr/attr3 +4 -0
  46. data/test/fixtures/attr/binfile +1 -0
  47. data/test/fixtures/attr/dir/file +0 -0
  48. data/test/fixtures/attr/file +1 -0
  49. data/test/fixtures/attr/gitattributes +29 -0
  50. data/test/fixtures/attr/gitignore +2 -0
  51. data/test/fixtures/attr/ign +1 -0
  52. data/test/fixtures/attr/macro_bad +1 -0
  53. data/test/fixtures/attr/macro_test +1 -0
  54. data/test/fixtures/attr/root_test1 +1 -0
  55. data/test/fixtures/attr/root_test2 +6 -0
  56. data/test/fixtures/attr/root_test3 +19 -0
  57. data/test/fixtures/attr/root_test4.txt +14 -0
  58. data/test/fixtures/attr/sub/abc +37 -0
  59. data/test/fixtures/attr/sub/dir/file +0 -0
  60. data/test/fixtures/attr/sub/file +1 -0
  61. data/test/fixtures/attr/sub/ign/file +1 -0
  62. data/test/fixtures/attr/sub/ign/sub/file +1 -0
  63. data/test/fixtures/attr/sub/sub/dir +0 -0
  64. data/test/fixtures/attr/sub/sub/file +1 -0
  65. data/test/fixtures/attr/sub/sub/subsub.txt +1 -0
  66. data/test/fixtures/attr/sub/subdir_test1 +2 -0
  67. data/test/fixtures/attr/sub/subdir_test2.txt +1 -0
  68. data/test/fixtures/diff/another.txt +38 -0
  69. data/test/fixtures/diff/readme.txt +36 -0
  70. data/test/fixtures/mergedrepo/conflicts-one.txt +5 -0
  71. data/test/fixtures/mergedrepo/conflicts-two.txt +5 -0
  72. data/test/fixtures/mergedrepo/one.txt +10 -0
  73. data/test/fixtures/mergedrepo/two.txt +12 -0
  74. data/test/fixtures/status/current_file +1 -0
  75. data/test/fixtures/status/ignored_file +1 -0
  76. data/test/fixtures/status/modified_file +2 -0
  77. data/test/fixtures/status/new_file +1 -0
  78. data/test/fixtures/status/staged_changes +2 -0
  79. data/test/fixtures/status/staged_changes_modified_file +3 -0
  80. data/test/fixtures/status/staged_delete_modified_file +1 -0
  81. data/test/fixtures/status/staged_new_file +1 -0
  82. data/test/fixtures/status/staged_new_file_modified_file +2 -0
  83. data/test/fixtures/status/subdir.txt +2 -0
  84. data/test/fixtures/status/subdir/current_file +1 -0
  85. data/test/fixtures/status/subdir/modified_file +2 -0
  86. data/test/fixtures/status/subdir/new_file +1 -0
  87. data/test/fixtures/status//350/277/231 +1 -0
  88. data/test/fixtures/testrepo.git/config +5 -0
  89. data/test/fixtures/testrepo.git/objects/77/71329dfa3002caf8c61a0ceb62a31d09023f37 +0 -0
  90. data/test/fixtures/text_file.md +464 -0
  91. data/test/fixtures/unsymlinked.git/HEAD +1 -0
  92. data/test/fixtures/unsymlinked.git/config +6 -0
  93. data/test/fixtures/unsymlinked.git/description +1 -0
  94. data/test/fixtures/unsymlinked.git/info/exclude +2 -0
  95. data/test/fixtures/unsymlinked.git/objects/08/8b64704e0d6b8bd061dea879418cb5442a3fbf +0 -0
  96. data/test/fixtures/unsymlinked.git/objects/13/a5e939bca25940c069fd2169d993dba328e30b +0 -0
  97. data/test/fixtures/unsymlinked.git/objects/19/bf568e59e3a0b363cafb4106226e62d4a4c41c +0 -0
  98. data/test/fixtures/unsymlinked.git/objects/58/1fadd35b4cf320d102a152f918729011604773 +0 -0
  99. data/test/fixtures/unsymlinked.git/objects/5c/87b6791e8b13da658a14d1ef7e09b5dc3bac8c +0 -0
  100. data/test/fixtures/unsymlinked.git/objects/6f/e5f5398af85fb3de8a6aba0339b6d3bfa26a27 +0 -0
  101. data/test/fixtures/unsymlinked.git/objects/7f/ccd75616ec188b8f1b23d67506a334cc34a49d +0 -0
  102. data/test/fixtures/unsymlinked.git/objects/80/6999882bf91d24241e4077906b9017605eb1f3 +0 -0
  103. data/test/fixtures/unsymlinked.git/objects/83/7d176303c5005505ec1e4a30231c40930c0230 +0 -0
  104. data/test/fixtures/unsymlinked.git/objects/a8/595ccca04f40818ae0155c8f9c77a230e597b6 +2 -0
  105. data/test/fixtures/unsymlinked.git/objects/cf/8f1cf5cce859c438d6cc067284cb5e161206e7 +0 -0
  106. data/test/fixtures/unsymlinked.git/objects/d5/278d05c8607ec420bfee4cf219fbc0eeebfd6a +0 -0
  107. data/test/fixtures/unsymlinked.git/objects/f4/e16fb76536591a41454194058d048d8e4dd2e9 +0 -0
  108. data/test/fixtures/unsymlinked.git/objects/f9/e65619d93fdf2673882e0a261c5e93b1a84006 +0 -0
  109. data/test/fixtures/unsymlinked.git/refs/heads/exe-file +1 -0
  110. data/test/fixtures/unsymlinked.git/refs/heads/master +1 -0
  111. data/test/fixtures/unsymlinked.git/refs/heads/reg-file +1 -0
  112. data/test/index_test.rb +120 -0
  113. data/test/reference_test.rb +38 -3
  114. data/test/remote_test.rb +224 -3
  115. data/test/repo_reset_test.rb +2 -0
  116. data/test/repo_test.rb +147 -10
  117. data/test/test_helper.rb +5 -2
  118. data/vendor/libgit2/include/git2/attr.h +3 -3
  119. data/vendor/libgit2/include/git2/blob.h +11 -17
  120. data/vendor/libgit2/include/git2/branch.h +3 -2
  121. data/vendor/libgit2/include/git2/checkout.h +7 -0
  122. data/vendor/libgit2/include/git2/clone.h +3 -0
  123. data/vendor/libgit2/include/git2/commit.h +61 -66
  124. data/vendor/libgit2/include/git2/common.h +73 -42
  125. data/vendor/libgit2/include/git2/config.h +57 -71
  126. data/vendor/libgit2/include/git2/cred_helpers.h +2 -2
  127. data/vendor/libgit2/include/git2/diff.h +179 -30
  128. data/vendor/libgit2/include/git2/errors.h +3 -3
  129. data/vendor/libgit2/include/git2/index.h +225 -146
  130. data/vendor/libgit2/include/git2/indexer.h +2 -22
  131. data/vendor/libgit2/include/git2/inttypes.h +9 -9
  132. data/vendor/libgit2/include/git2/merge.h +123 -5
  133. data/vendor/libgit2/include/git2/odb.h +59 -38
  134. data/vendor/libgit2/include/git2/odb_backend.h +45 -104
  135. data/vendor/libgit2/include/git2/oid.h +30 -19
  136. data/vendor/libgit2/include/git2/pack.h +21 -3
  137. data/vendor/libgit2/include/git2/refdb.h +0 -35
  138. data/vendor/libgit2/include/git2/refs.h +93 -31
  139. data/vendor/libgit2/include/git2/refspec.h +17 -0
  140. data/vendor/libgit2/include/git2/remote.h +60 -20
  141. data/vendor/libgit2/include/git2/repository.h +48 -70
  142. data/vendor/libgit2/include/git2/reset.h +3 -3
  143. data/vendor/libgit2/include/git2/revparse.h +22 -0
  144. data/vendor/libgit2/include/git2/stash.h +1 -1
  145. data/vendor/libgit2/include/git2/status.h +131 -56
  146. data/vendor/libgit2/include/git2/strarray.h +2 -2
  147. data/vendor/libgit2/include/git2/submodule.h +16 -16
  148. data/vendor/libgit2/include/git2/sys/commit.h +46 -0
  149. data/vendor/libgit2/include/git2/sys/config.h +71 -0
  150. data/vendor/libgit2/include/git2/sys/index.h +179 -0
  151. data/vendor/libgit2/include/git2/sys/odb_backend.h +86 -0
  152. data/vendor/libgit2/include/git2/sys/refdb_backend.h +158 -0
  153. data/vendor/libgit2/include/git2/sys/refs.h +38 -0
  154. data/vendor/libgit2/include/git2/sys/repository.h +106 -0
  155. data/vendor/libgit2/include/git2/tag.h +44 -18
  156. data/vendor/libgit2/include/git2/trace.h +1 -2
  157. data/vendor/libgit2/include/git2/transport.h +74 -0
  158. data/vendor/libgit2/include/git2/tree.h +12 -22
  159. data/vendor/libgit2/include/git2/types.h +33 -0
  160. data/vendor/libgit2/include/git2/version.h +2 -2
  161. data/vendor/libgit2/src/array.h +66 -0
  162. data/vendor/libgit2/src/attr.c +26 -13
  163. data/vendor/libgit2/src/attr_file.c +3 -2
  164. data/vendor/libgit2/src/attr_file.h +3 -3
  165. data/vendor/libgit2/src/attrcache.h +4 -4
  166. data/vendor/libgit2/src/blob.c +13 -9
  167. data/vendor/libgit2/src/blob.h +2 -2
  168. data/vendor/libgit2/src/branch.c +67 -49
  169. data/vendor/libgit2/src/cache.c +224 -54
  170. data/vendor/libgit2/src/cache.h +33 -20
  171. data/vendor/libgit2/src/checkout.c +145 -85
  172. data/vendor/libgit2/src/clone.c +62 -50
  173. data/vendor/libgit2/src/commit.c +74 -40
  174. data/vendor/libgit2/src/commit.h +2 -3
  175. data/vendor/libgit2/src/commit_list.c +14 -8
  176. data/vendor/libgit2/src/config.c +119 -36
  177. data/vendor/libgit2/src/config.h +3 -0
  178. data/vendor/libgit2/src/config_cache.c +24 -7
  179. data/vendor/libgit2/src/config_file.c +9 -6
  180. data/vendor/libgit2/src/crlf.c +4 -2
  181. data/vendor/libgit2/src/date.c +3 -3
  182. data/vendor/libgit2/src/delta.c +1 -1
  183. data/vendor/libgit2/src/diff.c +681 -303
  184. data/vendor/libgit2/src/diff.h +34 -2
  185. data/vendor/libgit2/src/diff_driver.c +405 -0
  186. data/vendor/libgit2/src/diff_driver.h +49 -0
  187. data/vendor/libgit2/src/diff_file.c +447 -0
  188. data/vendor/libgit2/src/diff_file.h +58 -0
  189. data/vendor/libgit2/src/diff_patch.c +995 -0
  190. data/vendor/libgit2/src/diff_patch.h +46 -0
  191. data/vendor/libgit2/src/diff_print.c +430 -0
  192. data/vendor/libgit2/src/diff_tform.c +464 -203
  193. data/vendor/libgit2/src/diff_xdiff.c +166 -0
  194. data/vendor/libgit2/src/diff_xdiff.h +28 -0
  195. data/vendor/libgit2/src/fetch.c +11 -4
  196. data/vendor/libgit2/src/fileops.c +85 -61
  197. data/vendor/libgit2/src/fileops.h +4 -0
  198. data/vendor/libgit2/src/global.c +10 -2
  199. data/vendor/libgit2/src/global.h +0 -8
  200. data/vendor/libgit2/src/hash/hash_generic.h +3 -3
  201. data/vendor/libgit2/src/hash/hash_win32.h +4 -4
  202. data/vendor/libgit2/src/hashsig.c +0 -1
  203. data/vendor/libgit2/src/ignore.c +68 -28
  204. data/vendor/libgit2/src/ignore.h +10 -1
  205. data/vendor/libgit2/src/index.c +666 -84
  206. data/vendor/libgit2/src/index.h +6 -0
  207. data/vendor/libgit2/src/indexer.c +10 -28
  208. data/vendor/libgit2/src/iterator.c +427 -283
  209. data/vendor/libgit2/src/iterator.h +58 -4
  210. data/vendor/libgit2/src/merge.c +1892 -32
  211. data/vendor/libgit2/src/merge.h +132 -5
  212. data/vendor/libgit2/src/merge_file.c +174 -0
  213. data/vendor/libgit2/src/merge_file.h +71 -0
  214. data/vendor/libgit2/src/mwindow.c +1 -1
  215. data/vendor/libgit2/src/notes.c +45 -48
  216. data/vendor/libgit2/src/object.c +89 -127
  217. data/vendor/libgit2/src/object.h +0 -1
  218. data/vendor/libgit2/src/object_api.c +129 -0
  219. data/vendor/libgit2/src/odb.c +156 -59
  220. data/vendor/libgit2/src/odb.h +5 -2
  221. data/vendor/libgit2/src/odb_loose.c +31 -17
  222. data/vendor/libgit2/src/odb_pack.c +39 -43
  223. data/vendor/libgit2/src/oid.c +62 -27
  224. data/vendor/libgit2/src/oid.h +33 -0
  225. data/vendor/libgit2/src/oidmap.h +4 -6
  226. data/vendor/libgit2/src/pack-objects.c +54 -22
  227. data/vendor/libgit2/src/pack.c +98 -56
  228. data/vendor/libgit2/src/pack.h +3 -1
  229. data/vendor/libgit2/src/pathspec.c +26 -1
  230. data/vendor/libgit2/src/pathspec.h +14 -0
  231. data/vendor/libgit2/src/pool.c +5 -0
  232. data/vendor/libgit2/src/posix.c +2 -2
  233. data/vendor/libgit2/src/posix.h +3 -0
  234. data/vendor/libgit2/src/push.c +13 -10
  235. data/vendor/libgit2/src/refdb.c +82 -62
  236. data/vendor/libgit2/src/refdb.h +16 -16
  237. data/vendor/libgit2/src/refdb_fs.c +386 -133
  238. data/vendor/libgit2/src/reflog.c +3 -1
  239. data/vendor/libgit2/src/refs.c +247 -221
  240. data/vendor/libgit2/src/refs.h +2 -1
  241. data/vendor/libgit2/src/refspec.c +18 -1
  242. data/vendor/libgit2/src/refspec.h +3 -1
  243. data/vendor/libgit2/src/remote.c +434 -253
  244. data/vendor/libgit2/src/remote.h +5 -3
  245. data/vendor/libgit2/src/repository.c +197 -111
  246. data/vendor/libgit2/src/repository.h +26 -5
  247. data/vendor/libgit2/src/reset.c +1 -1
  248. data/vendor/libgit2/src/revparse.c +84 -79
  249. data/vendor/libgit2/src/revwalk.c +1 -1
  250. data/vendor/libgit2/src/signature.c +22 -10
  251. data/vendor/libgit2/src/stash.c +5 -2
  252. data/vendor/libgit2/src/status.c +311 -107
  253. data/vendor/libgit2/src/status.h +23 -0
  254. data/vendor/libgit2/src/submodule.c +21 -13
  255. data/vendor/libgit2/src/tag.c +42 -31
  256. data/vendor/libgit2/src/tag.h +2 -3
  257. data/vendor/libgit2/src/thread-utils.h +105 -3
  258. data/vendor/libgit2/src/trace.c +1 -2
  259. data/vendor/libgit2/src/trace.h +3 -3
  260. data/vendor/libgit2/src/transport.c +18 -6
  261. data/vendor/libgit2/src/transports/cred.c +103 -1
  262. data/vendor/libgit2/src/transports/local.c +19 -9
  263. data/vendor/libgit2/src/transports/smart_protocol.c +32 -12
  264. data/vendor/libgit2/src/transports/ssh.c +519 -0
  265. data/vendor/libgit2/src/transports/winhttp.c +3 -1
  266. data/vendor/libgit2/src/tree.c +26 -28
  267. data/vendor/libgit2/src/tree.h +3 -3
  268. data/vendor/libgit2/src/unix/posix.h +2 -0
  269. data/vendor/libgit2/src/util.c +43 -6
  270. data/vendor/libgit2/src/util.h +40 -12
  271. data/vendor/libgit2/src/vector.c +3 -5
  272. data/vendor/libgit2/src/vector.h +9 -0
  273. data/vendor/libgit2/src/win32/dir.c +1 -1
  274. data/vendor/libgit2/src/win32/error.c +2 -0
  275. data/vendor/libgit2/src/win32/findfile.c +3 -6
  276. data/vendor/libgit2/src/win32/posix_w32.c +85 -59
  277. data/vendor/libgit2/src/win32/pthread.c +16 -8
  278. data/vendor/libgit2/src/win32/pthread.h +7 -4
  279. metadata +407 -306
  280. data/test/coverage/HEAD.json +0 -1
  281. data/vendor/libgit2/include/git2/refdb_backend.h +0 -109
  282. data/vendor/libgit2/src/diff_output.c +0 -1819
  283. data/vendor/libgit2/src/diff_output.h +0 -93
@@ -1 +0,0 @@
1
- {"files":[{"file":"version.h","functions":[],"meta":{},"lines":15},{"file":"types.h","functions":[],"meta":{"brief":"libgit2 base & compatibility types","ingroup":"Git","comments":"\n"},"lines":204},{"file":"tree.h","functions":["git_tree_lookup","git_tree_lookup_prefix","git_tree_free","git_tree_entry_free","git_tree_entry_dup","git_tree_id","git_tree_entrycount","git_tree_entry_byname","git_tree_entry_byindex","git_tree_entry_byoid","git_tree_entry_filemode","git_tree_entry_name","git_tree_entry_id","git_tree_entry_type","git_tree_entry_to_object","git_treebuilder_create","git_treebuilder_clear","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_remove","git_treebuilder_filter","git_treebuilder_write","git_tree_entry_bypath","git_tree_walk"],"meta":{"brief":"Git tree parsing, loading routines","defgroup":"git_tree Git tree parsing, loading routines","ingroup":"Git","comments":"\n"},"lines":356},{"file":"transport.h","functions":["git_cred_userpass_plaintext_new","git_transport_new","git_transport_valid_url","git_transport_dummy","git_transport_local","git_transport_smart","git_smart_subtransport_http","git_smart_subtransport_git"],"meta":{"brief":"Git transport interfaces and functions","defgroup":"git_transport interfaces and functions","ingroup":"Git","comments":"\n"},"lines":306},{"file":"threads.h","functions":["git_threads_init","git_threads_shutdown"],"meta":{"brief":"Library level thread functions","defgroup":"git_thread Threading functions","ingroup":"Git","comments":"\n"},"lines":47},{"file":"tag.h","functions":["git_tag_lookup","git_tag_lookup_prefix","git_tag_free","git_tag_id","git_tag_target","git_tag_target_oid","git_tag_target_type","git_tag_name","git_tag_tagger","git_tag_message","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_list","git_tag_list_match","git_tag_foreach","git_tag_peel"],"meta":{"brief":"Git tag parsing routines","defgroup":"git_tag Git tag management","ingroup":"Git","comments":"\n"},"lines":313},{"file":"submodule.h","functions":["git_submodule_lookup","git_submodule_foreach","git_submodule_add_setup","git_submodule_add_finalize","git_submodule_add_to_index","git_submodule_save","git_submodule_owner","git_submodule_name","git_submodule_path","git_submodule_url","git_submodule_set_url","git_submodule_index_oid","git_submodule_head_oid","git_submodule_wd_oid","git_submodule_ignore","git_submodule_set_ignore","git_submodule_update","git_submodule_set_update","git_submodule_fetch_recurse_submodules","git_submodule_set_fetch_recurse_submodules","git_submodule_init","git_submodule_sync","git_submodule_open","git_submodule_reload","git_submodule_reload_all","git_submodule_status"],"meta":{"brief":"Git submodule management utilities","defgroup":"git_submodule Git submodule management routines","ingroup":"Git","comments":"\n"},"lines":509},{"file":"strarray.h","functions":["git_strarray_free","git_strarray_copy"],"meta":{"brief":"Git string array routines","defgroup":"git_strarray Git string array routines","ingroup":"Git","comments":"\n"},"lines":53},{"file":"stdint.h","functions":[],"meta":{},"lines":247},{"file":"status.h","functions":["git_status_foreach","git_status_foreach_ext","git_status_file","git_status_should_ignore"],"meta":{"brief":"Git file status routines","defgroup":"git_status Git file status routines","ingroup":"Git","comments":"\n"},"lines":215},{"file":"stash.h","functions":["git_stash_save","git_stash_foreach","git_stash_drop"],"meta":{"brief":"Git stash management routines","ingroup":"Git","comments":"\n"},"lines":122},{"file":"signature.h","functions":["git_signature_new","git_signature_now","git_signature_dup","git_signature_free"],"meta":{"brief":"Git signature creation","defgroup":"git_signature Git signature creation","ingroup":"Git","comments":"\n"},"lines":68},{"file":"revwalk.h","functions":["git_revwalk_new","git_revwalk_reset","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_push_ref","git_revwalk_hide_ref","git_revwalk_next","git_revwalk_sorting","git_revwalk_free","git_revwalk_repository"],"meta":{"brief":"Git revision traversal routines","defgroup":"git_revwalk Git revision traversal routines","ingroup":"Git","comments":"\n"},"lines":237},{"file":"revparse.h","functions":["git_revparse_single"],"meta":{"brief":"Git revision parsing routines","defgroup":"git_revparse Git revision parsing routines","ingroup":"Git","comments":"\n"},"lines":36},{"file":"reset.h","functions":["git_reset"],"meta":{"brief":"Git reset management routines","ingroup":"Git","comments":"\n"},"lines":47},{"file":"repository.h","functions":["git_repository_open","git_repository_wrap_odb","git_repository_discover","git_repository_open_ext","git_repository_free","git_repository_init","git_repository_init_ext","git_repository_head","git_repository_head_detached","git_repository_head_orphan","git_repository_is_empty","git_repository_path","git_repository_workdir","git_repository_set_workdir","git_repository_is_bare","git_repository_config","git_repository_set_config","git_repository_odb","git_repository_set_odb","git_repository_index","git_repository_set_index","git_repository_message","git_repository_message_remove","git_repository_hashfile","git_repository_set_head","git_repository_set_head_detached","git_repository_detach_head","git_repository_state"],"meta":{"brief":"Git repository management routines","defgroup":"git_repository Git repository management routines","ingroup":"Git","comments":"\n"},"lines":596},{"file":"remote.h","functions":["git_remote_new","git_remote_load","git_remote_save","git_remote_name","git_remote_url","git_remote_pushurl","git_remote_set_url","git_remote_set_pushurl","git_remote_set_fetchspec","git_remote_fetchspec","git_remote_set_pushspec","git_remote_pushspec","git_remote_connect","git_remote_ls","git_remote_download","git_remote_connected","git_remote_stop","git_remote_disconnect","git_remote_free","git_remote_update_tips","git_remote_valid_url","git_remote_supported_url","git_remote_list","git_remote_add","git_remote_check_cert","git_remote_set_cred_acquire_cb","git_remote_set_transport","git_remote_set_callbacks","git_remote_stats","git_remote_autotag","git_remote_set_autotag","git_remote_rename"],"meta":{"brief":"Git remote management functions","defgroup":"git_remote remote management functions","ingroup":"Git","comments":"\n"},"lines":406},{"file":"refspec.h","functions":["git_refspec_src","git_refspec_dst","git_refspec_force","git_refspec_src_matches","git_refspec_transform"],"meta":{"brief":"Git refspec attributes","defgroup":"git_refspec Git refspec attributes","ingroup":"Git","comments":"\n"},"lines":68},{"file":"refs.h","functions":["git_reference_lookup","git_reference_name_to_oid","git_reference_create_symbolic","git_reference_create_oid","git_reference_oid","git_reference_target","git_reference_type","git_reference_name","git_reference_resolve","git_reference_owner","git_reference_set_target","git_reference_set_oid","git_reference_rename","git_reference_delete","git_reference_packall","git_reference_list","git_reference_foreach","git_reference_is_packed","git_reference_reload","git_reference_free","git_reference_cmp","git_reference_foreach_glob","git_reference_has_log","git_reference_is_branch","git_reference_is_remote","git_reference_normalize_name","git_reference_peel","git_reference_is_valid_name"],"meta":{"brief":"Git reference management routines","defgroup":"git_reference Git reference management routines","ingroup":"Git","comments":"\n"},"lines":493},{"file":"reflog.h","functions":["git_reflog_read","git_reflog_write","git_reflog_append","git_reflog_rename","git_reflog_delete","git_reflog_entrycount","git_reflog_entry_byindex","git_reflog_drop","git_reflog_entry_oidold","git_reflog_entry_oidnew","git_reflog_entry_committer","git_reflog_entry_msg","git_reflog_free"],"meta":{"brief":"Git reflog management routines","defgroup":"git_reflog Git reflog management routines","ingroup":"Git","comments":"\n"},"lines":158},{"file":"pack.h","functions":["git_packbuilder_new","git_packbuilder_set_threads","git_packbuilder_insert","git_packbuilder_insert_tree","git_packbuilder_write","git_packbuilder_foreach","git_packbuilder_object_count","git_packbuilder_written","git_packbuilder_free"],"meta":{"brief":"Git pack management routines","defgroup":"git_pack Git pack management routines","ingroup":"Git","comments":"\n"},"lines":113},{"file":"oid.h","functions":["git_oid_fromstr","git_oid_fromstrn","git_oid_fromraw","git_oid_fmt","git_oid_pathfmt","git_oid_allocfmt","git_oid_tostr","git_oid_cpy","git_oid_cmp","git_oid_equal","git_oid_ncmp","git_oid_streq","git_oid_iszero","git_oid_shorten_new","git_oid_shorten_add","git_oid_shorten_free"],"meta":{"brief":"Git object id routines","defgroup":"git_oid Git object id routines","ingroup":"Git","comments":"\n"},"lines":249},{"file":"odb_backend.h","functions":[],"meta":{"brief":"Git custom backend functions","defgroup":"git_backend Git custom backend API","ingroup":"Git","comments":"\n"},"lines":129},{"file":"odb.h","functions":["git_odb_new","git_odb_open","git_odb_add_backend","git_odb_add_alternate","git_odb_free","git_odb_read","git_odb_read_prefix","git_odb_read_header","git_odb_exists","git_odb_foreach","git_odb_write","git_odb_open_wstream","git_odb_open_rstream","git_odb_write_pack","git_odb_hash","git_odb_hashfile","git_odb_object_free","git_odb_object_id","git_odb_object_data","git_odb_object_size","git_odb_object_type"],"meta":{"brief":"Git object database routines","defgroup":"git_odb Git object database routines","ingroup":"Git","comments":"\n"},"lines":369},{"file":"object.h","functions":["git_object_lookup","git_object_lookup_prefix","git_object_id","git_object_type","git_object_owner","git_object_free","git_object_type2string","git_object_string2type","git_object_typeisloose","git_object__size","git_object_peel"],"meta":{"brief":"Git revision object management routines","defgroup":"git_object Git revision object management routines","ingroup":"Git","comments":"\n"},"lines":193},{"file":"notes.h","functions":["git_note_read","git_note_message","git_note_oid","git_note_create","git_note_remove","git_note_free","git_note_default_ref","git_note_foreach"],"meta":{"brief":"Git notes management routines","defgroup":"git_note Git notes management routines","ingroup":"Git","comments":"\n"},"lines":143},{"file":"net.h","functions":[],"meta":{"brief":"Git networking declarations","ingroup":"Git","comments":"\n"},"lines":51},{"file":"message.h","functions":["git_message_prettify"],"meta":{"brief":"Git message management routines","ingroup":"Git","comments":"\n"},"lines":43},{"file":"merge.h","functions":["git_merge_base","git_merge_base_many"],"meta":{"brief":"Git merge-base routines","defgroup":"git_revwalk Git merge-base routines","ingroup":"Git","comments":"\n"},"lines":45},{"file":"inttypes.h","functions":[],"meta":{},"lines":305},{"file":"indexer.h","functions":["git_indexer_stream_new","git_indexer_stream_add","git_indexer_stream_finalize","git_indexer_stream_hash","git_indexer_stream_free","git_indexer_new","git_indexer_run","git_indexer_write","git_indexer_hash","git_indexer_free"],"meta":{},"lines":134},{"file":"index.h","functions":["git_index_open","git_index_new","git_index_free","git_index_owner","git_index_caps","git_index_set_caps","git_index_read","git_index_write","git_index_read_tree","git_index_write_tree","git_index_write_tree_to","git_index_entrycount","git_index_clear","git_index_get_byindex","git_index_get_bypath","git_index_remove","git_index_add","git_index_entry_stage","git_index_add_from_workdir","git_index_find","git_index_conflict_add","git_index_conflict_get","git_index_conflict_remove","git_index_conflict_cleanup","git_index_has_conflicts","git_index_reuc_entrycount","git_index_reuc_find","git_index_reuc_get_bypath","git_index_reuc_get_byindex","git_index_reuc_add","git_index_reuc_remove"],"meta":{"brief":"Git index parsing and manipulation routines","defgroup":"git_index Git index parsing and manipulation routines","ingroup":"Git","comments":"\n"},"lines":538},{"file":"ignore.h","functions":["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"],"meta":{},"lines":77},{"file":"errors.h","functions":["giterr_last","giterr_clear","giterr_set_str","giterr_set_oom"],"meta":{"brief":"Git error handling routines and variables","ingroup":"Git","comments":"\n"},"lines":114},{"file":"diff.h","functions":["git_diff_list_free","git_diff_tree_to_tree","git_diff_index_to_tree","git_diff_workdir_to_index","git_diff_workdir_to_tree","git_diff_merge","git_diff_find_similar","git_diff_foreach","git_diff_print_compact","git_diff_status_char","git_diff_print_patch","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_get_patch","git_diff_patch_free","git_diff_patch_delta","git_diff_patch_num_hunks","git_diff_patch_get_hunk","git_diff_patch_num_lines_in_hunk","git_diff_patch_get_line_in_hunk","git_diff_patch_print","git_diff_patch_to_str","git_diff_blobs"],"meta":{"brief":"Git tree and file differencing routines.","ingroup":"Git","comments":"\n"},"lines":723},{"file":"config.h","functions":["git_config_find_global","git_config_find_xdg","git_config_find_system","git_config_open_default","git_config_file__ondisk","git_config_new","git_config_add_file","git_config_add_file_ondisk","git_config_open_ondisk","git_config_open_level","git_config_refresh","git_config_free","git_config_get_config_entry","git_config_get_int32","git_config_get_int64","git_config_get_bool","git_config_get_string","git_config_get_multivar","git_config_set_int32","git_config_set_int64","git_config_set_bool","git_config_set_string","git_config_set_multivar","git_config_delete","git_config_foreach","git_config_foreach_match","git_config_get_mapped","git_config_lookup_map_value","git_config_parse_bool","git_config_parse_int64","git_config_parse_int32"],"meta":{"brief":"Git config management routines","defgroup":"git_config Git config management routines","ingroup":"Git","comments":"\n"},"lines":547},{"file":"common.h","functions":["git_libgit2_version","git_libgit2_capabilities"],"meta":{"brief":"Git common platform definitions","defgroup":"git_common Git common platform definitions","ingroup":"Git","comments":"\n"},"lines":124},{"file":"commit.h","functions":["git_commit_lookup","git_commit_lookup_prefix","git_commit_free","git_commit_id","git_commit_message_encoding","git_commit_message","git_commit_time","git_commit_time_offset","git_commit_committer","git_commit_author","git_commit_tree","git_commit_tree_oid","git_commit_parentcount","git_commit_parent","git_commit_parent_oid","git_commit_nth_gen_ancestor","git_commit_create","git_commit_create_v"],"meta":{"brief":"Git commit parsing, formatting routines","defgroup":"git_commit Git commit parsing, formatting routines","ingroup":"Git","comments":"\n"},"lines":289},{"file":"clone.h","functions":["git_clone","git_clone_bare"],"meta":{"brief":"Git cloning routines","defgroup":"git_clone Git cloning routines","ingroup":"Git","comments":"\n"},"lines":70},{"file":"checkout.h","functions":["git_checkout_head","git_checkout_index","git_checkout_tree"],"meta":{"brief":"Git checkout routines","defgroup":"git_checkout Git checkout routines","ingroup":"Git","comments":"\n"},"lines":128},{"file":"branch.h","functions":["git_branch_create","git_branch_delete","git_branch_foreach","git_branch_move","git_branch_lookup","git_branch_tracking","git_branch_is_head"],"meta":{"brief":"Git branch parsing routines","defgroup":"git_branch Git branch management","ingroup":"Git","comments":"\n"},"lines":164},{"file":"blob.h","functions":["git_blob_lookup","git_blob_lookup_prefix","git_blob_free","git_blob_rawcontent","git_blob_rawsize","git_blob_create_fromfile","git_blob_create_fromdisk","git_blob_create_fromchunks","git_blob_create_frombuffer"],"meta":{"brief":"Git blob load and write routines","defgroup":"git_blob Git blob load and write routines","ingroup":"Git","comments":"\n"},"lines":174},{"file":"attr.h","functions":["git_attr_get","git_attr_get_many","git_attr_foreach","git_attr_cache_flush","git_attr_add_macro"],"meta":{"brief":"Git attribute management routines","defgroup":"git_attr Git attribute management routines","ingroup":"Git","comments":"\n"},"lines":238}],"functions":{"git_tree_lookup":{"type":"function","file":"tree.h","line":32,"lineto":35,"args":[{"name":"tree","type":"git_tree **","comment":"pointer to the looked up tree"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tree."},{"name":"id","type":"const git_oid *","comment":"identity of the tree to locate."}],"argline":"git_tree **tree, git_repository *repo, const git_oid *id","sig":"git_tree **::git_repository *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a tree object from the repository.","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_lookup-1","ex/HEAD/general.html#git_tree_lookup-2"]}},"git_tree_lookup_prefix":{"type":"function","file":"tree.h","line":49,"lineto":56,"args":[{"name":"tree","type":"git_tree **","comment":"pointer to the looked up tree"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tree."},{"name":"id","type":"const git_oid *","comment":"identity of the tree to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_tree **tree,\n\tgit_repository *repo,\n\tconst git_oid *id,\n\tsize_t len","sig":"git_tree **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a tree object from the repository,\ngiven a prefix of its identifier (short id).","comments":"@see git_object_lookup_prefix\n","group":"tree"},"git_tree_free":{"type":"function","file":"tree.h","line":69,"lineto":72,"args":[{"name":"tree","type":"git_tree *","comment":"the tree to close"}],"argline":"git_tree *tree","sig":"git_tree *","return":{"type":"void"},"description":"Close an open tree","comments":"This is a wrapper around git_object_free()\n\nIMPORTANT:\nIt *is* necessary to call this method when you stop\nusing a tree. Failure to do so will cause a memory leak.\n","group":"tree","examples":{"diff.c":["ex/HEAD/diff.html#git_tree_free-1","ex/HEAD/diff.html#git_tree_free-2"]}},"git_tree_entry_free":{"type":"function","file":"tree.h","line":83,"lineto":83,"args":[{"name":"entry","type":"git_tree_entry *","comment":"The entry to free"}],"argline":"git_tree_entry *entry","sig":"git_tree_entry *","return":{"type":"void"},"description":"Free a tree entry","comments":"IMPORTANT: This function is only needed for tree\nentries owned by the user, such as the ones returned\nby `git_tree_entry_dup`.\n","group":"tree"},"git_tree_entry_dup":{"type":"function","file":"tree.h","line":95,"lineto":95,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"A tree entry to duplicate"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_tree_entry *","comment":"a copy of the original entry"},"description":"Duplicate a tree entry","comments":"Create a copy of a tree entry. The returned copy is owned\nby the user, and must be freed manually with\n`git_tree_entry_free`.\n","group":"tree"},"git_tree_id":{"type":"function","file":"tree.h","line":103,"lineto":103,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"const git_oid *","comment":"object identity for the tree."},"description":"Get the id of a tree.","comments":"","group":"tree"},"git_tree_entrycount":{"type":"function","file":"tree.h","line":111,"lineto":111,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"unsigned int","comment":"the number of entries in the tree"},"description":"Get the number of entries listed in a tree","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_entrycount-3"]}},"git_tree_entry_byname":{"type":"function","file":"tree.h","line":120,"lineto":120,"args":[{"name":"tree","type":"git_tree *","comment":"a previously loaded tree."},{"name":"filename","type":"const char *","comment":"the filename of the desired entry"}],"argline":"git_tree *tree, const char *filename","sig":"git_tree *::const char *","return":{"type":"const git_tree_entry *","comment":"the tree entry; NULL if not found"},"description":"Lookup a tree entry by its filename","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_entry_byname-4"]}},"git_tree_entry_byindex":{"type":"function","file":"tree.h","line":129,"lineto":129,"args":[{"name":"tree","type":"git_tree *","comment":"a previously loaded tree."},{"name":"idx","type":"size_t","comment":"the position in the entry list"}],"argline":"git_tree *tree, size_t idx","sig":"git_tree *::size_t","return":{"type":"const git_tree_entry *","comment":"the tree entry; NULL if not found"},"description":"Lookup a tree entry by its position in the tree","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_entry_byindex-5"]}},"git_tree_entry_byoid":{"type":"function","file":"tree.h","line":140,"lineto":140,"args":[{"name":"tree","type":"git_tree *","comment":"a previously loaded tree."},{"name":"oid","type":"const git_oid *","comment":"the sha being looked for"}],"argline":"git_tree *tree, const git_oid *oid","sig":"git_tree *::const git_oid *","return":{"type":"const git_tree_entry *","comment":"the tree entry; NULL if not found"},"description":"Lookup a tree entry by SHA value.","comments":"Warning: this must examine every entry in the tree, so it is not fast.\n","group":"tree"},"git_tree_entry_filemode":{"type":"function","file":"tree.h","line":148,"lineto":148,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_filemode_t","comment":"filemode as an integer"},"description":"Get the UNIX file attributes of a tree entry","comments":"","group":"tree"},"git_tree_entry_name":{"type":"function","file":"tree.h","line":156,"lineto":156,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"const char *","comment":"the name of the file"},"description":"Get the filename of a tree entry","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_entry_name-6","ex/HEAD/general.html#git_tree_entry_name-7"]}},"git_tree_entry_id":{"type":"function","file":"tree.h","line":164,"lineto":164,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"const git_oid *","comment":"the oid of the object"},"description":"Get the id of the object pointed by the entry","comments":"","group":"tree"},"git_tree_entry_type":{"type":"function","file":"tree.h","line":172,"lineto":172,"args":[{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"const git_tree_entry *entry","sig":"const git_tree_entry *","return":{"type":"git_otype","comment":"the type of the pointed object"},"description":"Get the type of the object pointed by the entry","comments":"","group":"tree"},"git_tree_entry_to_object":{"type":"function","file":"tree.h","line":182,"lineto":185,"args":[{"name":"object_out","type":"git_object **"},{"name":"repo","type":"git_repository *","comment":"repository where to lookup the pointed object"},{"name":"entry","type":"const git_tree_entry *","comment":"a tree entry"}],"argline":"git_object **object_out,\n\tgit_repository *repo,\n\tconst git_tree_entry *entry","sig":"git_object **::git_repository *::const git_tree_entry *","return":{"type":"int","comment":"0 or an error code"},"description":"Convert a tree entry to the git_object it points too.","comments":"","group":"tree","examples":{"general.c":["ex/HEAD/general.html#git_tree_entry_to_object-8"]}},"git_treebuilder_create":{"type":"function","file":"tree.h","line":204,"lineto":204,"args":[{"name":"builder_p","type":"git_treebuilder **","comment":"Pointer where to store the tree builder"},{"name":"source","type":"const git_tree *","comment":"Source tree to initialize the builder (optional)"}],"argline":"git_treebuilder **builder_p, const git_tree *source","sig":"git_treebuilder **::const git_tree *","return":{"type":"int","comment":"0 on success; error code otherwise"},"description":"Create a new tree builder.","comments":"The tree builder can be used to create or modify\ntrees in memory and write them as tree objects to the\ndatabase.\n\nIf the `source` parameter is not NULL, the tree builder\nwill be initialized with the entries of the given tree.\n\nIf the `source` parameter is NULL, the tree builder will\nhave no entries and will have to be filled manually.\n","group":"treebuilder"},"git_treebuilder_clear":{"type":"function","file":"tree.h","line":211,"lineto":211,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to clear"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void"},"description":"Clear all the entires in the builder","comments":"","group":"treebuilder"},"git_treebuilder_free":{"type":"function","file":"tree.h","line":222,"lineto":222,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to free"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void"},"description":"Free a tree builder","comments":"This will clear all the entries and free to builder.\nFailing to free the builder after you're done using it\nwill result in a memory leak\n","group":"treebuilder"},"git_treebuilder_get":{"type":"function","file":"tree.h","line":234,"lineto":234,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Name of the entry"}],"argline":"git_treebuilder *bld, const char *filename","sig":"git_treebuilder *::const char *","return":{"type":"const git_tree_entry *","comment":"pointer to the entry; NULL if not found"},"description":"Get an entry from the builder from its filename","comments":"The returned entry is owned by the builder and should\nnot be freed manually.\n","group":"treebuilder"},"git_treebuilder_insert":{"type":"function","file":"tree.h","line":261,"lineto":266,"args":[{"name":"entry_out","type":"const git_tree_entry **","comment":"Pointer to store the entry (optional)"},{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Filename of the entry"},{"name":"id","type":"const git_oid *","comment":"SHA1 oid of the entry"},{"name":"filemode","type":"git_filemode_t","comment":"Folder attributes of the entry. This parameter must be valued with one of the following entries: 0040000, 0100644, 0100755, 0120000 or 0160000."}],"argline":"const git_tree_entry **entry_out,\n\tgit_treebuilder *bld,\n\tconst char *filename,\n\tconst git_oid *id,\n\tgit_filemode_t filemode","sig":"const git_tree_entry **::git_treebuilder *::const char *::const git_oid *::git_filemode_t","return":{"type":"int","comment":"0 or an error code"},"description":"Add or update an entry to the builder","comments":"Insert a new entry for `filename` in the builder with the\ngiven attributes.\n\nif an entry named `filename` already exists, its attributes\nwill be updated with the given ones.\n\nThe optional pointer `entry_out` can be used to retrieve a\npointer to the newly created/updated entry.\n\nNo attempt is being made to ensure that the provided oid points\nto an existing git object in the object database, nor that the\nattributes make sense regarding the type of the pointed at object.\n","group":"treebuilder"},"git_treebuilder_remove":{"type":"function","file":"tree.h","line":274,"lineto":274,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filename","type":"const char *","comment":"Filename of the entry to remove"}],"argline":"git_treebuilder *bld, const char *filename","sig":"git_treebuilder *::const char *","return":{"type":"int"},"description":"Remove an entry from the builder by its filename","comments":"","group":"treebuilder"},"git_treebuilder_filter":{"type":"function","file":"tree.h","line":287,"lineto":290,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filter","type":"int (*)(const git_tree_entry *, void *)","comment":"Callback to filter entries"},{"name":"payload","type":"void *"}],"argline":"git_treebuilder *bld,\n\tint (*filter)(const git_tree_entry *, void *),\n\tvoid *payload","sig":"git_treebuilder *::int (*)(const git_tree_entry *, void *)::void *","return":{"type":"void"},"description":"Filter the entries in the tree","comments":"The `filter` callback will be called for each entry\nin the tree with a pointer to the entry and the\nprovided `payload`: if the callback returns 1, the\nentry will be filtered (removed from the builder).\n","group":"treebuilder"},"git_treebuilder_write":{"type":"function","file":"tree.h","line":304,"lineto":304,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the written OID"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the object"},{"name":"bld","type":"git_treebuilder *","comment":"Tree builder to write"}],"argline":"git_oid *oid, git_repository *repo, git_treebuilder *bld","sig":"git_oid *::git_repository *::git_treebuilder *","return":{"type":"int","comment":"0 or an error code"},"description":"Write the contents of the tree builder as a tree object","comments":"The tree builder will be written to the given `repo`, and\nit's identifying SHA1 hash will be stored in the `oid`\npointer.\n","group":"treebuilder"},"git_tree_entry_bypath":{"type":"function","file":"tree.h","line":318,"lineto":321,"args":[{"name":"entry","type":"git_tree_entry **","comment":"Pointer where to store the tree entry"},{"name":"root","type":"git_tree *","comment":"A previously loaded tree which will be the root of the relative path"},{"name":"path","type":"const char *"}],"argline":"git_tree_entry **entry,\n\tgit_tree *root,\n\tconst char *path","sig":"git_tree_entry **::git_tree *::const char *","return":{"type":"int","comment":"0 on success; GIT_ENOTFOUND if the path does not exist"},"description":"Retrieve a tree entry contained in a tree or in any\nof its subtrees, given its relative path.","comments":"The returned tree entry is owned by the user and must\nbe freed manually with `git_tree_entry_free`.\n","group":"tree"},"git_tree_walk":{"type":"function","file":"tree.h","line":352,"lineto":352,"args":[{"name":"tree","type":"git_tree *","comment":"The tree to walk"},{"name":"callback","type":"git_treewalk_cb","comment":"Function to call on each tree entry"},{"name":"mode","type":"int","comment":"Traversal mode (pre or post-order)"},{"name":"payload","type":"void *","comment":"Opaque pointer to be passed on each callback"}],"argline":"git_tree *tree, git_treewalk_cb callback, int mode, void *payload","sig":"git_tree *::git_treewalk_cb::int::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Traverse the entries in a tree and its subtrees in\npost or pre order","comments":"The entries will be traversed in the specified order,\nchildren subtrees will be automatically loaded as required,\nand the `callback` will be called once per entry with\nthe current (relative) root for the entry and the entry\ndata itself.\n\nIf the callback returns a positive value, the passed entry will be\nskipped on the traversal (in pre mode). A negative value stops the\nwalk.\n","group":"tree"},"git_cred_userpass_plaintext_new":{"type":"function","file":"transport.h","line":52,"lineto":55,"args":[{"name":"cred","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"The username of the credential."},{"name":"password","type":"const char *","comment":"The password of the credential."}],"argline":"git_cred **cred,\n\tconst char *username,\n\tconst char *password","sig":"git_cred **::const char *::const char *","return":{"type":"int"},"description":"Creates a new plain-text username and password credential object.","comments":"","group":"cred"},"git_transport_new":{"type":"function","file":"transport.h","line":151,"lineto":151,"args":[{"name":"transport","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"url","type":"const char *","comment":"The URL to connect to"}],"argline":"git_transport **transport, const char *url","sig":"git_transport **::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Function to use to create a transport from a URL. The transport database\nis scanned to find a transport that implements the scheme of the URI (i.e.\ngit:// or http://) and a transport object is returned to the caller.","comments":"","group":"transport"},"git_transport_valid_url":{"type":"function","file":"transport.h","line":161,"lineto":167,"args":[{"name":"url","type":"const char *","comment":"The URL to check"}],"argline":"const char *url","sig":"const char *","return":{"type":"int","comment":"Zero if the URL is not valid; nonzero otherwise"},"description":"Function which checks to see if a transport could be created for the\ngiven URL (i.e. checks to see if libgit2 has a transport that supports\nthe given URL's scheme)","comments":"","group":"transport"},"git_transport_dummy":{"type":"function","file":"transport.h","line":176,"lineto":178,"args":[{"name":"transport","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"param","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **transport,\n\t void *param","sig":"git_transport **::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Create an instance of the dummy transport.","comments":"","group":"transport"},"git_transport_local":{"type":"function","file":"transport.h","line":187,"lineto":189,"args":[{"name":"transport","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"param","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **transport,\n\t void *param","sig":"git_transport **::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Create an instance of the local transport.","comments":"","group":"transport"},"git_transport_smart":{"type":"function","file":"transport.h","line":198,"lineto":274,"args":[{"name":"transport","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"param","type":"void *","comment":"A pointer to a git_smart_subtransport_definition"}],"argline":"git_transport **transport,\n\t void *param","sig":"git_transport **::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Create an instance of the smart transport.","comments":"","group":"transport"},"git_smart_subtransport_http":{"type":"function","file":"transport.h","line":285,"lineto":287,"args":[{"name":"out","type":"git_smart_subtransport **","comment":"The newly created subtransport"},{"name":"owner","type":"git_transport*","comment":"The smart transport to own this subtransport"}],"argline":"git_smart_subtransport **out,\n\tgit_transport* owner","sig":"git_smart_subtransport **::git_transport*","return":{"type":"int","comment":"0 or an error code"},"description":"Create an instance of the http subtransport. This subtransport\nalso supports https. On Win32, this subtransport may be implemented\nusing the WinHTTP library.","comments":"","group":"smart"},"git_smart_subtransport_git":{"type":"function","file":"transport.h","line":296,"lineto":302,"args":[{"name":"out","type":"git_smart_subtransport **","comment":"The newly created subtransport"},{"name":"owner","type":"git_transport*","comment":"The smart transport to own this subtransport"}],"argline":"git_smart_subtransport **out,\n\tgit_transport* owner","sig":"git_smart_subtransport **::git_transport*","return":{"type":"int","comment":"0 or an error code"},"description":"Create an instance of the git subtransport.","comments":"","group":"smart"},"git_threads_init":{"type":"function","file":"threads.h","line":31,"lineto":31,"args":[],"argline":"void","sig":"","return":{"type":"void"},"description":"Init the threading system.","comments":"If libgit2 has been built with GIT_THREADS\non, this function must be called once before\nany other library functions.\n\nIf libgit2 has been built without GIT_THREADS\nsupport, this function is a no-op.","group":"threads"},"git_threads_shutdown":{"type":"function","file":"threads.h","line":43,"lineto":43,"args":[],"argline":"void","sig":"","return":{"type":"void"},"description":"Shutdown the threading system.","comments":"If libgit2 has been built with GIT_THREADS\non, this function must be called before shutting\ndown the library.\n\nIf libgit2 has been built without GIT_THREADS\nsupport, this function is a no-op.","group":"threads"},"git_tag_lookup":{"type":"function","file":"tag.h","line":33,"lineto":36,"args":[{"name":"tag","type":"git_tag **","comment":"pointer to the looked up tag"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tag."},{"name":"id","type":"const git_oid *","comment":"identity of the tag to locate."}],"argline":"git_tag **tag, git_repository *repo, const git_oid *id","sig":"git_tag **::git_repository *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a tag object from the repository.","comments":"","group":"tag","examples":{"general.c":["ex/HEAD/general.html#git_tag_lookup-9"]}},"git_tag_lookup_prefix":{"type":"function","file":"tag.h","line":50,"lineto":53,"args":[{"name":"tag","type":"git_tag **","comment":"pointer to the looked up tag"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the tag."},{"name":"id","type":"const git_oid *","comment":"identity of the tag to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_tag **tag, git_repository *repo, const git_oid *id, size_t len","sig":"git_tag **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a tag object from the repository,\ngiven a prefix of its identifier (short id).","comments":"@see git_object_lookup_prefix\n","group":"tag"},"git_tag_free":{"type":"function","file":"tag.h","line":66,"lineto":69,"args":[{"name":"tag","type":"git_tag *","comment":"the tag to close"}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"void"},"description":"Close an open tag","comments":"This is a wrapper around git_object_free()\n\nIMPORTANT:\nIt *is* necessary to call this method when you stop\nusing a tag. Failure to do so will cause a memory leak.\n","group":"tag"},"git_tag_id":{"type":"function","file":"tag.h","line":79,"lineto":79,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"const git_oid *","comment":"object identity for the tag."},"description":"Get the id of a tag.","comments":"","group":"tag"},"git_tag_target":{"type":"function","file":"tag.h","line":91,"lineto":91,"args":[{"name":"target","type":"git_object **","comment":"pointer where to store the target"},{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_object **target, git_tag *tag","sig":"git_object **::git_tag *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the tagged object of a tag","comments":"This method performs a repository lookup for the\ngiven object and returns it\n","group":"tag","examples":{"general.c":["ex/HEAD/general.html#git_tag_target-10"]}},"git_tag_target_oid":{"type":"function","file":"tag.h","line":99,"lineto":99,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"const git_oid *","comment":"pointer to the OID"},"description":"Get the OID of the tagged object of a tag","comments":"","group":"tag"},"git_tag_target_type":{"type":"function","file":"tag.h","line":107,"lineto":107,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"git_otype","comment":"type of the tagged object"},"description":"Get the type of a tag's tagged object","comments":"","group":"tag","examples":{"general.c":["ex/HEAD/general.html#git_tag_target_type-11"]}},"git_tag_name":{"type":"function","file":"tag.h","line":115,"lineto":115,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"const char *","comment":"name of the tag"},"description":"Get the name of a tag","comments":"","group":"tag","examples":{"general.c":["ex/HEAD/general.html#git_tag_name-12"]}},"git_tag_tagger":{"type":"function","file":"tag.h","line":123,"lineto":123,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"const git_signature *","comment":"reference to the tag's author"},"description":"Get the tagger (author) of a tag","comments":"","group":"tag"},"git_tag_message":{"type":"function","file":"tag.h","line":131,"lineto":131,"args":[{"name":"tag","type":"git_tag *","comment":"a previously loaded tag."}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"const char *","comment":"message of the tag"},"description":"Get the message of a tag","comments":"","group":"tag","examples":{"general.c":["ex/HEAD/general.html#git_tag_message-13"]}},"git_tag_create":{"type":"function","file":"tag.h","line":169,"lineto":176,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the newly created tag. If the tag already exists, this parameter will be the oid of the existing tag, and the function will return a GIT_EEXISTS error code."},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag; this name is validated for consistency. It should also not conflict with an already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object must belong to the given `repo`."},{"name":"tagger","type":"const git_signature *","comment":"Signature of the tagger for this tag, and of the tagging time"},{"name":"message","type":"const char *","comment":"Full message for this tag"},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_oid *oid,\n\t\tgit_repository *repo,\n\t\tconst char *tag_name,\n\t\tconst git_object *target,\n\t\tconst git_signature *tagger,\n\t\tconst char *message,\n\t\tint force","sig":"git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int","return":{"type":"int","comment":"0 or an error code A tag object is written to the ODB, and a proper reference is written in the /refs/tags folder, pointing to it"},"description":"Create a new tag in the repository from an object","comments":"A new reference will also be created pointing to\nthis tag object. If `force` is true and a reference\nalready exists with the given name, it'll be replaced.\n\nThe message will not be cleaned up. This can be achieved\nthrough `git_message_prettify()`.\n","group":"tag"},"git_tag_create_frombuffer":{"type":"function","file":"tag.h","line":187,"lineto":191,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the newly created tag"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"buffer","type":"const char *","comment":"Raw tag data"},{"name":"force","type":"int","comment":"Overwrite existing tags"}],"argline":"git_oid *oid,\n\t\tgit_repository *repo,\n\t\tconst char *buffer,\n\t\tint force","sig":"git_oid *::git_repository *::const char *::int","return":{"type":"int","comment":"0 on success; error code otherwise"},"description":"Create a new tag in the repository from a buffer","comments":"","group":"tag"},"git_tag_create_lightweight":{"type":"function","file":"tag.h","line":220,"lineto":225,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the provided target object. If the tag already exists, this parameter will be filled with the oid of the existing pointed object and the function will return a GIT_EEXISTS error code."},{"name":"repo","type":"git_repository *","comment":"Repository where to store the lightweight tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag; this name is validated for consistency. It should also not conflict with an already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object must belong to the given `repo`."},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_oid *oid,\n\t\tgit_repository *repo,\n\t\tconst char *tag_name,\n\t\tconst git_object *target,\n\t\tint force","sig":"git_oid *::git_repository *::const char *::const git_object *::int","return":{"type":"int","comment":"0 or an error code A proper reference is written in the /refs/tags folder, pointing to the provided target object"},"description":"Create a new lightweight tag pointing at a target object","comments":"A new direct reference will be created pointing to\nthis target object. If `force` is true and a reference\nalready exists with the given name, it'll be replaced.\n","group":"tag"},"git_tag_delete":{"type":"function","file":"tag.h","line":237,"lineto":239,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where lives the tag"},{"name":"tag_name","type":"const char *","comment":"Name of the tag to be deleted; this name is validated for consistency."}],"argline":"git_repository *repo,\n\t\tconst char *tag_name","sig":"git_repository *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Delete an existing tag reference.","comments":"","group":"tag"},"git_tag_list":{"type":"function","file":"tag.h","line":254,"lineto":256,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where the tag names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the tags"}],"argline":"git_strarray *tag_names,\n\t\tgit_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Fill a list with all the tags in the Repository","comments":"The string array will be filled with the names of the\nmatching tags; these values are owned by the user and\nshould be free'd manually when no longer needed, using\n`git_strarray_free`.\n","group":"tag"},"git_tag_list_match":{"type":"function","file":"tag.h","line":276,"lineto":282,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where the tag names will be stored"},{"name":"pattern","type":"const char *","comment":"Standard fnmatch pattern"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the tags"}],"argline":"git_strarray *tag_names,\n\t\tconst char *pattern,\n\t\tgit_repository *repo","sig":"git_strarray *::const char *::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Fill a list with all the tags in the Repository\nwhich name match a defined pattern","comments":"If an empty pattern is provided, all the tags\nwill be returned.\n\nThe string array will be filled with the names of the\nmatching tags; these values are owned by the user and\nshould be free'd manually when no longer needed, using\n`git_strarray_free`.\n","group":"tag"},"git_tag_foreach":{"type":"function","file":"tag.h","line":290,"lineto":293,"args":[{"name":"repo","type":"git_repository *","comment":"Repository"},{"name":"cb","type":"git_tag_foreach_cb","comment":"Callback function"},{"name":"cb_data","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo,\n\t\tgit_tag_foreach_cb cb,\n\t\tvoid *cb_data","sig":"git_repository *::git_tag_foreach_cb::void *","return":{"type":"int"},"description":"Call callback `cb' for each tag in the repository","comments":"","group":"tag"},"git_tag_peel":{"type":"function","file":"tag.h","line":307,"lineto":309,"args":[{"name":"tag_target","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"tag","type":"git_tag *","comment":"_target Pointer to the peeled git_object"}],"argline":"git_object **tag_target,\n\t\tgit_tag *tag","sig":"git_object **::git_tag *","return":{"type":"int","comment":"0 or an error code"},"description":"Recursively peel a tag until a non tag git_object\nis met","comments":"The retrieved `tag_target` object is owned by the repository\nand should be closed with the `git_object_free` method.\n","group":"tag"},"git_submodule_lookup":{"type":"function","file":"submodule.h","line":161,"lineto":164,"args":[{"name":"submodule","type":"git_submodule **","comment":"Pointer to submodule description object pointer.."},{"name":"repo","type":"git_repository *","comment":"The repository."},{"name":"name","type":"const char *","comment":"The name of the submodule. Trailing slashes will be ignored."}],"argline":"git_submodule **submodule,\n\tgit_repository *repo,\n\tconst char *name","sig":"git_submodule **::git_repository *::const char *","return":{"type":"int","comment":"0 on success, GIT_ENOTFOUND if submodule does not exist, GIT_EEXISTS if submodule exists in working directory only, -1 on other errors."},"description":"Lookup submodule information by name or path.","comments":"Given either the submodule name or path (they are usually the same), this\nreturns a structure describing the submodule.\n\nThere are two expected error scenarios:\n\n- The submodule is not mentioned in the HEAD, the index, and the config,\n but does \"exist\" in the working directory (i.e. there is a subdirectory\n that is a valid self-contained git repo). In this case, this function\n returns GIT_EEXISTS to indicate the the submodule exists but not in a\n state where a git_submodule can be instantiated.\n- The submodule is not mentioned in the HEAD, index, or config and the\n working directory doesn't contain a value git repo at that path.\n There may or may not be anything else at that path, but nothing that\n looks like a submodule. In this case, this returns GIT_ENOTFOUND.\n\nThe submodule object is owned by the containing repo and will be freed\nwhen the repo is freed. The caller need not free the submodule.\n","group":"submodule"},"git_submodule_foreach":{"type":"function","file":"submodule.h","line":184,"lineto":187,"args":[{"name":"repo","type":"git_repository *","comment":"The repository"},{"name":"callback","type":"int (*)(git_submodule *sm, const char *name, void *payload)","comment":"Function to be called with the name of each submodule. Return a non-zero value to terminate the iteration."},{"name":"payload","type":"void *","comment":"Extra data to pass to callback"}],"argline":"git_repository *repo,\n\tint (*callback)(git_submodule *sm, const char *name, void *payload),\n\tvoid *payload","sig":"git_repository *::int (*)(git_submodule *sm, const char *name, void *payload)::void *","return":{"type":"int","comment":"0 on success, -1 on error, or non-zero return value of callback"},"description":"Iterate over all tracked submodules of a repository.","comments":"See the note on `git_submodule` above. This iterates over the tracked\nsubmodules as decribed therein.\n\nIf you are concerned about items in the working directory that look like\nsubmodules but are not tracked, the diff API will generate a diff record\nfor workdir items that look like submodules but are not tracked, showing\nthem as added in the workdir. Also, the status API will treat the entire\nsubdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.\n","group":"submodule"},"git_submodule_add_setup":{"type":"function","file":"submodule.h","line":212,"lineto":217,"args":[{"name":"submodule","type":"git_submodule **","comment":"The newly created submodule ready to open for clone"},{"name":"repo","type":"git_repository *","comment":"Superproject repository to contain the new submodule"},{"name":"url","type":"const char *","comment":"URL for the submodules remote"},{"name":"path","type":"const char *","comment":"Path at which the submodule should be created"},{"name":"use_gitlink","type":"int","comment":"Should workdir contain a gitlink to the repo in .git/modules vs. repo directly in workdir."}],"argline":"git_submodule **submodule,\n\tgit_repository *repo,\n\tconst char *url,\n\tconst char *path,\n\tint use_gitlink","sig":"git_submodule **::git_repository *::const char *::const char *::int","return":{"type":"int","comment":"0 on success, GIT_EEXISTS if submodule already exists, -1 on other errors."},"description":"Set up a new git submodule for checkout.","comments":"This does \"git submodule add\" up to the fetch and checkout of the\nsubmodule contents. It preps a new submodule, creates an entry in\n.gitmodules and creates an empty initialized repository either at the\ngiven path in the working directory or in .git/modules with a gitlink\nfrom the working directory to the new repo.\n\nTo fully emulate \"git submodule add\" call this function, then open the\nsubmodule repo and perform the clone step as needed. Lastly, call\n`git_submodule_add_finalize()` to wrap up adding the new submodule and\n.gitmodules to the index to be ready to commit.\n","group":"submodule"},"git_submodule_add_finalize":{"type":"function","file":"submodule.h","line":229,"lineto":229,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to finish adding."}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int"},"description":"Resolve the setup of a new git submodule.","comments":"This should be called on a submodule once you have called add setup\nand done the clone of the submodule. This adds the .gitmodules file\nand the newly cloned submodule to the index to be ready to be committed\n(but doesn't actually do the commit).\n","group":"submodule"},"git_submodule_add_to_index":{"type":"function","file":"submodule.h","line":241,"lineto":243,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to add to the index"},{"name":"write_index","type":"int","comment":"Boolean if this should immediately write the index file. If you pass this as false, you will have to get the git_index and explicitly call `git_index_write()` on it to save the change."}],"argline":"git_submodule *submodule,\n\tint write_index","sig":"git_submodule *::int","return":{"type":"int","comment":"0 on success, <0 on failure"},"description":"Add current submodule HEAD commit to index of superproject.","comments":"","group":"submodule"},"git_submodule_save":{"type":"function","file":"submodule.h","line":257,"lineto":257,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to write."}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":"0 on success, <0 on failure."},"description":"Write submodule settings to .gitmodules file.","comments":"This commits any in-memory changes to the submodule to the gitmodules\nfile on disk. You may also be interested in `git_submodule_init()` which\nwrites submodule info to \".git/config\" (which is better for local changes\nto submodule settings) and/or `git_submodule_sync()` which writes\nsettings about remotes to the actual submodule repository.\n","group":"submodule"},"git_submodule_owner":{"type":"function","file":"submodule.h","line":270,"lineto":270,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_repository *","comment":"Pointer to `git_repository`"},"description":"Get the containing repository for a submodule.","comments":"This returns a pointer to the repository that contains the submodule.\nThis is a just a reference to the repository that was passed to the\noriginal `git_submodule_lookup()` call, so if that repository has been\nfreed, then this may be a dangling reference.\n","group":"submodule"},"git_submodule_name":{"type":"function","file":"submodule.h","line":278,"lineto":278,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":"Pointer to the submodule name"},"description":"Get the name of submodule.","comments":"","group":"submodule"},"git_submodule_path":{"type":"function","file":"submodule.h","line":289,"lineto":289,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":"Pointer to the submodule path"},"description":"Get the path to the submodule.","comments":"The path is almost always the same as the submodule name, but the\ntwo are actually not required to match.\n","group":"submodule"},"git_submodule_url":{"type":"function","file":"submodule.h","line":297,"lineto":297,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const char *","comment":"Pointer to the submodule url"},"description":"Get the URL for the submodule.","comments":"","group":"submodule"},"git_submodule_set_url":{"type":"function","file":"submodule.h","line":313,"lineto":313,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to the submodule object"},{"name":"url","type":"const char *","comment":"URL that should be used for the submodule"}],"argline":"git_submodule *submodule, const char *url","sig":"git_submodule *::const char *","return":{"type":"int","comment":"0 on success, <0 on failure"},"description":"Set the URL for the submodule.","comments":"This sets the URL in memory for the submodule. This will be used for\nany following submodule actions while this submodule data is in memory.\n\nAfter calling this, you may wish to call `git_submodule_save()` to write\nthe changes back to the \".gitmodules\" file and `git_submodule_sync()` to\nwrite the changes to the checked out submodule repository.\n","group":"submodule"},"git_submodule_index_oid":{"type":"function","file":"submodule.h","line":321,"lineto":321,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":"Pointer to git_oid or NULL if submodule is not in index."},"description":"Get the OID for the submodule in the index.","comments":"","group":"submodule"},"git_submodule_head_oid":{"type":"function","file":"submodule.h","line":329,"lineto":329,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":"Pointer to git_oid or NULL if submodule is not in the HEAD."},"description":"Get the OID for the submodule in the current HEAD tree.","comments":"","group":"submodule"},"git_submodule_wd_oid":{"type":"function","file":"submodule.h","line":342,"lineto":342,"args":[{"name":"submodule","type":"git_submodule *","comment":"Pointer to submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"const git_oid *","comment":"Pointer to git_oid or NULL if submodule is not checked out."},"description":"Get the OID for the submodule in the current working directory.","comments":"This returns the OID that corresponds to looking up 'HEAD' in the checked\nout submodule. If there are pending changes in the index or anything\nelse, this won't notice that. You should call `git_submodule_status()`\nfor a more complete picture about the state of the working directory.\n","group":"submodule"},"git_submodule_ignore":{"type":"function","file":"submodule.h","line":362,"lineto":363,"args":[],"argline":"_t) git_submodule_ignore(\n\tgit_submodule *submodule)","sig":"","return":{"type":"GIT_EXTERN("},"description":"Get the ignore rule for the submodule.","comments":"There are four ignore values:\n\n - **GIT_SUBMODULE_IGNORE_NONE** will consider any change to the contents\n of the submodule from a clean checkout to be dirty, including the\n addition of untracked files. This is the default if unspecified.\n - **GIT_SUBMODULE_IGNORE_UNTRACKED** examines the contents of the\n working tree (i.e. call `git_status_foreach()` on the submodule) but\n UNTRACKED files will not count as making the submodule dirty.\n - **GIT_SUBMODULE_IGNORE_DIRTY** means to only check if the HEAD of the\n submodule has moved for status. This is fast since it does not need to\n scan the working tree of the submodule at all.\n - **GIT_SUBMODULE_IGNORE_ALL** means not to open the submodule repo.\n The working directory will be consider clean so long as there is a\n checked out version present.","group":"submodule"},"git_submodule_set_ignore":{"type":"function","file":"submodule.h","line":379,"lineto":381,"args":[{"name":"submodule","type":"git_submodule *"},{"name":"ignore","type":"git_submodule_ignore_t"}],"argline":"git_submodule *submodule,\n\tgit_submodule_ignore_t ignore","sig":"git_submodule *::git_submodule_ignore_t","return":{"type":"git_submodule_ignore_t","comment":"old value for ignore"},"description":"Set the ignore rule for the submodule.","comments":"This sets the ignore rule in memory for the submodule. This will be used\nfor any following actions (such as `git_submodule_status()`) while the\nsubmodule is in memory. You should call `git_submodule_save()` if you\nwant to persist the new ignore role.\n\nCalling this again with GIT_SUBMODULE_IGNORE_DEFAULT or calling\n`git_submodule_reload()` will revert the rule to the value that was in the\noriginal config.\n","group":"submodule"},"git_submodule_update":{"type":"function","file":"submodule.h","line":386,"lineto":387,"args":[],"argline":"_t) git_submodule_update(\n\tgit_submodule *submodule)","sig":"","return":{"type":"GIT_EXTERN("},"description":"Get the update rule for the submodule.","comments":"","group":"submodule"},"git_submodule_set_update":{"type":"function","file":"submodule.h","line":401,"lineto":403,"args":[{"name":"submodule","type":"git_submodule *"},{"name":"update","type":"git_submodule_update_t"}],"argline":"git_submodule *submodule,\n\tgit_submodule_update_t update","sig":"git_submodule *::git_submodule_update_t","return":{"type":"git_submodule_update_t","comment":"old value for update"},"description":"Set the update rule for the submodule.","comments":"This sets the update rule in memory for the submodule. You should call\n`git_submodule_save()` if you want to persist the new update rule.\n\nCalling this again with GIT_SUBMODULE_UPDATE_DEFAULT or calling\n`git_submodule_reload()` will revert the rule to the value that was in the\noriginal config.\n","group":"submodule"},"git_submodule_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":416,"lineto":417,"args":[{"name":"submodule","type":"git_submodule *"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":"0 if fetchRecurseSubmodules is false, 1 if true"},"description":"Read the fetchRecurseSubmodules rule for a submodule.","comments":"This accesses the submodule.<name>.fetchRecurseSubmodules value for\nthe submodule that controls fetching behavior for the submodule.\n\nNote that at this time, libgit2 does not honor this setting and the\nfetch functionality current ignores submodules.\n","group":"submodule"},"git_submodule_set_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":430,"lineto":432,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to modify"},{"name":"fetch_recurse_submodules","type":"int","comment":"Boolean value"}],"argline":"git_submodule *submodule,\n\tint fetch_recurse_submodules","sig":"git_submodule *::int","return":{"type":"int","comment":"old value for fetchRecurseSubmodules"},"description":"Set the fetchRecurseSubmodules rule for a submodule.","comments":"This sets the submodule.<name>.fetchRecurseSubmodules value for\nthe submodule. You should call `git_submodule_save()` if you want\nto persist the new value.\n","group":"submodule"},"git_submodule_init":{"type":"function","file":"submodule.h","line":447,"lineto":447,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to write into the superproject config"},{"name":"overwrite","type":"int","comment":"By default, existing entries will not be overwritten, but setting this to true forces them to be updated."}],"argline":"git_submodule *submodule, int overwrite","sig":"git_submodule *::int","return":{"type":"int","comment":"0 on success, <0 on failure."},"description":"Copy submodule info into \".git/config\" file.","comments":"Just like \"git submodule init\", this copies information about the\nsubmodule into \".git/config\". You can use the accessor functions\nabove to alter the in-memory git_submodule object and control what\nis written to the config, overriding what is in .gitmodules.\n","group":"submodule"},"git_submodule_sync":{"type":"function","file":"submodule.h","line":457,"lineto":457,"args":[{"name":"submodule","type":"git_submodule *"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int"},"description":"Copy submodule remote info into submodule repo.","comments":"This copies the information about the submodules URL into the checked out\nsubmodule config, acting like \"git submodule sync\". This is useful if\nyou have altered the URL for the submodule (or it has been altered by a\nfetch of upstream changes) and you need to update your local repo.","group":"submodule"},"git_submodule_open":{"type":"function","file":"submodule.h","line":471,"lineto":473,"args":[{"name":"repo","type":"git_repository **"},{"name":"submodule","type":"git_submodule *","comment":"Submodule to be opened"}],"argline":"git_repository **repo,\n\tgit_submodule *submodule","sig":"git_repository **::git_submodule *","return":{"type":"int","comment":"0 on success, <0 if submodule repo could not be opened."},"description":"Open the repository for a submodule.","comments":"This is a newly opened repository object. The caller is responsible for\ncalling `git_repository_free()` on it when done. Multiple calls to this\nfunction will return distinct `git_repository` objects. This will only\nwork if the submodule is checked out into the working directory.\n","group":"submodule"},"git_submodule_reload":{"type":"function","file":"submodule.h","line":481,"lineto":481,"args":[{"name":"submodule","type":"git_submodule *"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int"},"description":"Reread submodule info from config, index, and HEAD.","comments":"Call this to reread cached submodule information for this submodule if\nyou have reason to believe that it has changed.","group":"submodule"},"git_submodule_reload_all":{"type":"function","file":"submodule.h","line":488,"lineto":488,"args":[{"name":"repo","type":"git_repository *"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int"},"description":"Reread all submodule info.","comments":"Call this to reload all cached submodule information for the repo.","group":"submodule"},"git_submodule_status":{"type":"function","file":"submodule.h","line":503,"lineto":505,"args":[{"name":"status","type":"unsigned int *","comment":"Combination of `GIT_SUBMODULE_STATUS` flags"},{"name":"submodule","type":"git_submodule *","comment":"Submodule for which to get status"}],"argline":"unsigned int *status,\n\tgit_submodule *submodule","sig":"unsigned int *::git_submodule *","return":{"type":"int","comment":"0 on success, <0 on error"},"description":"Get the status for a submodule.","comments":"This looks at a submodule and tries to determine the status. It\nwill return a combination of the `GIT_SUBMODULE_STATUS` values above.\nHow deeply it examines the working directory to do this will depend\non the `git_submodule_ignore_t` value for the submodule - which can be\nset either temporarily or permanently with `git_submodule_set_ignore()`.\n","group":"submodule"},"git_strarray_free":{"type":"function","file":"strarray.h","line":36,"lineto":36,"args":[{"name":"array","type":"git_strarray *","comment":"array to close"}],"argline":"git_strarray *array","sig":"git_strarray *","return":{"type":"void"},"description":"Close a string array object","comments":"This method must always be called once a git_strarray is no\nlonger needed, otherwise memory will leak.\n","group":"strarray","examples":{"general.c":["ex/HEAD/general.html#git_strarray_free-14"]}},"git_strarray_copy":{"type":"function","file":"strarray.h","line":47,"lineto":47,"args":[{"name":"tgt","type":"git_strarray *","comment":"target"},{"name":"src","type":"const git_strarray *","comment":"source"}],"argline":"git_strarray *tgt, const git_strarray *src","sig":"git_strarray *::const git_strarray *","return":{"type":"int"},"description":"Copy a string array object from source to target.","comments":"Note: target is overwritten and hence should be empty, \notherwise its contents are leaked.\n","group":"strarray"},"git_status_foreach":{"type":"function","file":"status.h","line":64,"lineto":67,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"int (*)(const char *, unsigned int, void *)","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo,\n\tint (*callback)(const char *, unsigned int, void *),\n\tvoid *payload","sig":"git_repository *::int (*)(const char *, unsigned int, void *)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Gather file statuses and run a callback for each one.","comments":"The callback is passed the path of the file, the status (a combination of\nthe `git_status_t` values above) and the `payload` data pointer passed\ninto this function.\n\nIf the callback returns a non-zero value, this function will stop looping\nand return GIT_EUSER.\n","group":"status"},"git_status_foreach_ext":{"type":"function","file":"status.h","line":168,"lineto":172,"args":[{"name":"repo","type":"git_repository *","comment":"Repository object"},{"name":"opts","type":"const git_status_options *","comment":"Status options structure"},{"name":"callback","type":"int (*)(const char *, unsigned int, void *)","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo,\n\tconst git_status_options *opts,\n\tint (*callback)(const char *, unsigned int, void *),\n\tvoid *payload","sig":"git_repository *::const git_status_options *::int (*)(const char *, unsigned int, void *)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Gather file status information and run callbacks as requested.","comments":"This is an extended version of the `git_status_foreach()` API that\nallows for more granular control over which paths will be processed and\nin what order. See the `git_status_options` structure for details\nabout the additional controls that this makes available.\n","group":"status"},"git_status_file":{"type":"function","file":"status.h","line":187,"lineto":190,"args":[{"name":"status_flags","type":"unsigned int *","comment":"The status value for the file"},{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"path","type":"const char *","comment":"The file to retrieve status for, rooted at the repo's workdir"}],"argline":"unsigned int *status_flags,\n\tgit_repository *repo,\n\tconst char *path","sig":"unsigned int *::git_repository *::const char *","return":{"type":"int","comment":"0 on success, GIT_ENOTFOUND if the file is not found in the HEAD, index, and work tree, GIT_EINVALIDPATH if `path` points at a folder, GIT_EAMBIGUOUS if \"path\" matches multiple files, -1 on other error."},"description":"Get file status for a single file.","comments":"This is not quite the same as calling `git_status_foreach_ext()` with\nthe pathspec set to the specified path.\n","group":"status"},"git_status_should_ignore":{"type":"function","file":"status.h","line":208,"lineto":211,"args":[{"name":"ignored","type":"int *","comment":"Boolean returning 0 if the file is not ignored, 1 if it is"},{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"path","type":"const char *","comment":"The file to check ignores for, rooted at the repo's workdir."}],"argline":"int *ignored,\n\tgit_repository *repo,\n\tconst char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":"0 if ignore rules could be processed for the file (regardless of whether it exists or not), or an error < 0 if they could not."},"description":"Test if the ignore rules apply to a given file.","comments":"This function checks the ignore rules to see if they would apply to the\ngiven file. This indicates if the file would be ignored regardless of\nwhether the file is already in the index or commited to the repository.\n\nOne way to think of this is if you were to do \"git add .\" on the\ndirectory containing the file, would it be added or not?\n","group":"status"},"git_stash_save":{"type":"function","file":"stash.h","line":57,"lineto":62,"args":[{"name":"out","type":"git_oid *","comment":"Object id of the commit containing the stashed state. This commit is also the target of the direct reference refs/stash."},{"name":"repo","type":"git_repository *","comment":"The owning repository."},{"name":"stasher","type":"git_signature *","comment":"The identity of the person performing the stashing."},{"name":"message","type":"const char *","comment":"Optional description along with the stashed state."},{"name":"flags","type":"uint32_t","comment":"Flags to control the stashing process."}],"argline":"git_oid *out,\n\tgit_repository *repo,\n\tgit_signature *stasher,\n\tconst char *message,\n\tuint32_t flags","sig":"git_oid *::git_repository *::git_signature *::const char *::uint32_t","return":{"type":"int","comment":"0 on success, GIT_ENOTFOUND where there's nothing to stash, or error code."},"description":"Save the local modifications to a new stash.","comments":"","group":"stash"},"git_stash_foreach":{"type":"function","file":"stash.h","line":100,"lineto":103,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the stash."},{"name":"callback","type":"stash_cb"},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo,\n\tstash_cb callback,\n\tvoid *payload","sig":"git_repository *::stash_cb::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Loop over all the stashed states and issue a callback for each one.","comments":"If the callback returns a non-zero value, this will stop looping.\n","group":"stash"},"git_stash_drop":{"type":"function","file":"stash.h","line":115,"lineto":117,"args":[{"name":"repo","type":"git_repository *","comment":"The owning repository."},{"name":"index","type":"size_t","comment":"The position within the stash list. 0 points to the most recent stashed state."}],"argline":"git_repository *repo,\n\tsize_t index","sig":"git_repository *::size_t","return":{"type":"int","comment":"0 on success, or error code"},"description":"Remove a single stashed state from the stash list.","comments":"","group":"stash"},"git_signature_new":{"type":"function","file":"signature.h","line":36,"lineto":36,"args":[{"name":"sig_out","type":"git_signature **","comment":"new signature, in case of error NULL"},{"name":"name","type":"const char *","comment":"name of the person"},{"name":"email","type":"const char *","comment":"email of the person"},{"name":"time","type":"git_time_t","comment":"time when the action happened"},{"name":"offset","type":"int","comment":"timezone offset in minutes for the time"}],"argline":"git_signature **sig_out, const char *name, const char *email, git_time_t time, int offset","sig":"git_signature **::const char *::const char *::git_time_t::int","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new action signature. The signature must be freed\nmanually or using git_signature_free","comments":"Note: angle brackets ('<' and '>') characters are not allowed\nto be used in either the `name` or the `email` parameter.\n","group":"signature","examples":{"general.c":["ex/HEAD/general.html#git_signature_new-15","ex/HEAD/general.html#git_signature_new-16"]}},"git_signature_now":{"type":"function","file":"signature.h","line":47,"lineto":47,"args":[{"name":"sig_out","type":"git_signature **","comment":"new signature, in case of error NULL"},{"name":"name","type":"const char *","comment":"name of the person"},{"name":"email","type":"const char *","comment":"email of the person"}],"argline":"git_signature **sig_out, const char *name, const char *email","sig":"git_signature **::const char *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new action signature with a timestamp of 'now'. The\nsignature must be freed manually or using git_signature_free","comments":"","group":"signature"},"git_signature_dup":{"type":"function","file":"signature.h","line":57,"lineto":57,"args":[{"name":"sig","type":"const git_signature *","comment":"signature to duplicated"}],"argline":"const git_signature *sig","sig":"const git_signature *","return":{"type":"git_signature *","comment":"a copy of sig, NULL on out of memory"},"description":"Create a copy of an existing signature.","comments":"All internal strings are also duplicated.","group":"signature"},"git_signature_free":{"type":"function","file":"signature.h","line":64,"lineto":64,"args":[{"name":"sig","type":"git_signature *","comment":"signature to free"}],"argline":"git_signature *sig","sig":"git_signature *","return":{"type":"void"},"description":"Free an existing signature","comments":"","group":"signature"},"git_revwalk_new":{"type":"function","file":"revwalk.h","line":70,"lineto":70,"args":[{"name":"walker","type":"git_revwalk **","comment":"pointer to the new revision walker"},{"name":"repo","type":"git_repository *","comment":"the repo to walk through"}],"argline":"git_revwalk **walker, git_repository *repo","sig":"git_revwalk **::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Allocate a new revision walker to iterate through a repo.","comments":"This revision walker uses a custom memory pool and an internal\ncommit cache, so it is relatively expensive to allocate.\n\nFor maximum performance, this revision walker should be\nreused for different walks.\n\nThis revision walker is *not* thread safe: it may only be\nused to walk a repository on a single thread; however,\nit is possible to have several revision walkers in\nseveral different threads walking the same repository.\n","group":"revwalk","examples":{"general.c":["ex/HEAD/general.html#git_revwalk_new-17"]}},"git_revwalk_reset":{"type":"function","file":"revwalk.h","line":85,"lineto":85,"args":[{"name":"walker","type":"git_revwalk *","comment":"handle to reset."}],"argline":"git_revwalk *walker","sig":"git_revwalk *","return":{"type":"void"},"description":"Reset the revision walker for reuse.","comments":"This will clear all the pushed and hidden commits, and\nleave the walker in a blank state (just like at\ncreation) ready to receive new commit pushes and\nstart a new walk.\n\nThe revision walk is automatically reset when a walk\nis over.\n","group":"revwalk"},"git_revwalk_push":{"type":"function","file":"revwalk.h","line":102,"lineto":102,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"oid","type":"const git_oid *","comment":"the oid of the commit to start from."}],"argline":"git_revwalk *walk, const git_oid *oid","sig":"git_revwalk *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Mark a commit to start traversal from.","comments":"The given OID must belong to a commit on the walked\nrepository.\n\nThe given commit will be used as one of the roots\nwhen starting the revision walk. At least one commit\nmust be pushed the repository before a walk can\nbe started.\n","group":"revwalk","examples":{"general.c":["ex/HEAD/general.html#git_revwalk_push-18"]}},"git_revwalk_push_glob":{"type":"function","file":"revwalk.h","line":117,"lineto":117,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"glob","type":"const char *","comment":"the glob pattern references should match"}],"argline":"git_revwalk *walk, const char *glob","sig":"git_revwalk *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Push matching references","comments":"The OIDs pointed to by the references that match the given glob\npattern will be pushed to the revision walker.\n\nA leading 'refs/' is implied if not present as well as a trailing\n'/ *' if the glob lacks '?', '*' or '['.\n","group":"revwalk"},"git_revwalk_push_head":{"type":"function","file":"revwalk.h","line":125,"lineto":125,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"int","comment":"0 or an error code"},"description":"Push the repository's HEAD","comments":"","group":"revwalk"},"git_revwalk_hide":{"type":"function","file":"revwalk.h","line":140,"lineto":140,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"oid","type":"const git_oid *","comment":"the oid of commit that will be ignored during the traversal"}],"argline":"git_revwalk *walk, const git_oid *oid","sig":"git_revwalk *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Mark a commit (and its ancestors) uninteresting for the output.","comments":"The given OID must belong to a commit on the walked\nrepository.\n\nThe resolved commit and all its parents will be hidden from the\noutput on the revision walk.\n","group":"revwalk"},"git_revwalk_hide_glob":{"type":"function","file":"revwalk.h","line":156,"lineto":156,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"glob","type":"const char *","comment":"the glob pattern references should match"}],"argline":"git_revwalk *walk, const char *glob","sig":"git_revwalk *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Hide matching references.","comments":"The OIDs pointed to by the references that match the given glob\npattern and their ancestors will be hidden from the output on the\nrevision walk.\n\nA leading 'refs/' is implied if not present as well as a trailing\n'/ *' if the glob lacks '?', '*' or '['.\n","group":"revwalk"},"git_revwalk_hide_head":{"type":"function","file":"revwalk.h","line":164,"lineto":164,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"int","comment":"0 or an error code"},"description":"Hide the repository's HEAD","comments":"","group":"revwalk"},"git_revwalk_push_ref":{"type":"function","file":"revwalk.h","line":175,"lineto":175,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"refname","type":"const char *","comment":"the reference to push"}],"argline":"git_revwalk *walk, const char *refname","sig":"git_revwalk *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Push the OID pointed to by a reference","comments":"The reference must point to a commit.\n","group":"revwalk"},"git_revwalk_hide_ref":{"type":"function","file":"revwalk.h","line":186,"lineto":186,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"refname","type":"const char *","comment":"the reference to hide"}],"argline":"git_revwalk *walk, const char *refname","sig":"git_revwalk *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Hide the OID pointed to by a reference","comments":"The reference must point to a commit.\n","group":"revwalk"},"git_revwalk_next":{"type":"function","file":"revwalk.h","line":206,"lineto":206,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the oid of the next commit"},{"name":"walk","type":"git_revwalk *","comment":"the walker to pop the commit from."}],"argline":"git_oid *oid, git_revwalk *walk","sig":"git_oid *::git_revwalk *","return":{"type":"int","comment":"0 if the next commit was found; GIT_ITEROVER if there are no commits left to iterate"},"description":"Get the next commit from the revision walk.","comments":"The initial call to this method is *not* blocking when\niterating through a repo with a time-sorting mode.\n\nIterating with Topological or inverted modes makes the initial\ncall blocking to preprocess the commit list, but this block should be\nmostly unnoticeable on most repositories (topological preprocessing\ntimes at 0.3s on the git.git repo).\n\nThe revision walker is reset when the walk is over.\n","group":"revwalk","examples":{"general.c":["ex/HEAD/general.html#git_revwalk_next-19"]}},"git_revwalk_sorting":{"type":"function","file":"revwalk.h","line":217,"lineto":217,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"sort_mode","type":"unsigned int","comment":"combination of GIT_SORT_XXX flags"}],"argline":"git_revwalk *walk, unsigned int sort_mode","sig":"git_revwalk *::unsigned int","return":{"type":"void"},"description":"Change the sorting mode when iterating through the\nrepository's contents.","comments":"Changing the sorting mode resets the walker.\n","group":"revwalk","examples":{"general.c":["ex/HEAD/general.html#git_revwalk_sorting-20"]}},"git_revwalk_free":{"type":"function","file":"revwalk.h","line":224,"lineto":224,"args":[{"name":"walk","type":"git_revwalk *","comment":"traversal handle to close. If NULL nothing occurs."}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"void"},"description":"Free a revision walker previously allocated.","comments":"","group":"revwalk","examples":{"general.c":["ex/HEAD/general.html#git_revwalk_free-21"]}},"git_revwalk_repository":{"type":"function","file":"revwalk.h","line":233,"lineto":233,"args":[{"name":"walk","type":"git_revwalk *","comment":"the revision walker"}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"git_repository *","comment":"the repository being walked"},"description":"Return the repository on which this walker\nis operating.","comments":"","group":"revwalk"},"git_revparse_single":{"type":"function","file":"revparse.h","line":32,"lineto":32,"args":[{"name":"out","type":"git_object **","comment":"pointer to output object"},{"name":"repo","type":"git_repository *","comment":"the repository to search in"},{"name":"spec","type":"const char *","comment":"the textual specification for an object"}],"argline":"git_object **out, git_repository *repo, const char *spec","sig":"git_object **::git_repository *::const char *","return":{"type":"int","comment":"on success, GIT_ERROR otherwise (use git_error_last for information about the error)"},"description":"Find an object, as specified by a revision string. See `man gitrevisions`, or the documentation\nfor `git rev-parse` for information on the syntax accepted.","comments":"","group":"revparse"},"git_reset":{"type":"function","file":"reset.h","line":43,"lineto":43,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to perform the reset operation."},{"name":"target","type":"git_object *","comment":"Object to which the Head should be moved to. This object must belong to the given `repo` and can either be a git_commit or a git_tag. When a git_tag is being passed, it should be dereferencable to a git_commit which oid will be used as the target of the branch."},{"name":"reset_type","type":"git_reset_type","comment":"Kind of reset operation to perform."}],"argline":"git_repository *repo, git_object *target, git_reset_type reset_type","sig":"git_repository *::git_object *::git_reset_type","return":{"type":"int","comment":"GIT_SUCCESS or an error code"},"description":"Sets the current head to the specified commit oid and optionally\nresets the index and working tree to match.","comments":"When specifying a Soft kind of reset, the head will be moved to the commit.\n\nSpecifying a Mixed kind of reset will trigger a Soft reset and the index will\nbe replaced with the content of the commit tree.\n\nSpecifying a Hard kind of reset will trigger a Mixed reset and the working\ndirectory will be replaced with the content of the index.\n\nTODO: Implement remaining kinds of resets.\n","group":"reset"},"git_repository_open":{"type":"function","file":"repository.h","line":36,"lineto":36,"args":[{"name":"repository","type":"git_repository **","comment":"pointer to the repo which will be opened"},{"name":"path","type":"const char *","comment":"the path to the repository"}],"argline":"git_repository **repository, const char *path","sig":"git_repository **::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Open a git repository.","comments":"The 'path' argument must point to either a git repository\nfolder, or an existing work dir.\n\nThe method will automatically detect if 'path' is a normal\nor bare repository or fail is 'path' is neither.\n","group":"repository","examples":{"network/git2.c":["ex/HEAD/git2.html#git_repository_open-1"],"general.c":["ex/HEAD/general.html#git_repository_open-22","ex/HEAD/general.html#git_repository_open-23"]}},"git_repository_wrap_odb":{"type":"function","file":"repository.h","line":49,"lineto":49,"args":[{"name":"repository","type":"git_repository **","comment":"pointer to the repo"},{"name":"odb","type":"git_odb *","comment":"the object database to wrap"}],"argline":"git_repository **repository, git_odb *odb","sig":"git_repository **::git_odb *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a \"fake\" repository to wrap an object database","comments":"Create a repository object to wrap an object database to be used\nwith the API when all you have is an object database. This doesn't\nhave any paths associated with it, so use with care.\n","group":"repository"},"git_repository_discover":{"type":"function","file":"repository.h","line":79,"lineto":84,"args":[{"name":"repository_path","type":"char *","comment":"The user allocated buffer which will contain the found path."},{"name":"size","type":"size_t","comment":"repository_path size"},{"name":"start_path","type":"const char *","comment":"The base path where the lookup starts."},{"name":"across_fs","type":"int","comment":"If true, then the lookup will not stop when a filesystem device change is detected while exploring parent directories."},{"name":"ceiling_dirs","type":"const char *","comment":"A GIT_PATH_LIST_SEPARATOR separated list of absolute symbolic link free paths. The lookup will stop when any of this paths is reached. Note that the lookup always performs on start_path no matter start_path appears in ceiling_dirs ceiling_dirs might be NULL (which is equivalent to an empty string)"}],"argline":"char *repository_path,\n\t\tsize_t size,\n\t\tconst char *start_path,\n\t\tint across_fs,\n\t\tconst char *ceiling_dirs","sig":"char *::size_t::const char *::int::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Look for a git repository and copy its path in the given buffer.\nThe lookup start from base_path and walk across parent directories\nif nothing has been found. The lookup ends when the first repository\nis found, or when reaching a directory referenced in ceiling_dirs\nor when the filesystem changes (in case across_fs is true).","comments":"The method will automatically detect if the repository is bare\n(if there is a repository).\n","group":"repository"},"git_repository_open_ext":{"type":"function","file":"repository.h","line":120,"lineto":124,"args":[{"name":"repo","type":"git_repository **","comment":"_out Pointer to the repo which will be opened. This can actually be NULL if you only want to use the error code to see if a repo at this path could be opened."},{"name":"start_path","type":"const char *","comment":"Path to open as git repository. If the flags permit \"searching\", then this can be a path to a subdirectory inside the working directory of the repository."},{"name":"flags","type":"uint32_t","comment":"A combination of the GIT_REPOSITORY_OPEN flags above."},{"name":"ceiling_dirs","type":"const char *","comment":"A GIT_PATH_LIST_SEPARATOR delimited list of path prefixes at which the search for a containing repository should terminate."}],"argline":"git_repository **repo,\n\tconst char *start_path,\n\tuint32_t flags,\n\tconst char *ceiling_dirs","sig":"git_repository **::const char *::uint32_t::const char *","return":{"type":"int","comment":"0 on success, GIT_ENOTFOUND if no repository could be found, or -1 if there was a repository but open failed for some reason (such as repo corruption or system errors)."},"description":"Find and open a repository with extended controls.","comments":"","group":"repository","examples":{"showindex.c":["ex/HEAD/showindex.html#git_repository_open_ext-1"],"diff.c":["ex/HEAD/diff.html#git_repository_open_ext-3"]}},"git_repository_free":{"type":"function","file":"repository.h","line":137,"lineto":137,"args":[{"name":"repo","type":"git_repository *","comment":"repository handle to close. If NULL nothing occurs."}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void"},"description":"Free a previously allocated repository","comments":"Note that after a repository is free'd, all the objects it has spawned\nwill still exist until they are manually closed by the user\nwith `git_object_free`, but accessing any of the attributes of\nan object without a backing repository will result in undefined\nbehavior\n","group":"repository","examples":{"showindex.c":["ex/HEAD/showindex.html#git_repository_free-2"],"network/git2.c":["ex/HEAD/git2.html#git_repository_free-2"],"network/clone.c":["ex/HEAD/clone.html#git_repository_free-1"],"general.c":["ex/HEAD/general.html#git_repository_free-24"],"diff.c":["ex/HEAD/diff.html#git_repository_free-4"]}},"git_repository_init":{"type":"function","file":"repository.h","line":154,"lineto":157,"args":[{"name":"repo_out","type":"git_repository **","comment":"pointer to the repo which will be created or reinitialized"},{"name":"path","type":"const char *","comment":"the path to the repository"},{"name":"is_bare","type":"unsigned","comment":"if true, a Git repository without a working directory is created at the pointed path. If false, provided path will be considered as the working directory into which the .git directory will be created."}],"argline":"git_repository **repo_out,\n\tconst char *path,\n\tunsigned is_bare","sig":"git_repository **::const char *::unsigned","return":{"type":"int","comment":"0 or an error code"},"description":"Creates a new Git repository in the given folder.","comments":"TODO:\n- Reinit the repository\n","group":"repository"},"git_repository_init_ext":{"type":"function","file":"repository.h","line":264,"lineto":267,"args":[{"name":"repo_out","type":"git_repository **","comment":"Pointer to the repo which will be created or reinitialized."},{"name":"repo_path","type":"const char *","comment":"The path to the repository."},{"name":"opts","type":"git_repository_init_options *","comment":"Pointer to git_repository_init_options struct."}],"argline":"git_repository **repo_out,\n\tconst char *repo_path,\n\tgit_repository_init_options *opts","sig":"git_repository **::const char *::git_repository_init_options *","return":{"type":"int","comment":"0 or an error code on failure."},"description":"Create a new Git repository in the given folder with extended controls.","comments":"This will initialize a new git repository (creating the repo_path\nif requested by flags) and working directory as needed. It will\nauto-detect the case sensitivity of the file system and if the\nfile system supports file mode bits correctly.\n","group":"repository"},"git_repository_head":{"type":"function","file":"repository.h","line":278,"lineto":278,"args":[{"name":"head_out","type":"git_reference **","comment":"pointer to the reference which will be retrieved"},{"name":"repo","type":"git_repository *","comment":"a repository object"}],"argline":"git_reference **head_out, git_repository *repo","sig":"git_reference **::git_repository *","return":{"type":"int","comment":"0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing branch, an error code otherwise"},"description":"Retrieve and resolve the reference pointed at by HEAD.","comments":"","group":"repository"},"git_repository_head_detached":{"type":"function","file":"repository.h","line":290,"lineto":290,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"1 if HEAD is detached, 0 if it's not; error code if there was an error."},"description":"Check if a repository's HEAD is detached","comments":"A repository's HEAD is detached when it points directly to a commit\ninstead of a branch.\n","group":"repository"},"git_repository_head_orphan":{"type":"function","file":"repository.h","line":302,"lineto":302,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"1 if the current branch is an orphan, 0 if it's not; error code if there was an error"},"description":"Check if the current branch is an orphan","comments":"An orphan branch is one named from HEAD but which doesn't exist in\nthe refs namespace, because it doesn't have any commit to point to.\n","group":"repository"},"git_repository_is_empty":{"type":"function","file":"repository.h","line":314,"lineto":314,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"1 if the repository is empty, 0 if it isn't, error code if the repository is corrupted"},"description":"Check if a repository is empty","comments":"An empty repository has just been initialized and contains\nno commits.\n","group":"repository"},"git_repository_path":{"type":"function","file":"repository.h","line":325,"lineto":325,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":"the path to the repository"},"description":"Get the path of this repository","comments":"This is the path of the `.git` folder for normal repositories,\nor of the repository itself for bare repositories.\n","group":"repository"},"git_repository_workdir":{"type":"function","file":"repository.h","line":336,"lineto":336,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":"the path to the working dir, if it exists"},"description":"Get the path of the working directory for this repository","comments":"If the repository is bare, this function will always return\nNULL.\n","group":"repository"},"git_repository_set_workdir":{"type":"function","file":"repository.h","line":355,"lineto":356,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"workdir","type":"const char *","comment":"The path to a working directory"},{"name":"update_gitlink","type":"int","comment":"Create/update gitlink in workdir and set config \"core.worktree\" (if workdir is not the parent of the .git directory)"}],"argline":"git_repository *repo, const char *workdir, int update_gitlink","sig":"git_repository *::const char *::int","return":{"type":"int","comment":"0, or an error code"},"description":"Set the path to the working directory for this repository","comments":"The working directory doesn't need to be the same one\nthat contains the `.git` folder for this repository.\n\nIf this repository is bare, setting its working directory\nwill turn it into a normal repository, capable of performing\nall the common workdir operations (checkout, status, index\nmanipulation, etc).\n","group":"repository"},"git_repository_is_bare":{"type":"function","file":"repository.h","line":364,"lineto":364,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to test"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"1 if the repository is bare, 0 otherwise."},"description":"Check if a repository is bare","comments":"","group":"repository"},"git_repository_config":{"type":"function","file":"repository.h","line":380,"lineto":380,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the loaded config file"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_config **out, git_repository *repo","sig":"git_config **::git_repository *","return":{"type":"int","comment":"0, or an error code"},"description":"Get the configuration file for this repository.","comments":"If a configuration file has not been set, the default\nconfig set for the repository will be returned, including\nglobal and system configurations (if they are available).\n\nThe configuration file must be freed once it's no longer\nbeing used by the user.\n","group":"repository"},"git_repository_set_config":{"type":"function","file":"repository.h","line":395,"lineto":395,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"config","type":"git_config *","comment":"A Config object"}],"argline":"git_repository *repo, git_config *config","sig":"git_repository *::git_config *","return":{"type":"void"},"description":"Set the configuration file for this repository","comments":"This configuration file will be used for all configuration\nqueries involving this repository.\n\nThe repository will keep a reference to the config file;\nthe user must still free the config after setting it\nto the repository, or it will leak.\n","group":"repository"},"git_repository_odb":{"type":"function","file":"repository.h","line":411,"lineto":411,"args":[{"name":"out","type":"git_odb **","comment":"Pointer to store the loaded ODB"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_odb **out, git_repository *repo","sig":"git_odb **::git_repository *","return":{"type":"int","comment":"0, or an error code"},"description":"Get the Object Database for this repository.","comments":"If a custom ODB has not been set, the default\ndatabase for the repository will be returned (the one\nlocated in `.git/objects`).\n\nThe ODB must be freed once it's no longer being used by\nthe user.\n","group":"repository","examples":{"general.c":["ex/HEAD/general.html#git_repository_odb-25"]}},"git_repository_set_odb":{"type":"function","file":"repository.h","line":426,"lineto":426,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"odb","type":"git_odb *","comment":"An ODB object"}],"argline":"git_repository *repo, git_odb *odb","sig":"git_repository *::git_odb *","return":{"type":"void"},"description":"Set the Object Database for this repository","comments":"The ODB will be used for all object-related operations\ninvolving this repository.\n\nThe repository will keep a reference to the ODB; the user\nmust still free the ODB object after setting it to the\nrepository, or it will leak.\n","group":"repository"},"git_repository_index":{"type":"function","file":"repository.h","line":442,"lineto":442,"args":[{"name":"out","type":"git_index **","comment":"Pointer to store the loaded index"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_index **out, git_repository *repo","sig":"git_index **::git_repository *","return":{"type":"int","comment":"0, or an error code"},"description":"Get the Index file for this repository.","comments":"If a custom index has not been set, the default\nindex for the repository will be returned (the one\nlocated in `.git/index`).\n\nThe index must be freed once it's no longer being used by\nthe user.\n","group":"repository","examples":{"showindex.c":["ex/HEAD/showindex.html#git_repository_index-3"],"general.c":["ex/HEAD/general.html#git_repository_index-26"]}},"git_repository_set_index":{"type":"function","file":"repository.h","line":457,"lineto":457,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"index","type":"git_index *","comment":"An index object"}],"argline":"git_repository *repo, git_index *index","sig":"git_repository *::git_index *","return":{"type":"void"},"description":"Set the index file for this repository","comments":"This index will be used for all index-related operations\ninvolving this repository.\n\nThe repository will keep a reference to the index file;\nthe user must still free the index after setting it\nto the repository, or it will leak.\n","group":"repository"},"git_repository_message":{"type":"function","file":"repository.h","line":476,"lineto":476,"args":[{"name":"buffer","type":"char *","comment":"Buffer to write data into or NULL to just read required size"},{"name":"len","type":"size_t","comment":"Length of buffer in bytes"},{"name":"repo","type":"git_repository *","comment":"Repository to read prepared message from"}],"argline":"char *buffer, size_t len, git_repository *repo","sig":"char *::size_t::git_repository *","return":{"type":"int","comment":"Bytes written to buffer, GIT_ENOTFOUND if no message, or -1 on error"},"description":"Retrieve git's prepared message","comments":"Operations such as git revert/cherry-pick/merge with the -n option\nstop just short of creating a commit with the changes and save\ntheir prepared message in .git/MERGE_MSG so the next git-commit\nexecution can present it to the user for them to amend if they\nwish.\n\nUse this function to get the contents of this file. Don't forget to\nremove the file after you create the commit.\n","group":"repository"},"git_repository_message_remove":{"type":"function","file":"repository.h","line":483,"lineto":483,"args":[{"name":"repo","type":"git_repository *"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int"},"description":"Remove git's prepared message.","comments":"Remove the message that `git_repository_message` retrieves.","group":"repository"},"git_repository_hashfile":{"type":"function","file":"repository.h","line":503,"lineto":508,"args":[{"name":"out","type":"git_oid *","comment":"Output value of calculated SHA"},{"name":"repo","type":"git_repository *","comment":"Repository pointer"},{"name":"path","type":"const char *","comment":"Path to file on disk whose contents should be hashed. If the repository is not NULL, this can be a relative path."},{"name":"type","type":"git_otype","comment":"The object type to hash as (e.g. GIT_OBJ_BLOB)"},{"name":"as_path","type":"const char *","comment":"The path to use to look up filtering rules. If this is NULL, then the `path` parameter will be used instead. If this is passed as the empty string, then no filters will be applied when calculating the hash."}],"argline":"git_oid *out,\n git_repository *repo,\n const char *path,\n git_otype type,\n const char *as_path","sig":"git_oid *::git_repository *::const char *::git_otype::const char *","return":{"type":"int"},"description":"Calculate hash of file using repository filtering rules.","comments":"If you simply want to calculate the hash of a file on disk with no filters,\nyou can just use the `git_odb_hashfile()` API. However, if you want to\nhash a file in the repository and you want to apply filtering rules (e.g.\ncrlf filters) before generating the SHA, then use this function.\n","group":"repository"},"git_repository_set_head":{"type":"function","file":"repository.h","line":528,"lineto":530,"args":[{"name":"repo","type":"git_repository*","comment":"Repository pointer"},{"name":"refname","type":"const char*","comment":"Canonical name of the reference the HEAD should point at"}],"argline":"git_repository* repo,\n\tconst char* refname","sig":"git_repository*::const char*","return":{"type":"int","comment":"0 on success, or an error code"},"description":"Make the repository HEAD point to the specified reference.","comments":"If the provided reference points to a Tree or a Blob, the HEAD is\nunaltered and -1 is returned.\n\nIf the provided reference points to a branch, the HEAD will point\nto that branch, staying attached, or become attached if it isn't yet.\nIf the branch doesn't exist yet, no error will be return. The HEAD\nwill then be attached to an unborn branch.\n\nOtherwise, the HEAD will be detached and will directly point to\nthe Commit.\n","group":"repository"},"git_repository_set_head_detached":{"type":"function","file":"repository.h","line":548,"lineto":550,"args":[{"name":"repo","type":"git_repository*","comment":"Repository pointer"},{"name":"commitish","type":"const git_oid*","comment":"Object id of the Commit the HEAD should point to"}],"argline":"git_repository* repo,\n\tconst git_oid* commitish","sig":"git_repository*::const git_oid*","return":{"type":"int","comment":"0 on success, or an error code"},"description":"Make the repository HEAD directly point to the Commit.","comments":"If the provided committish cannot be found in the repository, the HEAD\nis unaltered and GIT_ENOTFOUND is returned.\n\nIf the provided commitish cannot be peeled into a commit, the HEAD\nis unaltered and -1 is returned.\n\nOtherwise, the HEAD will eventually be detached and will directly point to\nthe peeled Commit.\n","group":"repository"},"git_repository_detach_head":{"type":"function","file":"repository.h","line":569,"lineto":583,"args":[{"name":"repo","type":"git_repository*","comment":"Repository pointer"}],"argline":"git_repository* repo","sig":"git_repository*","return":{"type":"int","comment":"0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing branch or an error code"},"description":"Detach the HEAD.","comments":"If the HEAD is already detached and points to a Commit, 0 is returned.\n\nIf the HEAD is already detached and points to a Tag, the HEAD is\nupdated into making it point to the peeled Commit, and 0 is returned.\n\nIf the HEAD is already detached and points to a non commitish, the HEAD is \nunaletered, and -1 is returned.\n\nOtherwise, the HEAD will be detached and point to the peeled Commit.\n","group":"repository"},"git_repository_state":{"type":"function","file":"repository.h","line":592,"lineto":592,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"The state of the repository"},"description":"Determines the status of a git repository - ie, whether an operation\n(merge, cherry-pick, etc) is in progress.","comments":"","group":"repository"},"git_remote_new":{"type":"function","file":"remote.h","line":48,"lineto":48,"args":[{"name":"out","type":"git_remote **","comment":"pointer to the new remote object"},{"name":"repo","type":"git_repository *","comment":"the associated repository"},{"name":"name","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the remote repository's URL"},{"name":"fetch","type":"const char *","comment":"the fetch refspec to use for this remote"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch","sig":"git_remote **::git_repository *::const char *::const char *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a remote in memory","comments":"Create a remote with the default refspecs in memory. You can use\nthis when you have a URL instead of a remote's name.\n","group":"remote","examples":{"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_remote_new-1"],"network/fetch.c":["ex/HEAD/fetch.html#git_remote_new-1"]}},"git_remote_load":{"type":"function","file":"remote.h","line":58,"lineto":58,"args":[{"name":"out","type":"git_remote **","comment":"pointer to the new remote object"},{"name":"repo","type":"git_repository *","comment":"the associated repository"},{"name":"name","type":"const char *","comment":"the remote's name"}],"argline":"git_remote **out, git_repository *repo, const char *name","sig":"git_remote **::git_repository *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the information for a particular remote","comments":"","group":"remote","examples":{"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_remote_load-2"],"network/fetch.c":["ex/HEAD/fetch.html#git_remote_load-2"]}},"git_remote_save":{"type":"function","file":"remote.h","line":66,"lineto":66,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to save to config"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":"0 or an error code"},"description":"Save a remote to its repository's configuration","comments":"","group":"remote"},"git_remote_name":{"type":"function","file":"remote.h","line":74,"lineto":74,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const char *","comment":"a pointer to the name"},"description":"Get the remote's name","comments":"","group":"remote"},"git_remote_url":{"type":"function","file":"remote.h","line":82,"lineto":82,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const char *","comment":"a pointer to the url"},"description":"Get the remote's url","comments":"","group":"remote"},"git_remote_pushurl":{"type":"function","file":"remote.h","line":90,"lineto":90,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const char *","comment":"a pointer to the url or NULL if no special url for pushing is set"},"description":"Get the remote's url for pushing","comments":"","group":"remote"},"git_remote_set_url":{"type":"function","file":"remote.h","line":101,"lineto":101,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"url","type":"const char*","comment":"the url to set"}],"argline":"git_remote *remote, const char* url","sig":"git_remote *::const char*","return":{"type":"int","comment":"0 or an error value"},"description":"Set the remote's url","comments":"Existing connections will not be updated.\n","group":"remote"},"git_remote_set_pushurl":{"type":"function","file":"remote.h","line":112,"lineto":112,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"url","type":"const char*","comment":"the url to set or NULL to clear the pushurl"}],"argline":"git_remote *remote, const char* url","sig":"git_remote *::const char*","return":{"type":"int","comment":"0 or an error value"},"description":"Set the remote's url for pushing","comments":"Existing connections will not be updated.\n","group":"remote"},"git_remote_set_fetchspec":{"type":"function","file":"remote.h","line":121,"lineto":121,"args":[{"name":"remote","type":"git_remote *","comment":"the remote @apram spec the new fetch refspec"},{"name":"spec","type":"const char *"}],"argline":"git_remote *remote, const char *spec","sig":"git_remote *::const char *","return":{"type":"int","comment":"0 or an error value"},"description":"Set the remote's fetch refspec","comments":"","group":"remote"},"git_remote_fetchspec":{"type":"function","file":"remote.h","line":129,"lineto":129,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_refspec *","comment":"a pointer to the fetch refspec or NULL if it doesn't exist"},"description":"Get the fetch refspec","comments":"","group":"remote"},"git_remote_set_pushspec":{"type":"function","file":"remote.h","line":138,"lineto":138,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"spec","type":"const char *","comment":"the new push refspec"}],"argline":"git_remote *remote, const char *spec","sig":"git_remote *::const char *","return":{"type":"int","comment":"0 or an error value"},"description":"Set the remote's push refspec","comments":"","group":"remote"},"git_remote_pushspec":{"type":"function","file":"remote.h","line":146,"lineto":146,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_refspec *","comment":"a pointer to the push refspec or NULL if it doesn't exist"},"description":"Get the push refspec","comments":"","group":"remote"},"git_remote_connect":{"type":"function","file":"remote.h","line":160,"lineto":160,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to connect to"},{"name":"direction","type":"int","comment":"whether you want to receive or send data"}],"argline":"git_remote *remote, int direction","sig":"git_remote *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Open a connection to a remote","comments":"The transport is selected based on the URL. The direction argument\nis due to a limitation of the git protocol (over TCP or SSH) which\nstarts up a specific binary which can only do the one or the other.\n","group":"remote","examples":{"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_remote_connect-3","ex/HEAD/ls-remote.html#git_remote_connect-4"],"network/fetch.c":["ex/HEAD/fetch.html#git_remote_connect-3"]}},"git_remote_ls":{"type":"function","file":"remote.h","line":176,"lineto":176,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"list_cb","type":"git_headlist_cb","comment":"function to call with each ref discovered at the remote"},{"name":"payload","type":"void *","comment":"additional data to pass to the callback"}],"argline":"git_remote *remote, git_headlist_cb list_cb, void *payload","sig":"git_remote *::git_headlist_cb::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Get a list of refs at the remote","comments":"The remote (or more exactly its transport) must be connected. The\nmemory belongs to the remote.\n\nIf you a return a non-zero value from the callback, this will stop\nlooping over the refs.\n","group":"remote","examples":{"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_remote_ls-5","ex/HEAD/ls-remote.html#git_remote_ls-6","ex/HEAD/ls-remote.html#git_remote_ls-7"]}},"git_remote_download":{"type":"function","file":"remote.h","line":194,"lineto":197,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to download from"},{"name":"progress_cb","type":"git_transfer_progress_callback","comment":"function to call with progress information. Be aware that this is called inline with network and indexing operations, so performance may be affected."},{"name":"progress_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_remote *remote,\n\t\tgit_transfer_progress_callback progress_cb,\n\t\tvoid *progress_payload","sig":"git_remote *::git_transfer_progress_callback::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Download the packfile","comments":"Negotiate what objects should be downloaded and download the\npackfile with those objects. The packfile is downloaded with a\ntemporary filename, as it's final name is not known yet. If there\nwas no packfile needed (all the objects were available locally),\nfilename will be NULL and the function will return success.\n","group":"remote","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_remote_download-4"]}},"git_remote_connected":{"type":"function","file":"remote.h","line":208,"lineto":208,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"int","comment":"1 if it's connected, 0 otherwise."},"description":"Check whether the remote is connected","comments":"Check whether the remote's underlying transport is connected to the\nremote host.\n","group":"remote"},"git_remote_stop":{"type":"function","file":"remote.h","line":218,"lineto":218,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void"},"description":"Cancel the operation","comments":"At certain points in its operation, the network code checks whether\nthe operation has been cancelled and if so stops the operation.\n","group":"remote"},"git_remote_disconnect":{"type":"function","file":"remote.h","line":228,"lineto":228,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to disconnect from"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void"},"description":"Disconnect from the remote","comments":"Close the connection to the remote and free the underlying\ntransport.\n","group":"remote","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_remote_disconnect-5"]}},"git_remote_free":{"type":"function","file":"remote.h","line":238,"lineto":238,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to free"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void"},"description":"Free the memory associated with a remote","comments":"This also disconnects from the remote, if the connection\nhas not been closed yet (using git_remote_disconnect).\n","group":"remote","examples":{"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_remote_free-8","ex/HEAD/ls-remote.html#git_remote_free-9"],"network/fetch.c":["ex/HEAD/fetch.html#git_remote_free-6","ex/HEAD/fetch.html#git_remote_free-7"]}},"git_remote_update_tips":{"type":"function","file":"remote.h","line":246,"lineto":246,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to update"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"int","comment":"0 or an error code"},"description":"Update the tips to the new state","comments":"","group":"remote","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_remote_update_tips-8"]}},"git_remote_valid_url":{"type":"function","file":"remote.h","line":254,"lineto":254,"args":[{"name":"url","type":"const char *","comment":"the url to check"}],"argline":"const char *url","sig":"const char *","return":{"type":"int"},"description":"Return whether a string is a valid remote URL","comments":"","group":"remote"},"git_remote_supported_url":{"type":"function","file":"remote.h","line":262,"lineto":262,"args":[{"name":"url","type":"const char*","comment":"the url to check"}],"argline":"const char* url","sig":"const char*","return":{"type":"int","comment":"1 if the url is supported, 0 otherwise"},"description":"Return whether the passed URL is supported by this version of the library.","comments":"","group":"remote"},"git_remote_list":{"type":"function","file":"remote.h","line":273,"lineto":273,"args":[{"name":"remotes_list","type":"git_strarray *","comment":"a string array with the names of the remotes"},{"name":"repo","type":"git_repository *","comment":"the repository to query"}],"argline":"git_strarray *remotes_list, git_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Get a list of the configured remotes for a repo","comments":"The string array must be freed by the user.\n","group":"remote"},"git_remote_add":{"type":"function","file":"remote.h","line":284,"lineto":284,"args":[{"name":"out","type":"git_remote **","comment":"the resulting remote"},{"name":"repo","type":"git_repository *","comment":"the repository in which to create the remote"},{"name":"name","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the remote's url"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url","sig":"git_remote **::git_repository *::const char *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Add a remote with the default fetch refspec to the repository's configuration","comments":"","group":"remote"},"git_remote_check_cert":{"type":"function","file":"remote.h","line":292,"lineto":292,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"check","type":"int","comment":"whether to check the server's certificate (defaults to yes)"}],"argline":"git_remote *remote, int check","sig":"git_remote *::int","return":{"type":"void"},"description":"Choose whether to check the server's certificate (applies to HTTPS only)","comments":"","group":"remote"},"git_remote_set_cred_acquire_cb":{"type":"function","file":"remote.h","line":304,"lineto":306,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"cred_acquire_cb","type":"git_cred_acquire_cb","comment":"The credentials acquisition callback to use (defaults to NULL)"}],"argline":"git_remote *remote,\n\tgit_cred_acquire_cb cred_acquire_cb","sig":"git_remote *::git_cred_acquire_cb","return":{"type":"void"},"description":"Set a credentials acquisition callback for this remote. If the remote is\nnot available for anonymous access, then you must set this callback in order\nto provide credentials to the transport at the time of authentication\nfailure so that retry can be performed.","comments":"","group":"remote"},"git_remote_set_transport":{"type":"function","file":"remote.h","line":320,"lineto":322,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"transport","type":"git_transport *","comment":"the transport object for the remote to use"}],"argline":"git_remote *remote,\n\tgit_transport *transport","sig":"git_remote *::git_transport *","return":{"type":"int","comment":"0 or an error code"},"description":"Sets a custom transport for the remote. The caller can use this function\nto bypass the automatic discovery of a transport by URL scheme (i.e.\nhttp://, https://, git://) and supply their own transport to be used\ninstead. After providing the transport to a remote using this function,\nthe transport object belongs exclusively to that remote, and the remote will\nfree it when it is freed with git_remote_free.","comments":"","group":"remote"},"git_remote_set_callbacks":{"type":"function","file":"remote.h","line":355,"lineto":355,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"callbacks","type":"git_remote_callbacks *","comment":"a pointer to the user's callback settings"}],"argline":"git_remote *remote, git_remote_callbacks *callbacks","sig":"git_remote *::git_remote_callbacks *","return":{"type":"void"},"description":"Set the callbacks for a remote","comments":"Note that the remote keeps its own copy of the data and you need to\ncall this function again if you want to change the callbacks.\n","group":"remote","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_remote_set_callbacks-9"]}},"git_remote_stats":{"type":"function","file":"remote.h","line":360,"lineto":367,"args":[{"name":"remote","type":"git_remote *"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_transfer_progress *"},"description":"Get the statistics structure that is filled in by the fetch operation.","comments":"","group":"remote","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_remote_stats-10"]}},"git_remote_autotag":{"type":"function","file":"remote.h","line":375,"lineto":375,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to query"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"int","comment":"the auto-follow setting"},"description":"Retrieve the tag auto-follow setting","comments":"","group":"remote"},"git_remote_set_autotag":{"type":"function","file":"remote.h","line":383,"lineto":383,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to configure"},{"name":"value","type":"int","comment":"a GIT_REMOTE_DOWNLOAD_TAGS value"}],"argline":"git_remote *remote, int value","sig":"git_remote *::int","return":{"type":"void"},"description":"Set the tag auto-follow setting","comments":"","group":"remote"},"git_remote_rename":{"type":"function","file":"remote.h","line":398,"lineto":402,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to rename"},{"name":"new_name","type":"const char *","comment":"the new name the remote should bear"},{"name":"callback","type":"int (*)(const char *problematic_refspec, void *payload)","comment":"Optional callback to notify the consumer of fetch refspecs that haven't been automatically updated and need potential manual tweaking."},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_remote *remote,\n\tconst char *new_name,\n\tint (*callback)(const char *problematic_refspec, void *payload),\n\tvoid *payload","sig":"git_remote *::const char *::int (*)(const char *problematic_refspec, void *payload)::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Give the remote a new name","comments":"All remote-tracking branches and configuration settings\nfor the remote are updated.\n","group":"remote"},"git_refspec_src":{"type":"function","file":"refspec.h","line":28,"lineto":28,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":"the refspec's source specifier"},"description":"Get the source specifier","comments":"","group":"refspec"},"git_refspec_dst":{"type":"function","file":"refspec.h","line":36,"lineto":36,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":"the refspec's destination specifier"},"description":"Get the destination specifier","comments":"","group":"refspec"},"git_refspec_force":{"type":"function","file":"refspec.h","line":44,"lineto":44,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"int","comment":"1 if force update has been set, 0 otherwise"},"description":"Get the force update setting","comments":"","group":"refspec"},"git_refspec_src_matches":{"type":"function","file":"refspec.h","line":53,"lineto":53,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"},{"name":"refname","type":"const char *","comment":"the name of the reference to check"}],"argline":"const git_refspec *refspec, const char *refname","sig":"const git_refspec *::const char *","return":{"type":"int","comment":"1 if the refspec matches, 0 otherwise"},"description":"Check if a refspec's source descriptor matches a reference","comments":"","group":"refspec"},"git_refspec_transform":{"type":"function","file":"refspec.h","line":64,"lineto":68,"args":[{"name":"out","type":"char *","comment":"where to store the target name"},{"name":"outlen","type":"size_t","comment":"the size ouf the `out` buffer"},{"name":"spec","type":"const git_refspec *","comment":"the refspec"},{"name":"name","type":"const char *","comment":"the name of the reference to transform"}],"argline":"char *out, size_t outlen, const git_refspec *spec, const char *name","sig":"char *::size_t::const git_refspec *::const char *","return":{"type":"int","comment":"0, GIT_EBUFS or another error"},"description":"Transform a reference to its target following the refspec's rules","comments":"","group":"refspec"},"git_reference_lookup":{"type":"function","file":"refs.h","line":37,"lineto":37,"args":[{"name":"reference_out","type":"git_reference **","comment":"pointer to the looked-up reference"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the reference"},{"name":"name","type":"const char *","comment":"the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)"}],"argline":"git_reference **reference_out, git_repository *repo, const char *name","sig":"git_reference **::git_repository *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a reference by name in a repository.","comments":"The returned reference must be freed by the user.\n\nSee `git_reference_create_symbolic()` for documentation about valid\nreference names.\n","group":"reference","examples":{"general.c":["ex/HEAD/general.html#git_reference_lookup-27"],"diff.c":["ex/HEAD/diff.html#git_reference_lookup-5"]}},"git_reference_name_to_oid":{"type":"function","file":"refs.h","line":51,"lineto":52,"args":[{"name":"out","type":"git_oid *"},{"name":"repo","type":"git_repository *","comment":"The repository in which to look up the reference"},{"name":"name","type":"const char *","comment":"The long name for the reference"}],"argline":"git_oid *out, git_repository *repo, const char *name","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":"0 on success, -1 if name could not be resolved"},"description":"Lookup a reference by name and resolve immediately to OID.","comments":"This function provides a quick way to resolve a reference name straight\nthrough to the object id that it refers to. This avoids having to\nallocate or free any `git_reference` objects for simple situations.\n","group":"reference"},"git_reference_create_symbolic":{"type":"function","file":"refs.h","line":83,"lineto":83,"args":[{"name":"ref_out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"target","type":"const char *","comment":"The target of the reference"},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_reference **ref_out, git_repository *repo, const char *name, const char *target, int force","sig":"git_reference **::git_repository *::const char *::const char *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new symbolic reference.","comments":"A symbolic reference is a reference name that refers to another\nreference name. If the other name moves, the symbolic name will move,\ntoo. As a simple example, the \"HEAD\" reference might refer to\n\"refs/heads/master\" while on the \"master\" branch of a repository.\n\nThe symbolic reference will be created in the repository and written to\nthe disk. The generated reference object must be freed by the user.\n\nValid reference names must follow one of two patterns:\n\n1. Top-level names must contain only capital letters and underscores,\n and must begin and end with a letter. (e.g. \"HEAD\", \"ORIG_HEAD\").\n2. Names prefixed with \"refs/\" can be almost anything. You must avoid\n the characters '~', '^', ':', '\\\\', '?', '[', and '*', and the\n sequences \"..\" and \"@{\" which have special meaning to revparse.\n\nThis function will return an error if a reference already exists with the\ngiven name unless `force` is true, in which case it will be overwritten.\n","group":"reference"},"git_reference_create_oid":{"type":"function","file":"refs.h","line":115,"lineto":115,"args":[{"name":"ref_out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"repo","type":"git_repository *","comment":"Repository where that reference will live"},{"name":"name","type":"const char *","comment":"The name of the reference"},{"name":"id","type":"const git_oid *","comment":"The object id pointed to by the reference."},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_reference **ref_out, git_repository *repo, const char *name, const git_oid *id, int force","sig":"git_reference **::git_repository *::const char *::const git_oid *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new direct reference.","comments":"A direct reference (also called an object id reference) refers directly\nto a specific object id (a.k.a. OID or SHA) in the repository. The id\npermanently refers to the object (although the reference itself can be\nmoved). For example, in libgit2 the direct ref \"refs/tags/v0.17.0\"\nrefers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.\n\nThe direct reference will be created in the repository and written to\nthe disk. The generated reference object must be freed by the user.\n\nValid reference names must follow one of two patterns:\n\n1. Top-level names must contain only capital letters and underscores,\n and must begin and end with a letter. (e.g. \"HEAD\", \"ORIG_HEAD\").\n2. Names prefixed with \"refs/\" can be almost anything. You must avoid\n the characters '~', '^', ':', '\\\\', '?', '[', and '*', and the\n sequences \"..\" and \"@{\" which have special meaning to revparse.\n\nThis function will return an error if a reference already exists with the\ngiven name unless `force` is true, in which case it will be overwritten.\n","group":"reference"},"git_reference_oid":{"type":"function","file":"refs.h","line":130,"lineto":130,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"const git_oid *","comment":"a pointer to the oid if available, NULL otherwise"},"description":"Get the OID pointed to by a direct reference.","comments":"Only available if the reference is direct (i.e. an object id reference,\nnot a symbolic one).\n\nTo find the OID of a symbolic ref, call `git_reference_resolve()` and\nthen this function (or maybe use `git_reference_name_to_oid()` to\ndirectly resolve a reference name all the way through to an OID).\n","group":"reference","examples":{"general.c":["ex/HEAD/general.html#git_reference_oid-28"],"diff.c":["ex/HEAD/diff.html#git_reference_oid-6"]}},"git_reference_target":{"type":"function","file":"refs.h","line":140,"lineto":140,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"const char *","comment":"a pointer to the name if available, NULL otherwise"},"description":"Get full name to the reference pointed to by a symbolic reference.","comments":"Only available if the reference is symbolic.\n","group":"reference","examples":{"general.c":["ex/HEAD/general.html#git_reference_target-29"]}},"git_reference_type":{"type":"function","file":"refs.h","line":150,"lineto":150,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"git_ref_t","comment":"the type"},"description":"Get the type of a reference.","comments":"Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)\n","group":"reference","examples":{"general.c":["ex/HEAD/general.html#git_reference_type-30"]}},"git_reference_name":{"type":"function","file":"refs.h","line":160,"lineto":160,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"const char *","comment":"the full name for the ref"},"description":"Get the full name of a reference.","comments":"See `git_reference_create_symbolic()` for rules about valid names.\n","group":"reference"},"git_reference_resolve":{"type":"function","file":"refs.h","line":178,"lineto":178,"args":[{"name":"resolved_ref","type":"git_reference **","comment":"Pointer to the peeled reference"},{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference **resolved_ref, git_reference *ref","sig":"git_reference **::git_reference *","return":{"type":"int","comment":"0 or an error code"},"description":"Resolve a symbolic reference to a direct reference.","comments":"This method iteratively peels a symbolic reference until it resolves to\na direct reference to an OID.\n\nThe peeled reference is returned in the `resolved_ref` argument, and\nmust be freed manually once it's no longer needed.\n\nIf a direct reference is passed as an argument, a copy of that\nreference is returned. This copy must be manually freed too.\n","group":"reference","examples":{"diff.c":["ex/HEAD/diff.html#git_reference_resolve-7"]}},"git_reference_owner":{"type":"function","file":"refs.h","line":186,"lineto":186,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"git_repository *","comment":"a pointer to the repo"},"description":"Get the repository where a reference resides.","comments":"","group":"reference"},"git_reference_set_target":{"type":"function","file":"refs.h","line":199,"lineto":199,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"target","type":"const char *","comment":"The new target for the reference"}],"argline":"git_reference *ref, const char *target","sig":"git_reference *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Set the symbolic target of a reference.","comments":"The reference must be a symbolic reference, otherwise this will fail.\n\nThe reference will be automatically updated in memory and on disk.\n","group":"reference"},"git_reference_set_oid":{"type":"function","file":"refs.h","line":212,"lineto":212,"args":[{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"id","type":"const git_oid *","comment":"The new target OID for the reference"}],"argline":"git_reference *ref, const git_oid *id","sig":"git_reference *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Set the OID target of a reference.","comments":"The reference must be a direct reference, otherwise this will fail.\n\nThe reference will be automatically updated in memory and on disk.\n","group":"reference"},"git_reference_rename":{"type":"function","file":"refs.h","line":239,"lineto":239,"args":[{"name":"ref","type":"git_reference *","comment":"The reference to rename"},{"name":"new_name","type":"const char *","comment":"The new name for the reference"},{"name":"force","type":"int","comment":"Overwrite an existing reference"}],"argline":"git_reference *ref, const char *new_name, int force","sig":"git_reference *::const char *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Rename an existing reference.","comments":"This method works for both direct and symbolic references.\nThe new name will be checked for validity and may be\nmodified into a normalized form.\n\nThe given git_reference will be updated in place.\n\nThe reference will be immediately renamed in-memory and on disk.\n\nIf the `force` flag is not enabled, and there's already\na reference with the given name, the renaming will fail.\n\nIMPORTANT:\nThe user needs to write a proper reflog entry if the\nreflog is enabled for the repository. We only rename\nthe reflog if it exists.\n","group":"reference"},"git_reference_delete":{"type":"function","file":"refs.h","line":252,"lineto":252,"args":[{"name":"ref","type":"git_reference *","comment":"The reference to remove"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"0 or an error code"},"description":"Delete an existing reference.","comments":"This method works for both direct and symbolic references.\n\nThe reference will be immediately removed on disk and from memory\n(i.e. freed). The given reference pointer will no longer be valid.\n","group":"reference"},"git_reference_packall":{"type":"function","file":"refs.h","line":267,"lineto":267,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where the loose refs will be packed"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Pack all the loose references in the repository.","comments":"This method will load into the cache all the loose\nreferences on the repository and update the\n`packed-refs` file with them.\n\nOnce the `packed-refs` file has been written properly,\nthe loose references will be removed from disk.\n","group":"reference"},"git_reference_list":{"type":"function","file":"refs.h","line":288,"lineto":288,"args":[{"name":"array","type":"git_strarray *","comment":"Pointer to a git_strarray structure where the reference names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"list_flags","type":"unsigned int","comment":"Filtering flags for the reference listing"}],"argline":"git_strarray *array, git_repository *repo, unsigned int list_flags","sig":"git_strarray *::git_repository *::unsigned int","return":{"type":"int","comment":"0 or an error code"},"description":"Fill a list with all the references that can be found in a repository.","comments":"Using the `list_flags` parameter, the listed references may be filtered\nby type (`GIT_REF_OID` or `GIT_REF_SYMBOLIC`) or using a bitwise OR of\n`git_ref_t` values. To include packed refs, include `GIT_REF_PACKED`.\nFor convenience, use the value `GIT_REF_LISTALL` to obtain all\nreferences, including packed ones.\n\nThe string array will be filled with the names of all references; these\nvalues are owned by the user and should be free'd manually when no\nlonger needed, using `git_strarray_free()`.\n","group":"reference","examples":{"general.c":["ex/HEAD/general.html#git_reference_list-31"]}},"git_reference_foreach":{"type":"function","file":"refs.h","line":310,"lineto":310,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"list_flags","type":"unsigned int","comment":"Filtering flags for the reference listing."},{"name":"callback","type":"int (*)(const char *, void *)","comment":"Function which will be called for every listed ref"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload","sig":"git_repository *::unsigned int::int (*)(const char *, void *)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Perform a callback on each reference in the repository.","comments":"Using the `list_flags` parameter, the references may be filtered by\ntype (`GIT_REF_OID` or `GIT_REF_SYMBOLIC`) or using a bitwise OR of\n`git_ref_t` values. To include packed refs, include `GIT_REF_PACKED`.\nFor convenience, use the value `GIT_REF_LISTALL` to obtain all\nreferences, including packed ones.\n\nThe `callback` function will be called for each reference in the\nrepository, receiving the name of the reference and the `payload` value\npassed to this method. Returning a non-zero value from the callback\nwill terminate the iteration.\n","group":"reference"},"git_reference_is_packed":{"type":"function","file":"refs.h","line":318,"lineto":318,"args":[{"name":"ref","type":"git_reference *","comment":"A git reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"0 in case it's not packed; 1 otherwise"},"description":"Check if a reference has been loaded from a packfile.","comments":"","group":"reference"},"git_reference_reload":{"type":"function","file":"refs.h","line":336,"lineto":336,"args":[{"name":"ref","type":"git_reference *","comment":"The reference to reload"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"0 on success, or an error code"},"description":"Reload a reference from disk.","comments":"Reference pointers can become outdated if the Git repository is\naccessed simultaneously by other clients while the library is open.\n\nThis method forces a reload of the reference from disk, to ensure that\nthe provided information is still reliable.\n\nIf the reload fails (e.g. the reference no longer exists on disk, or\nhas become corrupted), an error code will be returned and the reference\npointer will be invalidated and freed.\n","group":"reference"},"git_reference_free":{"type":"function","file":"refs.h","line":343,"lineto":343,"args":[{"name":"ref","type":"git_reference *","comment":"git_reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"void"},"description":"Free the given reference.","comments":"","group":"reference","examples":{"diff.c":["ex/HEAD/diff.html#git_reference_free-8","ex/HEAD/diff.html#git_reference_free-9"]}},"git_reference_cmp":{"type":"function","file":"refs.h","line":352,"lineto":352,"args":[{"name":"ref1","type":"git_reference *","comment":"The first git_reference"},{"name":"ref2","type":"git_reference *","comment":"The second git_reference"}],"argline":"git_reference *ref1, git_reference *ref2","sig":"git_reference *::git_reference *","return":{"type":"int","comment":"0 if the same, else a stable but meaningless ordering."},"description":"Compare two references.","comments":"","group":"reference"},"git_reference_foreach_glob":{"type":"function","file":"refs.h","line":373,"lineto":378,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"glob","type":"const char *","comment":"Pattern to match (fnmatch-style) against reference name."},{"name":"list_flags","type":"unsigned int","comment":"Filtering flags for the reference listing."},{"name":"callback","type":"int (*)(const char *reference_name, void *payload)","comment":"Function which will be called for every listed ref"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo,\n\tconst char *glob,\n\tunsigned int list_flags,\n\tint (*callback)(const char *reference_name, void *payload),\n\tvoid *payload","sig":"git_repository *::const char *::unsigned int::int (*)(const char *reference_name, void *payload)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Perform a callback on each reference in the repository whose name\nmatches the given pattern.","comments":"This function acts like `git_reference_foreach()` with an additional\npattern match being applied to the reference name before issuing the\ncallback function. See that function for more information.\n\nThe pattern is matched using fnmatch or \"glob\" style where a '*' matches\nany sequence of letters, a '?' matches any letter, and square brackets\ncan be used to define character ranges (such as \"[0-9]\" for digits).\n","group":"reference"},"git_reference_has_log":{"type":"function","file":"refs.h","line":388,"lineto":388,"args":[{"name":"ref","type":"git_reference *","comment":"A git reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"0 when no reflog can be found, 1 when it exists; otherwise an error code."},"description":"Check if a reflog exists for the specified reference.","comments":"","group":"reference"},"git_reference_is_branch":{"type":"function","file":"refs.h","line":398,"lineto":398,"args":[{"name":"ref","type":"git_reference *","comment":"A git reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"1 when the reference lives in the refs/heads namespace; 0 otherwise."},"description":"Check if a reference is a local branch.","comments":"","group":"reference"},"git_reference_is_remote":{"type":"function","file":"refs.h","line":408,"lineto":412,"args":[{"name":"ref","type":"git_reference *","comment":"A git reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"1 when the reference lives in the refs/remotes namespace; 0 otherwise."},"description":"Check if a reference is a remote tracking branch","comments":"","group":"reference"},"git_reference_normalize_name":{"type":"function","file":"refs.h","line":450,"lineto":454,"args":[{"name":"buffer_out","type":"char *","comment":"User allocated buffer to store normalized name"},{"name":"buffer_size","type":"size_t","comment":"Size of buffer_out"},{"name":"name","type":"const char *","comment":"Reference name to be checked."},{"name":"flags","type":"unsigned int","comment":"Flags to constrain name validation rules - see the GIT_REF_FORMAT constants above."}],"argline":"char *buffer_out,\n\tsize_t buffer_size,\n\tconst char *name,\n\tunsigned int flags","sig":"char *::size_t::const char *::unsigned int","return":{"type":"int","comment":"0 on success or error code (GIT_EBUFS if buffer is too small, -1 if reference is invalid)"},"description":"Normalize reference name and check validity.","comments":"This will normalize the reference name by removing any leading slash\n'/' characters and collapsing runs of adjacent slashes between name\ncomponents into a single slash.\n\nOnce normalized, if the reference name is valid, it will be returned in\nthe user allocated buffer.\n","group":"reference"},"git_reference_peel":{"type":"function","file":"refs.h","line":470,"lineto":473,"args":[{"name":"out","type":"git_object **"},{"name":"ref","type":"git_reference *","comment":"The reference to be processed"},{"name":"type","type":"git_otype"}],"argline":"git_object **out,\n\tgit_reference *ref,\n\tgit_otype type","sig":"git_object **::git_reference *::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Recursively peel reference until object of the specified type is found.","comments":"The retrieved `peeled` object is owned by the repository\nand should be closed with the `git_object_free` method.\n\nIf you pass `GIT_OBJ_ANY` as the target type, then the object\nwill be peeled until a non-tag object is met.\n","group":"reference"},"git_reference_is_valid_name":{"type":"function","file":"refs.h","line":489,"lineto":489,"args":[{"name":"refname","type":"const char *","comment":"name to be checked."}],"argline":"const char *refname","sig":"const char *","return":{"type":"int","comment":"1 if the reference name is acceptable; 0 if it isn't"},"description":"Ensure the reference name is well-formed.","comments":"Valid reference names must follow one of two patterns:\n\n1. Top-level names must contain only capital letters and underscores,\n and must begin and end with a letter. (e.g. \"HEAD\", \"ORIG_HEAD\").\n2. Names prefixed with \"refs/\" can be almost anything. You must avoid\n the characters '~', '^', ':', '\\\\', '?', '[', and '*', and the\n sequences \"..\" and \"@{\" which have special meaning to revparse.\n","group":"reference"},"git_reflog_read":{"type":"function","file":"reflog.h","line":37,"lineto":37,"args":[{"name":"reflog","type":"git_reflog **","comment":"pointer to reflog"},{"name":"ref","type":"git_reference *","comment":"log pointer to reflog"}],"argline":"git_reflog **reflog, git_reference *ref","sig":"git_reflog **::git_reference *","return":{"type":"int","comment":"0 or an error code"},"description":"Read the reflog for the given reference","comments":"If there is no reflog file for the given\nreference yet, an empty reflog object will\nbe returned.\n\nThe reflog must be freed manually by using\ngit_reflog_free().\n","group":"reflog"},"git_reflog_write":{"type":"function","file":"reflog.h","line":46,"lineto":46,"args":[{"name":"reflog","type":"git_reflog *","comment":"an existing reflog object"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"int","comment":"0 or an error code"},"description":"Write an existing in-memory reflog object back to disk\nusing an atomic file lock.","comments":"","group":"reflog"},"git_reflog_append":{"type":"function","file":"reflog.h","line":59,"lineto":59,"args":[{"name":"reflog","type":"git_reflog *","comment":"an existing reflog object"},{"name":"new_oid","type":"const git_oid *","comment":"the OID the reference is now pointing to"},{"name":"committer","type":"const git_signature *","comment":"the signature of the committer"},{"name":"msg","type":"const char *","comment":"the reflog message"}],"argline":"git_reflog *reflog, const git_oid *new_oid, const git_signature *committer, const char *msg","sig":"git_reflog *::const git_oid *::const git_signature *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Add a new entry to the reflog.","comments":"`msg` is optional and can be NULL.\n","group":"reflog"},"git_reflog_rename":{"type":"function","file":"reflog.h","line":70,"lineto":70,"args":[{"name":"ref","type":"git_reference *","comment":"the reference"},{"name":"new_name","type":"const char *","comment":"the new name of the reference"}],"argline":"git_reference *ref, const char *new_name","sig":"git_reference *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Rename the reflog for the given reference","comments":"The reflog to be renamed is expected to already exist\n","group":"reflog"},"git_reflog_delete":{"type":"function","file":"reflog.h","line":78,"lineto":78,"args":[{"name":"ref","type":"git_reference *","comment":"the reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":"0 or an error code"},"description":"Delete the reflog for the given reference","comments":"","group":"reflog"},"git_reflog_entrycount":{"type":"function","file":"reflog.h","line":86,"lineto":86,"args":[{"name":"reflog","type":"git_reflog *","comment":"the previously loaded reflog"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"unsigned int","comment":"the number of log entries"},"description":"Get the number of log entries in a reflog","comments":"","group":"reflog"},"git_reflog_entry_byindex":{"type":"function","file":"reflog.h","line":95,"lineto":95,"args":[{"name":"reflog","type":"git_reflog *","comment":"a previously loaded reflog"},{"name":"idx","type":"size_t","comment":"the position to lookup"}],"argline":"git_reflog *reflog, size_t idx","sig":"git_reflog *::size_t","return":{"type":"const git_reflog_entry *","comment":"the entry; NULL if not found"},"description":"Lookup an entry by its index","comments":"","group":"reflog"},"git_reflog_drop":{"type":"function","file":"reflog.h","line":112,"lineto":115,"args":[{"name":"reflog","type":"git_reflog *","comment":"a previously loaded reflog."},{"name":"idx","type":"unsigned int","comment":"the position of the entry to remove."},{"name":"rewrite_previous_entry","type":"int","comment":"1 to rewrite the history; 0 otherwise."}],"argline":"git_reflog *reflog,\n\tunsigned int idx,\n\tint rewrite_previous_entry","sig":"git_reflog *::unsigned int::int","return":{"type":"int","comment":"0 on success or an error code."},"description":"Remove an entry from the reflog by its index","comments":"To ensure there's no gap in the log history, set `rewrite_previous_entry`\nparam value to 1. When deleting entry `n`, member old_oid of entry `n-1`\n(if any) will be updated with the value of member new_oid of entry `n+1`.\n","group":"reflog"},"git_reflog_entry_oidold":{"type":"function","file":"reflog.h","line":123,"lineto":123,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const git_oid *","comment":"the old oid"},"description":"Get the old oid","comments":"","group":"reflog"},"git_reflog_entry_oidnew":{"type":"function","file":"reflog.h","line":131,"lineto":131,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"const git_oid *","comment":"the new oid at this time"},"description":"Get the new oid","comments":"","group":"reflog"},"git_reflog_entry_committer":{"type":"function","file":"reflog.h","line":139,"lineto":139,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"git_signature *","comment":"the committer"},"description":"Get the committer of this entry","comments":"","group":"reflog"},"git_reflog_entry_msg":{"type":"function","file":"reflog.h","line":147,"lineto":147,"args":[{"name":"entry","type":"const git_reflog_entry *","comment":"a reflog entry"}],"argline":"const git_reflog_entry *entry","sig":"const git_reflog_entry *","return":{"type":"char *","comment":"the log msg"},"description":"Get the log msg","comments":"","group":"reflog"},"git_reflog_free":{"type":"function","file":"reflog.h","line":154,"lineto":154,"args":[{"name":"reflog","type":"git_reflog *","comment":"reflog to free"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"void"},"description":"Free the reflog","comments":"","group":"reflog"},"git_packbuilder_new":{"type":"function","file":"pack.h","line":30,"lineto":30,"args":[{"name":"out","type":"git_packbuilder **","comment":"The new packbuilder object"},{"name":"repo","type":"git_repository *","comment":"The repository"}],"argline":"git_packbuilder **out, git_repository *repo","sig":"git_packbuilder **::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Initialize a new packbuilder","comments":"","group":"packbuilder"},"git_packbuilder_set_threads":{"type":"function","file":"pack.h","line":42,"lineto":42,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"n","type":"unsigned int","comment":"Number of threads to spawn"}],"argline":"git_packbuilder *pb, unsigned int n","sig":"git_packbuilder *::unsigned int","return":{"type":"void"},"description":"Set number of threads to spawn","comments":"By default, libgit2 won't spawn any threads at all;\nwhen set to 0, libgit2 will autodetect the number of\nCPUs.\n","group":"packbuilder"},"git_packbuilder_insert":{"type":"function","file":"pack.h","line":56,"lineto":56,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"oid","type":"const git_oid *","comment":"The oid of the commit"},{"name":"name","type":"const char *"}],"argline":"git_packbuilder *pb, const git_oid *oid,\tconst char *name","sig":"git_packbuilder *::const git_oid *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Insert a single object","comments":"For an optimal pack it's mandatory to insert objects in recency order,\ncommits followed by trees and blobs.\n","group":"packbuilder"},"git_packbuilder_insert_tree":{"type":"function","file":"pack.h","line":68,"lineto":68,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"oid","type":"const git_oid *","comment":"The oid of the root tree"}],"argline":"git_packbuilder *pb, const git_oid *oid","sig":"git_packbuilder *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Insert a root tree object","comments":"This will add the tree as well as all referenced trees and blobs.\n","group":"packbuilder"},"git_packbuilder_write":{"type":"function","file":"pack.h","line":78,"lineto":78,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"file","type":"const char *"}],"argline":"git_packbuilder *pb, const char *file","sig":"git_packbuilder *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Write the new pack and the corresponding index to path","comments":"","group":"packbuilder"},"git_packbuilder_foreach":{"type":"function","file":"pack.h","line":88,"lineto":88,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"},{"name":"cb","type":"int (*)(void *buf, size_t size, void *data)","comment":"the callback to call with each packed object's buffer"},{"name":"data","type":"void *","comment":"the callback's data"}],"argline":"git_packbuilder *pb, int (*cb)(void *buf, size_t size, void *data), void *data","sig":"git_packbuilder *::int (*)(void *buf, size_t size, void *data)::void *","return":{"type":"int","comment":"0 or an error code"},"description":"Create the new pack and pass each object to the callback","comments":"","group":"packbuilder"},"git_packbuilder_object_count":{"type":"function","file":"pack.h","line":95,"lineto":95,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t"},"description":"Get the total number of objects the packbuilder will write out","comments":"","group":"packbuilder"},"git_packbuilder_written":{"type":"function","file":"pack.h","line":102,"lineto":102,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t"},"description":"Get the number of objects the packbuilder has already written out","comments":"","group":"packbuilder"},"git_packbuilder_free":{"type":"function","file":"pack.h","line":109,"lineto":109,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"void"},"description":"Free the packbuilder and all associated data","comments":"","group":"packbuilder"},"git_oid_fromstr":{"type":"function","file":"oid.h","line":48,"lineto":48,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"str","type":"const char *","comment":"input hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes)."}],"argline":"git_oid *out, const char *str","sig":"git_oid *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Parse a hex formatted object id into a git_oid.","comments":"","group":"oid","examples":{"general.c":["ex/HEAD/general.html#git_oid_fromstr-32","ex/HEAD/general.html#git_oid_fromstr-33","ex/HEAD/general.html#git_oid_fromstr-34","ex/HEAD/general.html#git_oid_fromstr-35","ex/HEAD/general.html#git_oid_fromstr-36","ex/HEAD/general.html#git_oid_fromstr-37","ex/HEAD/general.html#git_oid_fromstr-38","ex/HEAD/general.html#git_oid_fromstr-39"]}},"git_oid_fromstrn":{"type":"function","file":"oid.h","line":61,"lineto":61,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"str","type":"const char *","comment":"input hex string of at least size `length`"},{"name":"length","type":"size_t","comment":"length of the input string"}],"argline":"git_oid *out, const char *str, size_t length","sig":"git_oid *::const char *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Parse N characters of a hex formatted object id into a git_oid","comments":"If N is odd, N-1 characters will be parsed instead.\nThe remaining space in the git_oid will be set to zero.\n","group":"oid","examples":{"diff.c":["ex/HEAD/diff.html#git_oid_fromstrn-10"]}},"git_oid_fromraw":{"type":"function","file":"oid.h","line":69,"lineto":69,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"raw","type":"const unsigned char *","comment":"the raw input bytes to be copied."}],"argline":"git_oid *out, const unsigned char *raw","sig":"git_oid *::const unsigned char *","return":{"type":"void"},"description":"Copy an already raw oid into a git_oid structure.","comments":"","group":"oid"},"git_oid_fmt":{"type":"function","file":"oid.h","line":81,"lineto":81,"args":[{"name":"str","type":"char *","comment":"output hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (40 bytes). Only the oid digits are written; a '\\\\0' terminator must be added by the caller if it is required."},{"name":"oid","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *str, const git_oid *oid","sig":"char *::const git_oid *","return":{"type":"void"},"description":"Format a git_oid into a hex string.","comments":"","group":"oid","examples":{"showindex.c":["ex/HEAD/showindex.html#git_oid_fmt-4"],"network/ls-remote.c":["ex/HEAD/ls-remote.html#git_oid_fmt-10"],"network/index-pack.c":["ex/HEAD/index-pack.html#git_oid_fmt-1"],"network/fetch.c":["ex/HEAD/fetch.html#git_oid_fmt-11","ex/HEAD/fetch.html#git_oid_fmt-12"],"general.c":["ex/HEAD/general.html#git_oid_fmt-40","ex/HEAD/general.html#git_oid_fmt-41","ex/HEAD/general.html#git_oid_fmt-42","ex/HEAD/general.html#git_oid_fmt-43","ex/HEAD/general.html#git_oid_fmt-44"]}},"git_oid_pathfmt":{"type":"function","file":"oid.h","line":96,"lineto":96,"args":[{"name":"str","type":"char *","comment":"output hex string; must be pointing at the start of the hex sequence and have at least the number of bytes needed for an oid encoded in hex (41 bytes). Only the oid digits are written; a '\\\\0' terminator must be added by the caller if it is required."},{"name":"oid","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *str, const git_oid *oid","sig":"char *::const git_oid *","return":{"type":"void"},"description":"Format a git_oid into a loose-object path string.","comments":"The resulting string is \"aa/...\", where \"aa\" is the first two\nhex digits of the oid and \"...\" is the remaining 38 digits.\n","group":"oid"},"git_oid_allocfmt":{"type":"function","file":"oid.h","line":105,"lineto":105,"args":[{"name":"oid","type":"const git_oid *","comment":"the oid structure to format"}],"argline":"const git_oid *oid","sig":"const git_oid *","return":{"type":"char *","comment":"the c-string; NULL if memory is exhausted. Caller must deallocate the string with git__free()."},"description":"Format a git_oid into a newly allocated c-string.","comments":"","group":"oid"},"git_oid_tostr":{"type":"function","file":"oid.h","line":122,"lineto":122,"args":[{"name":"out","type":"char *","comment":"the buffer into which the oid string is output."},{"name":"n","type":"size_t","comment":"the size of the out buffer."},{"name":"oid","type":"const git_oid *","comment":"the oid structure to format."}],"argline":"char *out, size_t n, const git_oid *oid","sig":"char *::size_t::const git_oid *","return":{"type":"char *","comment":"the out buffer pointer, assuming no input parameter errors, otherwise a pointer to an empty string."},"description":"Format a git_oid into a buffer as a hex format c-string.","comments":"If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting\noid c-string will be truncated to n-1 characters. If there are\nany input parameter errors (out == NULL, n == 0, oid == NULL),\nthen a pointer to an empty string is returned, so that the return\nvalue can always be printed.\n","group":"oid"},"git_oid_cpy":{"type":"function","file":"oid.h","line":130,"lineto":130,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"src","type":"const git_oid *","comment":"oid structure to copy from."}],"argline":"git_oid *out, const git_oid *src","sig":"git_oid *::const git_oid *","return":{"type":"void"},"description":"Copy an oid from one structure to another.","comments":"","group":"oid"},"git_oid_cmp":{"type":"function","file":"oid.h","line":139,"lineto":151,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."}],"argline":"const git_oid *a, const git_oid *b","sig":"const git_oid *::const git_oid *","return":{"type":"int","comment":"<0, 0, >0 if a < b, a == b, a > b."},"description":"Compare two oid structures.","comments":"","group":"oid"},"git_oid_equal":{"type":"function","file":"oid.h","line":160,"lineto":163,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."}],"argline":"const git_oid *a, const git_oid *b","sig":"const git_oid *::const git_oid *","return":{"type":"int","comment":"true if equal, false otherwise"},"description":"Compare two oid structures for equality","comments":"","group":"oid"},"git_oid_ncmp":{"type":"function","file":"oid.h","line":174,"lineto":174,"args":[{"name":"a","type":"const git_oid *","comment":"first oid structure."},{"name":"b","type":"const git_oid *","comment":"second oid structure."},{"name":"len","type":"size_t","comment":"the number of hex chars to compare"}],"argline":"const git_oid *a, const git_oid *b, size_t len","sig":"const git_oid *::const git_oid *::size_t","return":{"type":"int","comment":"0 in case of a match"},"description":"Compare the first 'len' hexadecimal characters (packets of 4 bits)\nof two oid structures.","comments":"","group":"oid"},"git_oid_streq":{"type":"function","file":"oid.h","line":184,"lineto":184,"args":[{"name":"a","type":"const git_oid *","comment":"oid structure."},{"name":"str","type":"const char *","comment":"input hex string of an object id."}],"argline":"const git_oid *a, const char *str","sig":"const git_oid *::const char *","return":{"type":"int","comment":"GIT_ENOTOID if str is not a valid hex string, 0 in case of a match, GIT_ERROR otherwise."},"description":"Check if an oid equals an hex formatted object id.","comments":"","group":"oid"},"git_oid_iszero":{"type":"function","file":"oid.h","line":191,"lineto":191,"args":[{"name":"a","type":"const git_oid *"}],"argline":"const git_oid *a","sig":"const git_oid *","return":{"type":"int","comment":"1 if all zeros, 0 otherwise."},"description":"Check is an oid is all zeros.","comments":"","group":"oid","examples":{"network/fetch.c":["ex/HEAD/fetch.html#git_oid_iszero-13"]}},"git_oid_shorten_new":{"type":"function","file":"oid.h","line":212,"lineto":212,"args":[{"name":"min_length","type":"size_t","comment":"The minimal length for all identifiers, which will be used even if shorter OIDs would still be unique."}],"argline":"size_t min_length","sig":"size_t","return":{"type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance, NULL if OOM"},"description":"Create a new OID shortener.","comments":"The OID shortener is used to process a list of OIDs\nin text form and return the shortest length that would\nuniquely identify all of them.\n\nE.g. look at the result of `git log --abbrev`.\n","group":"oid"},"git_oid_shorten_add":{"type":"function","file":"oid.h","line":238,"lineto":238,"args":[{"name":"os","type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance"},{"name":"text_oid","type":"const char *","comment":"an OID in text form"}],"argline":"git_oid_shorten *os, const char *text_oid","sig":"git_oid_shorten *::const char *","return":{"type":"int","comment":"the minimal length to uniquely identify all OIDs added so far to the set; or an error code (<0) if an error occurs."},"description":"Add a new OID to set of shortened OIDs and calculate\nthe minimal length to uniquely identify all the OIDs in\nthe set.","comments":"The OID is expected to be a 40-char hexadecimal string.\nThe OID is owned by the user and will not be modified\nor freed.\n\nFor performance reasons, there is a hard-limit of how many\nOIDs can be added to a single set (around ~22000, assuming\na mostly randomized distribution), which should be enough\nfor any kind of program, and keeps the algorithm fast and\nmemory-efficient.\n\nAttempting to add more than those OIDs will result in a\nGIT_ENOMEM error\n","group":"oid"},"git_oid_shorten_free":{"type":"function","file":"oid.h","line":245,"lineto":245,"args":[{"name":"os","type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance"}],"argline":"git_oid_shorten *os","sig":"git_oid_shorten *","return":{"type":"void"},"description":"Free an OID shortener instance","comments":"","group":"oid"},"git_odb_new":{"type":"function","file":"odb.h","line":35,"lineto":35,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened. Set to NULL if the open failed."}],"argline":"git_odb **out","sig":"git_odb **","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new object database with no backends.","comments":"Before the ODB can be used for read/writing, a custom database\nbackend must be manually added using `git_odb_add_backend()`\n","group":"odb"},"git_odb_open":{"type":"function","file":"odb.h","line":53,"lineto":53,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened. Set to NULL if the open failed."},{"name":"objects_dir","type":"const char *","comment":"path of the backends' \"objects\" directory."}],"argline":"git_odb **out, const char *objects_dir","sig":"git_odb **::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new object database and automatically add\nthe two default backends:","comments":"- git_odb_backend_loose: read and write loose object files\n\tfrom disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,\n\tassuming `objects_dir` as the Objects folder which\n\tcontains a 'pack/' folder with the corresponding data\n","group":"odb"},"git_odb_add_backend":{"type":"function","file":"odb.h","line":68,"lineto":68,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"backend","type":"git_odb_backend *","comment":"pointer to a git_odb_backend instance"},{"name":"priority","type":"int","comment":"Value for ordering the backends queue"}],"argline":"git_odb *odb, git_odb_backend *backend, int priority","sig":"git_odb *::git_odb_backend *::int","return":{"type":"int","comment":"0 on success; error code otherwise"},"description":"Add a custom backend to an existing Object DB","comments":"The backends are checked in relative ordering, based on the\nvalue of the `priority` parameter.\n\nRead <odb_backends.h> for more information.\n","group":"odb"},"git_odb_add_alternate":{"type":"function","file":"odb.h","line":89,"lineto":89,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"backend","type":"git_odb_backend *","comment":"pointer to a git_odb_backend instance"},{"name":"priority","type":"int","comment":"Value for ordering the backends queue"}],"argline":"git_odb *odb, git_odb_backend *backend, int priority","sig":"git_odb *::git_odb_backend *::int","return":{"type":"int","comment":"0 on success; error code otherwise"},"description":"Add a custom backend to an existing Object DB; this\nbackend will work as an alternate.","comments":"Alternate backends are always checked for objects *after*\nall the main backends have been exhausted.\n\nThe backends are checked in relative ordering, based on the\nvalue of the `priority` parameter.\n\nWriting is disabled on alternate backends.\n\nRead <odb_backends.h> for more information.\n","group":"odb"},"git_odb_free":{"type":"function","file":"odb.h","line":96,"lineto":96,"args":[{"name":"db","type":"git_odb *","comment":"database pointer to close. If NULL no action is taken."}],"argline":"git_odb *db","sig":"git_odb *","return":{"type":"void"},"description":"Close an open object database.","comments":"","group":"odb"},"git_odb_read":{"type":"function","file":"odb.h","line":115,"lineto":115,"args":[{"name":"out","type":"git_odb_object **","comment":"pointer where to store the read object"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"id","type":"const git_oid *","comment":"identity of the object to read."}],"argline":"git_odb_object **out, git_odb *db, const git_oid *id","sig":"git_odb_object **::git_odb *::const git_oid *","return":{"type":"int","comment":"- 0 if the object was read; - GIT_ENOTFOUND if the object is not in the database."},"description":"Read an object from the database.","comments":"This method queries all available ODB backends\ntrying to read the given OID.\n\nThe returned object is reference counted and\ninternally cached, so it should be closed\nby the user once it's no longer in use.\n","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_read-45"]}},"git_odb_read_prefix":{"type":"function","file":"odb.h","line":143,"lineto":143,"args":[{"name":"out","type":"git_odb_object **","comment":"pointer where to store the read object"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"short_id","type":"const git_oid *","comment":"a prefix of the id of the object to read."},{"name":"len","type":"size_t","comment":"the length of the prefix"}],"argline":"git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len","sig":"git_odb_object **::git_odb *::const git_oid *::size_t","return":{"type":"int","comment":"0 if the object was read; GIT_ENOTFOUND if the object is not in the database. GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)"},"description":"Read an object from the database, given a prefix\nof its identifier.","comments":"This method queries all available ODB backends\ntrying to match the 'len' first hexadecimal\ncharacters of the 'short_id'.\nThe remaining (GIT_OID_HEXSZ-len)*4 bits of\n'short_id' must be 0s.\n'len' must be at least GIT_OID_MINPREFIXLEN,\nand the prefix must be long enough to identify\na unique object in all the backends; the\nmethod will fail otherwise.\n\nThe returned object is reference counted and\ninternally cached, so it should be closed\nby the user once it's no longer in use.\n","group":"odb"},"git_odb_read_header":{"type":"function","file":"odb.h","line":163,"lineto":163,"args":[{"name":"len_p","type":"size_t *","comment":"pointer where to store the length"},{"name":"type_p","type":"git_otype *","comment":"pointer where to store the type"},{"name":"db","type":"git_odb *","comment":"database to search for the object in."},{"name":"id","type":"const git_oid *","comment":"identity of the object to read."}],"argline":"size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id","sig":"size_t *::git_otype *::git_odb *::const git_oid *","return":{"type":"int","comment":"- 0 if the object was read; - GIT_ENOTFOUND if the object is not in the database."},"description":"Read the header of an object from the database, without\nreading its full contents.","comments":"The header includes the length and the type of an object.\n\nNote that most backends do not support reading only the header\nof an object, so the whole object will be read and then the\nheader will be returned.\n","group":"odb"},"git_odb_exists":{"type":"function","file":"odb.h","line":174,"lineto":174,"args":[{"name":"db","type":"git_odb *","comment":"database to be searched for the given object."},{"name":"id","type":"const git_oid *","comment":"the object to search for."}],"argline":"git_odb *db, const git_oid *id","sig":"git_odb *::const git_oid *","return":{"type":"int","comment":"- 1, if the object was found - 0, otherwise"},"description":"Determine if the given object can be found in the object database.","comments":"","group":"odb"},"git_odb_foreach":{"type":"function","file":"odb.h","line":189,"lineto":189,"args":[{"name":"db","type":"git_odb *","comment":"database to use"},{"name":"cb","type":"int (*)(git_oid *oid, void *data)","comment":"the callback to call for each object"},{"name":"data","type":"void *","comment":"data to pass to the callback"}],"argline":"git_odb *db, int (*cb)(git_oid *oid, void *data), void *data","sig":"git_odb *::int (*)(git_oid *oid, void *data)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"List all objects available in the database","comments":"The callback will be called for each object available in the\ndatabase. Note that the objects are likely to be returned in the index\norder, which would make accessing the objects in that order inefficient.\nReturn a non-zero value from the callback to stop looping.\n","group":"odb"},"git_odb_write":{"type":"function","file":"odb.h","line":209,"lineto":209,"args":[{"name":"oid","type":"git_oid *","comment":"pointer to store the OID result of the write"},{"name":"odb","type":"git_odb *","comment":"object database where to store the object"},{"name":"data","type":"const void *","comment":"buffer with the data to store"},{"name":"len","type":"size_t","comment":"size of the buffer"},{"name":"type","type":"git_otype","comment":"type of the data to store"}],"argline":"git_oid *oid, git_odb *odb, const void *data, size_t len, git_otype type","sig":"git_oid *::git_odb *::const void *::size_t::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Write an object directly into the ODB","comments":"This method writes a full object straight into the ODB.\nFor most cases, it is preferred to write objects through a write\nstream, which is both faster and less memory intensive, specially\nfor big objects.\n\nThis method is provided for compatibility with custom backends\nwhich are not able to support streaming writes\n","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_write-46"]}},"git_odb_open_wstream":{"type":"function","file":"odb.h","line":238,"lineto":238,"args":[{"name":"stream","type":"git_odb_stream **","comment":"pointer where to store the stream"},{"name":"db","type":"git_odb *","comment":"object database where the stream will write"},{"name":"size","type":"size_t","comment":"final size of the object that will be written"},{"name":"type","type":"git_otype","comment":"type of the object that will be written"}],"argline":"git_odb_stream **stream, git_odb *db, size_t size, git_otype type","sig":"git_odb_stream **::git_odb *::size_t::git_otype","return":{"type":"int","comment":"0 if the stream was created; error code otherwise"},"description":"Open a stream to write an object into the ODB","comments":"The type and final length of the object must be specified\nwhen opening the stream.\n\nThe returned stream will be of type `GIT_STREAM_WRONLY` and\nwill have the following methods:\n\n\t- stream->write: write `n` bytes into the stream\n\t- stream->finalize_write: close the stream and store the object in\n\t\tthe odb\n\t- stream->free: free the stream\n\nThe streaming write won't be effective until `stream->finalize_write`\nis called and returns without an error\n\nThe stream must always be free'd or will leak memory.\n\n@see git_odb_stream\n","group":"odb"},"git_odb_open_rstream":{"type":"function","file":"odb.h","line":264,"lineto":264,"args":[{"name":"stream","type":"git_odb_stream **","comment":"pointer where to store the stream"},{"name":"db","type":"git_odb *","comment":"object database where the stream will read from"},{"name":"oid","type":"const git_oid *","comment":"oid of the object the stream will read from"}],"argline":"git_odb_stream **stream, git_odb *db, const git_oid *oid","sig":"git_odb_stream **::git_odb *::const git_oid *","return":{"type":"int","comment":"0 if the stream was created; error code otherwise"},"description":"Open a stream to read an object from the ODB","comments":"Note that most backends do *not* support streaming reads\nbecause they store their objects as compressed/delta'ed blobs.\n\nIt's recommended to use `git_odb_read` instead, which is\nassured to work on all backends.\n\nThe returned stream will be of type `GIT_STREAM_RDONLY` and\nwill have the following methods:\n\n\t- stream->read: read `n` bytes from the stream\n\t- stream->free: free the stream\n\nThe stream must always be free'd or will leak memory.\n\n@see git_odb_stream\n","group":"odb"},"git_odb_write_pack":{"type":"function","file":"odb.h","line":284,"lineto":284,"args":[{"name":"writepack","type":"git_odb_writepack **","comment":"pointer to the writepack functions"},{"name":"db","type":"git_odb *","comment":"object database where the stream will read from"},{"name":"progress_cb","type":"git_transfer_progress_callback","comment":"function to call with progress information. Be aware that this is called inline with network and indexing operations, so performance may be affected."},{"name":"progress_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_odb_writepack **writepack, git_odb *db, git_transfer_progress_callback progress_cb, void *progress_payload","sig":"git_odb_writepack **::git_odb *::git_transfer_progress_callback::void *","return":{"type":"int"},"description":"Open a stream for writing a pack file to the ODB.","comments":"If the ODB layer understands pack files, then the given\npackfile will likely be streamed directly to disk (and a\ncorresponding index created). If the ODB layer does not\nunderstand pack files, the objects will be stored in whatever\nformat the ODB layer uses.\n\n@see git_odb_writepack\n","group":"odb"},"git_odb_hash":{"type":"function","file":"odb.h","line":298,"lineto":298,"args":[{"name":"id","type":"git_oid *","comment":"the resulting object-ID."},{"name":"data","type":"const void *","comment":"data to hash"},{"name":"len","type":"size_t","comment":"size of the data"},{"name":"type","type":"git_otype","comment":"of the data to hash"}],"argline":"git_oid *id, const void *data, size_t len, git_otype type","sig":"git_oid *::const void *::size_t::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Determine the object-ID (sha1 hash) of a data buffer","comments":"The resulting SHA-1 OID will be the identifier for the data\nbuffer as if the data buffer it were to written to the ODB.\n","group":"odb"},"git_odb_hashfile":{"type":"function","file":"odb.h","line":313,"lineto":313,"args":[{"name":"out","type":"git_oid *","comment":"oid structure the result is written into."},{"name":"path","type":"const char *","comment":"file to read and determine object id for"},{"name":"type","type":"git_otype","comment":"the type of the object that will be hashed"}],"argline":"git_oid *out, const char *path, git_otype type","sig":"git_oid *::const char *::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Read a file from disk and fill a git_oid with the object id\nthat the file would have if it were written to the Object\nDatabase as an object of the given type (w/o applying filters).\nSimilar functionality to git.git's `git hash-object` without\nthe `-w` flag, however, with the --no-filters flag.\nIf you need filters, see git_repository_hashfile.","comments":"","group":"odb"},"git_odb_object_free":{"type":"function","file":"odb.h","line":323,"lineto":323,"args":[{"name":"object","type":"git_odb_object *","comment":"object to close"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"void"},"description":"Close an ODB object","comments":"This method must always be called once a `git_odb_object` is no\nlonger needed, otherwise memory will leak.\n","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_object_free-47"]}},"git_odb_object_id":{"type":"function","file":"odb.h","line":333,"lineto":333,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"const git_oid *","comment":"a pointer to the OID"},"description":"Return the OID of an ODB object","comments":"This is the OID from which the object was read from\n","group":"odb"},"git_odb_object_data":{"type":"function","file":"odb.h","line":346,"lineto":346,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"const void *","comment":"a pointer to the data"},"description":"Return the data of an ODB object","comments":"This is the uncompressed, raw data as read from the ODB,\nwithout the leading header.\n\nThis pointer is owned by the object and shall not be free'd.\n","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_object_data-48"]}},"git_odb_object_size":{"type":"function","file":"odb.h","line":357,"lineto":357,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"size_t","comment":"the size"},"description":"Return the size of an ODB object","comments":"This is the real size of the `data` buffer, not the\nactual size of the object.\n","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_object_size-49"]}},"git_odb_object_type":{"type":"function","file":"odb.h","line":365,"lineto":365,"args":[{"name":"object","type":"git_odb_object *","comment":"the object"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"git_otype","comment":"the type"},"description":"Return the type of an ODB object","comments":"","group":"odb","examples":{"general.c":["ex/HEAD/general.html#git_odb_object_type-50"]}},"git_object_lookup":{"type":"function","file":"object.h","line":41,"lineto":45,"args":[{"name":"object","type":"git_object **","comment":"pointer to the looked-up object"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the object"},{"name":"id","type":"const git_oid *","comment":"the unique identifier for the object"},{"name":"type","type":"git_otype","comment":"the type of the object"}],"argline":"git_object **object,\n\t\tgit_repository *repo,\n\t\tconst git_oid *id,\n\t\tgit_otype type","sig":"git_object **::git_repository *::const git_oid *::git_otype","return":{"type":"int","comment":"a reference to the object"},"description":"Lookup a reference to one of the objects in a repository.","comments":"The generated reference is owned by the repository and\nshould be closed with the `git_object_free` method\ninstead of free'd manually.\n\nThe 'type' parameter must match the type of the object\nin the odb; the method will fail otherwise.\nThe special value 'GIT_OBJ_ANY' may be passed to let\nthe method guess the object's type.\n","group":"object","examples":{"diff.c":["ex/HEAD/diff.html#git_object_lookup-11"]}},"git_object_lookup_prefix":{"type":"function","file":"object.h","line":74,"lineto":79,"args":[{"name":"object_out","type":"git_object **","comment":"pointer where to store the looked-up object"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the object"},{"name":"id","type":"const git_oid *","comment":"a short identifier for the object"},{"name":"len","type":"size_t","comment":"the length of the short identifier"},{"name":"type","type":"git_otype","comment":"the type of the object"}],"argline":"git_object **object_out,\n\t\tgit_repository *repo,\n\t\tconst git_oid *id,\n\t\tsize_t len,\n\t\tgit_otype type","sig":"git_object **::git_repository *::const git_oid *::size_t::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a reference to one of the objects in a repository,\ngiven a prefix of its identifier (short id).","comments":"The object obtained will be so that its identifier\nmatches the first 'len' hexadecimal characters\n(packets of 4 bits) of the given 'id'.\n'len' must be at least GIT_OID_MINPREFIXLEN, and\nlong enough to identify a unique object matching\nthe prefix; otherwise the method will fail.\n\nThe generated reference is owned by the repository and\nshould be closed with the `git_object_free` method\ninstead of free'd manually.\n\nThe 'type' parameter must match the type of the object\nin the odb; the method will fail otherwise.\nThe special value 'GIT_OBJ_ANY' may be passed to let\nthe method guess the object's type.\n","group":"object","examples":{"diff.c":["ex/HEAD/diff.html#git_object_lookup_prefix-12"]}},"git_object_id":{"type":"function","file":"object.h","line":87,"lineto":87,"args":[{"name":"obj","type":"const git_object *","comment":"the repository object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"const git_oid *","comment":"the SHA1 id"},"description":"Get the id (SHA1) of a repository object","comments":"","group":"object"},"git_object_type":{"type":"function","file":"object.h","line":95,"lineto":95,"args":[{"name":"obj","type":"const git_object *","comment":"the repository object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"git_otype","comment":"the object's type"},"description":"Get the object type of an object","comments":"","group":"object","examples":{"diff.c":["ex/HEAD/diff.html#git_object_type-13"]}},"git_object_owner":{"type":"function","file":"object.h","line":109,"lineto":109,"args":[{"name":"obj","type":"const git_object *","comment":"the object"}],"argline":"const git_object *obj","sig":"const git_object *","return":{"type":"git_repository *","comment":"the repository who owns this object"},"description":"Get the repository that owns this object","comments":"Freeing or calling `git_repository_close` on the\nreturned pointer will invalidate the actual object.\n\nAny other operation may be run on the repository without\naffecting the object.\n","group":"object"},"git_object_free":{"type":"function","file":"object.h","line":126,"lineto":126,"args":[{"name":"object","type":"git_object *","comment":"the object to close"}],"argline":"git_object *object","sig":"git_object *","return":{"type":"void"},"description":"Close an open object","comments":"This method instructs the library to close an existing\nobject; note that git_objects are owned and cached by the repository\nso the object may or may not be freed after this library call,\ndepending on how aggressive is the caching mechanism used\nby the repository.\n\nIMPORTANT:\nIt *is* necessary to call this method when you stop using\nan object. Failure to do so will cause a memory leak.\n","group":"object","examples":{"general.c":["ex/HEAD/general.html#git_object_free-51"],"diff.c":["ex/HEAD/diff.html#git_object_free-14"]}},"git_object_type2string":{"type":"function","file":"object.h","line":137,"lineto":137,"args":[{"name":"type","type":"git_otype","comment":"object type to convert."}],"argline":"git_otype type","sig":"git_otype","return":{"type":"const char *","comment":"the corresponding string representation."},"description":"Convert an object type to it's string representation.","comments":"The result is a pointer to a string in static memory and\nshould not be free()'ed.\n","group":"object","examples":{"general.c":["ex/HEAD/general.html#git_object_type2string-52"]}},"git_object_string2type":{"type":"function","file":"object.h","line":145,"lineto":145,"args":[{"name":"str","type":"const char *","comment":"the string to convert."}],"argline":"const char *str","sig":"const char *","return":{"type":"git_otype","comment":"the corresponding git_otype."},"description":"Convert a string object type representation to it's git_otype.","comments":"","group":"object"},"git_object_typeisloose":{"type":"function","file":"object.h","line":154,"lineto":154,"args":[{"name":"type","type":"git_otype","comment":"object type to test."}],"argline":"git_otype type","sig":"git_otype","return":{"type":"int","comment":"true if the type represents a valid loose object type, false otherwise."},"description":"Determine if the given git_otype is a valid loose object type.","comments":"","group":"object"},"git_object__size":{"type":"function","file":"object.h","line":168,"lineto":168,"args":[{"name":"type","type":"git_otype","comment":"object type to get its size"}],"argline":"git_otype type","sig":"git_otype","return":{"type":"size_t","comment":"size in bytes of the object"},"description":"Get the size in bytes for the structure which\nacts as an in-memory representation of any given\nobject type.","comments":"For all the core types, this would the equivalent\nof calling `sizeof(git_commit)` if the core types\nwere not opaque on the external API.\n","group":"object"},"git_object_peel":{"type":"function","file":"object.h","line":185,"lineto":188,"args":[{"name":"peeled","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"object","type":"git_object *","comment":"The object to be processed"},{"name":"target_type","type":"git_otype","comment":"The type of the requested object"}],"argline":"git_object **peeled,\n\t\tgit_object *object,\n\t\tgit_otype target_type","sig":"git_object **::git_object *::git_otype","return":{"type":"int","comment":"0 or an error code"},"description":"Recursively peel an object until an object of the specified type is met.","comments":"The retrieved `peeled` object is owned by the repository and should be\nclosed with the `git_object_free` method.\n\nIf you pass `GIT_OBJ_ANY` as the target type, then the object will be\npeeled until the type changes (e.g. a tag will be chased until the\nreferenced object is no longer a tag).\n","group":"object"},"git_note_read":{"type":"function","file":"notes.h","line":34,"lineto":35,"args":[{"name":"note","type":"git_note **","comment":"pointer to the read note; NULL in case of error"},{"name":"repo","type":"git_repository *","comment":"repository where to look up the note"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional); defaults to \"refs/notes/commits\""},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to read the note from"}],"argline":"git_note **note, git_repository *repo,\n\t\t\t const char *notes_ref, const git_oid *oid","sig":"git_note **::git_repository *::const char *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Read the note for an object","comments":"The note must be freed manually by the user.\n","group":"note"},"git_note_message":{"type":"function","file":"notes.h","line":43,"lineto":43,"args":[{"name":"note","type":"git_note *","comment":""}],"argline":"git_note *note","sig":"git_note *","return":{"type":"const char *","comment":"the note message"},"description":"Get the note message","comments":"","group":"note"},"git_note_oid":{"type":"function","file":"notes.h","line":52,"lineto":52,"args":[{"name":"note","type":"git_note *","comment":""}],"argline":"git_note *note","sig":"git_note *","return":{"type":"const git_oid *","comment":"the note object OID"},"description":"Get the note object OID","comments":"","group":"note"},"git_note_create":{"type":"function","file":"notes.h","line":68,"lineto":71,"args":[{"name":"out","type":"git_oid *","comment":"pointer to store the OID (optional); NULL in case of error"},{"name":"repo","type":"git_repository *","comment":"repository where to store the note"},{"name":"author","type":"git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"git_signature *","comment":"signature of the notes commit committer"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional); defaults to \"refs/notes/commits\""},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to decorate"},{"name":"note","type":"const char *","comment":"s_ref canonical name of the reference to use (optional); defaults to \"refs/notes/commits\""}],"argline":"git_oid *out, git_repository *repo,\n\t\t\t\tgit_signature *author, git_signature *committer,\n\t\t\t\tconst char *notes_ref, const git_oid *oid,\n\t\t\t\t const char *note","sig":"git_oid *::git_repository *::git_signature *::git_signature *::const char *::const git_oid *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Add a note for an object","comments":"","group":"note"},"git_note_remove":{"type":"function","file":"notes.h","line":86,"lineto":88,"args":[{"name":"repo","type":"git_repository *","comment":"repository where the note lives"},{"name":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional); defaults to \"refs/notes/commits\""},{"name":"author","type":"git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"git_signature *","comment":"signature of the notes commit committer"},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to remove the note from"}],"argline":"git_repository *repo, const char *notes_ref,\n\t\t\t\tgit_signature *author, git_signature *committer,\n\t\t\t\tconst git_oid *oid","sig":"git_repository *::const char *::git_signature *::git_signature *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Remove the note for an object","comments":"","group":"note"},"git_note_free":{"type":"function","file":"notes.h","line":95,"lineto":95,"args":[{"name":"note","type":"git_note *","comment":"git_note object"}],"argline":"git_note *note","sig":"git_note *","return":{"type":"void"},"description":"Free a git_note object","comments":"","group":"note"},"git_note_default_ref":{"type":"function","file":"notes.h","line":105,"lineto":105,"args":[{"name":"out","type":"const char **","comment":"Pointer to the default notes reference"},{"name":"repo","type":"git_repository *","comment":"The Git repository"}],"argline":"const char **out, git_repository *repo","sig":"const char **::git_repository *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the default notes reference for a repository","comments":"","group":"note"},"git_note_foreach":{"type":"function","file":"notes.h","line":134,"lineto":139,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the notes."},{"name":"notes_ref","type":"const char *","comment":"Reference to read from (optional); defaults to \"refs/notes/commits\"."},{"name":"note_cb","type":"int (*)(git_note_data *note_data, void *payload)","comment":"Callback to invoke per found annotation. Return non-zero to stop looping."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo,\n\tconst char *notes_ref,\n\tint (*note_cb)(git_note_data *note_data, void *payload),\n\tvoid *payload","sig":"git_repository *::const char *::int (*)(git_note_data *note_data, void *payload)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Loop over all the notes within a specified namespace\nand issue a callback for each one.","comments":"","group":"note"},"git_message_prettify":{"type":"function","file":"message.h","line":39,"lineto":39,"args":[{"name":"message_out","type":"char *","comment":"The user allocated buffer which will be filled with the cleaned up message. Pass NULL if you just want to get the size of the prettified message as the output value."},{"name":"buffer_size","type":"size_t"},{"name":"message","type":"const char *","comment":"_out The user allocated buffer which will be filled with the cleaned up message. Pass NULL if you just want to get the size of the prettified message as the output value."},{"name":"strip_comments","type":"int","comment":"1 to remove lines starting with a \"#\", 0 otherwise."}],"argline":"char *message_out, size_t buffer_size, const char *message, int strip_comments","sig":"char *::size_t::const char *::int","return":{"type":"int","comment":"-1 on error, else number of characters in prettified message including the trailing NUL byte"},"description":"Clean up message from excess whitespace and make sure that the last line\nends with a '\\n'.","comments":"Optionally, can remove lines starting with a \"#\".\n","group":"message"},"git_merge_base":{"type":"function","file":"merge.h","line":31,"lineto":31,"args":[{"name":"out","type":"git_oid *","comment":"the OID of a merge base between 'one' and 'two'"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"one","type":"const git_oid *","comment":"one of the commits"},{"name":"two","type":"const git_oid *","comment":"the other commit"}],"argline":"git_oid *out, git_repository *repo, const git_oid *one, const git_oid *two","sig":"git_oid *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int"},"description":"Find a merge base between two commits","comments":"","group":"merge"},"git_merge_base_many":{"type":"function","file":"merge.h","line":41,"lineto":41,"args":[{"name":"out","type":"git_oid *","comment":"the OID of a merge base considering all the commits"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"length","type":"size_t","comment":"The number of commits in the provided `input_array`"}],"argline":"git_oid *out, git_repository *repo, const git_oid input_array[], size_t length","sig":"git_oid *::git_repository *::size_t","return":{"type":"int"},"description":"Find a merge base given a list of commits","comments":"","group":"merge"},"git_indexer_stream_new":{"type":"function","file":"indexer.h","line":43,"lineto":47,"args":[{"name":"out","type":"git_indexer_stream **","comment":"where to store the indexer instance"},{"name":"path","type":"const char *","comment":"to the directory where the packfile should be stored"},{"name":"progress_cb","type":"git_transfer_progress_callback","comment":"function to call with progress information"},{"name":"progress_callback_payload","type":"void *"}],"argline":"git_indexer_stream **out,\n\t\tconst char *path,\n\t\tgit_transfer_progress_callback progress_cb,\n\t\tvoid *progress_callback_payload","sig":"git_indexer_stream **::const char *::git_transfer_progress_callback::void *","return":{"type":"int"},"description":"Create a new streaming indexer instance","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/HEAD/index-pack.html#git_indexer_stream_new-2"]}},"git_indexer_stream_add":{"type":"function","file":"indexer.h","line":57,"lineto":57,"args":[{"name":"idx","type":"git_indexer_stream *","comment":"the indexer"},{"name":"data","type":"const void *","comment":"the data to add"},{"name":"size","type":"size_t","comment":"the size of the data"},{"name":"stats","type":"git_transfer_progress *","comment":"stat storage"}],"argline":"git_indexer_stream *idx, const void *data, size_t size, git_transfer_progress *stats","sig":"git_indexer_stream *::const void *::size_t::git_transfer_progress *","return":{"type":"int"},"description":"Add data to the indexer","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/HEAD/index-pack.html#git_indexer_stream_add-3"]}},"git_indexer_stream_finalize":{"type":"function","file":"indexer.h","line":66,"lineto":66,"args":[{"name":"idx","type":"git_indexer_stream *","comment":"the indexer"},{"name":"stats","type":"git_transfer_progress *"}],"argline":"git_indexer_stream *idx, git_transfer_progress *stats","sig":"git_indexer_stream *::git_transfer_progress *","return":{"type":"int"},"description":"Finalize the pack and index","comments":"Resolve any pending deltas and write out the index file\n","group":"indexer","examples":{"network/index-pack.c":["ex/HEAD/index-pack.html#git_indexer_stream_finalize-4"]}},"git_indexer_stream_hash":{"type":"function","file":"indexer.h","line":76,"lineto":76,"args":[{"name":"idx","type":"git_indexer_stream *","comment":"the indexer instance"}],"argline":"git_indexer_stream *idx","sig":"git_indexer_stream *","return":{"type":"const git_oid *"},"description":"Get the packfile's hash","comments":"A packfile's name is derived from the sorted hashing of all object\nnames. This is only correct after the index has been finalized.\n","group":"indexer","examples":{"network/index-pack.c":["ex/HEAD/index-pack.html#git_indexer_stream_hash-5"]}},"git_indexer_stream_free":{"type":"function","file":"indexer.h","line":83,"lineto":83,"args":[{"name":"idx","type":"git_indexer_stream *","comment":"the indexer to free"}],"argline":"git_indexer_stream *idx","sig":"git_indexer_stream *","return":{"type":"void"},"description":"Free the indexer and its resources","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/HEAD/index-pack.html#git_indexer_stream_free-6"]}},"git_indexer_new":{"type":"function","file":"indexer.h","line":91,"lineto":91,"args":[{"name":"out","type":"git_indexer **","comment":"where to store the indexer instance"},{"name":"packname","type":"const char *","comment":"the absolute filename of the packfile to index"}],"argline":"git_indexer **out, const char *packname","sig":"git_indexer **::const char *","return":{"type":"int"},"description":"Create a new indexer instance","comments":"","group":"indexer"},"git_indexer_run":{"type":"function","file":"indexer.h","line":103,"lineto":103,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer instance"},{"name":"stats","type":"git_transfer_progress *","comment":"storage for the running state"}],"argline":"git_indexer *idx, git_transfer_progress *stats","sig":"git_indexer *::git_transfer_progress *","return":{"type":"int"},"description":"Iterate over the objects in the packfile and extract the information","comments":"Indexing a packfile can be very expensive so this function is\nexpected to be run in a worker thread and the stats used to provide\nfeedback the user.\n","group":"indexer"},"git_indexer_write":{"type":"function","file":"indexer.h","line":113,"lineto":113,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer instance"}],"argline":"git_indexer *idx","sig":"git_indexer *","return":{"type":"int"},"description":"Write the index file to disk.","comments":"The file will be stored as pack-$hash.idx in the same directory as\nthe packfile.\n","group":"indexer"},"git_indexer_hash":{"type":"function","file":"indexer.h","line":123,"lineto":123,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer instance"}],"argline":"git_indexer *idx","sig":"git_indexer *","return":{"type":"const git_oid *"},"description":"Get the packfile's hash","comments":"A packfile's name is derived from the sorted hashing of all object\nnames. This is only correct after the index has been written to disk.\n","group":"indexer"},"git_indexer_free":{"type":"function","file":"indexer.h","line":130,"lineto":134,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer to free"}],"argline":"git_indexer *idx","sig":"git_indexer *","return":{"type":"void"},"description":"Free the indexer and its resources","comments":"","group":"indexer"},"git_index_open":{"type":"function","file":"index.h","line":126,"lineto":126,"args":[{"name":"index","type":"git_index **","comment":"the pointer for the new index"},{"name":"index_path","type":"const char *","comment":"the path to the index file in disk"}],"argline":"git_index **index, const char *index_path","sig":"git_index **::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new bare Git index object as a memory representation\nof the Git index file in 'index_path', without a repository\nto back it.","comments":"Since there is no ODB or working directory behind this index,\nany Index methods which rely on these (e.g. index_add) will\nfail with the GIT_EBAREINDEX error code.\n\nIf you need to access the index of an actual repository,\nuse the `git_repository_index` wrapper.\n\nThe index must be freed once it's no longer in use.\n","group":"index"},"git_index_new":{"type":"function","file":"index.h","line":139,"lineto":139,"args":[{"name":"index","type":"git_index **","comment":"the pointer for the new index"}],"argline":"git_index **index","sig":"git_index **","return":{"type":"int","comment":"0 or an error code"},"description":"Create an in-memory index object.","comments":"This index object cannot be read/written to the filesystem,\nbut may be used to perform in-memory index operations.\n\nThe index must be freed once it's no longer in use.\n","group":"index"},"git_index_free":{"type":"function","file":"index.h","line":146,"lineto":146,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"void"},"description":"Free an existing index object.","comments":"","group":"index","examples":{"showindex.c":["ex/HEAD/showindex.html#git_index_free-5"],"general.c":["ex/HEAD/general.html#git_index_free-53"]}},"git_index_owner":{"type":"function","file":"index.h","line":154,"lineto":154,"args":[{"name":"index","type":"const git_index *","comment":"The index"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"git_repository *","comment":"A pointer to the repository"},"description":"Get the repository this index relates to","comments":"","group":"index"},"git_index_caps":{"type":"function","file":"index.h","line":162,"lineto":162,"args":[{"name":"index","type":"const git_index *","comment":"An existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"unsigned int","comment":"A combination of GIT_INDEXCAP values"},"description":"Read index capabilities flags.","comments":"","group":"index"},"git_index_set_caps":{"type":"function","file":"index.h","line":175,"lineto":175,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"caps","type":"unsigned int","comment":"A combination of GIT_INDEXCAP values"}],"argline":"git_index *index, unsigned int caps","sig":"git_index *::unsigned int","return":{"type":"int","comment":"0 on success, -1 on failure"},"description":"Set index capabilities flags.","comments":"If you pass `GIT_INDEXCAP_FROM_OWNER` for the caps, then the\ncapabilities will be read from the config of the owner object,\nlooking at `core.ignorecase`, `core.filemode`, `core.symlinks`.\n","group":"index"},"git_index_read":{"type":"function","file":"index.h","line":184,"lineto":184,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":"0 or an error code"},"description":"Update the contents of an existing index object in memory\nby reading from the hard disk.","comments":"","group":"index","examples":{"showindex.c":["ex/HEAD/showindex.html#git_index_read-6"]}},"git_index_write":{"type":"function","file":"index.h","line":193,"lineto":193,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":"0 or an error code"},"description":"Write an existing index object from memory back to disk\nusing an atomic file lock.","comments":"","group":"index"},"git_index_read_tree":{"type":"function","file":"index.h","line":204,"lineto":204,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"tree","type":"git_tree *","comment":"tree to read"}],"argline":"git_index *index, git_tree *tree","sig":"git_index *::git_tree *","return":{"type":"int","comment":"0 or an error code"},"description":"Read a tree into the index file with stats","comments":"The current index contents will be replaced by the specified tree.\n","group":"index"},"git_index_write_tree":{"type":"function","file":"index.h","line":225,"lineto":225,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the written tree"},{"name":"index","type":"git_index *","comment":"Index to write"}],"argline":"git_oid *oid, git_index *index","sig":"git_oid *::git_index *","return":{"type":"int","comment":"0 on success, GIT_EUNMERGED when the index is not clean or an error code"},"description":"Write the index as a tree","comments":"This method will scan the index and write a representation\nof its current state back to disk; it recursively creates\ntree objects for each of the subtrees stored in the index,\nbut only returns the OID of the root tree. This is the OID\nthat can be used e.g. to create a commit.\n\nThe index instance cannot be bare, and needs to be associated\nto an existing repository.\n\nThe index must not contain any file in conflict.\n","group":"index"},"git_index_write_tree_to":{"type":"function","file":"index.h","line":242,"lineto":242,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store OID of the the written tree"},{"name":"index","type":"git_index *","comment":"Index to write"},{"name":"repo","type":"git_repository *","comment":"Repository where to write the tree"}],"argline":"git_oid *oid, git_index *index, git_repository *repo","sig":"git_oid *::git_index *::git_repository *","return":{"type":"int","comment":"0 on success, GIT_EUNMERGED when the index is not clean or an error code"},"description":"Write the index as a tree to the given repository","comments":"This method will do the same as `git_index_write_tree`, but\nletting the user choose the repository where the tree will\nbe written.\n\nThe index must not contain any file in conflict.\n","group":"index"},"git_index_entrycount":{"type":"function","file":"index.h","line":261,"lineto":261,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"unsigned int","comment":"integer of count of current entries"},"description":"Get the count of entries currently in the index","comments":"","group":"index","examples":{"showindex.c":["ex/HEAD/showindex.html#git_index_entrycount-7"],"general.c":["ex/HEAD/general.html#git_index_entrycount-54"]}},"git_index_clear":{"type":"function","file":"index.h","line":270,"lineto":270,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"void"},"description":"Clear the contents (all the entries) of an index object.\nThis clears the index object in memory; changes must be manually\nwritten to disk for them to take effect.","comments":"","group":"index"},"git_index_get_byindex":{"type":"function","file":"index.h","line":285,"lineto":285,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"n","type":"size_t","comment":"the position of the entry"}],"argline":"git_index *index, size_t n","sig":"git_index *::size_t","return":{"type":"git_index_entry *","comment":"a pointer to the entry; NULL if out of bounds"},"description":"Get a pointer to one of the entries in the index","comments":"The values of this entry can be modified (except the path)\nand the changes will be written back to disk on the next\nwrite() call.\n\nThe entry should not be freed by the caller.\n","group":"index","examples":{"showindex.c":["ex/HEAD/showindex.html#git_index_get_byindex-8"],"general.c":["ex/HEAD/general.html#git_index_get_byindex-55"]}},"git_index_get_bypath":{"type":"function","file":"index.h","line":301,"lineto":301,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *path, int stage","sig":"git_index *::const char *::int","return":{"type":"git_index_entry *","comment":"a pointer to the entry; NULL if it was not found"},"description":"Get a pointer to one of the entries in the index","comments":"The values of this entry can be modified (except the path)\nand the changes will be written back to disk on the next\nwrite() call.\n\nThe entry should not be freed by the caller.\n","group":"index"},"git_index_remove":{"type":"function","file":"index.h","line":311,"lineto":311,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *path, int stage","sig":"git_index *::const char *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Remove an entry from the index","comments":"","group":"index"},"git_index_add":{"type":"function","file":"index.h","line":327,"lineto":327,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"source_entry","type":"const git_index_entry *","comment":"new entry object"}],"argline":"git_index *index, const git_index_entry *source_entry","sig":"git_index *::const git_index_entry *","return":{"type":"int","comment":"0 or an error code"},"description":"Add or update an index entry from an in-memory struct","comments":"If a previous index entry exists that has the same path and stage\nas the given 'source_entry', it will be replaced. Otherwise, the\n'source_entry' will be added.\n\nA full copy (including the 'path' string) of the given\n'source_entry' will be inserted on the index.\n","group":"index"},"git_index_entry_stage":{"type":"function","file":"index.h","line":340,"lineto":340,"args":[{"name":"entry","type":"const git_index_entry *","comment":"The entry"}],"argline":"const git_index_entry *entry","sig":"const git_index_entry *","return":{"type":"int"},"description":"Return the stage number from a git index entry","comments":"This entry is calculated from the entry's flag\nattribute like this:\n\n(entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT\n","group":"index","examples":{"showindex.c":["ex/HEAD/showindex.html#git_index_entry_stage-9"]}},"git_index_add_from_workdir":{"type":"function","file":"index.h","line":371,"lineto":371,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"filename to add"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Add or update an index entry from a file in disk","comments":"The file `path` must be relative to the repository's\nworking folder and must be readable.\n\nThis method will fail in bare index instances.\n\nThis forces the file to be added to the index, not looking\nat gitignore rules. Those rules can be evaluated through\nthe git_status APIs (in status.h) before calling this.\n\nIf this file currently is the result of a merge conflict, this\nfile will no longer be marked as conflicting. The data about\nthe conflict will be moved to the \"resolve undo\" (REUC) section.\n","group":"index"},"git_index_find":{"type":"function","file":"index.h","line":381,"lineto":381,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":"an index >= 0 if found, -1 otherwise"},"description":"Find the first index of any entries which point to given\npath in the Git index.","comments":"","group":"index"},"git_index_conflict_add":{"type":"function","file":"index.h","line":405,"lineto":408,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"ancestor_entry","type":"const git_index_entry *","comment":"the entry data for the ancestor of the conflict"},{"name":"our_entry","type":"const git_index_entry *","comment":"the entry data for our side of the merge conflict"},{"name":"their_entry","type":"const git_index_entry *","comment":"the entry data for their side of the merge conflict"}],"argline":"git_index *index,\n\tconst git_index_entry *ancestor_entry,\n\tconst git_index_entry *our_entry,\n\tconst git_index_entry *their_entry","sig":"git_index *::const git_index_entry *::const git_index_entry *::const git_index_entry *","return":{"type":"int","comment":"0 or an error code"},"description":"Add or update index entries to represent a conflict","comments":"The entries are the entries from the tree included in the merge. Any\nentry may be null to indicate that that file was not present in the\ntrees during the merge. For example, ancestor_entry may be NULL to\nindicate that a file was added in both branches and must be resolved.\n","group":"index"},"git_index_conflict_get":{"type":"function","file":"index.h","line":423,"lineto":423,"args":[{"name":"ancestor_out","type":"git_index_entry **","comment":"Pointer to store the ancestor entry"},{"name":"our_out","type":"git_index_entry **","comment":"Pointer to store the our entry"},{"name":"their_out","type":"git_index_entry **","comment":"Pointer to store the their entry"},{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"git_index_entry **ancestor_out, git_index_entry **our_out, git_index_entry **their_out, git_index *index, const char *path","sig":"git_index_entry **::git_index_entry **::git_index_entry **::git_index *::const char *","return":{"type":"int"},"description":"Get the index entries that represent a conflict of a single file.","comments":"The values of this entry can be modified (except the paths)\nand the changes will be written back to disk on the next\nwrite() call.\n","group":"index"},"git_index_conflict_remove":{"type":"function","file":"index.h","line":431,"lineto":431,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"to search"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int"},"description":"Removes the index entries that represent a conflict of a single file.","comments":"","group":"index"},"git_index_conflict_cleanup":{"type":"function","file":"index.h","line":438,"lineto":438,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"void"},"description":"Remove all conflicts in the index (entries with a stage greater than 0.)","comments":"","group":"index"},"git_index_has_conflicts":{"type":"function","file":"index.h","line":445,"lineto":445,"args":[{"name":"index","type":"git_index *"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":"1 if at least one conflict is found, 0 otherwise."},"description":"Determine if the index contains entries representing file conflicts.","comments":"","group":"index"},"git_index_reuc_entrycount":{"type":"function","file":"index.h","line":462,"lineto":462,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"unsigned int","comment":"integer of count of current resolve undo entries"},"description":"Get the count of resolve undo entries currently in the index.","comments":"","group":"index"},"git_index_reuc_find":{"type":"function","file":"index.h","line":472,"lineto":472,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":"an index >= 0 if found, -1 otherwise"},"description":"Finds the resolve undo entry that points to the given path in the Git\nindex.","comments":"","group":"index"},"git_index_reuc_get_bypath":{"type":"function","file":"index.h","line":484,"lineto":484,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"const git_index_reuc_entry *","comment":"the resolve undo entry; NULL if not found"},"description":"Get a resolve undo entry from the index.","comments":"The returned entry is read-only and should not be modified\nof freed by the caller.\n","group":"index"},"git_index_reuc_get_byindex":{"type":"function","file":"index.h","line":496,"lineto":496,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"n","type":"size_t","comment":"the position of the entry"}],"argline":"git_index *index, size_t n","sig":"git_index *::size_t","return":{"type":"const git_index_reuc_entry *","comment":"a pointer to the resolve undo entry; NULL if out of bounds"},"description":"Get a resolve undo entry from the index.","comments":"The returned entry is read-only and should not be modified\nof freed by the caller.\n","group":"index"},"git_index_reuc_add":{"type":"function","file":"index.h","line":520,"lineto":523,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"filename to add"},{"name":"ancestor_mode","type":"int","comment":"mode of the ancestor file"},{"name":"ancestor_oid","type":"git_oid *","comment":"oid of the ancestor file"},{"name":"our_mode","type":"int","comment":"mode of our file"},{"name":"our_oid","type":"git_oid *","comment":"oid of our file"},{"name":"their_mode","type":"int","comment":"mode of their file"},{"name":"their_oid","type":"git_oid *","comment":"oid of their file"}],"argline":"git_index *index, const char *path,\n\tint ancestor_mode, git_oid *ancestor_oid,\n\tint our_mode, git_oid *our_oid,\n\tint their_mode, git_oid *their_oid","sig":"git_index *::const char *::int::git_oid *::int::git_oid *::int::git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Adds an resolve undo entry for a file based on the given parameters.","comments":"The resolve undo entry contains the OIDs of files that were involved\nin a merge conflict after the conflict has been resolved. This allows\nconflicts to be re-resolved later.\n\nIf there exists a resolve undo entry for the given path in the index,\nit will be removed.\n\nThis method will fail in bare index instances.\n","group":"index"},"git_index_reuc_remove":{"type":"function","file":"index.h","line":532,"lineto":532,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"position","type":"int","comment":"position of the resolve undo entry to remove"}],"argline":"git_index *index, int position","sig":"git_index *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Remove an resolve undo entry from the index","comments":"","group":"index"},"git_ignore_add_rule":{"type":"function","file":"ignore.h","line":37,"lineto":39,"args":[{"name":"repo","type":"git_repository *","comment":"The repository to add ignore rules to."},{"name":"rules","type":"const char *","comment":"Text of rules, a la the contents of a .gitignore file. It is okay to have multiple rules in the text; if so, each rule should be terminated with a newline."}],"argline":"git_repository *repo,\n\tconst char *rules","sig":"git_repository *::const char *","return":{"type":"int","comment":"0 on success"},"description":"Add ignore rules for a repository.","comments":"Excludesfile rules (i.e. .gitignore rules) are generally read from\n.gitignore files in the repository tree or from a shared system file\nonly if a \"core.excludesfile\" config value is set. The library also\nkeeps a set of per-repository internal ignores that can be configured\nin-memory and will not persist. This function allows you to add to\nthat internal rules list.\n\nExample usage:\n\n error = git_ignore_add_rule(myrepo, \"*.c\\ndir/\\nFile with space\\n\");\n\nThis would add three rules to the ignores.\n","group":"ignore"},"git_ignore_clear_internal_rules":{"type":"function","file":"ignore.h","line":51,"lineto":52,"args":[{"name":"repo","type":"git_repository *","comment":"The repository to remove ignore rules from."}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":"0 on success"},"description":"Clear ignore rules that were explicitly added.","comments":"Clears the internal ignore rules that have been set up. This will not\nturn off the rules in .gitignore files that actually exist in the\nfilesystem.\n","group":"ignore"},"git_ignore_path_is_ignored":{"type":"function","file":"ignore.h","line":70,"lineto":77,"args":[{"name":"ignored","type":"int *","comment":"boolean returning 0 if the file is not ignored, 1 if it is"},{"name":"repo","type":"git_repository *","comment":"a repository object"},{"name":"path","type":"const char *","comment":"the file to check ignores for, relative to the repo's workdir."}],"argline":"int *ignored,\n\tgit_repository *repo,\n\tconst char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":"0 if ignore rules could be processed for the file (regardless of whether it exists or not), or an error < 0 if they could not."},"description":"Test if the ignore rules apply to a given path.","comments":"This function checks the ignore rules to see if they would apply to the\ngiven file. This indicates if the file would be ignored regardless of\nwhether the file is already in the index or commited to the repository.\n\nOne way to think of this is if you were to do \"git add .\" on the\ndirectory containing the file, would it be added or not?\n","group":"ignore"},"giterr_last":{"type":"function","file":"errors.h","line":71,"lineto":71,"args":[],"argline":"void","sig":"","return":{"type":"const git_error *","comment":"A git_error object."},"description":"Return the last `git_error` object that was generated for the\ncurrent thread or NULL if no error has occurred.","comments":"","group":"giterr","examples":{"network/git2.c":["ex/HEAD/git2.html#giterr_last-3","ex/HEAD/git2.html#giterr_last-4"],"network/clone.c":["ex/HEAD/clone.html#giterr_last-2"]}},"giterr_clear":{"type":"function","file":"errors.h","line":76,"lineto":76,"args":[],"argline":"void","sig":"","return":{"type":"void"},"description":"Clear the last library error that occurred for this thread.","comments":"","group":"giterr"},"giterr_set_str":{"type":"function","file":"errors.h","line":99,"lineto":99,"args":[{"name":"error_class","type":"int","comment":"One of the `git_error_t` enum above describing the general subsystem that is responsible for the error."},{"name":"string","type":"const char *"}],"argline":"int error_class, const char *string","sig":"int::const char *","return":{"type":"void"},"description":"Set the error message string for this thread.","comments":"This function is public so that custom ODB backends and the like can\nrelay an error message through libgit2. Most regular users of libgit2\nwill never need to call this function -- actually, calling it in most\ncircumstances (for example, calling from within a callback function)\nwill just end up having the value overwritten by libgit2 internals.\n\nThis error message is stored in thread-local storage and only applies\nto the particular thread that this libgit2 call is made from.\n\nNOTE: Passing the `error_class` as GITERR_OS has a special behavior: we\nattempt to append the system default error message for the last OS error\nthat occurred and then clear the last error. The specific implementation\nof looking up and clearing this last OS error will vary by platform.\n","group":"giterr"},"giterr_set_oom":{"type":"function","file":"errors.h","line":110,"lineto":110,"args":[],"argline":"void","sig":"","return":{"type":"void"},"description":"Set the error message to a special value for memory allocation failure.","comments":"The normal `giterr_set_str()` function attempts to `strdup()` the string\nthat is passed in. This is not a good idea when the error in question\nis a memory allocation failure. That circumstance has a special setter\nfunction that sets the error string to a known and statically allocated\ninternal value.","group":"giterr"},"git_diff_list_free":{"type":"function","file":"diff.h","line":313,"lineto":313,"args":[{"name":"diff","type":"git_diff_list *"}],"argline":"git_diff_list *diff","sig":"git_diff_list *","return":{"type":"void"},"description":"Deallocate a diff list.","comments":"","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_list_free-15","ex/HEAD/diff.html#git_diff_list_free-16"]}},"git_diff_tree_to_tree":{"type":"function","file":"diff.h","line":326,"lineto":331,"args":[{"name":"repo","type":"git_repository *","comment":"The repository containing the trees."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults.\ncan be NULL for defaults"},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from."},{"name":"new_tree","type":"git_tree *","comment":"A git_tree object to diff to."},{"name":"diff","type":"git_diff_list **","comment":"A pointer to a git_diff_list pointer that will be allocated."}],"argline":"git_repository *repo,\n\tconst git_diff_options *opts, \n\tgit_tree *old_tree,\n\tgit_tree *new_tree,\n\tgit_diff_list **diff","sig":"git_repository *::const git_diff_options *::git_tree *::git_tree *::git_diff_list **","return":{"type":"int"},"description":"Compute a difference between two tree objects.","comments":"This is equivalent to `git diff <treeish> <treeish>`\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_tree_to_tree-17"]}},"git_diff_index_to_tree":{"type":"function","file":"diff.h","line":344,"lineto":348,"args":[{"name":"repo","type":"git_repository *","comment":"The repository containing the tree and index."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults.\ncan be NULL for defaults"},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from."},{"name":"diff","type":"git_diff_list **","comment":"A pointer to a git_diff_list pointer that will be allocated."}],"argline":"git_repository *repo,\n\tconst git_diff_options *opts, \n\tgit_tree *old_tree,\n\tgit_diff_list **diff","sig":"git_repository *::const git_diff_options *::git_tree *::git_diff_list **","return":{"type":"int"},"description":"Compute a difference between a tree and the index.","comments":"This is equivalent to `git diff --cached <treeish>` or if you pass\nthe HEAD tree, then like `git diff --cached`.\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_index_to_tree-18","ex/HEAD/diff.html#git_diff_index_to_tree-19","ex/HEAD/diff.html#git_diff_index_to_tree-20"]}},"git_diff_workdir_to_index":{"type":"function","file":"diff.h","line":362,"lineto":365,"args":[{"name":"repo","type":"git_repository *","comment":"The repository."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults.\ncan be NULL for defaults"},{"name":"diff","type":"git_diff_list **","comment":"A pointer to a git_diff_list pointer that will be allocated."}],"argline":"git_repository *repo,\n\tconst git_diff_options *opts, \n\tgit_diff_list **diff","sig":"git_repository *::const git_diff_options *::git_diff_list **","return":{"type":"int"},"description":"Compute a difference between the working directory and the index.","comments":"This matches the `git diff` command. See the note below on\n`git_diff_workdir_to_tree` for a discussion of the difference between\n`git diff` and `git diff HEAD` and how to emulate a `git diff <treeish>`\nusing libgit2.\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_workdir_to_index-21","ex/HEAD/diff.html#git_diff_workdir_to_index-22"]}},"git_diff_workdir_to_tree":{"type":"function","file":"diff.h","line":394,"lineto":398,"args":[{"name":"repo","type":"git_repository *","comment":"The repository containing the tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults.\ncan be NULL for defaults"},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from."},{"name":"diff","type":"git_diff_list **","comment":"A pointer to a git_diff_list pointer that will be allocated."}],"argline":"git_repository *repo,\n\tconst git_diff_options *opts, \n\tgit_tree *old_tree,\n\tgit_diff_list **diff","sig":"git_repository *::const git_diff_options *::git_tree *::git_diff_list **","return":{"type":"int"},"description":"Compute a difference between the working directory and a tree.","comments":"This is *NOT* the same as `git diff <treeish>`. Running `git diff HEAD`\nor the like actually uses information from the index, along with the tree\nand workdir dir info.\n\nThis function returns strictly the differences between the tree and the\nfiles contained in the working directory, regardless of the state of\nfiles in the index. It may come as a surprise, but there is no direct\nequivalent in core git.\n\nTo emulate `git diff <treeish>`, you should call both\n`git_diff_index_to_tree` and `git_diff_workdir_to_index`, then call\n`git_diff_merge` on the results. That will yield a `git_diff_list` that\nmatches the git output.\n\nIf this seems confusing, take the case of a file with a staged deletion\nwhere the file has then been put back into the working dir and modified.\nThe tree-to-workdir diff for that file is 'modified', but core git would\nshow status 'deleted' since there is a pending deletion in the index.\n","group":"diff"},"git_diff_merge":{"type":"function","file":"diff.h","line":413,"lineto":415,"args":[{"name":"onto","type":"git_diff_list *","comment":"Diff to merge into."},{"name":"from","type":"const git_diff_list *","comment":"Diff to merge."}],"argline":"git_diff_list *onto,\n\tconst git_diff_list *from","sig":"git_diff_list *::const git_diff_list *","return":{"type":"int"},"description":"Merge one diff list into another.","comments":"This merges items from the \"from\" list into the \"onto\" list. The\nresulting diff list will have all items that appear in either list.\nIf an item appears in both lists, then it will be \"merged\" to appear\nas if the old version was from the \"onto\" list and the new version\nis from the \"from\" list (with the exception that if the item has a\npending DELETE in the middle, then it will show as deleted).\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_merge-23"]}},"git_diff_find_similar":{"type":"function","file":"diff.h","line":429,"lineto":431,"args":[{"name":"diff","type":"git_diff_list *","comment":"Diff list to run detection algorithms on"},{"name":"options","type":"git_diff_find_options *","comment":"Control how detection should be run, NULL for defaults"}],"argline":"git_diff_list *diff,\n\tgit_diff_find_options *options","sig":"git_diff_list *::git_diff_find_options *","return":{"type":"int","comment":"0 on success, -1 on failure"},"description":"Transform a diff list marking file renames, copies, etc.","comments":"This modifies a diff list in place, replacing old entries that look\nlike renames or copies with new entries reflecting those changes.\nThis also will, if requested, break modified files into add/remove\npairs if the amount of change is above a threshold.\n","group":"diff"},"git_diff_foreach":{"type":"function","file":"diff.h","line":468,"lineto":473,"args":[{"name":"diff","type":"git_diff_list *","comment":"A git_diff_list generated by one of the above functions."},{"name":"cb_data","type":"void *","comment":"Reference pointer that will be passed to your callbacks."},{"name":"file_cb","type":"git_diff_file_fn","comment":"Callback function to make per file in the diff."},{"name":"hunk_cb","type":"git_diff_hunk_fn","comment":"Optional callback to make per hunk of text diff. This callback is called to describe a range of lines in the diff. It will not be issued for binary files."},{"name":"line_cb","type":"git_diff_data_fn","comment":"Optional callback to make per line of diff text. This same callback will be made for context lines, added, and removed lines, and even for a deleted trailing newline."}],"argline":"git_diff_list *diff,\n\tvoid *cb_data,\n\tgit_diff_file_fn file_cb,\n\tgit_diff_hunk_fn hunk_cb,\n\tgit_diff_data_fn line_cb","sig":"git_diff_list *::void *::git_diff_file_fn::git_diff_hunk_fn::git_diff_data_fn","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Loop over all deltas in a diff list issuing callbacks.","comments":"This will iterate through all of the files described in a diff. You\nshould provide a file callback to learn about each file.\n\nThe \"hunk\" and \"line\" callbacks are optional, and the text diff of the\nfiles will only be calculated if they are not NULL. Of course, these\ncallbacks will not be invoked for binary files on the diff list or for\nfiles whose only changed is a file mode change.\n\nReturning a non-zero value from any of the callbacks will terminate\nthe iteration and cause this return `GIT_EUSER`.\n","group":"diff"},"git_diff_print_compact":{"type":"function","file":"diff.h","line":486,"lineto":489,"args":[{"name":"diff","type":"git_diff_list *","comment":"A git_diff_list generated by one of the above functions."},{"name":"cb_data","type":"void *","comment":"Reference pointer that will be passed to your callback."},{"name":"print_cb","type":"git_diff_data_fn","comment":"Callback to make per line of diff text."}],"argline":"git_diff_list *diff,\n\tvoid *cb_data,\n\tgit_diff_data_fn print_cb","sig":"git_diff_list *::void *::git_diff_data_fn","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Iterate over a diff generating text output like \"git diff --name-status\".","comments":"Returning a non-zero value from the callbacks will terminate the\niteration and cause this return `GIT_EUSER`.\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_print_compact-24"]}},"git_diff_status_char":{"type":"function","file":"diff.h","line":503,"lineto":503,"args":[{"name":"status","type":"git_delta_t"}],"argline":"git_delta_t status","sig":"git_delta_t","return":{"type":"char","comment":"The single character label for that code"},"description":"Look up the single character abbreviation for a delta status code.","comments":"When you call `git_diff_print_compact` it prints single letter codes into\nthe output such as 'A' for added, 'D' for deleted, 'M' for modified, etc.\nIt is sometimes convenient to convert a git_delta_t value into these\nletters for your own purposes. This function does just that. By the\nway, unmodified will return a space (i.e. ' ').\n","group":"diff"},"git_diff_print_patch":{"type":"function","file":"diff.h","line":522,"lineto":525,"args":[{"name":"diff","type":"git_diff_list *","comment":"A git_diff_list generated by one of the above functions."},{"name":"cb_data","type":"void *","comment":"Reference pointer that will be passed to your callbacks."},{"name":"print_cb","type":"git_diff_data_fn","comment":"Callback function to output lines of the diff. This same function will be called for file headers, hunk headers, and diff lines. Fortunately, you can probably use various GIT_DIFF_LINE constants to determine what text you are given."}],"argline":"git_diff_list *diff,\n\tvoid *cb_data,\n\tgit_diff_data_fn print_cb","sig":"git_diff_list *::void *::git_diff_data_fn","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Iterate over a diff generating text output like \"git diff\".","comments":"This is a super easy way to generate a patch from a diff.\n\nReturning a non-zero value from the callbacks will terminate the\niteration and cause this return `GIT_EUSER`.\n","group":"diff","examples":{"diff.c":["ex/HEAD/diff.html#git_diff_print_patch-25"]}},"git_diff_num_deltas":{"type":"function","file":"diff.h","line":533,"lineto":533,"args":[{"name":"diff","type":"git_diff_list *","comment":"A git_diff_list generated by one of the above functions"}],"argline":"git_diff_list *diff","sig":"git_diff_list *","return":{"type":"size_t","comment":"Count of number of deltas in the list"},"description":"Query how many diff records are there in a diff list.","comments":"","group":"diff"},"git_diff_num_deltas_of_type":{"type":"function","file":"diff.h","line":546,"lineto":548,"args":[{"name":"diff","type":"git_diff_list *","comment":"A git_diff_list generated by one of the above functions"},{"name":"type","type":"git_delta_t","comment":"A git_delta_t value to filter the count"}],"argline":"git_diff_list *diff,\n\tgit_delta_t type","sig":"git_diff_list *::git_delta_t","return":{"type":"size_t","comment":"Count of number of deltas matching delta_t type"},"description":"Query how many diff deltas are there in a diff list filtered by type.","comments":"This works just like `git_diff_entrycount()` with an extra parameter\nthat is a `git_delta_t` and returns just the count of how many deltas\nmatch that particular type.\n","group":"diff"},"git_diff_get_patch":{"type":"function","file":"diff.h","line":575,"lineto":579,"args":[{"name":"patch","type":"git_diff_patch **","comment":"Output parameter for the delta patch object"},{"name":"delta","type":"const git_diff_delta **","comment":"Output parameter for the delta object"},{"name":"diff","type":"git_diff_list *","comment":"Diff list object"},{"name":"idx","type":"size_t","comment":"Index into diff list"}],"argline":"git_diff_patch **patch,\n\tconst git_diff_delta **delta,\n\tgit_diff_list *diff,\n\tsize_t idx","sig":"git_diff_patch **::const git_diff_delta **::git_diff_list *::size_t","return":{"type":"int","comment":"0 on success, other value < 0 on error"},"description":"Return the diff delta and patch for an entry in the diff list.","comments":"The `git_diff_patch` is a newly created object contains the text diffs\nfor the delta. You have to call `git_diff_patch_free()` when you are\ndone with it. You can use the patch object to loop over all the hunks\nand lines in the diff of the one delta.\n\nFor an unchanged file or a binary file, no `git_diff_patch` will be\ncreated, the output will be set to NULL, and the `binary` flag will be\nset true in the `git_diff_delta` structure.\n\nThe `git_diff_delta` pointer points to internal data and you do not have\nto release it when you are done with it. It will go away when the\n`git_diff_list` and `git_diff_patch` go away.\n\nIt is okay to pass NULL for either of the output parameters; if you pass\nNULL for the `git_diff_patch`, then the text diff will not be calculated.\n","group":"diff"},"git_diff_patch_free":{"type":"function","file":"diff.h","line":584,"lineto":585,"args":[{"name":"patch","type":"git_diff_patch *"}],"argline":"git_diff_patch *patch","sig":"git_diff_patch *","return":{"type":"void"},"description":"Free a git_diff_patch object.","comments":"","group":"diff"},"git_diff_patch_delta":{"type":"function","file":"diff.h","line":590,"lineto":591,"args":[{"name":"patch","type":"git_diff_patch *"}],"argline":"git_diff_patch *patch","sig":"git_diff_patch *","return":{"type":"const git_diff_delta *"},"description":"Get the delta associated with a patch","comments":"","group":"diff"},"git_diff_patch_num_hunks":{"type":"function","file":"diff.h","line":596,"lineto":597,"args":[{"name":"patch","type":"git_diff_patch *"}],"argline":"git_diff_patch *patch","sig":"git_diff_patch *","return":{"type":"size_t"},"description":"Get the number of hunks in a patch","comments":"","group":"diff"},"git_diff_patch_get_hunk":{"type":"function","file":"diff.h","line":615,"lineto":621,"args":[{"name":"range","type":"const git_diff_range **","comment":"Output pointer to git_diff_range of hunk"},{"name":"header","type":"const char **","comment":"Output pointer to header string for hunk. Unlike the content pointer for each line, this will be NUL-terminated"},{"name":"header_len","type":"size_t *","comment":"Output value of characters in header string"},{"name":"lines_in_hunk","type":"size_t *","comment":"Output count of total lines in this hunk"},{"name":"patch","type":"git_diff_patch *","comment":"Input pointer to patch object"},{"name":"hunk_idx","type":"size_t","comment":"Input index of hunk to get information about"}],"argline":"const git_diff_range **range,\n\tconst char **header,\n\tsize_t *header_len,\n\tsize_t *lines_in_hunk,\n\tgit_diff_patch *patch,\n\tsize_t hunk_idx","sig":"const git_diff_range **::const char **::size_t *::size_t *::git_diff_patch *::size_t","return":{"type":"int","comment":"0 on success, GIT_ENOTFOUND if hunk_idx out of range, <0 on error"},"description":"Get the information about a hunk in a patch","comments":"Given a patch and a hunk index into the patch, this returns detailed\ninformation about that hunk. Any of the output pointers can be passed\nas NULL if you don't care about that particular piece of information.\n","group":"diff"},"git_diff_patch_num_lines_in_hunk":{"type":"function","file":"diff.h","line":630,"lineto":632,"args":[{"name":"patch","type":"git_diff_patch *","comment":"The git_diff_patch object"},{"name":"hunk_idx","type":"size_t","comment":"Index of the hunk"}],"argline":"git_diff_patch *patch,\n\tsize_t hunk_idx","sig":"git_diff_patch *::size_t","return":{"type":"int","comment":"Number of lines in hunk or -1 if invalid hunk index"},"description":"Get the number of lines in a hunk.","comments":"","group":"diff"},"git_diff_patch_get_line_in_hunk":{"type":"function","file":"diff.h","line":652,"lineto":660,"args":[{"name":"line_origin","type":"char *","comment":"A GIT_DIFF_LINE constant from above"},{"name":"content","type":"const char **","comment":"Pointer to content of diff line, not NUL-terminated"},{"name":"content_len","type":"size_t *","comment":"Number of characters in content"},{"name":"old_lineno","type":"int *","comment":"Line number in old file or -1 if line is added"},{"name":"new_lineno","type":"int *","comment":"Line number in new file or -1 if line is deleted"},{"name":"patch","type":"git_diff_patch *","comment":"The patch to look in"},{"name":"hunk_idx","type":"size_t","comment":"The index of the hunk"},{"name":"line_of_hunk","type":"size_t"}],"argline":"char *line_origin,\n\tconst char **content,\n\tsize_t *content_len,\n\tint *old_lineno,\n\tint *new_lineno,\n\tgit_diff_patch *patch,\n\tsize_t hunk_idx,\n\tsize_t line_of_hunk","sig":"char *::const char **::size_t *::int *::int *::git_diff_patch *::size_t::size_t","return":{"type":"int","comment":"0 on success, <0 on failure"},"description":"Get data about a line in a hunk of a patch.","comments":"Given a patch, a hunk index, and a line index in the hunk, this\nwill return a lot of details about that line. If you pass a hunk\nindex larger than the number of hunks or a line index larger than\nthe number of lines in the hunk, this will return -1.\n","group":"diff"},"git_diff_patch_print":{"type":"function","file":"diff.h","line":674,"lineto":677,"args":[{"name":"patch","type":"git_diff_patch *","comment":"A git_diff_patch representing changes to one file"},{"name":"cb_data","type":"void *","comment":"Reference pointer that will be passed to your callbacks."},{"name":"print_cb","type":"git_diff_data_fn","comment":"Callback function to output lines of the patch. Will be called for file headers, hunk headers, and diff lines."}],"argline":"git_diff_patch *patch,\n\tvoid *cb_data,\n\tgit_diff_data_fn print_cb","sig":"git_diff_patch *::void *::git_diff_data_fn","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Serialize the patch to text via callback.","comments":"Returning a non-zero value from the callback will terminate the iteration\nand cause this return `GIT_EUSER`.\n","group":"diff"},"git_diff_patch_to_str":{"type":"function","file":"diff.h","line":686,"lineto":688,"args":[{"name":"string","type":"char **","comment":"Allocated string; caller must free."},{"name":"patch","type":"git_diff_patch *","comment":"A git_diff_patch representing changes to one file"}],"argline":"char **string,\n\tgit_diff_patch *patch","sig":"char **::git_diff_patch *","return":{"type":"int","comment":"0 on success, <0 on failure."},"description":"Get the content of a patch as a single diff text.","comments":"","group":"diff"},"git_diff_blobs":{"type":"function","file":"diff.h","line":711,"lineto":720,"args":[{"name":"old_blob","type":"git_blob *"},{"name":"new_blob","type":"git_blob *"},{"name":"options","type":"const git_diff_options *"},{"name":"cb_data","type":"void *"},{"name":"file_cb","type":"git_diff_file_fn"},{"name":"hunk_cb","type":"git_diff_hunk_fn"},{"name":"line_cb","type":"git_diff_data_fn"}],"argline":"git_blob *old_blob,\n\tgit_blob *new_blob,\n\tconst git_diff_options *options,\n\tvoid *cb_data,\n\tgit_diff_file_fn file_cb,\n\tgit_diff_hunk_fn hunk_cb,\n\tgit_diff_data_fn line_cb","sig":"git_blob *::git_blob *::const git_diff_options *::void *::git_diff_file_fn::git_diff_hunk_fn::git_diff_data_fn","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Directly run a text diff on two blobs.","comments":"Compared to a file, a blob lacks some contextual information. As such,\nthe `git_diff_file` parameters of the callbacks will be filled\naccordingly to the following: `mode` will be set to 0, `path` will be set\nto NULL. When dealing with a NULL blob, `oid` will be set to 0.\n\nWhen at least one of the blobs being dealt with is binary, the\n`git_diff_delta` binary attribute will be set to 1 and no call to the\nhunk_cb nor line_cb will be made.\n","group":"diff"},"git_config_find_global":{"type":"function","file":"config.h","line":94,"lineto":94,"args":[{"name":"global_config_path","type":"char *","comment":"Buffer of GIT_PATH_MAX length to store the path"},{"name":"length","type":"size_t"}],"argline":"char *global_config_path, size_t length","sig":"char *::size_t","return":{"type":"int","comment":"0 if a global configuration file has been found. Its path will be stored in `buffer`."},"description":"Locate the path to the global configuration file","comments":"The user or global configuration file is usually\nlocated in `$HOME/.gitconfig`.\n\nThis method will try to guess the full path to that\nfile, if the file exists. The returned path\nmay be used on any `git_config` call to load the\nglobal configuration file.\n\nThis method will not guess the path to the xdg compatible\nconfig file (.config/git/config).\n","group":"config"},"git_config_find_xdg":{"type":"function","file":"config.h","line":111,"lineto":111,"args":[{"name":"xdg_config_path","type":"char *","comment":"Buffer of GIT_PATH_MAX length to store the path"},{"name":"length","type":"size_t"}],"argline":"char *xdg_config_path, size_t length","sig":"char *::size_t","return":{"type":"int","comment":"0 if a xdg compatible configuration file has been found. Its path will be stored in `buffer`."},"description":"Locate the path to the global xdg compatible configuration file","comments":"The xdg compatible configuration file is usually\nlocated in `$HOME/.config/git/config`.\n\nThis method will try to guess the full path to that\nfile, if the file exists. The returned path\nmay be used on any `git_config` call to load the\nxdg compatible configuration file.\n","group":"config"},"git_config_find_system":{"type":"function","file":"config.h","line":123,"lineto":123,"args":[{"name":"system_config_path","type":"char *","comment":"Buffer of GIT_PATH_MAX length to store the path"},{"name":"length","type":"size_t"}],"argline":"char *system_config_path, size_t length","sig":"char *::size_t","return":{"type":"int","comment":"0 if a system configuration file has been found. Its path will be stored in `buffer`."},"description":"Locate the path to the system configuration file","comments":"If /etc/gitconfig doesn't exist, it will look for\n%PROGRAMFILES%\\Git\\etc\\gitconfig.\n","group":"config"},"git_config_open_default":{"type":"function","file":"config.h","line":135,"lineto":135,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the config instance"}],"argline":"git_config **out","sig":"git_config **","return":{"type":"int","comment":"0 or an error code"},"description":"Open the global, XDG and system configuration files","comments":"Utility wrapper that finds the global, XDG and system configuration files\nand opens them into a single prioritized config object that can be\nused when accessing default config data outside a repository.\n","group":"config"},"git_config_file__ondisk":{"type":"function","file":"config.h","line":148,"lineto":148,"args":[{"name":"out","type":"struct git_config_file **","comment":"the new backend"},{"name":"path","type":"const char *","comment":"where the config file is located"}],"argline":"struct git_config_file **out, const char *path","sig":"struct git_config_file **::const char *","return":{"type":"int"},"description":"Create a configuration file backend for ondisk files","comments":"These are the normal `.gitconfig` files that Core Git\nprocesses. Note that you first have to add this file to a\nconfiguration object before you can query it for configuration\nvariables.\n","group":"config"},"git_config_new":{"type":"function","file":"config.h","line":159,"lineto":159,"args":[{"name":"out","type":"git_config **","comment":"pointer to the new configuration"}],"argline":"git_config **out","sig":"git_config **","return":{"type":"int","comment":"0 or an error code"},"description":"Allocate a new configuration object","comments":"This object is empty, so you have to add a file to it before you\ncan do anything with it.\n","group":"config"},"git_config_add_file":{"type":"function","file":"config.h","line":179,"lineto":183,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to add the file to"},{"name":"file","type":"git_config_file *","comment":"the configuration file (backend) to add"},{"name":"level","type":"unsigned int","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"if a config file already exists for the given priority level, replace it"}],"argline":"git_config *cfg,\n\tgit_config_file *file,\n\tunsigned int level,\n\tint force","sig":"git_config *::git_config_file *::unsigned int::int","return":{"type":"int","comment":"0 on success, GIT_EEXISTS when adding more than one file for a given priority level (and force_replace set to 0), or error code"},"description":"Add a generic config file instance to an existing config","comments":"Note that the configuration object will free the file\nautomatically.\n\nFurther queries on this config object will access each\nof the config file instances in order (instances with\na higher priority level will be accessed first).\n","group":"config"},"git_config_add_file_ondisk":{"type":"function","file":"config.h","line":207,"lineto":211,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to add the file to"},{"name":"path","type":"const char *","comment":"path to the configuration file (backend) to add"},{"name":"level","type":"unsigned int","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"if a config file already exists for the given priority level, replace it"}],"argline":"git_config *cfg,\n\tconst char *path,\n\tunsigned int level,\n\tint force","sig":"git_config *::const char *::unsigned int::int","return":{"type":"int","comment":"0 on success, GIT_EEXISTS when adding more than one file for a given priority level (and force_replace set to 0), or error code"},"description":"Add an on-disk config file instance to an existing config","comments":"The on-disk file pointed at by `path` will be opened and\nparsed; it's expected to be a native Git config file following\nthe default Git config syntax (see man git-config).\n\nNote that the configuration object will free the file\nautomatically.\n\nFurther queries on this config object will access each\nof the config file instances in order (instances with\na higher priority level will be accessed first).\n","group":"config"},"git_config_open_ondisk":{"type":"function","file":"config.h","line":226,"lineto":226,"args":[{"name":"cfg","type":"git_config **","comment":"The configuration instance to create"},{"name":"path","type":"const char *","comment":"Path to the on-disk file to open"}],"argline":"git_config **cfg, const char *path","sig":"git_config **::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Create a new config instance containing a single on-disk file","comments":"This method is a simple utility wrapper for the following sequence\nof calls:\n- git_config_new\n- git_config_add_file_ondisk\n","group":"config","examples":{"general.c":["ex/HEAD/general.html#git_config_open_ondisk-56"]}},"git_config_open_level":{"type":"function","file":"config.h","line":241,"lineto":244,"args":[{"name":"cfg_out","type":"git_config **"},{"name":"cfg_parent","type":"git_config *"},{"name":"level","type":"unsigned int"}],"argline":"git_config **cfg_out,\n git_config *cfg_parent,\n unsigned int level","sig":"git_config **::git_config *::unsigned int","return":{"type":"int","comment":"0, GIT_ENOTFOUND if the passed level cannot be found in the multi-level parent config, or an error code"},"description":"Build a single-level focused config object from a multi-level one.","comments":"The returned config object can be used to perform get/set/delete operations\non a single specific level.\n\nGetting several times the same level from the same parent multi-level config\nwill return different config instances, but containing the same config_file\ninstance.\n","group":"config"},"git_config_refresh":{"type":"function","file":"config.h","line":257,"lineto":257,"args":[{"name":"cfg","type":"git_config *","comment":"The configuration to refresh"}],"argline":"git_config *cfg","sig":"git_config *","return":{"type":"int","comment":"0 or an error code"},"description":"Reload changed config files","comments":"A config file may be changed on disk out from under the in-memory\nconfig object. This function causes us to look for files that have\nbeen modified since we last loaded them and refresh the config with\nthe latest information.\n","group":"config"},"git_config_free":{"type":"function","file":"config.h","line":264,"lineto":264,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to free"}],"argline":"git_config *cfg","sig":"git_config *","return":{"type":"void"},"description":"Free the configuration and its associated memory and files","comments":"","group":"config"},"git_config_get_config_entry":{"type":"function","file":"config.h","line":277,"lineto":277,"args":[{"name":"out","type":"const git_config_entry **","comment":"pointer to the variable git_config_entry"},{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"const git_config_entry **out, git_config *cfg, const char *name","sig":"const git_config_entry **::git_config *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the git_config_entry of a config variable.","comments":"The git_config_entry is owned by the config and should not be freed by the\nuser.\n","group":"config"},"git_config_get_int32":{"type":"function","file":"config.h","line":291,"lineto":291,"args":[{"name":"out","type":"int32_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int32_t *out, git_config *cfg, const char *name","sig":"int32_t *::git_config *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the value of an integer config variable.","comments":"All config files will be looked into, in the order of their\ndefined level. A higher level means a higher priority. The\nfirst occurence of the variable will be returned here.\n","group":"config","examples":{"general.c":["ex/HEAD/general.html#git_config_get_int32-57"]}},"git_config_get_int64":{"type":"function","file":"config.h","line":305,"lineto":305,"args":[{"name":"out","type":"int64_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int64_t *out, git_config *cfg, const char *name","sig":"int64_t *::git_config *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the value of a long integer config variable.","comments":"All config files will be looked into, in the order of their\ndefined level. A higher level means a higher priority. The\nfirst occurence of the variable will be returned here.\n","group":"config"},"git_config_get_bool":{"type":"function","file":"config.h","line":322,"lineto":322,"args":[{"name":"out","type":"int *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int *out, git_config *cfg, const char *name","sig":"int *::git_config *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the value of a boolean config variable.","comments":"This function uses the usual C convention of 0 being false and\nanything else true.\n\nAll config files will be looked into, in the order of their\ndefined level. A higher level means a higher priority. The\nfirst occurence of the variable will be returned here.\n","group":"config"},"git_config_get_string":{"type":"function","file":"config.h","line":339,"lineto":339,"args":[{"name":"out","type":"const char **","comment":"pointer to the variable's value"},{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"const char **out, git_config *cfg, const char *name","sig":"const char **::git_config *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the value of a string config variable.","comments":"The string is owned by the variable and should not be freed by the\nuser.\n\nAll config files will be looked into, in the order of their\ndefined level. A higher level means a higher priority. The\nfirst occurence of the variable will be returned here.\n","group":"config","examples":{"general.c":["ex/HEAD/general.html#git_config_get_string-58"]}},"git_config_get_multivar":{"type":"function","file":"config.h","line":353,"lineto":353,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"regular expression to filter which variables we're interested in. Use NULL to indicate all"},{"name":"fn","type":"int (*)(const git_config_entry *, void *)","comment":"the function to be called on each value of the variable"},{"name":"data","type":"void *","comment":"opaque pointer to pass to the callback"}],"argline":"git_config *cfg, const char *name, const char *regexp, int (*fn)(const git_config_entry *, void *), void *data","sig":"git_config *::const char *::const char *::int (*)(const git_config_entry *, void *)::void *","return":{"type":"int"},"description":"Get each value of a multivar.","comments":"The callback will be called on each variable found\n","group":"config"},"git_config_set_int32":{"type":"function","file":"config.h","line":364,"lineto":364,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int32_t","comment":"Integer value for the variable"}],"argline":"git_config *cfg, const char *name, int32_t value","sig":"git_config *::const char *::int32_t","return":{"type":"int","comment":"0 or an error code"},"description":"Set the value of an integer config variable in the config file\nwith the highest level (usually the local one).","comments":"","group":"config"},"git_config_set_int64":{"type":"function","file":"config.h","line":375,"lineto":375,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int64_t","comment":"Long integer value for the variable"}],"argline":"git_config *cfg, const char *name, int64_t value","sig":"git_config *::const char *::int64_t","return":{"type":"int","comment":"0 or an error code"},"description":"Set the value of a long integer config variable in the config file\nwith the highest level (usually the local one).","comments":"","group":"config"},"git_config_set_bool":{"type":"function","file":"config.h","line":386,"lineto":386,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"int","comment":"the value to store"}],"argline":"git_config *cfg, const char *name, int value","sig":"git_config *::const char *::int","return":{"type":"int","comment":"0 or an error code"},"description":"Set the value of a boolean config variable in the config file\nwith the highest level (usually the local one).","comments":"","group":"config"},"git_config_set_string":{"type":"function","file":"config.h","line":400,"lineto":400,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"value","type":"const char *","comment":"the string to store."}],"argline":"git_config *cfg, const char *name, const char *value","sig":"git_config *::const char *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Set the value of a string config variable in the config file\nwith the highest level (usually the local one).","comments":"A copy of the string is made and the user is free to use it\nafterwards.\n","group":"config"},"git_config_set_multivar":{"type":"function","file":"config.h","line":410,"lineto":410,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"a regular expression to indicate which values to replace"},{"name":"value","type":"const char *","comment":"the new value."}],"argline":"git_config *cfg, const char *name, const char *regexp, const char *value","sig":"git_config *::const char *::const char *::const char *","return":{"type":"int"},"description":"Set a multivar in the local config file.","comments":"","group":"config"},"git_config_delete":{"type":"function","file":"config.h","line":419,"lineto":419,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration"},{"name":"name","type":"const char *","comment":"the variable to delete"}],"argline":"git_config *cfg, const char *name","sig":"git_config *::const char *","return":{"type":"int"},"description":"Delete a config variable from the config file\nwith the highest level (usually the local one).","comments":"","group":"config"},"git_config_foreach":{"type":"function","file":"config.h","line":434,"lineto":437,"args":[{"name":"cfg","type":"git_config *","comment":"where to get the variables from"},{"name":"callback","type":"int (*)(const git_config_entry *, void *payload)","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"git_config *cfg,\n\tint (*callback)(const git_config_entry *, void *payload),\n\tvoid *payload","sig":"git_config *::int (*)(const git_config_entry *, void *payload)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Perform an operation on each config variable.","comments":"The callback receives the normalized name and value of each variable\nin the config backend, and the data pointer passed to this function.\nAs soon as one of the callback functions returns something other than 0,\nthis function stops iterating and returns `GIT_EUSER`.\n","group":"config"},"git_config_foreach_match":{"type":"function","file":"config.h","line":452,"lineto":456,"args":[{"name":"cfg","type":"git_config *","comment":"where to get the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match against config names"},{"name":"callback","type":"int (*)(const git_config_entry *entry, void *payload)","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"git_config *cfg,\n\tconst char *regexp,\n\tint (*callback)(const git_config_entry *entry, void *payload),\n\tvoid *payload","sig":"git_config *::const char *::int (*)(const git_config_entry *entry, void *payload)::void *","return":{"type":"int","comment":"0 or the return value of the callback which didn't return 0"},"description":"Perform an operation on each config variable matching a regular expression.","comments":"This behaviors like `git_config_foreach` with an additional filter of a\nregular expression that filters which config keys are passed to the\ncallback.\n","group":"config"},"git_config_get_mapped":{"type":"function","file":"config.h","line":492,"lineto":492,"args":[{"name":"out","type":"int *","comment":"place to store the result of the mapping"},{"name":"cfg","type":"git_config *","comment":"config file to get the variables from"},{"name":"name","type":"const char *","comment":"name of the config variable to lookup"},{"name":"maps","type":"git_cvar_map *","comment":"array of `git_cvar_map` objects specifying the possible mappings"},{"name":"map_n","type":"size_t","comment":"number of mapping objects in `maps`"}],"argline":"int *out, git_config *cfg, const char *name, git_cvar_map *maps, size_t map_n","sig":"int *::git_config *::const char *::git_cvar_map *::size_t","return":{"type":"int","comment":"0 on success, error code otherwise"},"description":"Query the value of a config variable and return it mapped to\nan integer constant.","comments":"This is a helper method to easily map different possible values\nto a variable to integer constants that easily identify them.\n\nA mapping array looks as follows:\n\ngit_cvar_map autocrlf_mapping[] = {\n\t{GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},\n\t{GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},\n\t{GIT_CVAR_STRING, \"input\", GIT_AUTO_CRLF_INPUT},\n\t{GIT_CVAR_STRING, \"default\", GIT_AUTO_CRLF_DEFAULT}};\n\nOn any \"false\" value for the variable (e.g. \"false\", \"FALSE\", \"no\"), the\nmapping will store `GIT_AUTO_CRLF_FALSE` in the `out` parameter.\n\nThe same thing applies for any \"true\" value such as \"true\", \"yes\" or \"1\", storing\nthe `GIT_AUTO_CRLF_TRUE` variable.\n\nOtherwise, if the value matches the string \"input\" (with case insensitive comparison),\nthe given constant will be stored in `out`, and likewise for \"default\".\n\nIf not a single match can be made to store in `out`, an error code will be\nreturned.\n","group":"config"},"git_config_lookup_map_value":{"type":"function","file":"config.h","line":502,"lineto":506,"args":[{"name":"out","type":"int *","comment":"place to store the result of the parsing"},{"name":"maps","type":"git_cvar_map *","comment":"array of `git_cvar_map` objects specifying the possible mappings"},{"name":"map_n","type":"size_t","comment":"number of mapping objects in `maps`"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int *out,\n\tgit_cvar_map *maps,\n\tsize_t map_n,\n\tconst char *value","sig":"int *::git_cvar_map *::size_t::const char *","return":{"type":"int"},"description":"Maps a string value to an integer constant","comments":"","group":"config"},"git_config_parse_bool":{"type":"function","file":"config.h","line":518,"lineto":518,"args":[{"name":"out","type":"int *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int *out, const char *value","sig":"int *::const char *","return":{"type":"int"},"description":"Parse a string value as a bool.","comments":"Valid values for true are: 'true', 'yes', 'on', 1 or any\n number different from 0\nValid values for false are: 'false', 'no', 'off', 0\n","group":"config"},"git_config_parse_int64":{"type":"function","file":"config.h","line":530,"lineto":530,"args":[{"name":"out","type":"int64_t *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int64_t *out, const char *value","sig":"int64_t *::const char *","return":{"type":"int"},"description":"Parse a string value as an int64.","comments":"An optional value suffix of 'k', 'm', or 'g' will\ncause the value to be multiplied by 1024, 1048576,\nor 1073741824 prior to output.\n","group":"config"},"git_config_parse_int32":{"type":"function","file":"config.h","line":542,"lineto":542,"args":[{"name":"out","type":"int32_t *","comment":"place to store the result of the parsing"},{"name":"value","type":"const char *","comment":"value to parse"}],"argline":"int32_t *out, const char *value","sig":"int32_t *::const char *","return":{"type":"int"},"description":"Parse a string value as an int32.","comments":"An optional value suffix of 'k', 'm', or 'g' will\ncause the value to be multiplied by 1024, 1048576,\nor 1073741824 prior to output.\n","group":"config"},"git_libgit2_version":{"type":"function","file":"common.h","line":96,"lineto":96,"args":[{"name":"major","type":"int *","comment":"Store the major version number"},{"name":"minor","type":"int *","comment":"Store the minor version number"},{"name":"rev","type":"int *","comment":"Store the revision (patch) number"}],"argline":"int *major, int *minor, int *rev","sig":"int *::int *::int *","return":{"type":"void"},"description":"Return the version of the libgit2 library\nbeing currently used.","comments":"","group":"libgit2"},"git_libgit2_capabilities":{"type":"function","file":"common.h","line":119,"lineto":119,"args":[],"argline":"void","sig":"","return":{"type":"int","comment":"A combination of GIT_CAP_* values. - GIT_CAP_THREADS Libgit2 was compiled with thread support. Note that thread support is still to be seen as a 'work in progress'. - GIT_CAP_HTTPS Libgit2 supports the https:// protocol. This requires the open ssl library to be found when compiling libgit2."},"description":"Query compile time options for libgit2.","comments":"","group":"libgit2"},"git_commit_lookup":{"type":"function","file":"commit.h","line":33,"lineto":36,"args":[{"name":"commit","type":"git_commit **","comment":"pointer to the looked up commit"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the commit."},{"name":"id","type":"const git_oid *","comment":"identity of the commit to locate. If the object is an annotated tag it will be peeled back to the commit."}],"argline":"git_commit **commit, git_repository *repo, const git_oid *id","sig":"git_commit **::git_repository *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a commit object from a repository.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_lookup-59","ex/HEAD/general.html#git_commit_lookup-60","ex/HEAD/general.html#git_commit_lookup-61"]}},"git_commit_lookup_prefix":{"type":"function","file":"commit.h","line":51,"lineto":54,"args":[{"name":"commit","type":"git_commit **","comment":"pointer to the looked up commit"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the commit."},{"name":"id","type":"const git_oid *","comment":"identity of the commit to locate. If the object is an annotated tag it will be peeled back to the commit."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_commit **commit, git_repository *repo, const git_oid *id, size_t len","sig":"git_commit **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a commit object from a repository,\ngiven a prefix of its identifier (short id).","comments":"@see git_object_lookup_prefix\n","group":"commit"},"git_commit_free":{"type":"function","file":"commit.h","line":67,"lineto":70,"args":[{"name":"commit","type":"git_commit *","comment":"the commit to close"}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"void"},"description":"Close an open commit","comments":"This is a wrapper around git_object_free()\n\nIMPORTANT:\nIt *is* necessary to call this method when you stop\nusing a commit. Failure to do so will cause a memory leak.\n","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_free-62","ex/HEAD/general.html#git_commit_free-63","ex/HEAD/general.html#git_commit_free-64","ex/HEAD/general.html#git_commit_free-65"]}},"git_commit_id":{"type":"function","file":"commit.h","line":79,"lineto":79,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const git_oid *","comment":"object identity for the commit."},"description":"Get the id of a commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_id-66"]}},"git_commit_message_encoding":{"type":"function","file":"commit.h","line":91,"lineto":91,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const char *","comment":"NULL, or the encoding"},"description":"Get the encoding for the message of a commit,\nas a string representing a standard encoding name.","comments":"The encoding may be NULL if the `encoding` header\nin the commit is missing; in that case UTF-8 is assumed.\n","group":"commit"},"git_commit_message":{"type":"function","file":"commit.h","line":99,"lineto":99,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const char *","comment":"the message of a commit"},"description":"Get the full message of a commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_message-67","ex/HEAD/general.html#git_commit_message-68"]}},"git_commit_time":{"type":"function","file":"commit.h","line":107,"lineto":107,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"git_time_t","comment":"the time of a commit"},"description":"Get the commit time (i.e. committer time) of a commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_time-69","ex/HEAD/general.html#git_commit_time-70"]}},"git_commit_time_offset":{"type":"function","file":"commit.h","line":115,"lineto":115,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"int","comment":"positive or negative timezone offset, in minutes from UTC"},"description":"Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.","comments":"","group":"commit"},"git_commit_committer":{"type":"function","file":"commit.h","line":123,"lineto":123,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const git_signature *","comment":"the committer of a commit"},"description":"Get the committer of a commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_committer-71"]}},"git_commit_author":{"type":"function","file":"commit.h","line":131,"lineto":131,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const git_signature *","comment":"the author of a commit"},"description":"Get the author of a commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_author-72","ex/HEAD/general.html#git_commit_author-73"]}},"git_commit_tree":{"type":"function","file":"commit.h","line":140,"lineto":140,"args":[{"name":"tree_out","type":"git_tree **","comment":"pointer where to store the tree object"},{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_tree **tree_out, git_commit *commit","sig":"git_tree **::git_commit *","return":{"type":"int","comment":"0 or an error code"},"description":"Get the tree pointed to by a commit.","comments":"","group":"commit","examples":{"diff.c":["ex/HEAD/diff.html#git_commit_tree-26"]}},"git_commit_tree_oid":{"type":"function","file":"commit.h","line":150,"lineto":150,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const git_oid *","comment":"the id of tree pointed to by commit."},"description":"Get the id of the tree pointed to by a commit. This differs from\n`git_commit_tree` in that no attempts are made to fetch an object\nfrom the ODB.","comments":"","group":"commit"},"git_commit_parentcount":{"type":"function","file":"commit.h","line":158,"lineto":158,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"unsigned int","comment":"integer of count of parents"},"description":"Get the number of parents of this commit","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_parentcount-74"]}},"git_commit_parent":{"type":"function","file":"commit.h","line":168,"lineto":168,"args":[{"name":"parent","type":"git_commit **","comment":"Pointer where to store the parent commit"},{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the position of the parent (from 0 to `parentcount`)"}],"argline":"git_commit **parent, git_commit *commit, unsigned int n","sig":"git_commit **::git_commit *::unsigned int","return":{"type":"int","comment":"0 or an error code"},"description":"Get the specified parent of the commit.","comments":"","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_parent-75"]}},"git_commit_parent_oid":{"type":"function","file":"commit.h","line":179,"lineto":179,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the position of the parent (from 0 to `parentcount`)"}],"argline":"git_commit *commit, unsigned int n","sig":"git_commit *::unsigned int","return":{"type":"const git_oid *","comment":"the id of the parent, NULL on error."},"description":"Get the oid of a specified parent for a commit. This is different from\n`git_commit_parent`, which will attempt to load the parent commit from\nthe ODB.","comments":"","group":"commit"},"git_commit_nth_gen_ancestor":{"type":"function","file":"commit.h","line":195,"lineto":198,"args":[{"name":"ancestor","type":"git_commit **","comment":"Pointer where to store the ancestor commit"},{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the requested generation"}],"argline":"git_commit **ancestor,\n\tconst git_commit *commit,\n\tunsigned int n","sig":"git_commit **::const git_commit *::unsigned int","return":{"type":"int","comment":"0 on success; GIT_ENOTFOUND if no matching ancestor exists or an error code"},"description":"Get the commit object that is the <n>th generation ancestor\nof the named commit object, following only the first parents.\nThe returned commit has to be freed by the caller.","comments":"Passing `0` as the generation number returns another instance of the\nbase commit itself.\n","group":"commit"},"git_commit_create":{"type":"function","file":"commit.h","line":247,"lineto":257,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the newly created commit"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the commit"},{"name":"update_ref","type":"const char *","comment":"If not NULL, name of the reference that will be updated to point to this commit. If the reference is not direct, it will be resolved to a direct reference. Use \"HEAD\" to update the HEAD of the current branch and make it point to this commit. If the reference doesn't exist yet, it will be created."},{"name":"author","type":"const git_signature *","comment":"Signature representing the author and the authory time of this commit"},{"name":"committer","type":"const git_signature *","comment":"Signature representing the committer and the commit time of this commit"},{"name":"message_encoding","type":"const char *","comment":"The encoding for the message in the commit, represented with a standard encoding name. E.g. \"UTF-8\". If NULL, no encoding header is written and UTF-8 is assumed."},{"name":"message","type":"const char *","comment":"_encoding The encoding for the message in the commit, represented with a standard encoding name. E.g. \"UTF-8\". If NULL, no encoding header is written and UTF-8 is assumed."},{"name":"tree","type":"const git_tree *","comment":"An instance of a `git_tree` object that will be used as the tree for the commit. This tree object must also be owned by the given `repo`."},{"name":"parent_count","type":"int","comment":"Number of parents for this commit"}],"argline":"git_oid *oid,\n\t\tgit_repository *repo,\n\t\tconst char *update_ref,\n\t\tconst git_signature *author,\n\t\tconst git_signature *committer,\n\t\tconst char *message_encoding,\n\t\tconst char *message,\n\t\tconst git_tree *tree,\n\t\tint parent_count,\n\t\tconst git_commit *parents[]","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::int","return":{"type":"int","comment":"0 or an error code The created commit will be written to the Object Database and the given reference will be updated to point to it"},"description":"Create a new commit in the repository using `git_object`\ninstances as parameters.","comments":"The message will not be cleaned up. This can be achieved\nthrough `git_message_prettify()`.\n","group":"commit"},"git_commit_create_v":{"type":"function","file":"commit.h","line":275,"lineto":285,"args":[{"name":"oid","type":"git_oid *"},{"name":"repo","type":"git_repository *"},{"name":"update_ref","type":"const char *"},{"name":"author","type":"const git_signature *"},{"name":"committer","type":"const git_signature *"},{"name":"message_encoding","type":"const char *"},{"name":"message","type":"const char *"},{"name":"tree","type":"const git_tree *"},{"name":"parent_count","type":"int"}],"argline":"git_oid *oid,\n\t\tgit_repository *repo,\n\t\tconst char *update_ref,\n\t\tconst git_signature *author,\n\t\tconst git_signature *committer,\n\t\tconst char *message_encoding,\n\t\tconst char *message,\n\t\tconst git_tree *tree,\n\t\tint parent_count,\n\t\t...","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::int","return":{"type":"int"},"description":"Create a new commit in the repository using a variable\nargument list.","comments":"The message will be cleaned up from excess whitespace\nit will be made sure that the last line ends with a '\\n'.\n\nThe parents for the commit are specified as a variable\nlist of pointers to `const git_commit *`. Note that this\nis a convenience method which may not be safe to export\nfor certain languages or compilers\n\nAll other parameters remain the same\n\n@see git_commit_create","group":"commit","examples":{"general.c":["ex/HEAD/general.html#git_commit_create_v-76"]}},"git_clone":{"type":"function","file":"clone.h","line":41,"lineto":47,"args":[{"name":"out","type":"git_repository **","comment":"pointer that will receive the resulting repository object"},{"name":"origin_url","type":"const char *","comment":"repository to clone from"},{"name":"workdir_path","type":"const char *","comment":"local directory to clone to"},{"name":"fetch_progress_cb","type":"git_transfer_progress_callback","comment":"optional callback for fetch progress. Be aware that this is called inline with network and indexing operations, so performance may be affected."},{"name":"fetch_progress_payload","type":"void *","comment":"payload for fetch_progress_cb"},{"name":"checkout_opts","type":"git_checkout_opts *","comment":"options for the checkout step. If NULL, no checkout is performed"}],"argline":"git_repository **out,\n\t\tconst char *origin_url,\n\t\tconst char *workdir_path,\n\t\tgit_transfer_progress_callback fetch_progress_cb,\n\t\tvoid *fetch_progress_payload,\n\t\tgit_checkout_opts *checkout_opts","sig":"git_repository **::const char *::const char *::git_transfer_progress_callback::void *::git_checkout_opts *","return":{"type":"int","comment":"0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)"},"description":"Clone a remote repository, and checkout the branch pointed to by the remote\nHEAD.","comments":"","group":"clone","examples":{"network/clone.c":["ex/HEAD/clone.html#git_clone-3"]}},"git_clone_bare":{"type":"function","file":"clone.h","line":61,"lineto":66,"args":[{"name":"out","type":"git_repository **","comment":"pointer that will receive the resulting repository object"},{"name":"origin_url","type":"const char *","comment":"repository to clone from"},{"name":"dest_path","type":"const char *","comment":"local directory to clone to"},{"name":"fetch_progress_cb","type":"git_transfer_progress_callback","comment":"optional callback for fetch progress. Be aware that this is called inline with network and indexing operations, so performance may be affected."},{"name":"fetch_progress_payload","type":"void *","comment":"payload for fetch_progress_cb"}],"argline":"git_repository **out,\n\t\tconst char *origin_url,\n\t\tconst char *dest_path,\n\t\tgit_transfer_progress_callback fetch_progress_cb,\n\t\tvoid *fetch_progress_payload","sig":"git_repository **::const char *::const char *::git_transfer_progress_callback::void *","return":{"type":"int","comment":"0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)"},"description":"Create a bare clone of a remote repository.","comments":"","group":"clone"},"git_checkout_head":{"type":"function","file":"checkout.h","line":94,"lineto":96,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"opts","type":"git_checkout_opts *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo,\n\tgit_checkout_opts *opts","sig":"git_repository *::git_checkout_opts *","return":{"type":"int","comment":"0 on success, GIT_EORPHANEDHEAD when HEAD points to a non existing branch, GIT_ERROR otherwise (use giterr_last for information about the error)"},"description":"Updates files in the index and the working tree to match the content of the\ncommit pointed at by HEAD.","comments":"","group":"checkout"},"git_checkout_index":{"type":"function","file":"checkout.h","line":106,"lineto":108,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"opts","type":"git_checkout_opts *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo,\n\tgit_checkout_opts *opts","sig":"git_repository *::git_checkout_opts *","return":{"type":"int","comment":"0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)"},"description":"Updates files in the working tree to match the content of the index.","comments":"","group":"checkout"},"git_checkout_tree":{"type":"function","file":"checkout.h","line":121,"lineto":124,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"treeish","type":"git_object *","comment":"a commit, tag or tree which content will be used to update the working directory"},{"name":"opts","type":"git_checkout_opts *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo,\n\tgit_object *treeish,\n\tgit_checkout_opts *opts","sig":"git_repository *::git_object *::git_checkout_opts *","return":{"type":"int","comment":"0 on success, GIT_ERROR otherwise (use giterr_last for information about the error)"},"description":"Updates files in the index and working tree to match the content of the\ntree pointed at by the treeish.","comments":"","group":"checkout"},"git_branch_create":{"type":"function","file":"branch.h","line":49,"lineto":54,"args":[{"name":"branch_out","type":"git_reference **","comment":"Pointer where to store the underlying reference."},{"name":"repo","type":"git_repository *"},{"name":"branch_name","type":"const char *","comment":"Name for the branch; this name is validated for consistency. It should also not conflict with an already existing branch name."},{"name":"target","type":"const git_object *","comment":"Object to which this branch should point. This object must belong to the given `repo` and can either be a git_commit or a git_tag. When a git_tag is being passed, it should be dereferencable to a git_commit which oid will be used as the target of the branch."},{"name":"force","type":"int","comment":"Overwrite existing branch."}],"argline":"git_reference **branch_out,\n\t\tgit_repository *repo,\n\t\tconst char *branch_name,\n\t\tconst git_object *target,\n\t\tint force","sig":"git_reference **::git_repository *::const char *::const git_object *::int","return":{"type":"int","comment":"0 or an error code. A proper reference is written in the refs/heads namespace pointing to the provided target commit."},"description":"Create a new branch pointing at a target commit","comments":"A new direct reference will be created pointing to\nthis target commit. If `force` is true and a reference\nalready exists with the given name, it'll be replaced.\n\nThe returned reference must be freed by the user.\n","group":"branch"},"git_branch_delete":{"type":"function","file":"branch.h","line":65,"lineto":65,"args":[{"name":"branch","type":"git_reference *","comment":"A valid reference representing a branch"}],"argline":"git_reference *branch","sig":"git_reference *","return":{"type":"int","comment":"0 on success, or an error code."},"description":"Delete an existing branch reference.","comments":"If the branch is successfully deleted, the passed reference\nobject will be freed and invalidated.\n","group":"branch"},"git_branch_foreach":{"type":"function","file":"branch.h","line":84,"lineto":92,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the branches."},{"name":"list_flags","type":"unsigned int","comment":"Filtering flags for the branch listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE or a combination of the two."},{"name":"branch_cb","type":"int (*)(\n\t\t\tconst char *branch_name,\n\t\t\tgit_branch_t branch_type,\n\t\t\tvoid *payload)","comment":"Callback to invoke per found branch."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo,\n\t\tunsigned int list_flags,\n\t\tint (*branch_cb)(\n\t\t\tconst char *branch_name,\n\t\t\tgit_branch_t branch_type,\n\t\t\tvoid *payload),\n\t\tvoid *payload","sig":"git_repository *::unsigned int::int (*)(\n\t\t\tconst char *branch_name,\n\t\t\tgit_branch_t branch_type,\n\t\t\tvoid *payload)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Loop over all the branches and issue a callback for each one.","comments":"If the callback returns a non-zero value, this will stop looping.\n","group":"branch"},"git_branch_move":{"type":"function","file":"branch.h","line":106,"lineto":109,"args":[{"name":"branch","type":"git_reference *","comment":"Current underlying reference of the branch."},{"name":"new_branch_name","type":"const char *","comment":"Target name of the branch once the move is performed; this name is validated for consistency."},{"name":"force","type":"int","comment":"Overwrite existing branch."}],"argline":"git_reference *branch,\n\t\tconst char *new_branch_name,\n\t\tint force","sig":"git_reference *::const char *::int","return":{"type":"int","comment":"0 on success, or an error code."},"description":"Move/rename an existing local branch reference.","comments":"","group":"branch"},"git_branch_lookup":{"type":"function","file":"branch.h","line":129,"lineto":133,"args":[{"name":"branch_out","type":"git_reference **","comment":"pointer to the looked-up branch reference"},{"name":"repo","type":"git_repository *","comment":"the repository to look up the branch"},{"name":"branch_name","type":"const char *","comment":"Name of the branch to be looked-up; this name is validated for consistency."},{"name":"branch_type","type":"git_branch_t","comment":"Type of the considered branch. This should be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE."}],"argline":"git_reference **branch_out,\n\t\tgit_repository *repo,\n\t\tconst char *branch_name,\n\t\tgit_branch_t branch_type","sig":"git_reference **::git_repository *::const char *::git_branch_t","return":{"type":"int","comment":"0 on success; GIT_ENOTFOUND when no matching branch exists, otherwise an error code."},"description":"Lookup a branch by its name in a repository.","comments":"The generated reference must be freed by the user.\n","group":"branch"},"git_branch_tracking":{"type":"function","file":"branch.h","line":147,"lineto":149,"args":[{"name":"tracking_out","type":"git_reference **","comment":"Pointer where to store the retrieved reference."},{"name":"branch","type":"git_reference *","comment":"Current underlying reference of the branch."}],"argline":"git_reference **tracking_out,\n\t\tgit_reference *branch","sig":"git_reference **::git_reference *","return":{"type":"int","comment":"0 on success; GIT_ENOTFOUND when no remote tracking reference exists, otherwise an error code."},"description":"Return the reference supporting the remote tracking branch,\ngiven a local branch reference.","comments":"","group":"branch"},"git_branch_is_head":{"type":"function","file":"branch.h","line":159,"lineto":160,"args":[{"name":"branch","type":"git_reference *","comment":"Current underlying reference of the branch."}],"argline":"git_reference *branch","sig":"git_reference *","return":{"type":"int","comment":"1 if HEAD points at the branch, 0 if it isn't, error code otherwise."},"description":"Determine if the current local branch is pointed at by HEAD.","comments":"","group":"branch"},"git_blob_lookup":{"type":"function","file":"blob.h","line":32,"lineto":35,"args":[{"name":"blob","type":"git_blob **","comment":"pointer to the looked up blob"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the blob."},{"name":"id","type":"const git_oid *","comment":"identity of the blob to locate."}],"argline":"git_blob **blob, git_repository *repo, const git_oid *id","sig":"git_blob **::git_repository *::const git_oid *","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a blob object from a repository.","comments":"","group":"blob","examples":{"general.c":["ex/HEAD/general.html#git_blob_lookup-77"]}},"git_blob_lookup_prefix":{"type":"function","file":"blob.h","line":49,"lineto":52,"args":[{"name":"blob","type":"git_blob **","comment":"pointer to the looked up blob"},{"name":"repo","type":"git_repository *","comment":"the repo to use when locating the blob."},{"name":"id","type":"const git_oid *","comment":"identity of the blob to locate."},{"name":"len","type":"size_t","comment":"the length of the short identifier"}],"argline":"git_blob **blob, git_repository *repo, const git_oid *id, size_t len","sig":"git_blob **::git_repository *::const git_oid *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Lookup a blob object from a repository,\ngiven a prefix of its identifier (short id).","comments":"@see git_object_lookup_prefix\n","group":"blob"},"git_blob_free":{"type":"function","file":"blob.h","line":65,"lineto":68,"args":[{"name":"blob","type":"git_blob *","comment":"the blob to close"}],"argline":"git_blob *blob","sig":"git_blob *","return":{"type":"void"},"description":"Close an open blob","comments":"This is a wrapper around git_object_free()\n\nIMPORTANT:\nIt *is* necessary to call this method when you stop\nusing a blob. Failure to do so will cause a memory leak.\n","group":"blob"},"git_blob_rawcontent":{"type":"function","file":"blob.h","line":83,"lineto":83,"args":[{"name":"blob","type":"git_blob *","comment":"pointer to the blob"}],"argline":"git_blob *blob","sig":"git_blob *","return":{"type":"const void *","comment":"the pointer; NULL if the blob has no contents"},"description":"Get a read-only buffer with the raw content of a blob.","comments":"A pointer to the raw content of a blob is returned;\nthis pointer is owned internally by the object and shall\nnot be free'd. The pointer may be invalidated at a later\ntime.\n","group":"blob","examples":{"general.c":["ex/HEAD/general.html#git_blob_rawcontent-78"]}},"git_blob_rawsize":{"type":"function","file":"blob.h","line":91,"lineto":91,"args":[{"name":"blob","type":"git_blob *","comment":"pointer to the blob"}],"argline":"git_blob *blob","sig":"git_blob *","return":{"type":"size_t","comment":"size on bytes"},"description":"Get the size in bytes of the contents of a blob","comments":"","group":"blob","examples":{"general.c":["ex/HEAD/general.html#git_blob_rawsize-79","ex/HEAD/general.html#git_blob_rawsize-80"]}},"git_blob_create_fromfile":{"type":"function","file":"blob.h","line":104,"lineto":104,"args":[{"name":"oid","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written. this repository cannot be bare"},{"name":"path","type":"const char *","comment":"file from which the blob will be created, relative to the repository's working dir"}],"argline":"git_oid *oid, git_repository *repo, const char *path","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Read a file from the working folder of a repository\nand write it to the Object Database as a loose blob","comments":"","group":"blob"},"git_blob_create_fromdisk":{"type":"function","file":"blob.h","line":116,"lineto":116,"args":[{"name":"oid","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written. this repository can be bare or not"},{"name":"path","type":"const char *","comment":"file from which the blob will be created"}],"argline":"git_oid *oid, git_repository *repo, const char *path","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":"0 or an error code"},"description":"Read a file from the filesystem and write its content\nto the Object Database as a loose blob","comments":"","group":"blob"},"git_blob_create_fromchunks":{"type":"function","file":"blob.h","line":154,"lineto":159,"args":[{"name":"oid","type":"git_oid *","comment":"Return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written. This repository can be bare or not."},{"name":"hintpath","type":"const char *","comment":"if not NULL, will help selecting the filters to apply onto the content of the blob to be created."},{"name":"source_cb","type":"int (*)(char *content, size_t max_length, void *payload)"},{"name":"payload","type":"void *"}],"argline":"git_oid *oid,\n\tgit_repository *repo,\n\tconst char *hintpath,\n\tint (*source_cb)(char *content, size_t max_length, void *payload),\n\tvoid *payload","sig":"git_oid *::git_repository *::const char *::int (*)(char *content, size_t max_length, void *payload)::void *","return":{"type":"int","comment":"GIT_SUCCESS or an error code"},"description":"Write a loose blob to the Object Database from a\nprovider of chunks of data.","comments":"Provided the `hintpath` parameter is filled, its value\nwill help to determine what git filters should be applied\nto the object before it can be placed to the object database.\n\n\nThe implementation of the callback has to respect the\nfollowing rules:\n\n - `content` will have to be filled by the consumer. The maximum number\nof bytes that the buffer can accept per call is defined by the\n`max_length` parameter. Allocation and freeing of the buffer will be taken\ncare of by the function.\n\n - The callback is expected to return the number of bytes\nthat `content` have been filled with.\n\n - When there is no more data to stream, the callback should\nreturn 0. This will prevent it from being invoked anymore.\n\n - When an error occurs, the callback should return -1.\n\n","group":"blob"},"git_blob_create_frombuffer":{"type":"function","file":"blob.h","line":170,"lineto":170,"args":[{"name":"oid","type":"git_oid *","comment":"return the oid of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where to blob will be written"},{"name":"buffer","type":"const void *","comment":"data to be written into the blob"},{"name":"len","type":"size_t","comment":"length of the data"}],"argline":"git_oid *oid, git_repository *repo, const void *buffer, size_t len","sig":"git_oid *::git_repository *::const void *::size_t","return":{"type":"int","comment":"0 or an error code"},"description":"Write an in-memory buffer to the ODB as a blob","comments":"","group":"blob"},"git_attr_get":{"type":"function","file":"attr.h","line":142,"lineto":147,"args":[{"name":"value_out","type":"const char **","comment":"Output of the value of the attribute. Use the GIT_ATTR_... macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just use the string value for attributes set to a value. You should NOT modify or free this value."},{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"The path to check for attributes. Relative paths are interpreted relative to the repo root. The file does not have to exist, but if it does not, then it will be treated as a plain file (not a directory)."},{"name":"name","type":"const char *","comment":"The name of the attribute to look up."}],"argline":"const char **value_out,\n git_repository *repo,\n\tuint32_t flags,\n\tconst char *path,\n\tconst char *name","sig":"const char **::git_repository *::uint32_t::const char *::const char *","return":{"type":"int"},"description":"Look up the value of one git attribute for path.","comments":"","group":"attr"},"git_attr_get_many":{"type":"function","file":"attr.h","line":178,"lineto":184,"args":[{"name":"values_out","type":"const char **"},{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"The path inside the repo to check attributes. This does not have to exist, but if it does not, then it will be treated as a plain file (i.e. not a directory)."},{"name":"num_attr","type":"size_t","comment":"The number of attributes being looked up"},{"name":"names","type":"const char **","comment":"An array of num_attr strings containing attribute names."}],"argline":"const char **values_out,\n\tgit_repository *repo,\n\tuint32_t flags,\n\tconst char *path,\n\tsize_t num_attr,\n\tconst char **names","sig":"const char **::git_repository *::uint32_t::const char *::size_t::const char **","return":{"type":"int"},"description":"Look up a list of git attributes for path.","comments":"Use this if you have a known list of attributes that you want to\nlook up in a single call. This is somewhat more efficient than\ncalling `git_attr_get()` multiple times.\n\nFor example, you might write:\n\n const char *attrs[] = { \"crlf\", \"diff\", \"foo\" };\n const char **values[3];\n git_attr_get_many(values, repo, 0, \"my/fun/file.c\", 3, attrs);\n\nThen you could loop through the 3 values to get the settings for\nthe three attributes you asked about.\n","group":"attr"},"git_attr_foreach":{"type":"function","file":"attr.h","line":203,"lineto":208,"args":[{"name":"repo","type":"git_repository *","comment":"The repository containing the path."},{"name":"flags","type":"uint32_t","comment":"A combination of GIT_ATTR_CHECK... flags."},{"name":"path","type":"const char *","comment":"Path inside the repo to check attributes. This does not have to exist, but if it does not, then it will be treated as a plain file (i.e. not a directory)."},{"name":"callback","type":"int (*)(const char *name, const char *value, void *payload)","comment":"Function to invoke on each attribute name and value. The value may be NULL is the attribute is explicitly set to UNSPECIFIED using the '!' sign. Callback will be invoked only once per attribute name, even if there are multiple rules for a given file. The highest priority rule will be used. Return a non-zero value from this to stop looping."},{"name":"payload","type":"void *","comment":"Passed on as extra parameter to callback function."}],"argline":"git_repository *repo,\n\tuint32_t flags,\n\tconst char *path,\n\tint (*callback)(const char *name, const char *value, void *payload),\n\tvoid *payload","sig":"git_repository *::uint32_t::const char *::int (*)(const char *name, const char *value, void *payload)::void *","return":{"type":"int","comment":"0 on success, GIT_EUSER on non-zero callback, or error code"},"description":"Loop over all the git attributes for a path.","comments":"","group":"attr"},"git_attr_cache_flush":{"type":"function","file":"attr.h","line":218,"lineto":219,"args":[{"name":"repo","type":"git_repository *"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void"},"description":"Flush the gitattributes cache.","comments":"Call this if you have reason to believe that the attributes files on\ndisk no longer match the cached contents of memory. This will cause\nthe attributes files to be reloaded the next time that an attribute\naccess function is called.","group":"attr"},"git_attr_add_macro":{"type":"function","file":"attr.h","line":231,"lineto":234,"args":[{"name":"repo","type":"git_repository *"},{"name":"name","type":"const char *"},{"name":"values","type":"const char *"}],"argline":"git_repository *repo,\n\tconst char *name,\n\tconst char *values","sig":"git_repository *::const char *::const char *","return":{"type":"int"},"description":"Add a macro definition.","comments":"Macros will automatically be loaded from the top level `.gitattributes`\nfile of the repository (plus the build-in \"binary\" macro). This\nfunction allows you to add others. For example, to add the default\nmacro, you would call:\n\n git_attr_add_macro(repo, \"binary\", \"-diff -crlf\");","group":"attr"}},"globals":{"GIT_SORT_NONE":{"value":"(0)","file":"revwalk.h","line":29,"comments":"Sort the repository contents in no particular ordering;\nthis sorting is arbitrary, implementation-specific\nand subject to change at any time.\nThis is the default sorting for new walkers."},"GIT_SORT_TOPOLOGICAL":{"value":"(1 << 0)","file":"revwalk.h","line":36,"comments":"Sort the repository contents in topological order\n(parents before children); this sorting mode\ncan be combined with time sorting."},"GIT_SORT_TIME":{"value":"(1 << 1)","file":"revwalk.h","line":43,"comments":"Sort the repository contents by commit time;\nthis sorting mode can be combined with\ntopological sorting."},"GIT_SORT_REVERSE":{"value":"(1 << 2)","file":"revwalk.h","line":50,"comments":"Iterate through the repository contents in reverse\norder; this sorting mode can be combined with\nany of the above."},"GIT_OID_RAWSZ":{"value":"20","file":"oid.h","line":23,"comments":"Size (in bytes) of a raw/binary oid"},"GIT_OID_HEXSZ":{"value":"(GIT_OID_RAWSZ * 2)","file":"oid.h","line":26,"comments":"Size (in bytes) of a hex formatted oid"},"GIT_OID_MINPREFIXLEN":{"value":"4","file":"oid.h","line":30,"comments":"Minimum length (in number of hex characters,\ni.e. packets of 4 bits) of an oid prefix"},"GIT_STREAM_RDONLY":{"file":"odb_backend.h","line":96,"value":"(1 << 1)","comments":"Streaming mode"},"GIT_STREAM_WRONLY":{"file":"odb_backend.h","line":97,"value":"(1 << 2)","comments":"Streaming mode"},"GIT_STREAM_RW":{"file":"odb_backend.h","line":98,"value":"(GIT_STREAM_RDONLY | GIT_STREAM_WRONLY)","comments":"Streaming mode"},"GIT_INDEXCAP_IGNORE_CASE":{"file":"index.h","line":96,"value":"1","comments":"Capabilities of system that affect index actions."},"GIT_INDEXCAP_NO_FILEMODE":{"file":"index.h","line":97,"value":"2","comments":"Capabilities of system that affect index actions."},"GIT_INDEXCAP_NO_SYMLINKS":{"file":"index.h","line":98,"value":"4","comments":"Capabilities of system that affect index actions."},"GIT_INDEXCAP_FROM_OWNER":{"file":"index.h","line":99,"value":"~0u\n","comments":"Capabilities of system that affect index actions."},"GIT_OK":{"file":"errors.h","line":22,"value":"0","comments":"Generic return codes"},"GIT_ERROR":{"file":"errors.h","line":23,"value":"-1","comments":"Generic return codes"},"GIT_ENOTFOUND":{"file":"errors.h","line":24,"value":"-3","comments":"Generic return codes"},"GIT_EEXISTS":{"file":"errors.h","line":25,"value":"-4","comments":"Generic return codes"},"GIT_EAMBIGUOUS":{"file":"errors.h","line":26,"value":"-5","comments":"Generic return codes"},"GIT_EBUFS":{"file":"errors.h","line":27,"value":"-6","comments":"Generic return codes"},"GIT_EUSER":{"file":"errors.h","line":28,"value":"-7","comments":"Generic return codes"},"GIT_EBAREREPO":{"file":"errors.h","line":29,"value":"-8","comments":"Generic return codes"},"GIT_EORPHANEDHEAD":{"file":"errors.h","line":30,"value":"-9","comments":"Generic return codes"},"GIT_EUNMERGED":{"file":"errors.h","line":31,"value":"-10","comments":"Generic return codes"},"GIT_PASSTHROUGH":{"file":"errors.h","line":33,"value":"-30","comments":"Generic return codes"},"GIT_ITEROVER":{"file":"errors.h","line":34,"value":"-31","comments":"Generic return codes"},"GIT_CONFIG_LEVEL_SYSTEM":{"file":"config.h","line":31,"value":"1","comments":"Priority level of a config file.\nThese priority levels correspond to the natural escalation logic\n(from higher to lower) when searching for config entries in git.git.\n\ngit_config_open_default() and git_repository_config() honor those\npriority levels as well."},"GIT_CONFIG_LEVEL_XDG":{"file":"config.h","line":32,"value":"2","comments":"Priority level of a config file.\nThese priority levels correspond to the natural escalation logic\n(from higher to lower) when searching for config entries in git.git.\n\ngit_config_open_default() and git_repository_config() honor those\npriority levels as well."},"GIT_CONFIG_LEVEL_GLOBAL":{"file":"config.h","line":33,"value":"3","comments":"Priority level of a config file.\nThese priority levels correspond to the natural escalation logic\n(from higher to lower) when searching for config entries in git.git.\n\ngit_config_open_default() and git_repository_config() honor those\npriority levels as well."},"GIT_CONFIG_LEVEL_LOCAL":{"file":"config.h","line":34,"value":"4","comments":"Priority level of a config file.\nThese priority levels correspond to the natural escalation logic\n(from higher to lower) when searching for config entries in git.git.\n\ngit_config_open_default() and git_repository_config() honor those\npriority levels as well."},"GIT_CONFIG_HIGHEST_LEVEL":{"file":"config.h","line":35,"value":"-1","comments":"Priority level of a config file.\nThese priority levels correspond to the natural escalation logic\n(from higher to lower) when searching for config entries in git.git.\n\ngit_config_open_default() and git_repository_config() honor those\npriority levels as well."},"GIT_BEGIN_DECL":{"value":"","file":"common.h","line":24,"comments":"Start declarations in C mode"},"GIT_END_DECL":{"value":"","file":"common.h","line":26,"comments":"End declarations in C mode"},"GIT_EXTERN(type)":{"value":"extern __attribute__((visibility(\"default\"))) type","file":"common.h","line":30,"comments":"Declare a public function exported for application use."},"GIT_INLINE(type)":{"value":"static __inline type","file":"common.h","line":41,"comments":"Declare a function as always inlined."},"GIT_FORMAT_PRINTF(a,b)":{"value":"__attribute__((format (printf, a, b)))","file":"common.h","line":48,"comments":"Declare a function's takes printf style arguments."},"GIT_PATH_LIST_SEPARATOR":{"value":"';'","file":"common.h","line":77,"comments":"The separator used in path list strings (ie like in the PATH\nenvironment variable). A semi-colon \";\" is used on Windows, and\na colon \":\" for all other systems."},"GIT_PATH_MAX":{"value":"4096","file":"common.h","line":86,"comments":"The maximum length of a valid git path."},"GIT_CAP_THREADS":{"file":"common.h","line":102,"value":"( 1 << 0 )","comments":"Combinations of these values describe the capabilities of libgit2."},"GIT_CAP_HTTPS":{"file":"common.h","line":103,"value":"( 1 << 1 )\n","comments":"Combinations of these values describe the capabilities of libgit2."},"GIT_ATTR_TRUE(attr)":{"value":"(git_attr_value(attr) == GIT_ATTR_TRUE_T)","file":"attr.h","line":33,"comments":"GIT_ATTR_TRUE checks if an attribute is set on. In core git\nparlance, this the value for \"Set\" attributes.\n\nFor example, if the attribute file contains:\n\n *.c foo\n\nThen for file `xyz.c` looking up attribute \"foo\" gives a value for\nwhich `GIT_ATTR_TRUE(value)` is true."},"GIT_ATTR_FALSE(attr)":{"value":"(git_attr_value(attr) == GIT_ATTR_FALSE_T)","file":"attr.h","line":47,"comments":"GIT_ATTR_FALSE checks if an attribute is set off. In core git\nparlance, this is the value for attributes that are \"Unset\" (not to\nbe confused with values that a \"Unspecified\").\n\nFor example, if the attribute file contains:\n\n *.h -foo\n\nThen for file `zyx.h` looking up attribute \"foo\" gives a value for\nwhich `GIT_ATTR_FALSE(value)` is true."},"GIT_ATTR_UNSPECIFIED(attr)":{"value":"(git_attr_value(attr) == GIT_ATTR_UNSPECIFIED_T)","file":"attr.h","line":65,"comments":"GIT_ATTR_UNSPECIFIED checks if an attribute is unspecified. This\nmay be due to the attribute not being mentioned at all or because\nthe attribute was explicitly set unspecified via the `!` operator.\n\nFor example, if the attribute file contains:\n\n *.c foo\n *.h -foo\n onefile.c !foo\n\nThen for `onefile.c` looking up attribute \"foo\" yields a value with\n`GIT_ATTR_UNSPECIFIED(value)` of true. Also, looking up \"foo\" on\nfile `onefile.rb` or looking up \"bar\" on any file will all give\n`GIT_ATTR_UNSPECIFIED(value)` of true."},"GIT_ATTR_HAS_VALUE(attr)":{"value":"(git_attr_value(attr) == GIT_ATTR_VALUE_T)","file":"attr.h","line":77,"comments":"GIT_ATTR_HAS_VALUE checks if an attribute is set to a value (as\nopposed to TRUE, FALSE or UNSPECIFIED). This would be the case if\nfor a file with something like:\n\n *.txt eol=lf\n\nGiven this, looking up \"eol\" for `onefile.txt` will give back the\nstring \"lf\" and `GIT_ATTR_SET_TO_VALUE(attr)` will return true."},"GIT_ATTR_CHECK_NO_SYSTEM":{"value":"(1 << 2)","file":"attr.h","line":125,"comments":"Check attribute flags: Using the system attributes file.\n\nNormally, attribute checks include looking in the /etc (or system\nequivalent) directory for a `gitattributes` file. Passing this\nflag will cause attribute checks to ignore that file."}},"types":[["GIT_ATTR_CHECK",{"type":"enum","file":"attr.h","line":114,"lineto":116,"block":"GIT_ATTR_CHECK_FILE_THEN_INDEX\nGIT_ATTR_CHECK_INDEX_THEN_FILE\nGIT_ATTR_CHECK_INDEX_ONLY","tdef":null,"comments":"Check attribute flags: Reading values from index and working directory.\n\nWhen checking attributes, it is possible to check attribute files\nin both the working directory (if there is one) and the index (if\nthere is one). You can explicitly choose where to check and in\nwhich order using the following flags.\n\nCore git usually checks the working directory then the index,\nexcept during a checkout when it checks the index first. It will\nuse index only for creating archives or for a bare repo (if an\nindex has been specified for the bare repo).","used":{"returns":[],"needs":[]}}],["GIT_REPOSITORY_INIT",{"type":"enum","file":"repository.h","line":185,"lineto":192,"block":"GIT_REPOSITORY_INIT_BARE\nGIT_REPOSITORY_INIT_NO_REINIT\nGIT_REPOSITORY_INIT_NO_DOTGIT_DIR\nGIT_REPOSITORY_INIT_MKDIR\nGIT_REPOSITORY_INIT_MKPATH\nGIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE","tdef":null,"comments":"Option flags for `git_repository_init_ext`.\n\nThese flags configure extra behaviors to `git_repository_init_ext`.\nIn every case, the default behavior is the zero value (i.e. flag is\nnot set). Just OR the flag values together for the `flags` parameter\nwhen initializing a new repo. Details of individual values are:\n\n* BARE - Create a bare repository with no working directory.\n* NO_REINIT - Return an EEXISTS error if the repo_path appears to\n already be an git repository.\n* NO_DOTGIT_DIR - Normally a \"/.git/\" will be appended to the repo\n path for non-bare repos (if it is not already there), but\n passing this flag prevents that behavior.\n* MKDIR - Make the repo_path (and workdir_path) as needed. Init is\n always willing to create the \".git\" directory even without this\n flag. This flag tells init to create the trailing component of\n the repo and workdir paths as needed.\n* MKPATH - Recursively make all components of the repo and workdir\n paths as necessary.\n* EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to\n initialize a new repo. This flags enables external templates,\n looking the \"template_path\" from the options if set, or the\n `init.templatedir` global config if not, or falling back on\n \"/usr/share/git-core/templates\" if it exists.","used":{"returns":[],"needs":[]}}],["GIT_REPOSITORY_INIT_SHARED",{"type":"enum","file":"repository.h","line":207,"lineto":211,"block":"GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL","tdef":null,"comments":"Mode options for `git_repository_init_ext`.\n\nSet the mode field of the `git_repository_init_options` structure\neither to the custom mode that you would like, or to one of the\nfollowing modes:\n\n* SHARED_UMASK - Use permissions configured by umask - the default.\n* SHARED_GROUP - Use \"--shared=group\" behavior, chmod'ing the new repo\n to be group writable and \"g+sx\" for sticky group assignment.\n* SHARED_ALL - Use \"--shared=all\" behavior, adding world readability.\n* Anything else - Set to custom value.","used":{"returns":[],"needs":[]}}],["GIT_REPOSITORY_OPEN",{"type":"enum","file":"repository.h","line":98,"lineto":101,"block":"GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS","tdef":null,"comments":"Option flags for `git_repository_open_ext`.\n\n* GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be\n immediately found in the start_path. Do not walk up from the\n start_path looking at parent directories.\n* GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not\n continue searching across filesystem boundaries (i.e. when `st_dev`\n changes from the `stat` system call). (E.g. Searching in a user's home\n directory \"/home/user/source/\" will not return \"/.git/\" as the found\n repo if \"/\" is a different filesystem than \"/home\".)","used":{"returns":[],"needs":[]}}],["git_blob",{"type":"struct","value":"git_blob","file":"types.h","line":111,"lineto":111,"block":"","tdef":"typedef","comments":"In-memory representation of a blob object.","used":{"returns":[],"needs":["git_blob_free","git_blob_lookup","git_blob_lookup_prefix","git_blob_rawcontent","git_blob_rawsize","git_diff_blobs"]}}],["git_branch_t",{"type":"enum","file":"types.h","line":173,"lineto":176,"block":"GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE","tdef":"typedef","comments":"Basic type of any Git branch.","used":{"returns":[],"needs":["git_branch_foreach","git_branch_lookup"]}}],["git_checkout_opts",{"type":"struct","value":"git_checkout_opts","file":"checkout.h","line":49,"lineto":74,"block":"unsigned int checkout_strategy\nint disable_filters\nint dir_mode\nint file_mode\nint file_open_flags\nint (* skipped_notify_cb)(const char *skipped_file, const git_oid *blob_oid, int file_mode, void *payload)\nvoid *notify_payload\nvoid (* progress_cb)(const char *path, size_t completed_steps, size_t total_steps, void *payload)\nvoid *progress_payload\ngit_strarray paths","tdef":"typedef","comments":"Checkout options structure\n\nUse zeros to indicate default settings.","used":{"returns":[],"needs":["git_checkout_head","git_checkout_index","git_checkout_tree","git_clone"]}}],["git_commit",{"type":"struct","value":"git_commit","file":"types.h","line":114,"lineto":114,"block":"","tdef":"typedef","comments":"Parsed representation of a commit object.","used":{"returns":[],"needs":["git_commit_author","git_commit_committer","git_commit_create","git_commit_free","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_nth_gen_ancestor","git_commit_parent","git_commit_parent_oid","git_commit_parentcount","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_oid"]}}],["git_config",{"type":"struct","value":"git_config","file":"types.h","line":129,"lineto":129,"block":"","tdef":"typedef","comments":"Memory representation of a set of config files","used":{"returns":[],"needs":["git_config_add_file","git_config_add_file_ondisk","git_config_delete","git_config_foreach","git_config_foreach_match","git_config_free","git_config_get_bool","git_config_get_config_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar","git_config_get_string","git_config_new","git_config_open_default","git_config_open_level","git_config_open_ondisk","git_config_refresh","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string","git_repository_config","git_repository_set_config"]}}],["git_config_file",{"type":"struct","value":"git_config_file","file":"config.h","line":48,"lineto":74,"block":"struct git_config *cfg\nint (*open)(struct git_config_file *, unsigned int level)\nint (*get)(struct git_config_file *, const char *key, const git_config_entry **entry)\nint (*get_multivar)(struct git_config_file *, const char *key, const char *regexp, int (*fn)(const git_config_entry *, void *), void *data)\nint (*set)(struct git_config_file *, const char *key, const char *value)\nint (*set_multivar)(git_config_file *cfg, const char *name, const char *regexp, const char *value)\nint (*del)(struct git_config_file *, const char *key)\nint (*foreach)(struct git_config_file *, const char *, int (*fn)(const git_config_entry *, void *), void *data)\nint (*refresh)(struct git_config_file *)\nvoid (*free)(struct git_config_file *)","tdef":null,"comments":"Generic backend that implements the interface to\naccess a configuration file","used":{"returns":[],"needs":["git_config_add_file","git_config_file__ondisk"]}}],["git_cred_acquire_cb",{"type":"function pointer","value":"git_cred_acquire_cb","file":"transport.h","line":64,"lineto":140,"comments":"Signature of a function which acquires a credential object.\n\n@param cred The newly created credential object.\n@param url The resource for which we are demanding a credential.\n@param allowed_types A bitmask stating which cred types are OK to return.","used":{"returns":[],"needs":["git_remote_set_cred_acquire_cb"]}}],["git_delta_t",{"type":"enum","file":"diff.h","line":140,"lineto":150,"block":"GIT_DELTA_UNMODIFIED\nGIT_DELTA_ADDED\nGIT_DELTA_DELETED\nGIT_DELTA_MODIFIED\nGIT_DELTA_RENAMED\nGIT_DELTA_COPIED\nGIT_DELTA_IGNORED\nGIT_DELTA_UNTRACKED\nGIT_DELTA_TYPECHANGE","tdef":"typedef","comments":"What type of change is described by a git_diff_delta?","used":{"returns":[],"needs":["git_diff_num_deltas_of_type","git_diff_status_char"]}}],["git_diff_data_fn",{"type":"function pointer","value":"git_diff_data_fn","file":"diff.h","line":246,"lineto":252,"comments":"When iterating over a diff, callback that will be made per text diff\nline. In this context, the provided range will be NULL.\n\nWhen printing a diff, callback that will be made to output each line\nof text. This uses some extra GIT_DIFF_LINE_... constants for output\nof lines of file and hunk headers.","used":{"returns":[],"needs":["git_diff_blobs","git_diff_foreach","git_diff_patch_print","git_diff_print_compact","git_diff_print_patch"]}}],["git_diff_delta",{"type":"struct","value":"git_diff_delta","file":"diff.h","line":176,"lineto":182,"block":"git_diff_file old_file\ngit_diff_file new_file\ngit_delta_t status\nunsigned int similarity\nint binary","tdef":"typedef","comments":"Description of changes to one file.\n\nWhen iterating over a diff list object, this will generally be passed to\nmost callback functions and you can use the contents to understand\nexactly what has changed.\n\nUnder some circumstances, not all fields will be filled in, but the code\ngenerally tries to fill in as much as possible. One example is that the\n\"binary\" field will not actually look at file contents if you do not\npass in hunk and/or line callbacks to the diff foreach iteration function.\nIt will just use the git attributes for those files.","used":{"returns":["git_diff_patch_delta"],"needs":["git_diff_get_patch"]}}],["git_diff_file",{"type":"struct","value":"git_diff_file","file":"diff.h","line":155,"lineto":161,"block":"git_oid oid\nconst char *path\ngit_off_t size\nunsigned int flags\nuint16_t mode","tdef":"typedef","comments":"Description of one side of a diff.","used":{"returns":[],"needs":[]}}],["git_diff_file_flag_t",{"type":"enum","file":"diff.h","line":127,"lineto":135,"block":"GIT_DIFF_FILE_VALID_OID\nGIT_DIFF_FILE_FREE_PATH\nGIT_DIFF_FILE_BINARY\nGIT_DIFF_FILE_NOT_BINARY\nGIT_DIFF_FILE_FREE_DATA\nGIT_DIFF_FILE_UNMAP_DATA\nGIT_DIFF_FILE_NO_DATA","tdef":"typedef","comments":"Flags that can be set for the file on side of a diff.\n\nMost of the flags are just for internal consumption by libgit2,\nbut some of them may be interesting to external users.","used":{"returns":[],"needs":[]}}],["git_diff_file_fn",{"type":"function pointer","value":"git_diff_file_fn","file":"diff.h","line":187,"lineto":190,"comments":"When iterating over a diff, callback that will be made per file.","used":{"returns":[],"needs":["git_diff_blobs","git_diff_foreach"]}}],["git_diff_find_options",{"type":"struct","value":"git_diff_find_options","file":"diff.h","line":283,"lineto":298,"block":"unsigned int flags\nunsigned int rename_threshold\nunsigned int rename_from_rewrite_threshold\nunsigned int copy_threshold\nunsigned int break_rewrite_threshold\nunsigned int target_limit","tdef":"typedef","comments":"Control behavior of rename and copy detection","used":{"returns":[],"needs":["git_diff_find_similar"]}}],["git_diff_hunk_fn",{"type":"function pointer","value":"git_diff_hunk_fn","file":"diff.h","line":205,"lineto":210,"comments":"When iterating over a diff, callback that will be made per hunk.","used":{"returns":[],"needs":["git_diff_blobs","git_diff_foreach"]}}],["git_diff_line_t",{"type":"enum","file":"diff.h","line":221,"lineto":236,"block":"GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_ADD_EOFNL\nGIT_DIFF_LINE_DEL_EOFNL\nGIT_DIFF_LINE_FILE_HDR\nGIT_DIFF_LINE_HUNK_HDR\nGIT_DIFF_LINE_BINARY","tdef":"typedef","comments":"Line origin constants.\n\nThese values describe where a line came from and will be passed to\nthe git_diff_data_fn when iterating over a diff. There are some\nspecial origin constants at the end that are used for the text\noutput callbacks to demarcate lines that are actually part of\nthe file or hunk headers.","used":{"returns":[],"needs":[]}}],["git_diff_list",{"type":"struct","value":"git_diff_list","file":"diff.h","line":119,"lineto":119,"block":"","tdef":"typedef","comments":"The diff list object that contains all individual file deltas.","used":{"returns":[],"needs":["git_diff_find_similar","git_diff_foreach","git_diff_get_patch","git_diff_index_to_tree","git_diff_list_free","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_print_compact","git_diff_print_patch","git_diff_tree_to_tree","git_diff_workdir_to_index","git_diff_workdir_to_tree"]}}],["git_diff_options",{"type":"struct","value":"git_diff_options","file":"diff.h","line":106,"lineto":114,"block":"uint32_t flags\nuint16_t context_lines\nuint16_t interhunk_lines\nchar *old_prefix\nchar *new_prefix\ngit_strarray pathspec\ngit_off_t max_size","tdef":"typedef","comments":"Structure describing options about how the diff should be executed.\n\nSetting all values of the structure to zero will yield the default\nvalues. Similarly, passing NULL for the options structure will\ngive the defaults. The default values are marked below.\n\n- flags: a combination of the git_diff_option_t values above\n- context_lines: number of lines of context to show around diffs\n- interhunk_lines: min lines between diff hunks to merge them\n- old_prefix: \"directory\" to prefix to old file names (default \"a\")\n- new_prefix: \"directory\" to prefix to new file names (default \"b\")\n- pathspec: array of paths / patterns to constrain diff\n- max_size: maximum blob size to diff, above this treated as binary","used":{"returns":[],"needs":["git_diff_blobs","git_diff_index_to_tree","git_diff_tree_to_tree","git_diff_workdir_to_index","git_diff_workdir_to_tree"]}}],["git_diff_patch",{"type":"struct","value":"git_diff_patch","file":"diff.h","line":260,"lineto":260,"block":"","tdef":"typedef","comments":"The diff patch is used to store all the text diffs for a delta.\n\nYou can easily loop over the content of patches and get information about\nthem.","used":{"returns":[],"needs":["git_diff_get_patch","git_diff_patch_delta","git_diff_patch_free","git_diff_patch_get_hunk","git_diff_patch_get_line_in_hunk","git_diff_patch_num_hunks","git_diff_patch_num_lines_in_hunk","git_diff_patch_print","git_diff_patch_to_str"]}}],["git_diff_range",{"type":"struct","value":"git_diff_range","file":"diff.h","line":195,"lineto":200,"block":"int old_start\nint old_lines\nint new_start\nint new_lines","tdef":"typedef","comments":"Structure describing a hunk of a diff.","used":{"returns":[],"needs":["git_diff_patch_get_hunk"]}}],["git_error_t",{"type":"enum","file":"errors.h","line":43,"lineto":63,"block":"GITERR_NOMEMORY\nGITERR_OS\nGITERR_INVALID\nGITERR_REFERENCE\nGITERR_ZLIB\nGITERR_REPOSITORY\nGITERR_CONFIG\nGITERR_REGEX\nGITERR_ODB\nGITERR_INDEX\nGITERR_OBJECT\nGITERR_NET\nGITERR_TAG\nGITERR_TREE\nGITERR_INDEXER\nGITERR_SSL\nGITERR_SUBMODULE\nGITERR_THREAD\nGITERR_STASH","tdef":"typedef","comments":"Error classes","used":{"returns":[],"needs":[]}}],["git_filemode_t",{"type":"enum","file":"types.h","line":186,"lineto":199,"block":"GIT_FILEMODE_NEW\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT","tdef":"typedef","comments":"Valid modes for index and tree entries.","used":{"returns":[],"needs":["git_treebuilder_insert"]}}],["git_headlist_cb",{"type":"function pointer","value":"git_headlist_cb","file":"net.h","line":47,"lineto":47,"comments":"Callback for listing the remote heads","used":{"returns":[],"needs":["git_remote_ls"]}}],["git_index",{"type":"struct","value":"git_index","file":"types.h","line":126,"lineto":126,"block":"","tdef":"typedef","comments":"Memory representation of an index file.","used":{"returns":[],"needs":["git_index_add","git_index_add_from_workdir","git_index_caps","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_remove","git_index_entrycount","git_index_find","git_index_free","git_index_get_byindex","git_index_get_bypath","git_index_has_conflicts","git_index_new","git_index_open","git_index_owner","git_index_read","git_index_read_tree","git_index_remove","git_index_reuc_add","git_index_reuc_entrycount","git_index_reuc_find","git_index_reuc_get_byindex","git_index_reuc_get_bypath","git_index_reuc_remove","git_index_set_caps","git_index_write","git_index_write_tree","git_index_write_tree_to","git_repository_index","git_repository_set_index"]}}],["git_index_entry",{"type":"struct","value":"git_index_entry","file":"index.h","line":68,"lineto":85,"block":"git_index_time ctime\ngit_index_time mtime\nunsigned int dev\nunsigned int ino\nunsigned int mode\nunsigned int uid\nunsigned int gid\ngit_off_t file_size\ngit_oid oid\nunsigned short flags\nunsigned short flags_extended\nchar *path","tdef":"typedef","comments":"Memory representation of a file entry in the index.","used":{"returns":["git_index_get_byindex","git_index_get_bypath"],"needs":["git_index_add","git_index_conflict_add","git_index_conflict_get","git_index_entry_stage"]}}],["git_index_reuc_entry",{"type":"struct","value":"git_index_reuc_entry","file":"index.h","line":88,"lineto":92,"block":"unsigned int mode[3]\ngit_oid oid[3]\nchar *path","tdef":"typedef","comments":"Representation of a resolve undo entry in the index.","used":{"returns":["git_index_reuc_get_byindex","git_index_reuc_get_bypath"],"needs":[]}}],["git_index_time",{"type":"struct","value":"git_index_time","file":"index.h","line":61,"lineto":65,"block":"git_time_t seconds\nunsigned int nanoseconds","tdef":"typedef","comments":"Time used in a git index entry","used":{"returns":[],"needs":[]}}],["git_note",{"type":"struct","value":"git_note","file":"types.h","line":141,"lineto":141,"block":"","tdef":"typedef","comments":"Representation of a git note","used":{"returns":[],"needs":["git_note_free","git_note_message","git_note_oid","git_note_read"]}}],["git_note_data",{"type":"struct","value":"git_note_data","file":"notes.h","line":113,"lineto":116,"block":"git_oid blob_oid\ngit_oid annotated_object_oid","tdef":"typedef","comments":"Basic components of a note\n\n - Oid of the blob containing the message\n - Oid of the git object being annotated","used":{"returns":[],"needs":["git_note_foreach"]}}],["git_object",{"type":"struct","value":"git_object","file":"types.h","line":102,"lineto":102,"block":"","tdef":"typedef","comments":"Representation of a generic object in a repository","used":{"returns":[],"needs":["git_branch_create","git_checkout_tree","git_object_free","git_object_id","git_object_lookup","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_type","git_reference_peel","git_reset","git_revparse_single","git_tag_create","git_tag_create_lightweight","git_tag_peel","git_tag_target","git_tree_entry_to_object"]}}],["git_odb",{"type":"struct","value":"git_odb","file":"types.h","line":81,"lineto":81,"block":"","tdef":"typedef","comments":"An open object database handle.","used":{"returns":[],"needs":["git_odb_add_alternate","git_odb_add_backend","git_odb_exists","git_odb_foreach","git_odb_free","git_odb_new","git_odb_open","git_odb_open_rstream","git_odb_open_wstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_write","git_odb_write_pack","git_repository_odb","git_repository_set_odb","git_repository_wrap_odb"]}}],["git_odb_backend",{"type":"struct","value":"git_odb_backend","file":"odb_backend.h","line":28,"lineto":92,"block":"git_odb *odb\nint (* read)(void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *)\nint (* read_prefix)(git_oid *, void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *, size_t)\nint (* read_header)(size_t *, git_otype *, struct git_odb_backend *, const git_oid *)\nint (* write)(git_oid *, struct git_odb_backend *, const void *, size_t, git_otype)\nint (* writestream)(struct git_odb_stream **, struct git_odb_backend *, size_t, git_otype)\nint (* readstream)(struct git_odb_stream **, struct git_odb_backend *, const git_oid *)\nint (* exists)(struct git_odb_backend *, const git_oid *)\nint (* foreach)(struct git_odb_backend *, int (*cb)(git_oid *oid, void *data), void *data)\nint (* writepack)(struct git_odb_writepack **, struct git_odb_backend *, git_transfer_progress_callback progress_cb, void *progress_payload)\nvoid (* free)(struct git_odb_backend *)","tdef":null,"comments":"An instance for a custom backend","used":{"returns":[],"needs":["git_odb_add_alternate","git_odb_add_backend"]}}],["git_odb_object",{"type":"struct","value":"git_odb_object","file":"types.h","line":87,"lineto":87,"block":"","tdef":"typedef","comments":"An object read from the ODB","used":{"returns":[],"needs":["git_odb_object_data","git_odb_object_free","git_odb_object_id","git_odb_object_size","git_odb_object_type","git_odb_read","git_odb_read_prefix"]}}],["git_odb_stream",{"type":"struct","value":"git_odb_stream","file":"odb_backend.h","line":102,"lineto":110,"block":"struct git_odb_backend *backend\nint mode\nint (*read)(struct git_odb_stream *stream, char *buffer, size_t len)\nint (*write)(struct git_odb_stream *stream, const char *buffer, size_t len)\nint (*finalize_write)(git_oid *oid_p, struct git_odb_stream *stream)\nvoid (*free)(struct git_odb_stream *stream)","tdef":null,"comments":"A stream to read/write from a backend","used":{"returns":[],"needs":["git_odb_open_rstream","git_odb_open_wstream"]}}],["git_odb_writepack",{"type":"struct","value":"git_odb_writepack","file":"odb_backend.h","line":113,"lineto":129,"block":"struct git_odb_backend *backend\nint (*add)(struct git_odb_writepack *writepack, const void *data, size_t size, git_transfer_progress *stats)\nint (*commit)(struct git_odb_writepack *writepack, git_transfer_progress *stats)\nvoid (*free)(struct git_odb_writepack *writepack)","tdef":null,"comments":"A stream to write a pack file to the ODB","used":{"returns":[],"needs":["git_odb_write_pack"]}}],["git_oid",{"type":"struct","value":"git_oid","file":"oid.h","line":33,"lineto":37,"block":"","tdef":"typedef","comments":"Unique identity of any object (commit, tree, blob, tag).","used":{"returns":["git_commit_id","git_commit_parent_oid","git_commit_tree_oid","git_indexer_hash","git_indexer_stream_hash","git_note_oid","git_object_id","git_odb_object_id","git_reference_oid","git_reflog_entry_oidnew","git_reflog_entry_oidold","git_submodule_head_oid","git_submodule_index_oid","git_submodule_wd_oid","git_tag_id","git_tag_target_oid","git_tree_entry_id","git_tree_id"],"needs":["git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromfile","git_blob_lookup","git_blob_lookup_prefix","git_commit_create","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_index_reuc_add","git_index_write_tree","git_index_write_tree_to","git_merge_base","git_merge_base_many","git_note_create","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_odb_exists","git_odb_foreach","git_odb_hash","git_odb_hashfile","git_odb_open_rstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_write","git_oid_allocfmt","git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_iszero","git_oid_ncmp","git_oid_pathfmt","git_oid_streq","git_oid_tostr","git_packbuilder_insert","git_packbuilder_insert_tree","git_reference_create_oid","git_reference_name_to_oid","git_reference_set_oid","git_reflog_append","git_repository_hashfile","git_repository_set_head_detached","git_revwalk_hide","git_revwalk_next","git_revwalk_push","git_stash_save","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_lookup","git_tag_lookup_prefix","git_tree_entry_byoid","git_tree_lookup","git_tree_lookup_prefix","git_treebuilder_insert","git_treebuilder_write"]}}],["git_oid_shorten",{"type":"struct","value":"git_oid_shorten","file":"oid.h","line":196,"lineto":196,"block":"","tdef":"typedef","comments":"OID Shortener object","used":{"returns":["git_oid_shorten_new"],"needs":["git_oid_shorten_add","git_oid_shorten_free"]}}],["git_otype",{"type":"enum","file":"types.h","line":67,"lineto":78,"block":"GIT_OBJ_ANY\nGIT_OBJ_BAD\nGIT_OBJ__EXT1\nGIT_OBJ_COMMIT\nGIT_OBJ_TREE\nGIT_OBJ_BLOB\nGIT_OBJ_TAG\nGIT_OBJ__EXT2\nGIT_OBJ_OFS_DELTA\nGIT_OBJ_REF_DELTA","tdef":"typedef","comments":"Basic type (loose or packed) of any Git object.","used":{"returns":[],"needs":["git_object__size","git_object_lookup","git_object_lookup_prefix","git_object_peel","git_object_type2string","git_object_typeisloose","git_odb_hash","git_odb_hashfile","git_odb_open_wstream","git_odb_read_header","git_odb_write","git_reference_peel","git_repository_hashfile"]}}],["git_packbuilder",{"type":"struct","value":"git_packbuilder","file":"types.h","line":144,"lineto":144,"block":"","tdef":"typedef","comments":"Representation of a git packbuilder","used":{"returns":[],"needs":["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_insert","git_packbuilder_insert_tree","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]}}],["git_ref_t",{"type":"enum","file":"types.h","line":163,"lineto":170,"block":"GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_PACKED\nGIT_REF_HAS_PEEL\nGIT_REF_LISTALL","tdef":"typedef","comments":"Basic type of any Git reference.","used":{"returns":[],"needs":[]}}],["git_reference",{"type":"struct","value":"git_reference","file":"types.h","line":160,"lineto":160,"block":"","tdef":"typedef","comments":"In-memory representation of a reference.","used":{"returns":[],"needs":["git_branch_create","git_branch_delete","git_branch_is_head","git_branch_lookup","git_branch_move","git_branch_tracking","git_reference_cmp","git_reference_create_oid","git_reference_create_symbolic","git_reference_delete","git_reference_free","git_reference_has_log","git_reference_is_branch","git_reference_is_packed","git_reference_is_remote","git_reference_lookup","git_reference_name","git_reference_oid","git_reference_owner","git_reference_peel","git_reference_reload","git_reference_rename","git_reference_resolve","git_reference_set_oid","git_reference_set_target","git_reference_target","git_reference_type","git_reflog_delete","git_reflog_read","git_reflog_rename","git_repository_head"]}}],["git_reflog",{"type":"struct","value":"git_reflog","file":"types.h","line":138,"lineto":138,"block":"","tdef":"typedef","comments":"Representation of a reference log","used":{"returns":[],"needs":["git_reflog_append","git_reflog_drop","git_reflog_entry_byindex","git_reflog_entrycount","git_reflog_free","git_reflog_read","git_reflog_write"]}}],["git_reflog_entry",{"type":"struct","value":"git_reflog_entry","file":"types.h","line":135,"lineto":135,"block":"","tdef":"typedef","comments":"Representation of a reference log entry","used":{"returns":["git_reflog_entry_byindex"],"needs":["git_reflog_entry_committer","git_reflog_entry_msg","git_reflog_entry_oidnew","git_reflog_entry_oidold"]}}],["git_remote_callbacks",{"type":"struct","value":"git_remote_callbacks","file":"remote.h","line":339,"lineto":344,"block":"void (*progress)(const char *str, int len, void *data)\nint (*completion)(git_remote_completion_type type, void *data)\nint (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data)\nvoid *data","tdef":null,"comments":"The callback settings structure\n\nSet the calbacks to be called by the remote.","used":{"returns":[],"needs":["git_remote_set_callbacks"]}}],["git_remote_head",{"type":"struct","value":"git_remote_head","file":"net.h","line":37,"lineto":42,"block":"int local:1\ngit_oid oid\ngit_oid loid\nchar *name","tdef":null,"comments":"Remote head description, given out on `ls` calls.","used":{"returns":[],"needs":[]}}],["git_repository",{"type":"struct","value":"git_repository","file":"types.h","line":99,"lineto":99,"block":"","tdef":"typedef","comments":"Representation of an existing git repository,\nincluding all its object contents","used":{"returns":["git_index_owner","git_object_owner","git_reference_owner","git_revwalk_repository","git_submodule_owner"],"needs":["git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many","git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromfile","git_blob_lookup","git_blob_lookup_prefix","git_branch_create","git_branch_foreach","git_branch_lookup","git_checkout_head","git_checkout_index","git_checkout_tree","git_clone","git_clone_bare","git_commit_create","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_diff_index_to_tree","git_diff_tree_to_tree","git_diff_workdir_to_index","git_diff_workdir_to_tree","git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored","git_index_write_tree_to","git_merge_base","git_merge_base_many","git_note_create","git_note_default_ref","git_note_foreach","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_packbuilder_new","git_reference_create_oid","git_reference_create_symbolic","git_reference_foreach","git_reference_foreach_glob","git_reference_list","git_reference_lookup","git_reference_name_to_oid","git_reference_packall","git_remote_add","git_remote_list","git_remote_load","git_remote_new","git_repository_config","git_repository_detach_head","git_repository_free","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_orphan","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_is_bare","git_repository_is_empty","git_repository_message","git_repository_message_remove","git_repository_odb","git_repository_open","git_repository_open_ext","git_repository_path","git_repository_set_config","git_repository_set_head","git_repository_set_head_detached","git_repository_set_index","git_repository_set_odb","git_repository_set_workdir","git_repository_state","git_repository_workdir","git_repository_wrap_odb","git_reset","git_revparse_single","git_revwalk_new","git_stash_drop","git_stash_foreach","git_stash_save","git_status_file","git_status_foreach","git_status_foreach_ext","git_status_should_ignore","git_submodule_add_setup","git_submodule_foreach","git_submodule_lookup","git_submodule_open","git_submodule_reload_all","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_foreach","git_tag_list","git_tag_list_match","git_tag_lookup","git_tag_lookup_prefix","git_tree_entry_to_object","git_tree_lookup","git_tree_lookup_prefix","git_treebuilder_write"]}}],["git_repository_init_options",{"type":"struct","value":"git_repository_init_options","file":"repository.h","line":241,"lineto":249,"block":"uint32_t flags\nuint32_t mode\nconst char *workdir_path\nconst char *description\nconst char *template_path\nconst char *initial_head\nconst char *origin_url","tdef":"typedef","comments":"Extended options structure for `git_repository_init_ext`.\n\nThis contains extra options for `git_repository_init_ext` that enable\nadditional initialization features. The fields are:\n\n* flags - Combination of GIT_REPOSITORY_INIT flags above.\n* mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_...\n constants above, or to a custom value that you would like.\n* workdir_path - The path to the working dir or NULL for default (i.e.\n repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH,\n IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not\n the \"natural\" working directory, a .git gitlink file will be\n created here linking to the repo_path.\n* description - If set, this will be used to initialize the \"description\"\n file in the repository, instead of using the template content.\n* template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set,\n this contains the path to use for the template directory. If\n this is NULL, the config or default directory options will be\n used instead.\n* initial_head - The name of the head to point HEAD at. If NULL, then\n this will be treated as \"master\" and the HEAD ref will be set\n to \"refs/heads/master\". If this begins with \"refs/\" it will be\n used verbatim; otherwise \"refs/heads/\" will be prefixed.\n* origin_url - If this is non-NULL, then after the rest of the\n repository initialization is completed, an \"origin\" remote\n will be added pointing to this URL.","used":{"returns":[],"needs":["git_repository_init_ext"]}}],["git_reset_type",{"type":"enum","file":"types.h","line":179,"lineto":183,"block":"GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD","tdef":"typedef","comments":"Kinds of reset operation.","used":{"returns":[],"needs":["git_reset"]}}],["git_revwalk",{"type":"struct","value":"git_revwalk","file":"types.h","line":105,"lineto":105,"block":"","tdef":"typedef","comments":"Representation of an in-progress walk through the commits in a repo","used":{"returns":[],"needs":["git_revwalk_free","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_hide_ref","git_revwalk_new","git_revwalk_next","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_sorting"]}}],["git_signature",{"type":"struct","value":"git_signature","file":"types.h","line":153,"lineto":157,"block":"char *name\nchar *email\ngit_time when","tdef":"typedef","comments":"An action signature (e.g. for committers, taggers, etc)","used":{"returns":["git_commit_author","git_commit_committer","git_reflog_entry_committer","git_signature_dup","git_tag_tagger"],"needs":["git_commit_create","git_commit_create_v","git_note_create","git_note_remove","git_reflog_append","git_signature_dup","git_signature_free","git_signature_new","git_signature_now","git_stash_save","git_tag_create"]}}],["git_status_opt_t",{"type":"enum","file":"status.h","line":123,"lineto":130,"block":"GIT_STATUS_OPT_INCLUDE_UNTRACKED\nGIT_STATUS_OPT_INCLUDE_IGNORED\nGIT_STATUS_OPT_INCLUDE_UNMODIFIED\nGIT_STATUS_OPT_EXCLUDE_SUBMODULES\nGIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS\nGIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH","tdef":"typedef","comments":"Flags to control status callbacks\n\n- GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made\n on untracked files. These will only be made if the workdir files are\n included in the status \"show\" option.\n- GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files should get\n callbacks. Again, these callbacks will only be made if the workdir\n files are included in the status \"show\" option. Right now, there is\n no option to include all files in directories that are ignored\n completely.\n- GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be\n made even on unmodified files.\n- GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that directories which\n appear to be submodules should just be skipped over.\n- GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that the contents of\n untracked directories should be included in the status. Normally if\n an entire directory is new, then just the top-level directory will be\n included (with a trailing slash on the entry name). Given this flag,\n the directory itself will not be included, but all the files in it\n will.\n- GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path\n will be treated as a literal path, and not as a pathspec.\n\nCalling `git_status_foreach()` is like calling the extended version\nwith: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED,\nand GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS.","used":{"returns":[],"needs":[]}}],["git_status_options",{"type":"struct","value":"git_status_options","file":"status.h","line":148,"lineto":152,"block":"git_status_show_t show\nunsigned int flags\ngit_strarray pathspec","tdef":"typedef","comments":"Options to control how `git_status_foreach_ext()` will issue callbacks.\n\nThis structure is set so that zeroing it out will give you relatively\nsane defaults.\n\nThe `show` value is one of the `git_status_show_t` constants that\ncontrol which files to scan and in what order.\n\nThe `flags` value is an OR'ed combination of the `git_status_opt_t`\nvalues above.\n\nThe `pathspec` is an array of path patterns to match (using\nfnmatch-style matching), or just an array of paths to match exactly if\n`GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags.","used":{"returns":[],"needs":["git_status_foreach_ext"]}}],["git_status_show_t",{"type":"enum","file":"status.h","line":88,"lineto":93,"block":"GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY\nGIT_STATUS_SHOW_INDEX_THEN_WORKDIR","tdef":"typedef","comments":"For extended status, select the files on which to report status.\n\n- GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This is the\n rough equivalent of `git status --porcelain` where each file\n will receive a callback indicating its status in the index and\n in the workdir.\n- GIT_STATUS_SHOW_INDEX_ONLY will only make callbacks for index\n side of status. The status of the index contents relative to\n the HEAD will be given.\n- GIT_STATUS_SHOW_WORKDIR_ONLY will only make callbacks for the\n workdir side of status, reporting the status of workdir content\n relative to the index.\n- GIT_STATUS_SHOW_INDEX_THEN_WORKDIR behaves like index-only\n followed by workdir-only, causing two callbacks to be issued\n per file (first index then workdir). This is slightly more\n efficient than making separate calls. This makes it easier to\n emulate the output of a plain `git status`.","used":{"returns":[],"needs":[]}}],["git_status_t",{"type":"enum","file":"status.h","line":32,"lineto":47,"block":"GIT_STATUS_CURRENT\nGIT_STATUS_INDEX_NEW\nGIT_STATUS_INDEX_MODIFIED\nGIT_STATUS_INDEX_DELETED\nGIT_STATUS_INDEX_RENAMED\nGIT_STATUS_INDEX_TYPECHANGE\nGIT_STATUS_WT_NEW\nGIT_STATUS_WT_MODIFIED\nGIT_STATUS_WT_DELETED\nGIT_STATUS_WT_TYPECHANGE\nGIT_STATUS_IGNORED","tdef":"typedef","comments":"Status flags for a single file.\n\nA combination of these values will be returned to indicate the status of\na file. Status compares the working directory, the index, and the\ncurrent HEAD of the repository. The `GIT_STATUS_INDEX` set of flags\nrepresents the status of file in the index relative to the HEAD, and the\n`GIT_STATUS_WT` set of flags represent the status of the file in the\nworking directory relative to the index.","used":{"returns":[],"needs":[]}}],["git_strarray",{"type":"struct","value":"git_strarray","file":"strarray.h","line":22,"lineto":26,"block":"","tdef":"typedef","comments":"Array of strings","used":{"returns":[],"needs":["git_reference_list","git_remote_list","git_strarray_copy","git_strarray_free","git_tag_list","git_tag_list_match"]}}],["git_submodule",{"type":"struct","value":"git_submodule","file":"submodule.h","line":32,"lineto":32,"block":"","tdef":"typedef","comments":"Opaque structure representing a submodule.\n\nSubmodule support in libgit2 builds a list of known submodules and keeps\nit in the repository. The list is built from the .gitmodules file, the\n.git/config file, the index, and the HEAD tree. Items in the working\ndirectory that look like submodules (i.e. a git repo) but are not\nmentioned in those places won't be tracked.","used":{"returns":[],"needs":["git_submodule_add_finalize","git_submodule_add_setup","git_submodule_add_to_index","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_head_oid","git_submodule_ignore","git_submodule_index_oid","git_submodule_init","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_save","git_submodule_set_fetch_recurse_submodules","git_submodule_set_ignore","git_submodule_set_update","git_submodule_set_url","git_submodule_status","git_submodule_sync","git_submodule_update","git_submodule_url","git_submodule_wd_oid"]}}],["git_submodule_ignore_t",{"type":"enum","file":"submodule.h","line":55,"lineto":61,"block":"GIT_SUBMODULE_IGNORE_DEFAULT\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL","tdef":"typedef","comments":"Values that could be specified for how closely to examine the\nworking directory when getting submodule status.\n\nUse the DEFUALT value if you have altered the ignore value via\n`git_submodule_set_ignore()` and wish to reset to the original value.","used":{"returns":[],"needs":["git_submodule_set_ignore"]}}],["git_submodule_status_t",{"type":"enum","file":"submodule.h","line":105,"lineto":131,"block":"GIT_SUBMODULE_STATUS_IN_HEAD\nGIT_SUBMODULE_STATUS_IN_INDEX\nGIT_SUBMODULE_STATUS_IN_CONFIG\nGIT_SUBMODULE_STATUS_IN_WD\nGIT_SUBMODULE_STATUS_INDEX_ADDED\nGIT_SUBMODULE_STATUS_INDEX_DELETED\nGIT_SUBMODULE_STATUS_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNINITIALIZED\nGIT_SUBMODULE_STATUS_WD_ADDED\nGIT_SUBMODULE_STATUS_WD_DELETED\nGIT_SUBMODULE_STATUS_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED\nGIT_SUBMODULE_STATUS_WD_WD_MODIFIED\nGIT_SUBMODULE_STATUS_WD_UNTRACKED","tdef":"typedef","comments":"Return codes for submodule status.\n\nA combination of these flags will be returned to describe the status of a\nsubmodule. Depending on the \"ignore\" property of the submodule, some of\nthe flags may never be returned because they indicate changes that are\nsupposed to be ignored.\n\nSubmodule info is contained in 4 places: the HEAD tree, the index, config\nfiles (both .git/config and .gitmodules), and the working directory. Any\nor all of those places might be missing information about the submodule\ndepending on what state the repo is in. We consider all four places to\nbuild the combination of status flags.\n\nThere are four values that are not really status, but give basic info\nabout what sources of submodule data are available. These will be\nreturned even if ignore is set to \"ALL\".\n\n* IN_HEAD - superproject head contains submodule\n* IN_INDEX - superproject index contains submodule\n* IN_CONFIG - superproject gitmodules has submodule\n* IN_WD - superproject workdir has submodule\n\nThe following values will be returned so long as ignore is not \"ALL\".\n\n* INDEX_ADDED - in index, not in head\n* INDEX_DELETED - in head, not in index\n* INDEX_MODIFIED - index and head don't match\n* WD_UNINITIALIZED - workdir contains empty directory\n* WD_ADDED - in workdir, not index\n* WD_DELETED - in index, not workdir\n* WD_MODIFIED - index and workdir head don't match\n\nThe following can only be returned if ignore is \"NONE\" or \"UNTRACKED\".\n\n* WD_INDEX_MODIFIED - submodule workdir index is dirty\n* WD_WD_MODIFIED - submodule workdir has modified files\n\nLastly, the following will only be returned for ignore \"NONE\".\n\n* WD_UNTRACKED - wd contains untracked files","used":{"returns":[],"needs":[]}}],["git_submodule_update_t",{"type":"enum","file":"submodule.h","line":40,"lineto":46,"block":"GIT_SUBMODULE_UPDATE_DEFAULT\nGIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE","tdef":"typedef","comments":"Values that could be specified for the update rule of a submodule.\n\nUse the DEFAULT value if you have altered the update value via\n`git_submodule_set_update()` and wish to reset to the original default.","used":{"returns":[],"needs":["git_submodule_set_update"]}}],["git_tag",{"type":"struct","value":"git_tag","file":"types.h","line":108,"lineto":108,"block":"","tdef":"typedef","comments":"Parsed representation of a tag object.","used":{"returns":[],"needs":["git_tag_free","git_tag_id","git_tag_lookup","git_tag_lookup_prefix","git_tag_message","git_tag_name","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_oid","git_tag_target_type"]}}],["git_time",{"type":"struct","value":"git_time","file":"types.h","line":147,"lineto":150,"block":"git_time_t time\nint offset","tdef":"typedef","comments":"Time in a signature","used":{"returns":[],"needs":[]}}],["git_transfer_progress",{"type":"struct","value":"git_transfer_progress","file":"indexer.h","line":19,"lineto":24,"block":"unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nsize_t received_bytes","tdef":"typedef","comments":"This is passed as the first argument to the callback to allow the\nuser to see the progress.","used":{"returns":["git_remote_stats"],"needs":["git_indexer_run","git_indexer_stream_add","git_indexer_stream_finalize"]}}],["git_transfer_progress_callback",{"type":"function pointer","value":"git_transfer_progress_callback","file":"indexer.h","line":30,"lineto":33,"comments":"Type for progress callbacks during indexing","used":{"returns":[],"needs":["git_clone","git_clone_bare","git_indexer_stream_new","git_odb_write_pack","git_remote_download"]}}],["git_tree",{"type":"struct","value":"git_tree","file":"types.h","line":120,"lineto":120,"block":"","tdef":"typedef","comments":"Representation of a tree object.","used":{"returns":[],"needs":["git_commit_create","git_commit_create_v","git_commit_tree","git_diff_index_to_tree","git_diff_tree_to_tree","git_diff_workdir_to_tree","git_index_read_tree","git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_byoid","git_tree_entry_bypath","git_tree_entrycount","git_tree_free","git_tree_id","git_tree_lookup","git_tree_lookup_prefix","git_tree_walk","git_treebuilder_create"]}}],["git_tree_entry",{"type":"struct","value":"git_tree_entry","file":"types.h","line":117,"lineto":117,"block":"","tdef":"typedef","comments":"Representation of each one of the entries in a tree object.","used":{"returns":["git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_byoid","git_tree_entry_dup","git_treebuilder_get"],"needs":["git_tree_entry_bypath","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_free","git_tree_entry_id","git_tree_entry_name","git_tree_entry_to_object","git_tree_entry_type","git_treebuilder_filter","git_treebuilder_insert"]}}],["git_treebuilder",{"type":"struct","value":"git_treebuilder","file":"types.h","line":123,"lineto":123,"block":"","tdef":"typedef","comments":"Constructor for in-memory trees","used":{"returns":[],"needs":["git_treebuilder_clear","git_treebuilder_create","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_remove","git_treebuilder_write"]}}],["git_treewalk_cb",{"type":"function pointer","value":"git_treewalk_cb","file":"tree.h","line":324,"lineto":324,"comments":"Callback for the tree traversal method","used":{"returns":[],"needs":["git_tree_walk"]}}],["stash_cb",{"type":"function pointer","value":"stash_cb","file":"stash.h","line":80,"lineto":84,"comments":"When iterating over all the stashed states, callback that will be\nissued per entry.\n\n@param index The position within the stash list. 0 points to the\nmost recent stashed state.\n\n@param message The stash message.\n\n@param stash_oid The commit oid of the stashed state.\n\n@param payload Extra parameter to callback function.\n\n@return 0 on success, GIT_EUSER on non-zero callback, or error code","used":{"returns":[],"needs":["git_stash_foreach"]}}]],"prefix":"include/git2","groups":[["attr",["git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many"]],["blob",["git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromfile","git_blob_free","git_blob_lookup","git_blob_lookup_prefix","git_blob_rawcontent","git_blob_rawsize"]],["branch",["git_branch_create","git_branch_delete","git_branch_foreach","git_branch_is_head","git_branch_lookup","git_branch_move","git_branch_tracking"]],["checkout",["git_checkout_head","git_checkout_index","git_checkout_tree"]],["clone",["git_clone","git_clone_bare"]],["commit",["git_commit_author","git_commit_committer","git_commit_create","git_commit_create_v","git_commit_free","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_nth_gen_ancestor","git_commit_parent","git_commit_parent_oid","git_commit_parentcount","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_oid"]],["config",["git_config_add_file","git_config_add_file_ondisk","git_config_delete","git_config_file__ondisk","git_config_find_global","git_config_find_system","git_config_find_xdg","git_config_foreach","git_config_foreach_match","git_config_free","git_config_get_bool","git_config_get_config_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar","git_config_get_string","git_config_lookup_map_value","git_config_new","git_config_open_default","git_config_open_level","git_config_open_ondisk","git_config_parse_bool","git_config_parse_int32","git_config_parse_int64","git_config_refresh","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string"]],["cred",["git_cred_userpass_plaintext_new"]],["diff",["git_diff_blobs","git_diff_find_similar","git_diff_foreach","git_diff_get_patch","git_diff_index_to_tree","git_diff_list_free","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_patch_delta","git_diff_patch_free","git_diff_patch_get_hunk","git_diff_patch_get_line_in_hunk","git_diff_patch_num_hunks","git_diff_patch_num_lines_in_hunk","git_diff_patch_print","git_diff_patch_to_str","git_diff_print_compact","git_diff_print_patch","git_diff_status_char","git_diff_tree_to_tree","git_diff_workdir_to_index","git_diff_workdir_to_tree"]],["giterr",["giterr_clear","giterr_last","giterr_set_oom","giterr_set_str"]],["ignore",["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"]],["index",["git_index_add","git_index_add_from_workdir","git_index_caps","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_remove","git_index_entry_stage","git_index_entrycount","git_index_find","git_index_free","git_index_get_byindex","git_index_get_bypath","git_index_has_conflicts","git_index_new","git_index_open","git_index_owner","git_index_read","git_index_read_tree","git_index_remove","git_index_reuc_add","git_index_reuc_entrycount","git_index_reuc_find","git_index_reuc_get_byindex","git_index_reuc_get_bypath","git_index_reuc_remove","git_index_set_caps","git_index_write","git_index_write_tree","git_index_write_tree_to"]],["indexer",["git_indexer_free","git_indexer_hash","git_indexer_new","git_indexer_run","git_indexer_stream_add","git_indexer_stream_finalize","git_indexer_stream_free","git_indexer_stream_hash","git_indexer_stream_new","git_indexer_write"]],["libgit2",["git_libgit2_capabilities","git_libgit2_version"]],["merge",["git_merge_base","git_merge_base_many"]],["message",["git_message_prettify"]],["note",["git_note_create","git_note_default_ref","git_note_foreach","git_note_free","git_note_message","git_note_oid","git_note_read","git_note_remove"]],["object",["git_object__size","git_object_free","git_object_id","git_object_lookup","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_string2type","git_object_type","git_object_type2string","git_object_typeisloose"]],["odb",["git_odb_add_alternate","git_odb_add_backend","git_odb_exists","git_odb_foreach","git_odb_free","git_odb_hash","git_odb_hashfile","git_odb_new","git_odb_object_data","git_odb_object_free","git_odb_object_id","git_odb_object_size","git_odb_object_type","git_odb_open","git_odb_open_rstream","git_odb_open_wstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_write","git_odb_write_pack"]],["oid",["git_oid_allocfmt","git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_iszero","git_oid_ncmp","git_oid_pathfmt","git_oid_shorten_add","git_oid_shorten_free","git_oid_shorten_new","git_oid_streq","git_oid_tostr"]],["packbuilder",["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_insert","git_packbuilder_insert_tree","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]],["reference",["git_reference_cmp","git_reference_create_oid","git_reference_create_symbolic","git_reference_delete","git_reference_foreach","git_reference_foreach_glob","git_reference_free","git_reference_has_log","git_reference_is_branch","git_reference_is_packed","git_reference_is_remote","git_reference_is_valid_name","git_reference_list","git_reference_lookup","git_reference_name","git_reference_name_to_oid","git_reference_normalize_name","git_reference_oid","git_reference_owner","git_reference_packall","git_reference_peel","git_reference_reload","git_reference_rename","git_reference_resolve","git_reference_set_oid","git_reference_set_target","git_reference_target","git_reference_type"]],["reflog",["git_reflog_append","git_reflog_delete","git_reflog_drop","git_reflog_entry_byindex","git_reflog_entry_committer","git_reflog_entry_msg","git_reflog_entry_oidnew","git_reflog_entry_oidold","git_reflog_entrycount","git_reflog_free","git_reflog_read","git_reflog_rename","git_reflog_write"]],["refspec",["git_refspec_dst","git_refspec_force","git_refspec_src","git_refspec_src_matches","git_refspec_transform"]],["remote",["git_remote_add","git_remote_autotag","git_remote_check_cert","git_remote_connect","git_remote_connected","git_remote_disconnect","git_remote_download","git_remote_fetchspec","git_remote_free","git_remote_list","git_remote_load","git_remote_ls","git_remote_name","git_remote_new","git_remote_pushspec","git_remote_pushurl","git_remote_rename","git_remote_save","git_remote_set_autotag","git_remote_set_callbacks","git_remote_set_cred_acquire_cb","git_remote_set_fetchspec","git_remote_set_pushspec","git_remote_set_pushurl","git_remote_set_transport","git_remote_set_url","git_remote_stats","git_remote_stop","git_remote_supported_url","git_remote_update_tips","git_remote_url","git_remote_valid_url"]],["repository",["git_repository_config","git_repository_detach_head","git_repository_discover","git_repository_free","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_orphan","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_is_bare","git_repository_is_empty","git_repository_message","git_repository_message_remove","git_repository_odb","git_repository_open","git_repository_open_ext","git_repository_path","git_repository_set_config","git_repository_set_head","git_repository_set_head_detached","git_repository_set_index","git_repository_set_odb","git_repository_set_workdir","git_repository_state","git_repository_workdir","git_repository_wrap_odb"]],["reset",["git_reset"]],["revparse",["git_revparse_single"]],["revwalk",["git_revwalk_free","git_revwalk_hide","git_revwalk_hide_glob","git_revwalk_hide_head","git_revwalk_hide_ref","git_revwalk_new","git_revwalk_next","git_revwalk_push","git_revwalk_push_glob","git_revwalk_push_head","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_sorting"]],["signature",["git_signature_dup","git_signature_free","git_signature_new","git_signature_now"]],["smart",["git_smart_subtransport_git","git_smart_subtransport_http"]],["stash",["git_stash_drop","git_stash_foreach","git_stash_save"]],["status",["git_status_file","git_status_foreach","git_status_foreach_ext","git_status_should_ignore"]],["strarray",["git_strarray_copy","git_strarray_free"]],["submodule",["git_submodule_add_finalize","git_submodule_add_setup","git_submodule_add_to_index","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_head_oid","git_submodule_ignore","git_submodule_index_oid","git_submodule_init","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_reload_all","git_submodule_save","git_submodule_set_fetch_recurse_submodules","git_submodule_set_ignore","git_submodule_set_update","git_submodule_set_url","git_submodule_status","git_submodule_sync","git_submodule_update","git_submodule_url","git_submodule_wd_oid"]],["tag",["git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_delete","git_tag_foreach","git_tag_free","git_tag_id","git_tag_list","git_tag_list_match","git_tag_lookup","git_tag_lookup_prefix","git_tag_message","git_tag_name","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_oid","git_tag_target_type"]],["threads",["git_threads_init","git_threads_shutdown"]],["transport",["git_transport_dummy","git_transport_local","git_transport_new","git_transport_smart","git_transport_valid_url"]],["tree",["git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_byoid","git_tree_entry_bypath","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_free","git_tree_entry_id","git_tree_entry_name","git_tree_entry_to_object","git_tree_entry_type","git_tree_entrycount","git_tree_free","git_tree_id","git_tree_lookup","git_tree_lookup_prefix","git_tree_walk"]],["treebuilder",["git_treebuilder_clear","git_treebuilder_create","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_remove","git_treebuilder_write"]]],"examples":[["showindex.c","ex/HEAD/showindex.html"],["network/ls-remote.c","ex/HEAD/ls-remote.html"],["network/index-pack.c","ex/HEAD/index-pack.html"],["network/git2.c","ex/HEAD/git2.html"],["network/fetch.c","ex/HEAD/fetch.html"],["network/clone.c","ex/HEAD/clone.html"],["general.c","ex/HEAD/general.html"],["diff.c","ex/HEAD/diff.html"]]}
@@ -1,109 +0,0 @@
1
- /*
2
- * Copyright (C) the libgit2 contributors. All rights reserved.
3
- *
4
- * This file is part of libgit2, distributed under the GNU GPL v2 with
5
- * a Linking Exception. For full terms see the included COPYING file.
6
- */
7
- #ifndef INCLUDE_git_refdb_backend_h__
8
- #define INCLUDE_git_refdb_backend_h__
9
-
10
- #include "common.h"
11
- #include "types.h"
12
- #include "oid.h"
13
-
14
- /**
15
- * @file git2/refdb_backend.h
16
- * @brief Git custom refs backend functions
17
- * @defgroup git_refdb_backend Git custom refs backend API
18
- * @ingroup Git
19
- * @{
20
- */
21
- GIT_BEGIN_DECL
22
-
23
- /** An instance for a custom backend */
24
- struct git_refdb_backend {
25
- unsigned int version;
26
-
27
- /**
28
- * Queries the refdb backend to determine if the given ref_name
29
- * exists. A refdb implementation must provide this function.
30
- */
31
- int (*exists)(
32
- int *exists,
33
- struct git_refdb_backend *backend,
34
- const char *ref_name);
35
-
36
- /**
37
- * Queries the refdb backend for a given reference. A refdb
38
- * implementation must provide this function.
39
- */
40
- int (*lookup)(
41
- git_reference **out,
42
- struct git_refdb_backend *backend,
43
- const char *ref_name);
44
-
45
- /**
46
- * Enumerates each reference in the refdb. A refdb implementation must
47
- * provide this function.
48
- */
49
- int (*foreach)(
50
- struct git_refdb_backend *backend,
51
- unsigned int list_flags,
52
- git_reference_foreach_cb callback,
53
- void *payload);
54
-
55
- /**
56
- * Enumerates each reference in the refdb that matches the given
57
- * glob string. A refdb implementation may provide this function;
58
- * if it is not provided, foreach will be used and the results filtered
59
- * against the glob.
60
- */
61
- int (*foreach_glob)(
62
- struct git_refdb_backend *backend,
63
- const char *glob,
64
- unsigned int list_flags,
65
- git_reference_foreach_cb callback,
66
- void *payload);
67
-
68
- /**
69
- * Writes the given reference to the refdb. A refdb implementation
70
- * must provide this function.
71
- */
72
- int (*write)(struct git_refdb_backend *backend, const git_reference *ref);
73
-
74
- /**
75
- * Deletes the given reference from the refdb. A refdb implementation
76
- * must provide this function.
77
- */
78
- int (*delete)(struct git_refdb_backend *backend, const git_reference *ref);
79
-
80
- /**
81
- * Suggests that the given refdb compress or optimize its references.
82
- * This mechanism is implementation specific. (For on-disk reference
83
- * databases, this may pack all loose references.) A refdb
84
- * implementation may provide this function; if it is not provided,
85
- * nothing will be done.
86
- */
87
- int (*compress)(struct git_refdb_backend *backend);
88
-
89
- /**
90
- * Frees any resources held by the refdb. A refdb implementation may
91
- * provide this function; if it is not provided, nothing will be done.
92
- */
93
- void (*free)(struct git_refdb_backend *backend);
94
- };
95
-
96
- #define GIT_ODB_BACKEND_VERSION 1
97
- #define GIT_ODB_BACKEND_INIT {GIT_ODB_BACKEND_VERSION}
98
-
99
- /**
100
- * Constructors for default refdb backends.
101
- */
102
- GIT_EXTERN(int) git_refdb_backend_fs(
103
- struct git_refdb_backend **backend_out,
104
- git_repository *repo,
105
- git_refdb *refdb);
106
-
107
- GIT_END_DECL
108
-
109
- #endif
@@ -1,1819 +0,0 @@
1
- /*
2
- * Copyright (C) the libgit2 contributors. All rights reserved.
3
- *
4
- * This file is part of libgit2, distributed under the GNU GPL v2 with
5
- * a Linking Exception. For full terms see the included COPYING file.
6
- */
7
- #include "common.h"
8
- #include "git2/attr.h"
9
- #include "git2/oid.h"
10
- #include "git2/submodule.h"
11
- #include "diff_output.h"
12
- #include <ctype.h>
13
- #include "fileops.h"
14
- #include "filter.h"
15
- #include "buf_text.h"
16
-
17
- static int read_next_int(const char **str, int *value)
18
- {
19
- const char *scan = *str;
20
- int v = 0, digits = 0;
21
- /* find next digit */
22
- for (scan = *str; *scan && !isdigit(*scan); scan++);
23
- /* parse next number */
24
- for (; isdigit(*scan); scan++, digits++)
25
- v = (v * 10) + (*scan - '0');
26
- *str = scan;
27
- *value = v;
28
- return (digits > 0) ? 0 : -1;
29
- }
30
-
31
- static int parse_hunk_header(git_diff_range *range, const char *header)
32
- {
33
- /* expect something of the form "@@ -%d[,%d] +%d[,%d] @@" */
34
- if (*header != '@')
35
- return -1;
36
- if (read_next_int(&header, &range->old_start) < 0)
37
- return -1;
38
- if (*header == ',') {
39
- if (read_next_int(&header, &range->old_lines) < 0)
40
- return -1;
41
- } else
42
- range->old_lines = 1;
43
- if (read_next_int(&header, &range->new_start) < 0)
44
- return -1;
45
- if (*header == ',') {
46
- if (read_next_int(&header, &range->new_lines) < 0)
47
- return -1;
48
- } else
49
- range->new_lines = 1;
50
- if (range->old_start < 0 || range->new_start < 0)
51
- return -1;
52
-
53
- return 0;
54
- }
55
-
56
- #define KNOWN_BINARY_FLAGS (GIT_DIFF_FLAG_BINARY|GIT_DIFF_FLAG_NOT_BINARY)
57
- #define NOT_BINARY_FLAGS (GIT_DIFF_FLAG_NOT_BINARY|GIT_DIFF_FLAG__NO_DATA)
58
-
59
- static int update_file_is_binary_by_attr(
60
- git_repository *repo, git_diff_file *file)
61
- {
62
- const char *value;
63
-
64
- /* because of blob diffs, cannot assume path is set */
65
- if (!file->path || !strlen(file->path))
66
- return 0;
67
-
68
- if (git_attr_get(&value, repo, 0, file->path, "diff") < 0)
69
- return -1;
70
-
71
- if (GIT_ATTR_FALSE(value))
72
- file->flags |= GIT_DIFF_FLAG_BINARY;
73
- else if (GIT_ATTR_TRUE(value))
74
- file->flags |= GIT_DIFF_FLAG_NOT_BINARY;
75
- /* otherwise leave file->flags alone */
76
-
77
- return 0;
78
- }
79
-
80
- static void update_delta_is_binary(git_diff_delta *delta)
81
- {
82
- if ((delta->old_file.flags & GIT_DIFF_FLAG_BINARY) != 0 ||
83
- (delta->new_file.flags & GIT_DIFF_FLAG_BINARY) != 0)
84
- delta->flags |= GIT_DIFF_FLAG_BINARY;
85
-
86
- else if ((delta->old_file.flags & NOT_BINARY_FLAGS) != 0 &&
87
- (delta->new_file.flags & NOT_BINARY_FLAGS) != 0)
88
- delta->flags |= GIT_DIFF_FLAG_NOT_BINARY;
89
-
90
- /* otherwise leave delta->flags binary value untouched */
91
- }
92
-
93
- /* returns if we forced binary setting (and no further checks needed) */
94
- static bool diff_delta_is_binary_forced(
95
- diff_context *ctxt,
96
- git_diff_delta *delta)
97
- {
98
- /* return true if binary-ness has already been settled */
99
- if ((delta->flags & KNOWN_BINARY_FLAGS) != 0)
100
- return true;
101
-
102
- /* make sure files are conceivably mmap-able */
103
- if ((git_off_t)((size_t)delta->old_file.size) != delta->old_file.size ||
104
- (git_off_t)((size_t)delta->new_file.size) != delta->new_file.size)
105
- {
106
- delta->old_file.flags |= GIT_DIFF_FLAG_BINARY;
107
- delta->new_file.flags |= GIT_DIFF_FLAG_BINARY;
108
- delta->flags |= GIT_DIFF_FLAG_BINARY;
109
- return true;
110
- }
111
-
112
- /* check if user is forcing us to text diff these files */
113
- if (ctxt->opts && (ctxt->opts->flags & GIT_DIFF_FORCE_TEXT) != 0) {
114
- delta->old_file.flags |= GIT_DIFF_FLAG_NOT_BINARY;
115
- delta->new_file.flags |= GIT_DIFF_FLAG_NOT_BINARY;
116
- delta->flags |= GIT_DIFF_FLAG_NOT_BINARY;
117
- return true;
118
- }
119
-
120
- return false;
121
- }
122
-
123
- static int diff_delta_is_binary_by_attr(
124
- diff_context *ctxt, git_diff_patch *patch)
125
- {
126
- int error = 0, mirror_new;
127
- git_diff_delta *delta = patch->delta;
128
-
129
- if (diff_delta_is_binary_forced(ctxt, delta))
130
- return 0;
131
-
132
- /* check diff attribute +, -, or 0 */
133
- if (update_file_is_binary_by_attr(ctxt->repo, &delta->old_file) < 0)
134
- return -1;
135
-
136
- mirror_new = (delta->new_file.path == delta->old_file.path ||
137
- ctxt->diff->strcomp(delta->new_file.path, delta->old_file.path) == 0);
138
- if (mirror_new)
139
- delta->new_file.flags |= (delta->old_file.flags & KNOWN_BINARY_FLAGS);
140
- else
141
- error = update_file_is_binary_by_attr(ctxt->repo, &delta->new_file);
142
-
143
- update_delta_is_binary(delta);
144
-
145
- return error;
146
- }
147
-
148
- static int diff_delta_is_binary_by_content(
149
- diff_context *ctxt,
150
- git_diff_delta *delta,
151
- git_diff_file *file,
152
- const git_map *map)
153
- {
154
- const git_buf search = { map->data, 0, min(map->len, 4000) };
155
-
156
- if (diff_delta_is_binary_forced(ctxt, delta))
157
- return 0;
158
-
159
- /* TODO: provide encoding / binary detection callbacks that can
160
- * be UTF-8 aware, etc. For now, instead of trying to be smart,
161
- * let's just use the simple NUL-byte detection that core git uses.
162
- */
163
-
164
- /* previously was: if (git_buf_text_is_binary(&search)) */
165
- if (git_buf_text_contains_nul(&search))
166
- file->flags |= GIT_DIFF_FLAG_BINARY;
167
- else
168
- file->flags |= GIT_DIFF_FLAG_NOT_BINARY;
169
-
170
- update_delta_is_binary(delta);
171
-
172
- return 0;
173
- }
174
-
175
- static int diff_delta_is_binary_by_size(
176
- diff_context *ctxt, git_diff_delta *delta, git_diff_file *file)
177
- {
178
- git_off_t threshold = MAX_DIFF_FILESIZE;
179
-
180
- if ((file->flags & KNOWN_BINARY_FLAGS) != 0)
181
- return 0;
182
-
183
- if (ctxt && ctxt->opts) {
184
- if (ctxt->opts->max_size < 0)
185
- return 0;
186
-
187
- if (ctxt->opts->max_size > 0)
188
- threshold = ctxt->opts->max_size;
189
- }
190
-
191
- if (file->size > threshold)
192
- file->flags |= GIT_DIFF_FLAG_BINARY;
193
-
194
- update_delta_is_binary(delta);
195
-
196
- return 0;
197
- }
198
-
199
- static void setup_xdiff_options(
200
- const git_diff_options *opts, xdemitconf_t *cfg, xpparam_t *param)
201
- {
202
- memset(cfg, 0, sizeof(xdemitconf_t));
203
- memset(param, 0, sizeof(xpparam_t));
204
-
205
- cfg->ctxlen =
206
- (!opts) ? 3 : opts->context_lines;
207
- cfg->interhunkctxlen =
208
- (!opts) ? 0 : opts->interhunk_lines;
209
-
210
- if (!opts)
211
- return;
212
-
213
- if (opts->flags & GIT_DIFF_IGNORE_WHITESPACE)
214
- param->flags |= XDF_WHITESPACE_FLAGS;
215
- if (opts->flags & GIT_DIFF_IGNORE_WHITESPACE_CHANGE)
216
- param->flags |= XDF_IGNORE_WHITESPACE_CHANGE;
217
- if (opts->flags & GIT_DIFF_IGNORE_WHITESPACE_EOL)
218
- param->flags |= XDF_IGNORE_WHITESPACE_AT_EOL;
219
- }
220
-
221
-
222
- static int get_blob_content(
223
- diff_context *ctxt,
224
- git_diff_delta *delta,
225
- git_diff_file *file,
226
- git_map *map,
227
- git_blob **blob)
228
- {
229
- int error;
230
- git_odb_object *odb_obj = NULL;
231
-
232
- if (git_oid_iszero(&file->oid))
233
- return 0;
234
-
235
- if (file->mode == GIT_FILEMODE_COMMIT)
236
- {
237
- char oidstr[GIT_OID_HEXSZ+1];
238
- git_buf content = GIT_BUF_INIT;
239
-
240
- git_oid_fmt(oidstr, &file->oid);
241
- oidstr[GIT_OID_HEXSZ] = 0;
242
- git_buf_printf(&content, "Subproject commit %s\n", oidstr );
243
-
244
- map->data = git_buf_detach(&content);
245
- map->len = strlen(map->data);
246
-
247
- file->flags |= GIT_DIFF_FLAG__FREE_DATA;
248
- return 0;
249
- }
250
-
251
- if (!file->size) {
252
- git_odb *odb;
253
- size_t len;
254
- git_otype type;
255
-
256
- /* peek at object header to avoid loading if too large */
257
- if ((error = git_repository_odb__weakptr(&odb, ctxt->repo)) < 0 ||
258
- (error = git_odb__read_header_or_object(
259
- &odb_obj, &len, &type, odb, &file->oid)) < 0)
260
- return error;
261
-
262
- assert(type == GIT_OBJ_BLOB);
263
-
264
- file->size = len;
265
- }
266
-
267
- /* if blob is too large to diff, mark as binary */
268
- if ((error = diff_delta_is_binary_by_size(ctxt, delta, file)) < 0)
269
- return error;
270
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
271
- return 0;
272
-
273
- if (odb_obj != NULL) {
274
- error = git_object__from_odb_object(
275
- (git_object **)blob, ctxt->repo, odb_obj, GIT_OBJ_BLOB);
276
- git_odb_object_free(odb_obj);
277
- } else
278
- error = git_blob_lookup(blob, ctxt->repo, &file->oid);
279
-
280
- if (error)
281
- return error;
282
-
283
- map->data = (void *)git_blob_rawcontent(*blob);
284
- map->len = (size_t)git_blob_rawsize(*blob);
285
-
286
- return diff_delta_is_binary_by_content(ctxt, delta, file, map);
287
- }
288
-
289
- static int get_workdir_sm_content(
290
- diff_context *ctxt,
291
- git_diff_file *file,
292
- git_map *map)
293
- {
294
- int error = 0;
295
- git_buf content = GIT_BUF_INIT;
296
- git_submodule* sm = NULL;
297
- unsigned int sm_status = 0;
298
- const char* sm_status_text = "";
299
- char oidstr[GIT_OID_HEXSZ+1];
300
-
301
- if ((error = git_submodule_lookup(&sm, ctxt->repo, file->path)) < 0 ||
302
- (error = git_submodule_status(&sm_status, sm)) < 0)
303
- {
304
- /* GIT_EEXISTS means a "submodule" that has not been git added */
305
- if (error == GIT_EEXISTS)
306
- error = 0;
307
- return error;
308
- }
309
-
310
- /* update OID if we didn't have it previously */
311
- if ((file->flags & GIT_DIFF_FLAG_VALID_OID) == 0) {
312
- const git_oid* sm_head;
313
-
314
- if ((sm_head = git_submodule_wd_id(sm)) != NULL ||
315
- (sm_head = git_submodule_head_id(sm)) != NULL)
316
- {
317
- git_oid_cpy(&file->oid, sm_head);
318
- file->flags |= GIT_DIFF_FLAG_VALID_OID;
319
- }
320
- }
321
-
322
- git_oid_fmt(oidstr, &file->oid);
323
- oidstr[GIT_OID_HEXSZ] = '\0';
324
-
325
- if (GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
326
- sm_status_text = "-dirty";
327
-
328
- git_buf_printf(&content, "Subproject commit %s%s\n",
329
- oidstr, sm_status_text);
330
-
331
- map->data = git_buf_detach(&content);
332
- map->len = strlen(map->data);
333
-
334
- file->flags |= GIT_DIFF_FLAG__FREE_DATA;
335
-
336
- return 0;
337
- }
338
-
339
- static int get_filtered(
340
- git_map *map, git_file fd, git_diff_file *file, git_vector *filters)
341
- {
342
- int error;
343
- git_buf raw = GIT_BUF_INIT, filtered = GIT_BUF_INIT;
344
-
345
- if ((error = git_futils_readbuffer_fd(&raw, fd, (size_t)file->size)) < 0)
346
- return error;
347
-
348
- if (!filters->length)
349
- git_buf_swap(&filtered, &raw);
350
- else
351
- error = git_filters_apply(&filtered, &raw, filters);
352
-
353
- if (!error) {
354
- map->len = git_buf_len(&filtered);
355
- map->data = git_buf_detach(&filtered);
356
-
357
- file->flags |= GIT_DIFF_FLAG__FREE_DATA;
358
- }
359
-
360
- git_buf_free(&raw);
361
- git_buf_free(&filtered);
362
-
363
- return error;
364
- }
365
-
366
- static int get_workdir_content(
367
- diff_context *ctxt,
368
- git_diff_delta *delta,
369
- git_diff_file *file,
370
- git_map *map)
371
- {
372
- int error = 0;
373
- git_buf path = GIT_BUF_INIT;
374
- const char *wd = git_repository_workdir(ctxt->repo);
375
-
376
- if (S_ISGITLINK(file->mode))
377
- return get_workdir_sm_content(ctxt, file, map);
378
-
379
- if (S_ISDIR(file->mode))
380
- return 0;
381
-
382
- if (git_buf_joinpath(&path, wd, file->path) < 0)
383
- return -1;
384
-
385
- if (S_ISLNK(file->mode)) {
386
- ssize_t alloc_len, read_len;
387
-
388
- file->flags |= GIT_DIFF_FLAG__FREE_DATA;
389
- file->flags |= GIT_DIFF_FLAG_BINARY;
390
-
391
- /* link path on disk could be UTF-16, so prepare a buffer that is
392
- * big enough to handle some UTF-8 data expansion
393
- */
394
- alloc_len = (ssize_t)(file->size * 2) + 1;
395
-
396
- map->data = git__malloc(alloc_len);
397
- GITERR_CHECK_ALLOC(map->data);
398
-
399
- read_len = p_readlink(path.ptr, map->data, alloc_len);
400
- if (read_len < 0) {
401
- giterr_set(GITERR_OS, "Failed to read symlink '%s'", file->path);
402
- error = -1;
403
- goto cleanup;
404
- }
405
-
406
- map->len = read_len;
407
- }
408
- else {
409
- git_file fd = git_futils_open_ro(path.ptr);
410
- git_vector filters = GIT_VECTOR_INIT;
411
-
412
- if (fd < 0) {
413
- error = fd;
414
- goto cleanup;
415
- }
416
-
417
- if (!file->size && !(file->size = git_futils_filesize(fd)))
418
- goto close_and_cleanup;
419
-
420
- if ((error = diff_delta_is_binary_by_size(ctxt, delta, file)) < 0 ||
421
- (delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
422
- goto close_and_cleanup;
423
-
424
- error = git_filters_load(
425
- &filters, ctxt->repo, file->path, GIT_FILTER_TO_ODB);
426
- if (error < 0)
427
- goto close_and_cleanup;
428
-
429
- if (error == 0) { /* note: git_filters_load returns filter count */
430
- error = git_futils_mmap_ro(map, fd, 0, (size_t)file->size);
431
- if (!error)
432
- file->flags |= GIT_DIFF_FLAG__UNMAP_DATA;
433
- }
434
- if (error != 0)
435
- error = get_filtered(map, fd, file, &filters);
436
-
437
- close_and_cleanup:
438
- git_filters_free(&filters);
439
- p_close(fd);
440
- }
441
-
442
- /* once data is loaded, update OID if we didn't have it previously */
443
- if (!error && (file->flags & GIT_DIFF_FLAG_VALID_OID) == 0) {
444
- error = git_odb_hash(
445
- &file->oid, map->data, map->len, GIT_OBJ_BLOB);
446
- if (!error)
447
- file->flags |= GIT_DIFF_FLAG_VALID_OID;
448
- }
449
-
450
- if (!error)
451
- error = diff_delta_is_binary_by_content(ctxt, delta, file, map);
452
-
453
- cleanup:
454
- git_buf_free(&path);
455
- return error;
456
- }
457
-
458
- static void release_content(git_diff_file *file, git_map *map, git_blob *blob)
459
- {
460
- if (blob != NULL)
461
- git_blob_free(blob);
462
-
463
- if (file->flags & GIT_DIFF_FLAG__FREE_DATA) {
464
- git__free(map->data);
465
- map->data = "";
466
- map->len = 0;
467
- file->flags &= ~GIT_DIFF_FLAG__FREE_DATA;
468
- }
469
- else if (file->flags & GIT_DIFF_FLAG__UNMAP_DATA) {
470
- git_futils_mmap_free(map);
471
- map->data = "";
472
- map->len = 0;
473
- file->flags &= ~GIT_DIFF_FLAG__UNMAP_DATA;
474
- }
475
- }
476
-
477
-
478
- static int diff_context_init(
479
- diff_context *ctxt,
480
- git_diff_list *diff,
481
- git_repository *repo,
482
- const git_diff_options *opts,
483
- git_diff_file_cb file_cb,
484
- git_diff_hunk_cb hunk_cb,
485
- git_diff_data_cb data_cb,
486
- void *payload)
487
- {
488
- memset(ctxt, 0, sizeof(diff_context));
489
-
490
- if (!repo && diff)
491
- repo = diff->repo;
492
-
493
- if (!opts && diff)
494
- opts = &diff->opts;
495
-
496
- ctxt->repo = repo;
497
- ctxt->diff = diff;
498
- ctxt->opts = opts;
499
- ctxt->file_cb = file_cb;
500
- ctxt->hunk_cb = hunk_cb;
501
- ctxt->data_cb = data_cb;
502
- ctxt->payload = payload;
503
- ctxt->error = 0;
504
-
505
- setup_xdiff_options(ctxt->opts, &ctxt->xdiff_config, &ctxt->xdiff_params);
506
-
507
- return 0;
508
- }
509
-
510
- static int diff_delta_file_callback(
511
- diff_context *ctxt, git_diff_delta *delta, size_t idx)
512
- {
513
- float progress;
514
-
515
- if (!ctxt->file_cb)
516
- return 0;
517
-
518
- progress = ctxt->diff ? ((float)idx / ctxt->diff->deltas.length) : 1.0f;
519
-
520
- if (ctxt->file_cb(delta, progress, ctxt->payload) != 0)
521
- ctxt->error = GIT_EUSER;
522
-
523
- return ctxt->error;
524
- }
525
-
526
- static void diff_patch_init(
527
- diff_context *ctxt, git_diff_patch *patch)
528
- {
529
- memset(patch, 0, sizeof(git_diff_patch));
530
-
531
- patch->diff = ctxt->diff;
532
- patch->ctxt = ctxt;
533
-
534
- if (patch->diff) {
535
- patch->old_src = patch->diff->old_src;
536
- patch->new_src = patch->diff->new_src;
537
- } else {
538
- patch->old_src = patch->new_src = GIT_ITERATOR_TYPE_TREE;
539
- }
540
- }
541
-
542
- static git_diff_patch *diff_patch_alloc(
543
- diff_context *ctxt, git_diff_delta *delta)
544
- {
545
- git_diff_patch *patch = git__malloc(sizeof(git_diff_patch));
546
- if (!patch)
547
- return NULL;
548
-
549
- diff_patch_init(ctxt, patch);
550
-
551
- git_diff_list_addref(patch->diff);
552
-
553
- GIT_REFCOUNT_INC(patch);
554
-
555
- patch->delta = delta;
556
- patch->flags = GIT_DIFF_PATCH_ALLOCATED;
557
-
558
- return patch;
559
- }
560
-
561
- static int diff_patch_load(
562
- diff_context *ctxt, git_diff_patch *patch)
563
- {
564
- int error = 0;
565
- git_diff_delta *delta = patch->delta;
566
- bool check_if_unmodified = false;
567
-
568
- if ((patch->flags & GIT_DIFF_PATCH_LOADED) != 0)
569
- return 0;
570
-
571
- error = diff_delta_is_binary_by_attr(ctxt, patch);
572
-
573
- patch->old_data.data = "";
574
- patch->old_data.len = 0;
575
- patch->old_blob = NULL;
576
-
577
- patch->new_data.data = "";
578
- patch->new_data.len = 0;
579
- patch->new_blob = NULL;
580
-
581
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
582
- goto cleanup;
583
-
584
- if (!ctxt->hunk_cb &&
585
- !ctxt->data_cb &&
586
- (ctxt->opts->flags & GIT_DIFF_SKIP_BINARY_CHECK) != 0)
587
- goto cleanup;
588
-
589
- switch (delta->status) {
590
- case GIT_DELTA_ADDED:
591
- delta->old_file.flags |= GIT_DIFF_FLAG__NO_DATA;
592
- break;
593
- case GIT_DELTA_DELETED:
594
- delta->new_file.flags |= GIT_DIFF_FLAG__NO_DATA;
595
- break;
596
- case GIT_DELTA_MODIFIED:
597
- break;
598
- case GIT_DELTA_UNTRACKED:
599
- delta->old_file.flags |= GIT_DIFF_FLAG__NO_DATA;
600
- if ((ctxt->opts->flags & GIT_DIFF_INCLUDE_UNTRACKED_CONTENT) == 0)
601
- delta->new_file.flags |= GIT_DIFF_FLAG__NO_DATA;
602
- break;
603
- default:
604
- delta->new_file.flags |= GIT_DIFF_FLAG__NO_DATA;
605
- delta->old_file.flags |= GIT_DIFF_FLAG__NO_DATA;
606
- break;
607
- }
608
-
609
- #define CHECK_UNMODIFIED (GIT_DIFF_FLAG__NO_DATA | GIT_DIFF_FLAG_VALID_OID)
610
-
611
- check_if_unmodified =
612
- (delta->old_file.flags & CHECK_UNMODIFIED) == 0 &&
613
- (delta->new_file.flags & CHECK_UNMODIFIED) == 0;
614
-
615
- /* Always try to load workdir content first, since it may need to be
616
- * filtered (and hence use 2x memory) and we want to minimize the max
617
- * memory footprint during diff.
618
- */
619
-
620
- if ((delta->old_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0 &&
621
- patch->old_src == GIT_ITERATOR_TYPE_WORKDIR) {
622
- if ((error = get_workdir_content(
623
- ctxt, delta, &delta->old_file, &patch->old_data)) < 0)
624
- goto cleanup;
625
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
626
- goto cleanup;
627
- }
628
-
629
- if ((delta->new_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0 &&
630
- patch->new_src == GIT_ITERATOR_TYPE_WORKDIR) {
631
- if ((error = get_workdir_content(
632
- ctxt, delta, &delta->new_file, &patch->new_data)) < 0)
633
- goto cleanup;
634
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
635
- goto cleanup;
636
- }
637
-
638
- if ((delta->old_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0 &&
639
- patch->old_src != GIT_ITERATOR_TYPE_WORKDIR) {
640
- if ((error = get_blob_content(
641
- ctxt, delta, &delta->old_file,
642
- &patch->old_data, &patch->old_blob)) < 0)
643
- goto cleanup;
644
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
645
- goto cleanup;
646
- }
647
-
648
- if ((delta->new_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0 &&
649
- patch->new_src != GIT_ITERATOR_TYPE_WORKDIR) {
650
- if ((error = get_blob_content(
651
- ctxt, delta, &delta->new_file,
652
- &patch->new_data, &patch->new_blob)) < 0)
653
- goto cleanup;
654
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0)
655
- goto cleanup;
656
- }
657
-
658
- /* if we did not previously have the definitive oid, we may have
659
- * incorrect status and need to switch this to UNMODIFIED.
660
- */
661
- if (check_if_unmodified &&
662
- delta->old_file.mode == delta->new_file.mode &&
663
- !git_oid_cmp(&delta->old_file.oid, &delta->new_file.oid))
664
- {
665
- delta->status = GIT_DELTA_UNMODIFIED;
666
-
667
- if ((ctxt->opts->flags & GIT_DIFF_INCLUDE_UNMODIFIED) == 0)
668
- goto cleanup;
669
- }
670
-
671
- cleanup:
672
- if ((delta->flags & KNOWN_BINARY_FLAGS) == 0)
673
- update_delta_is_binary(delta);
674
-
675
- if (!error) {
676
- patch->flags |= GIT_DIFF_PATCH_LOADED;
677
-
678
- /* patch is diffable only for non-binary, modified files where at
679
- * least one side has data and there is actual change in the data
680
- */
681
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0 &&
682
- delta->status != GIT_DELTA_UNMODIFIED &&
683
- (patch->old_data.len || patch->new_data.len) &&
684
- (patch->old_data.len != patch->new_data.len ||
685
- !git_oid_equal(&delta->old_file.oid, &delta->new_file.oid)))
686
- patch->flags |= GIT_DIFF_PATCH_DIFFABLE;
687
- }
688
-
689
- return error;
690
- }
691
-
692
- static int diff_patch_cb(void *priv, mmbuffer_t *bufs, int len)
693
- {
694
- git_diff_patch *patch = priv;
695
- diff_context *ctxt = patch->ctxt;
696
-
697
- if (len == 1) {
698
- ctxt->error = parse_hunk_header(&ctxt->range, bufs[0].ptr);
699
- if (ctxt->error < 0)
700
- return ctxt->error;
701
-
702
- if (ctxt->hunk_cb != NULL &&
703
- ctxt->hunk_cb(patch->delta, &ctxt->range,
704
- bufs[0].ptr, bufs[0].size, ctxt->payload))
705
- ctxt->error = GIT_EUSER;
706
- }
707
-
708
- if (len == 2 || len == 3) {
709
- /* expect " "/"-"/"+", then data */
710
- char origin =
711
- (*bufs[0].ptr == '+') ? GIT_DIFF_LINE_ADDITION :
712
- (*bufs[0].ptr == '-') ? GIT_DIFF_LINE_DELETION :
713
- GIT_DIFF_LINE_CONTEXT;
714
-
715
- if (ctxt->data_cb != NULL &&
716
- ctxt->data_cb(patch->delta, &ctxt->range,
717
- origin, bufs[1].ptr, bufs[1].size, ctxt->payload))
718
- ctxt->error = GIT_EUSER;
719
- }
720
-
721
- if (len == 3 && !ctxt->error) {
722
- /* If we have a '+' and a third buf, then we have added a line
723
- * without a newline and the old code had one, so DEL_EOFNL.
724
- * If we have a '-' and a third buf, then we have removed a line
725
- * with out a newline but added a blank line, so ADD_EOFNL.
726
- */
727
- char origin =
728
- (*bufs[0].ptr == '+') ? GIT_DIFF_LINE_DEL_EOFNL :
729
- (*bufs[0].ptr == '-') ? GIT_DIFF_LINE_ADD_EOFNL :
730
- GIT_DIFF_LINE_CONTEXT;
731
-
732
- if (ctxt->data_cb != NULL &&
733
- ctxt->data_cb(patch->delta, &ctxt->range,
734
- origin, bufs[2].ptr, bufs[2].size, ctxt->payload))
735
- ctxt->error = GIT_EUSER;
736
- }
737
-
738
- return ctxt->error;
739
- }
740
-
741
- static int diff_patch_generate(
742
- diff_context *ctxt, git_diff_patch *patch)
743
- {
744
- int error = 0;
745
- xdemitcb_t xdiff_callback;
746
- mmfile_t old_xdiff_data, new_xdiff_data;
747
-
748
- if ((patch->flags & GIT_DIFF_PATCH_DIFFED) != 0)
749
- return 0;
750
-
751
- if ((patch->flags & GIT_DIFF_PATCH_LOADED) == 0)
752
- if ((error = diff_patch_load(ctxt, patch)) < 0)
753
- return error;
754
-
755
- if ((patch->flags & GIT_DIFF_PATCH_DIFFABLE) == 0)
756
- return 0;
757
-
758
- if (!ctxt->file_cb && !ctxt->hunk_cb)
759
- return 0;
760
-
761
- patch->ctxt = ctxt;
762
-
763
- memset(&xdiff_callback, 0, sizeof(xdiff_callback));
764
- xdiff_callback.outf = diff_patch_cb;
765
- xdiff_callback.priv = patch;
766
-
767
- old_xdiff_data.ptr = patch->old_data.data;
768
- old_xdiff_data.size = patch->old_data.len;
769
- new_xdiff_data.ptr = patch->new_data.data;
770
- new_xdiff_data.size = patch->new_data.len;
771
-
772
- xdl_diff(&old_xdiff_data, &new_xdiff_data,
773
- &ctxt->xdiff_params, &ctxt->xdiff_config, &xdiff_callback);
774
-
775
- error = ctxt->error;
776
-
777
- if (!error)
778
- patch->flags |= GIT_DIFF_PATCH_DIFFED;
779
-
780
- return error;
781
- }
782
-
783
- static void diff_patch_unload(git_diff_patch *patch)
784
- {
785
- if ((patch->flags & GIT_DIFF_PATCH_DIFFED) != 0) {
786
- patch->flags = (patch->flags & ~GIT_DIFF_PATCH_DIFFED);
787
-
788
- patch->hunks_size = 0;
789
- patch->lines_size = 0;
790
- }
791
-
792
- if ((patch->flags & GIT_DIFF_PATCH_LOADED) != 0) {
793
- patch->flags = (patch->flags & ~GIT_DIFF_PATCH_LOADED);
794
-
795
- release_content(
796
- &patch->delta->old_file, &patch->old_data, patch->old_blob);
797
- release_content(
798
- &patch->delta->new_file, &patch->new_data, patch->new_blob);
799
- }
800
- }
801
-
802
- static void diff_patch_free(git_diff_patch *patch)
803
- {
804
- diff_patch_unload(patch);
805
-
806
- git__free(patch->lines);
807
- patch->lines = NULL;
808
- patch->lines_asize = 0;
809
-
810
- git__free(patch->hunks);
811
- patch->hunks = NULL;
812
- patch->hunks_asize = 0;
813
-
814
- if (!(patch->flags & GIT_DIFF_PATCH_ALLOCATED))
815
- return;
816
-
817
- patch->flags = 0;
818
-
819
- git_diff_list_free(patch->diff); /* decrements refcount */
820
-
821
- git__free(patch);
822
- }
823
-
824
- #define MAX_HUNK_STEP 128
825
- #define MIN_HUNK_STEP 8
826
- #define MAX_LINE_STEP 256
827
- #define MIN_LINE_STEP 8
828
-
829
- static int diff_patch_hunk_cb(
830
- const git_diff_delta *delta,
831
- const git_diff_range *range,
832
- const char *header,
833
- size_t header_len,
834
- void *payload)
835
- {
836
- git_diff_patch *patch = payload;
837
- diff_patch_hunk *hunk;
838
-
839
- GIT_UNUSED(delta);
840
-
841
- if (patch->hunks_size >= patch->hunks_asize) {
842
- size_t new_size;
843
- diff_patch_hunk *new_hunks;
844
-
845
- if (patch->hunks_asize > MAX_HUNK_STEP)
846
- new_size = patch->hunks_asize + MAX_HUNK_STEP;
847
- else
848
- new_size = patch->hunks_asize * 2;
849
- if (new_size < MIN_HUNK_STEP)
850
- new_size = MIN_HUNK_STEP;
851
-
852
- new_hunks = git__realloc(
853
- patch->hunks, new_size * sizeof(diff_patch_hunk));
854
- if (!new_hunks)
855
- return -1;
856
-
857
- patch->hunks = new_hunks;
858
- patch->hunks_asize = new_size;
859
- }
860
-
861
- hunk = &patch->hunks[patch->hunks_size++];
862
-
863
- memcpy(&hunk->range, range, sizeof(hunk->range));
864
-
865
- assert(header_len + 1 < sizeof(hunk->header));
866
- memcpy(&hunk->header, header, header_len);
867
- hunk->header[header_len] = '\0';
868
- hunk->header_len = header_len;
869
-
870
- hunk->line_start = patch->lines_size;
871
- hunk->line_count = 0;
872
-
873
- patch->oldno = range->old_start;
874
- patch->newno = range->new_start;
875
-
876
- return 0;
877
- }
878
-
879
- static int diff_patch_line_cb(
880
- const git_diff_delta *delta,
881
- const git_diff_range *range,
882
- char line_origin,
883
- const char *content,
884
- size_t content_len,
885
- void *payload)
886
- {
887
- git_diff_patch *patch = payload;
888
- diff_patch_hunk *hunk;
889
- diff_patch_line *line;
890
-
891
- GIT_UNUSED(delta);
892
- GIT_UNUSED(range);
893
-
894
- assert(patch->hunks_size > 0);
895
- assert(patch->hunks != NULL);
896
-
897
- hunk = &patch->hunks[patch->hunks_size - 1];
898
-
899
- if (patch->lines_size >= patch->lines_asize) {
900
- size_t new_size;
901
- diff_patch_line *new_lines;
902
-
903
- if (patch->lines_asize > MAX_LINE_STEP)
904
- new_size = patch->lines_asize + MAX_LINE_STEP;
905
- else
906
- new_size = patch->lines_asize * 2;
907
- if (new_size < MIN_LINE_STEP)
908
- new_size = MIN_LINE_STEP;
909
-
910
- new_lines = git__realloc(
911
- patch->lines, new_size * sizeof(diff_patch_line));
912
- if (!new_lines)
913
- return -1;
914
-
915
- patch->lines = new_lines;
916
- patch->lines_asize = new_size;
917
- }
918
-
919
- line = &patch->lines[patch->lines_size++];
920
-
921
- line->ptr = content;
922
- line->len = content_len;
923
- line->origin = line_origin;
924
-
925
- /* do some bookkeeping so we can provide old/new line numbers */
926
-
927
- for (line->lines = 0; content_len > 0; --content_len) {
928
- if (*content++ == '\n')
929
- ++line->lines;
930
- }
931
-
932
- switch (line_origin) {
933
- case GIT_DIFF_LINE_ADDITION:
934
- line->oldno = -1;
935
- line->newno = patch->newno;
936
- patch->newno += line->lines;
937
- break;
938
- case GIT_DIFF_LINE_DELETION:
939
- line->oldno = patch->oldno;
940
- line->newno = -1;
941
- patch->oldno += line->lines;
942
- break;
943
- default:
944
- line->oldno = patch->oldno;
945
- line->newno = patch->newno;
946
- patch->oldno += line->lines;
947
- patch->newno += line->lines;
948
- break;
949
- }
950
-
951
- hunk->line_count++;
952
-
953
- return 0;
954
- }
955
-
956
- static int diff_required(git_diff_list *diff, const char *action)
957
- {
958
- if (!diff) {
959
- giterr_set(GITERR_INVALID, "Must provide valid diff to %s", action);
960
- return -1;
961
- }
962
-
963
- return 0;
964
- }
965
-
966
- int git_diff_foreach(
967
- git_diff_list *diff,
968
- git_diff_file_cb file_cb,
969
- git_diff_hunk_cb hunk_cb,
970
- git_diff_data_cb data_cb,
971
- void *payload)
972
- {
973
- int error = 0;
974
- diff_context ctxt;
975
- size_t idx;
976
- git_diff_patch patch;
977
-
978
- if (diff_required(diff, "git_diff_foreach") < 0)
979
- return -1;
980
-
981
- if (diff_context_init(
982
- &ctxt, diff, NULL, NULL, file_cb, hunk_cb, data_cb, payload) < 0)
983
- return -1;
984
-
985
- diff_patch_init(&ctxt, &patch);
986
-
987
- git_vector_foreach(&diff->deltas, idx, patch.delta) {
988
-
989
- /* check flags against patch status */
990
- if (git_diff_delta__should_skip(ctxt.opts, patch.delta))
991
- continue;
992
-
993
- if (!(error = diff_patch_load(&ctxt, &patch))) {
994
-
995
- /* invoke file callback */
996
- error = diff_delta_file_callback(&ctxt, patch.delta, idx);
997
-
998
- /* generate diffs and invoke hunk and line callbacks */
999
- if (!error)
1000
- error = diff_patch_generate(&ctxt, &patch);
1001
-
1002
- diff_patch_unload(&patch);
1003
- }
1004
-
1005
- if (error < 0)
1006
- break;
1007
- }
1008
-
1009
- if (error == GIT_EUSER)
1010
- giterr_clear(); /* don't let error message leak */
1011
-
1012
- return error;
1013
- }
1014
-
1015
-
1016
- typedef struct {
1017
- git_diff_list *diff;
1018
- git_diff_data_cb print_cb;
1019
- void *payload;
1020
- git_buf *buf;
1021
- } diff_print_info;
1022
-
1023
- static char pick_suffix(int mode)
1024
- {
1025
- if (S_ISDIR(mode))
1026
- return '/';
1027
- else if (mode & 0100) //-V536
1028
- /* in git, modes are very regular, so we must have 0100755 mode */
1029
- return '*';
1030
- else
1031
- return ' ';
1032
- }
1033
-
1034
- char git_diff_status_char(git_delta_t status)
1035
- {
1036
- char code;
1037
-
1038
- switch (status) {
1039
- case GIT_DELTA_ADDED: code = 'A'; break;
1040
- case GIT_DELTA_DELETED: code = 'D'; break;
1041
- case GIT_DELTA_MODIFIED: code = 'M'; break;
1042
- case GIT_DELTA_RENAMED: code = 'R'; break;
1043
- case GIT_DELTA_COPIED: code = 'C'; break;
1044
- case GIT_DELTA_IGNORED: code = 'I'; break;
1045
- case GIT_DELTA_UNTRACKED: code = '?'; break;
1046
- default: code = ' '; break;
1047
- }
1048
-
1049
- return code;
1050
- }
1051
-
1052
- static int print_compact(
1053
- const git_diff_delta *delta, float progress, void *data)
1054
- {
1055
- diff_print_info *pi = data;
1056
- char old_suffix, new_suffix, code = git_diff_status_char(delta->status);
1057
-
1058
- GIT_UNUSED(progress);
1059
-
1060
- if (code == ' ')
1061
- return 0;
1062
-
1063
- old_suffix = pick_suffix(delta->old_file.mode);
1064
- new_suffix = pick_suffix(delta->new_file.mode);
1065
-
1066
- git_buf_clear(pi->buf);
1067
-
1068
- if (delta->old_file.path != delta->new_file.path &&
1069
- pi->diff->strcomp(delta->old_file.path,delta->new_file.path) != 0)
1070
- git_buf_printf(pi->buf, "%c\t%s%c -> %s%c\n", code,
1071
- delta->old_file.path, old_suffix, delta->new_file.path, new_suffix);
1072
- else if (delta->old_file.mode != delta->new_file.mode &&
1073
- delta->old_file.mode != 0 && delta->new_file.mode != 0)
1074
- git_buf_printf(pi->buf, "%c\t%s%c (%o -> %o)\n", code,
1075
- delta->old_file.path, new_suffix, delta->old_file.mode, delta->new_file.mode);
1076
- else if (old_suffix != ' ')
1077
- git_buf_printf(pi->buf, "%c\t%s%c\n", code, delta->old_file.path, old_suffix);
1078
- else
1079
- git_buf_printf(pi->buf, "%c\t%s\n", code, delta->old_file.path);
1080
-
1081
- if (git_buf_oom(pi->buf))
1082
- return -1;
1083
-
1084
- if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
1085
- git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
1086
- {
1087
- giterr_clear();
1088
- return GIT_EUSER;
1089
- }
1090
-
1091
- return 0;
1092
- }
1093
-
1094
- int git_diff_print_compact(
1095
- git_diff_list *diff,
1096
- git_diff_data_cb print_cb,
1097
- void *payload)
1098
- {
1099
- int error;
1100
- git_buf buf = GIT_BUF_INIT;
1101
- diff_print_info pi;
1102
-
1103
- pi.diff = diff;
1104
- pi.print_cb = print_cb;
1105
- pi.payload = payload;
1106
- pi.buf = &buf;
1107
-
1108
- error = git_diff_foreach(diff, print_compact, NULL, NULL, &pi);
1109
-
1110
- git_buf_free(&buf);
1111
-
1112
- return error;
1113
- }
1114
-
1115
- static int print_oid_range(diff_print_info *pi, const git_diff_delta *delta)
1116
- {
1117
- char start_oid[8], end_oid[8];
1118
-
1119
- /* TODO: Determine a good actual OID range to print */
1120
- git_oid_tostr(start_oid, sizeof(start_oid), &delta->old_file.oid);
1121
- git_oid_tostr(end_oid, sizeof(end_oid), &delta->new_file.oid);
1122
-
1123
- /* TODO: Match git diff more closely */
1124
- if (delta->old_file.mode == delta->new_file.mode) {
1125
- git_buf_printf(pi->buf, "index %s..%s %o\n",
1126
- start_oid, end_oid, delta->old_file.mode);
1127
- } else {
1128
- if (delta->old_file.mode == 0) {
1129
- git_buf_printf(pi->buf, "new file mode %o\n", delta->new_file.mode);
1130
- } else if (delta->new_file.mode == 0) {
1131
- git_buf_printf(pi->buf, "deleted file mode %o\n", delta->old_file.mode);
1132
- } else {
1133
- git_buf_printf(pi->buf, "old mode %o\n", delta->old_file.mode);
1134
- git_buf_printf(pi->buf, "new mode %o\n", delta->new_file.mode);
1135
- }
1136
- git_buf_printf(pi->buf, "index %s..%s\n", start_oid, end_oid);
1137
- }
1138
-
1139
- if (git_buf_oom(pi->buf))
1140
- return -1;
1141
-
1142
- return 0;
1143
- }
1144
-
1145
- static int print_patch_file(
1146
- const git_diff_delta *delta, float progress, void *data)
1147
- {
1148
- diff_print_info *pi = data;
1149
- const char *oldpfx = pi->diff->opts.old_prefix;
1150
- const char *oldpath = delta->old_file.path;
1151
- const char *newpfx = pi->diff->opts.new_prefix;
1152
- const char *newpath = delta->new_file.path;
1153
-
1154
- GIT_UNUSED(progress);
1155
-
1156
- if (S_ISDIR(delta->new_file.mode) ||
1157
- delta->status == GIT_DELTA_UNMODIFIED ||
1158
- delta->status == GIT_DELTA_IGNORED ||
1159
- (delta->status == GIT_DELTA_UNTRACKED &&
1160
- (pi->diff->opts.flags & GIT_DIFF_INCLUDE_UNTRACKED_CONTENT) == 0))
1161
- return 0;
1162
-
1163
- if (!oldpfx)
1164
- oldpfx = DIFF_OLD_PREFIX_DEFAULT;
1165
-
1166
- if (!newpfx)
1167
- newpfx = DIFF_NEW_PREFIX_DEFAULT;
1168
-
1169
- git_buf_clear(pi->buf);
1170
- git_buf_printf(pi->buf, "diff --git %s%s %s%s\n", oldpfx, delta->old_file.path, newpfx, delta->new_file.path);
1171
-
1172
- if (print_oid_range(pi, delta) < 0)
1173
- return -1;
1174
-
1175
- if (git_oid_iszero(&delta->old_file.oid)) {
1176
- oldpfx = "";
1177
- oldpath = "/dev/null";
1178
- }
1179
- if (git_oid_iszero(&delta->new_file.oid)) {
1180
- newpfx = "";
1181
- newpath = "/dev/null";
1182
- }
1183
-
1184
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0) {
1185
- git_buf_printf(pi->buf, "--- %s%s\n", oldpfx, oldpath);
1186
- git_buf_printf(pi->buf, "+++ %s%s\n", newpfx, newpath);
1187
- }
1188
-
1189
- if (git_buf_oom(pi->buf))
1190
- return -1;
1191
-
1192
- if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
1193
- git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
1194
- {
1195
- giterr_clear();
1196
- return GIT_EUSER;
1197
- }
1198
-
1199
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0)
1200
- return 0;
1201
-
1202
- git_buf_clear(pi->buf);
1203
- git_buf_printf(
1204
- pi->buf, "Binary files %s%s and %s%s differ\n",
1205
- oldpfx, oldpath, newpfx, newpath);
1206
- if (git_buf_oom(pi->buf))
1207
- return -1;
1208
-
1209
- if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_BINARY,
1210
- git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
1211
- {
1212
- giterr_clear();
1213
- return GIT_EUSER;
1214
- }
1215
-
1216
- return 0;
1217
- }
1218
-
1219
- static int print_patch_hunk(
1220
- const git_diff_delta *d,
1221
- const git_diff_range *r,
1222
- const char *header,
1223
- size_t header_len,
1224
- void *data)
1225
- {
1226
- diff_print_info *pi = data;
1227
-
1228
- if (S_ISDIR(d->new_file.mode))
1229
- return 0;
1230
-
1231
- git_buf_clear(pi->buf);
1232
- if (git_buf_printf(pi->buf, "%.*s", (int)header_len, header) < 0)
1233
- return -1;
1234
-
1235
- if (pi->print_cb(d, r, GIT_DIFF_LINE_HUNK_HDR,
1236
- git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
1237
- {
1238
- giterr_clear();
1239
- return GIT_EUSER;
1240
- }
1241
-
1242
- return 0;
1243
- }
1244
-
1245
- static int print_patch_line(
1246
- const git_diff_delta *delta,
1247
- const git_diff_range *range,
1248
- char line_origin, /* GIT_DIFF_LINE value from above */
1249
- const char *content,
1250
- size_t content_len,
1251
- void *data)
1252
- {
1253
- diff_print_info *pi = data;
1254
-
1255
- if (S_ISDIR(delta->new_file.mode))
1256
- return 0;
1257
-
1258
- git_buf_clear(pi->buf);
1259
-
1260
- if (line_origin == GIT_DIFF_LINE_ADDITION ||
1261
- line_origin == GIT_DIFF_LINE_DELETION ||
1262
- line_origin == GIT_DIFF_LINE_CONTEXT)
1263
- git_buf_printf(pi->buf, "%c%.*s", line_origin, (int)content_len, content);
1264
- else if (content_len > 0)
1265
- git_buf_printf(pi->buf, "%.*s", (int)content_len, content);
1266
-
1267
- if (git_buf_oom(pi->buf))
1268
- return -1;
1269
-
1270
- if (pi->print_cb(delta, range, line_origin,
1271
- git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
1272
- {
1273
- giterr_clear();
1274
- return GIT_EUSER;
1275
- }
1276
-
1277
- return 0;
1278
- }
1279
-
1280
- int git_diff_print_patch(
1281
- git_diff_list *diff,
1282
- git_diff_data_cb print_cb,
1283
- void *payload)
1284
- {
1285
- int error;
1286
- git_buf buf = GIT_BUF_INIT;
1287
- diff_print_info pi;
1288
-
1289
- pi.diff = diff;
1290
- pi.print_cb = print_cb;
1291
- pi.payload = payload;
1292
- pi.buf = &buf;
1293
-
1294
- error = git_diff_foreach(
1295
- diff, print_patch_file, print_patch_hunk, print_patch_line, &pi);
1296
-
1297
- git_buf_free(&buf);
1298
-
1299
- return error;
1300
- }
1301
-
1302
- static void set_data_from_blob(
1303
- const git_blob *blob, git_map *map, git_diff_file *file)
1304
- {
1305
- if (blob) {
1306
- file->size = git_blob_rawsize(blob);
1307
- git_oid_cpy(&file->oid, git_object_id((const git_object *)blob));
1308
- file->mode = 0644;
1309
-
1310
- map->len = (size_t)file->size;
1311
- map->data = (char *)git_blob_rawcontent(blob);
1312
- } else {
1313
- file->size = 0;
1314
- file->flags |= GIT_DIFF_FLAG__NO_DATA;
1315
-
1316
- map->len = 0;
1317
- map->data = "";
1318
- }
1319
- }
1320
-
1321
- static void set_data_from_buffer(
1322
- const char *buffer, size_t buffer_len, git_map *map, git_diff_file *file)
1323
- {
1324
- file->size = (git_off_t)buffer_len;
1325
- file->mode = 0644;
1326
- map->len = buffer_len;
1327
-
1328
- if (!buffer) {
1329
- file->flags |= GIT_DIFF_FLAG__NO_DATA;
1330
- map->data = NULL;
1331
- } else {
1332
- map->data = (char *)buffer;
1333
- git_odb_hash(&file->oid, buffer, buffer_len, GIT_OBJ_BLOB);
1334
- }
1335
- }
1336
-
1337
- typedef struct {
1338
- diff_context ctxt;
1339
- git_diff_delta delta;
1340
- git_diff_patch patch;
1341
- } diff_single_data;
1342
-
1343
- static int diff_single_init(
1344
- diff_single_data *data,
1345
- git_repository *repo,
1346
- const git_diff_options *opts,
1347
- git_diff_file_cb file_cb,
1348
- git_diff_hunk_cb hunk_cb,
1349
- git_diff_data_cb data_cb,
1350
- void *payload)
1351
- {
1352
- GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
1353
-
1354
- memset(data, 0, sizeof(*data));
1355
-
1356
- if (diff_context_init(
1357
- &data->ctxt, NULL, repo, opts,
1358
- file_cb, hunk_cb, data_cb, payload) < 0)
1359
- return -1;
1360
-
1361
- diff_patch_init(&data->ctxt, &data->patch);
1362
-
1363
- return 0;
1364
- }
1365
-
1366
- static int diff_single_apply(diff_single_data *data)
1367
- {
1368
- int error;
1369
- git_diff_delta *delta = &data->delta;
1370
- bool has_old = ((delta->old_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0);
1371
- bool has_new = ((delta->new_file.flags & GIT_DIFF_FLAG__NO_DATA) == 0);
1372
-
1373
- /* finish setting up fake git_diff_delta record and loaded data */
1374
-
1375
- data->patch.delta = delta;
1376
- delta->flags = delta->flags & ~KNOWN_BINARY_FLAGS;
1377
-
1378
- delta->status = has_new ?
1379
- (has_old ? GIT_DELTA_MODIFIED : GIT_DELTA_ADDED) :
1380
- (has_old ? GIT_DELTA_DELETED : GIT_DELTA_UNTRACKED);
1381
-
1382
- if (git_oid_cmp(&delta->new_file.oid, &delta->old_file.oid) == 0)
1383
- delta->status = GIT_DELTA_UNMODIFIED;
1384
-
1385
- if ((error = diff_delta_is_binary_by_content(
1386
- &data->ctxt, delta, &delta->old_file, &data->patch.old_data)) < 0 ||
1387
- (error = diff_delta_is_binary_by_content(
1388
- &data->ctxt, delta, &delta->new_file, &data->patch.new_data)) < 0)
1389
- goto cleanup;
1390
-
1391
- data->patch.flags |= GIT_DIFF_PATCH_LOADED;
1392
-
1393
- if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0 &&
1394
- delta->status != GIT_DELTA_UNMODIFIED)
1395
- data->patch.flags |= GIT_DIFF_PATCH_DIFFABLE;
1396
-
1397
- /* do diffs */
1398
-
1399
- if (!(error = diff_delta_file_callback(&data->ctxt, delta, 1)))
1400
- error = diff_patch_generate(&data->ctxt, &data->patch);
1401
-
1402
- cleanup:
1403
- if (error == GIT_EUSER)
1404
- giterr_clear();
1405
-
1406
- diff_patch_unload(&data->patch);
1407
-
1408
- return error;
1409
- }
1410
-
1411
- int git_diff_blobs(
1412
- const git_blob *old_blob,
1413
- const git_blob *new_blob,
1414
- const git_diff_options *options,
1415
- git_diff_file_cb file_cb,
1416
- git_diff_hunk_cb hunk_cb,
1417
- git_diff_data_cb data_cb,
1418
- void *payload)
1419
- {
1420
- int error;
1421
- diff_single_data d;
1422
- git_repository *repo =
1423
- new_blob ? git_object_owner((const git_object *)new_blob) :
1424
- old_blob ? git_object_owner((const git_object *)old_blob) : NULL;
1425
-
1426
- if (!repo) /* Hmm, given two NULL blobs, silently do no callbacks? */
1427
- return 0;
1428
-
1429
- if ((error = diff_single_init(
1430
- &d, repo, options, file_cb, hunk_cb, data_cb, payload)) < 0)
1431
- return error;
1432
-
1433
- if (options && (options->flags & GIT_DIFF_REVERSE) != 0) {
1434
- const git_blob *swap = old_blob;
1435
- old_blob = new_blob;
1436
- new_blob = swap;
1437
- }
1438
-
1439
- set_data_from_blob(old_blob, &d.patch.old_data, &d.delta.old_file);
1440
- set_data_from_blob(new_blob, &d.patch.new_data, &d.delta.new_file);
1441
-
1442
- return diff_single_apply(&d);
1443
- }
1444
-
1445
- int git_diff_blob_to_buffer(
1446
- const git_blob *old_blob,
1447
- const char *buf,
1448
- size_t buflen,
1449
- const git_diff_options *options,
1450
- git_diff_file_cb file_cb,
1451
- git_diff_hunk_cb hunk_cb,
1452
- git_diff_data_cb data_cb,
1453
- void *payload)
1454
- {
1455
- int error;
1456
- diff_single_data d;
1457
- git_repository *repo =
1458
- old_blob ? git_object_owner((const git_object *)old_blob) : NULL;
1459
-
1460
- if (!repo && !buf) /* Hmm, given NULLs, silently do no callbacks? */
1461
- return 0;
1462
-
1463
- if ((error = diff_single_init(
1464
- &d, repo, options, file_cb, hunk_cb, data_cb, payload)) < 0)
1465
- return error;
1466
-
1467
- if (options && (options->flags & GIT_DIFF_REVERSE) != 0) {
1468
- set_data_from_buffer(buf, buflen, &d.patch.old_data, &d.delta.old_file);
1469
- set_data_from_blob(old_blob, &d.patch.new_data, &d.delta.new_file);
1470
- } else {
1471
- set_data_from_blob(old_blob, &d.patch.old_data, &d.delta.old_file);
1472
- set_data_from_buffer(buf, buflen, &d.patch.new_data, &d.delta.new_file);
1473
- }
1474
-
1475
- return diff_single_apply(&d);
1476
- }
1477
-
1478
- size_t git_diff_num_deltas(git_diff_list *diff)
1479
- {
1480
- assert(diff);
1481
- return (size_t)diff->deltas.length;
1482
- }
1483
-
1484
- size_t git_diff_num_deltas_of_type(git_diff_list *diff, git_delta_t type)
1485
- {
1486
- size_t i, count = 0;
1487
- git_diff_delta *delta;
1488
-
1489
- assert(diff);
1490
-
1491
- git_vector_foreach(&diff->deltas, i, delta) {
1492
- count += (delta->status == type);
1493
- }
1494
-
1495
- return count;
1496
- }
1497
-
1498
- int git_diff_get_patch(
1499
- git_diff_patch **patch_ptr,
1500
- const git_diff_delta **delta_ptr,
1501
- git_diff_list *diff,
1502
- size_t idx)
1503
- {
1504
- int error;
1505
- diff_context ctxt;
1506
- git_diff_delta *delta;
1507
- git_diff_patch *patch;
1508
-
1509
- if (patch_ptr)
1510
- *patch_ptr = NULL;
1511
- if (delta_ptr)
1512
- *delta_ptr = NULL;
1513
-
1514
- if (diff_required(diff, "git_diff_get_patch") < 0)
1515
- return -1;
1516
-
1517
- if (diff_context_init(
1518
- &ctxt, diff, NULL, NULL,
1519
- NULL, diff_patch_hunk_cb, diff_patch_line_cb, NULL) < 0)
1520
- return -1;
1521
-
1522
- delta = git_vector_get(&diff->deltas, idx);
1523
- if (!delta) {
1524
- giterr_set(GITERR_INVALID, "Index out of range for delta in diff");
1525
- return GIT_ENOTFOUND;
1526
- }
1527
-
1528
- if (delta_ptr)
1529
- *delta_ptr = delta;
1530
-
1531
- if (!patch_ptr &&
1532
- ((delta->flags & KNOWN_BINARY_FLAGS) != 0 ||
1533
- (diff->opts.flags & GIT_DIFF_SKIP_BINARY_CHECK) != 0))
1534
- return 0;
1535
-
1536
- if (git_diff_delta__should_skip(ctxt.opts, delta))
1537
- return 0;
1538
-
1539
- /* Don't load the patch if the user doesn't want it */
1540
- if (!patch_ptr)
1541
- return 0;
1542
-
1543
- patch = diff_patch_alloc(&ctxt, delta);
1544
- if (!patch)
1545
- return -1;
1546
-
1547
- if (!(error = diff_patch_load(&ctxt, patch))) {
1548
- ctxt.payload = patch;
1549
-
1550
- error = diff_patch_generate(&ctxt, patch);
1551
-
1552
- if (error == GIT_EUSER)
1553
- error = ctxt.error;
1554
- }
1555
-
1556
- if (error)
1557
- git_diff_patch_free(patch);
1558
- else if (patch_ptr)
1559
- *patch_ptr = patch;
1560
-
1561
- return error;
1562
- }
1563
-
1564
- void git_diff_patch_free(git_diff_patch *patch)
1565
- {
1566
- if (patch)
1567
- GIT_REFCOUNT_DEC(patch, diff_patch_free);
1568
- }
1569
-
1570
- const git_diff_delta *git_diff_patch_delta(git_diff_patch *patch)
1571
- {
1572
- assert(patch);
1573
- return patch->delta;
1574
- }
1575
-
1576
- size_t git_diff_patch_num_hunks(git_diff_patch *patch)
1577
- {
1578
- assert(patch);
1579
- return patch->hunks_size;
1580
- }
1581
-
1582
- int git_diff_patch_line_stats(
1583
- size_t *total_ctxt,
1584
- size_t *total_adds,
1585
- size_t *total_dels,
1586
- const git_diff_patch *patch)
1587
- {
1588
- size_t totals[3], idx;
1589
-
1590
- memset(totals, 0, sizeof(totals));
1591
-
1592
- for (idx = 0; idx < patch->lines_size; ++idx) {
1593
- switch (patch->lines[idx].origin) {
1594
- case GIT_DIFF_LINE_CONTEXT: totals[0]++; break;
1595
- case GIT_DIFF_LINE_ADDITION: totals[1]++; break;
1596
- case GIT_DIFF_LINE_DELETION: totals[2]++; break;
1597
- default:
1598
- /* diff --stat and --numstat don't count EOFNL marks because
1599
- * they will always be paired with a ADDITION or DELETION line.
1600
- */
1601
- break;
1602
- }
1603
- }
1604
-
1605
- if (total_ctxt)
1606
- *total_ctxt = totals[0];
1607
- if (total_adds)
1608
- *total_adds = totals[1];
1609
- if (total_dels)
1610
- *total_dels = totals[2];
1611
-
1612
- return 0;
1613
- }
1614
-
1615
- int git_diff_patch_get_hunk(
1616
- const git_diff_range **range,
1617
- const char **header,
1618
- size_t *header_len,
1619
- size_t *lines_in_hunk,
1620
- git_diff_patch *patch,
1621
- size_t hunk_idx)
1622
- {
1623
- diff_patch_hunk *hunk;
1624
-
1625
- assert(patch);
1626
-
1627
- if (hunk_idx >= patch->hunks_size) {
1628
- if (range) *range = NULL;
1629
- if (header) *header = NULL;
1630
- if (header_len) *header_len = 0;
1631
- if (lines_in_hunk) *lines_in_hunk = 0;
1632
- return GIT_ENOTFOUND;
1633
- }
1634
-
1635
- hunk = &patch->hunks[hunk_idx];
1636
-
1637
- if (range) *range = &hunk->range;
1638
- if (header) *header = hunk->header;
1639
- if (header_len) *header_len = hunk->header_len;
1640
- if (lines_in_hunk) *lines_in_hunk = hunk->line_count;
1641
-
1642
- return 0;
1643
- }
1644
-
1645
- int git_diff_patch_num_lines_in_hunk(
1646
- git_diff_patch *patch,
1647
- size_t hunk_idx)
1648
- {
1649
- assert(patch);
1650
-
1651
- if (hunk_idx >= patch->hunks_size)
1652
- return GIT_ENOTFOUND;
1653
- else
1654
- return (int)patch->hunks[hunk_idx].line_count;
1655
- }
1656
-
1657
- int git_diff_patch_get_line_in_hunk(
1658
- char *line_origin,
1659
- const char **content,
1660
- size_t *content_len,
1661
- int *old_lineno,
1662
- int *new_lineno,
1663
- git_diff_patch *patch,
1664
- size_t hunk_idx,
1665
- size_t line_of_hunk)
1666
- {
1667
- diff_patch_hunk *hunk;
1668
- diff_patch_line *line;
1669
-
1670
- assert(patch);
1671
-
1672
- if (hunk_idx >= patch->hunks_size)
1673
- goto notfound;
1674
- hunk = &patch->hunks[hunk_idx];
1675
-
1676
- if (line_of_hunk >= hunk->line_count)
1677
- goto notfound;
1678
-
1679
- line = &patch->lines[hunk->line_start + line_of_hunk];
1680
-
1681
- if (line_origin) *line_origin = line->origin;
1682
- if (content) *content = line->ptr;
1683
- if (content_len) *content_len = line->len;
1684
- if (old_lineno) *old_lineno = (int)line->oldno;
1685
- if (new_lineno) *new_lineno = (int)line->newno;
1686
-
1687
- return 0;
1688
-
1689
- notfound:
1690
- if (line_origin) *line_origin = GIT_DIFF_LINE_CONTEXT;
1691
- if (content) *content = NULL;
1692
- if (content_len) *content_len = 0;
1693
- if (old_lineno) *old_lineno = -1;
1694
- if (new_lineno) *new_lineno = -1;
1695
-
1696
- return GIT_ENOTFOUND;
1697
- }
1698
-
1699
- static int print_to_buffer_cb(
1700
- const git_diff_delta *delta,
1701
- const git_diff_range *range,
1702
- char line_origin,
1703
- const char *content,
1704
- size_t content_len,
1705
- void *payload)
1706
- {
1707
- git_buf *output = payload;
1708
- GIT_UNUSED(delta); GIT_UNUSED(range); GIT_UNUSED(line_origin);
1709
- return git_buf_put(output, content, content_len);
1710
- }
1711
-
1712
- int git_diff_patch_print(
1713
- git_diff_patch *patch,
1714
- git_diff_data_cb print_cb,
1715
- void *payload)
1716
- {
1717
- int error;
1718
- git_buf temp = GIT_BUF_INIT;
1719
- diff_print_info pi;
1720
- size_t h, l;
1721
-
1722
- assert(patch && print_cb);
1723
-
1724
- pi.diff = patch->diff;
1725
- pi.print_cb = print_cb;
1726
- pi.payload = payload;
1727
- pi.buf = &temp;
1728
-
1729
- error = print_patch_file(patch->delta, 0, &pi);
1730
-
1731
- for (h = 0; h < patch->hunks_size && !error; ++h) {
1732
- diff_patch_hunk *hunk = &patch->hunks[h];
1733
-
1734
- error = print_patch_hunk(
1735
- patch->delta, &hunk->range, hunk->header, hunk->header_len, &pi);
1736
-
1737
- for (l = 0; l < hunk->line_count && !error; ++l) {
1738
- diff_patch_line *line = &patch->lines[hunk->line_start + l];
1739
-
1740
- error = print_patch_line(
1741
- patch->delta, &hunk->range,
1742
- line->origin, line->ptr, line->len, &pi);
1743
- }
1744
- }
1745
-
1746
- git_buf_free(&temp);
1747
-
1748
- return error;
1749
- }
1750
-
1751
- int git_diff_patch_to_str(
1752
- char **string,
1753
- git_diff_patch *patch)
1754
- {
1755
- int error;
1756
- git_buf output = GIT_BUF_INIT;
1757
-
1758
- error = git_diff_patch_print(patch, print_to_buffer_cb, &output);
1759
-
1760
- /* GIT_EUSER means git_buf_put in print_to_buffer_cb returned -1,
1761
- * meaning a memory allocation failure, so just map to -1...
1762
- */
1763
- if (error == GIT_EUSER)
1764
- error = -1;
1765
-
1766
- *string = git_buf_detach(&output);
1767
-
1768
- return error;
1769
- }
1770
-
1771
- int git_diff__paired_foreach(
1772
- git_diff_list *idx2head,
1773
- git_diff_list *wd2idx,
1774
- int (*cb)(git_diff_delta *i2h, git_diff_delta *w2i, void *payload),
1775
- void *payload)
1776
- {
1777
- int cmp;
1778
- git_diff_delta *i2h, *w2i;
1779
- size_t i, j, i_max, j_max;
1780
- int (*strcomp)(const char *, const char *);
1781
-
1782
- i_max = idx2head ? idx2head->deltas.length : 0;
1783
- j_max = wd2idx ? wd2idx->deltas.length : 0;
1784
-
1785
- /* Get appropriate strcmp function */
1786
- strcomp = idx2head ? idx2head->strcomp : wd2idx ? wd2idx->strcomp : NULL;
1787
-
1788
- /* Assert both iterators use matching ignore-case. If this function ever
1789
- * supports merging diffs that are not sorted by the same function, then
1790
- * it will need to spool and sort on one of the results before merging
1791
- */
1792
- if (idx2head && wd2idx) {
1793
- assert(idx2head->strcomp == wd2idx->strcomp);
1794
- }
1795
-
1796
- for (i = 0, j = 0; i < i_max || j < j_max; ) {
1797
- i2h = idx2head ? GIT_VECTOR_GET(&idx2head->deltas,i) : NULL;
1798
- w2i = wd2idx ? GIT_VECTOR_GET(&wd2idx->deltas,j) : NULL;
1799
-
1800
- cmp = !w2i ? -1 : !i2h ? 1 :
1801
- strcomp(i2h->old_file.path, w2i->old_file.path);
1802
-
1803
- if (cmp < 0) {
1804
- if (cb(i2h, NULL, payload))
1805
- return GIT_EUSER;
1806
- i++;
1807
- } else if (cmp > 0) {
1808
- if (cb(NULL, w2i, payload))
1809
- return GIT_EUSER;
1810
- j++;
1811
- } else {
1812
- if (cb(i2h, w2i, payload))
1813
- return GIT_EUSER;
1814
- i++; j++;
1815
- }
1816
- }
1817
-
1818
- return 0;
1819
- }