From 0d950eae460540684d8594931954a3b88278d8a4 Mon Sep 17 00:00:00 2001 From: Chris Bargren Date: Mon, 28 Mar 2016 10:45:46 -0700 Subject: [PATCH 01/11] Removing libgit2 as a submodule libgit2 isn't an actual submodule so this just causes problems --- .gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ca6a48f0b..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "vendor/libgit2"] - path = vendor/libgit2 - url = git://github.com/libgit2/libgit2.git From 94f7579442ec64e49b2199cace2ba07130d977d9 Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 28 Mar 2016 11:51:45 -0700 Subject: [PATCH 02/11] Beautifly v0.23.4.json --- generate/input/v0.23.4.json | 35221 +++++++++++++++++++++++++++++++++- 1 file changed, 35220 insertions(+), 1 deletion(-) diff --git a/generate/input/v0.23.4.json b/generate/input/v0.23.4.json index fc90801b6..71acf27a0 100644 --- a/generate/input/v0.23.4.json +++ b/generate/input/v0.23.4.json @@ -1 +1,35220 @@ -{"files":[{"file":"annotated_commit.h","functions":["git_annotated_commit_from_ref","git_annotated_commit_from_fetchhead","git_annotated_commit_lookup","git_annotated_commit_from_revspec","git_annotated_commit_id","git_annotated_commit_free"],"meta":{},"lines":112},{"file":"attr.h","functions":["git_attr_value","git_attr_get","git_attr_get_many","git_attr_foreach","git_attr_cache_flush","git_attr_add_macro"],"meta":{},"lines":240},{"file":"blame.h","functions":["git_blame_init_options","git_blame_get_hunk_count","git_blame_get_hunk_byindex","git_blame_get_hunk_byline","git_blame_file","git_blame_buffer","git_blame_free"],"meta":{},"lines":207},{"file":"blob.h","functions":["git_blob_lookup","git_blob_lookup_prefix","git_blob_free","git_blob_id","git_blob_owner","git_blob_rawcontent","git_blob_rawsize","git_blob_filtered_content","git_blob_create_fromworkdir","git_blob_create_fromdisk","git_blob_create_fromchunks","git_blob_create_frombuffer","git_blob_is_binary"],"meta":{},"lines":217},{"file":"branch.h","functions":["git_branch_create","git_branch_create_from_annotated","git_branch_delete","git_branch_iterator_new","git_branch_next","git_branch_iterator_free","git_branch_move","git_branch_lookup","git_branch_name","git_branch_upstream","git_branch_set_upstream","git_branch_is_head"],"meta":{},"lines":246},{"file":"buffer.h","functions":["git_buf_free","git_buf_grow","git_buf_set","git_buf_is_binary","git_buf_contains_nul"],"meta":{},"lines":122},{"file":"checkout.h","functions":["git_checkout_notify_cb","git_checkout_progress_cb","git_checkout_perfdata_cb","git_checkout_init_options","git_checkout_head","git_checkout_index","git_checkout_tree"],"meta":{},"lines":354},{"file":"cherrypick.h","functions":["git_cherrypick_init_options","git_cherrypick_commit","git_cherrypick"],"meta":{},"lines":84},{"file":"clone.h","functions":["git_remote_create_cb","git_repository_create_cb","git_clone_init_options","git_clone"],"meta":{},"lines":203},{"file":"commit.h","functions":["git_commit_lookup","git_commit_lookup_prefix","git_commit_free","git_commit_id","git_commit_owner","git_commit_message_encoding","git_commit_message","git_commit_message_raw","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_committer","git_commit_author","git_commit_raw_header","git_commit_tree","git_commit_tree_id","git_commit_parentcount","git_commit_parent","git_commit_parent_id","git_commit_nth_gen_ancestor","git_commit_header_field","git_commit_create","git_commit_create_v","git_commit_amend"],"meta":{},"lines":364},{"file":"common.h","functions":["git_libgit2_version","git_libgit2_features","git_libgit2_opts"],"meta":{},"lines":245},{"file":"config.h","functions":["git_config_entry_free","git_config_find_global","git_config_find_xdg","git_config_find_system","git_config_open_default","git_config_new","git_config_add_file_ondisk","git_config_open_ondisk","git_config_open_level","git_config_open_global","git_config_snapshot","git_config_free","git_config_get_entry","git_config_get_int32","git_config_get_int64","git_config_get_bool","git_config_get_path","git_config_get_string","git_config_get_string_buf","git_config_get_multivar_foreach","git_config_multivar_iterator_new","git_config_next","git_config_iterator_free","git_config_set_int32","git_config_set_int64","git_config_set_bool","git_config_set_string","git_config_set_multivar","git_config_delete_entry","git_config_delete_multivar","git_config_foreach","git_config_iterator_new","git_config_iterator_glob_new","git_config_foreach_match","git_config_get_mapped","git_config_lookup_map_value","git_config_parse_bool","git_config_parse_int32","git_config_parse_int64","git_config_parse_path","git_config_backend_foreach_match"],"meta":{},"lines":691},{"file":"cred_helpers.h","functions":["git_cred_userpass"],"meta":{},"lines":48},{"file":"describe.h","functions":["git_describe_commit","git_describe_workdir","git_describe_format","git_describe_result_free"],"meta":{},"lines":158},{"file":"diff.h","functions":["git_diff_notify_cb","git_diff_init_options","git_diff_file_cb","git_diff_binary_cb","git_diff_hunk_cb","git_diff_line_cb","git_diff_find_init_options","git_diff_free","git_diff_tree_to_tree","git_diff_tree_to_index","git_diff_index_to_workdir","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_diff_merge","git_diff_find_similar","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_get_delta","git_diff_is_sorted_icase","git_diff_foreach","git_diff_status_char","git_diff_print","git_diff_blobs","git_diff_blob_to_buffer","git_diff_buffers","git_diff_get_stats","git_diff_stats_files_changed","git_diff_stats_insertions","git_diff_stats_deletions","git_diff_stats_to_buf","git_diff_stats_free","git_diff_format_email","git_diff_commit_as_email","git_diff_format_email_init_options"],"meta":{},"lines":1301},{"file":"errors.h","functions":["giterr_last","giterr_clear","giterr_detach","giterr_set_str","giterr_set_oom"],"meta":{},"lines":160},{"file":"filter.h","functions":["git_filter_list_load","git_filter_list_contains","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_apply_to_blob","git_filter_list_stream_data","git_filter_list_stream_file","git_filter_list_stream_blob","git_filter_list_free"],"meta":{},"lines":210},{"file":"global.h","functions":["git_libgit2_init","git_libgit2_shutdown"],"meta":{},"lines":39},{"file":"graph.h","functions":["git_graph_ahead_behind","git_graph_descendant_of"],"meta":{},"lines":51},{"file":"ignore.h","functions":["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"],"meta":{},"lines":74},{"file":"index.h","functions":["git_index_matched_path_cb","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_path","git_index_checksum","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_remove_directory","git_index_add","git_index_entry_stage","git_index_entry_is_conflict","git_index_add_bypath","git_index_add_frombuffer","git_index_remove_bypath","git_index_add_all","git_index_remove_all","git_index_update_all","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_conflict_iterator_new","git_index_conflict_next","git_index_conflict_iterator_free"],"meta":{},"lines":755},{"file":"indexer.h","functions":["git_indexer_new","git_indexer_append","git_indexer_commit","git_indexer_hash","git_indexer_free"],"meta":{},"lines":72},{"file":"merge.h","functions":["git_merge_file_init_input","git_merge_file_init_options","git_merge_init_options","git_merge_analysis","git_merge_base","git_merge_bases","git_merge_base_many","git_merge_bases_many","git_merge_base_octopus","git_merge_file","git_merge_file_from_index","git_merge_file_result_free","git_merge_trees","git_merge_commits","git_merge"],"meta":{},"lines":547},{"file":"message.h","functions":["git_message_prettify"],"meta":{},"lines":39},{"file":"net.h","functions":["git_headlist_cb"],"meta":{},"lines":55},{"file":"notes.h","functions":["git_note_foreach_cb","git_note_iterator_new","git_note_iterator_free","git_note_next","git_note_read","git_note_author","git_note_committer","git_note_message","git_note_id","git_note_create","git_note_remove","git_note_free","git_note_foreach"],"meta":{},"lines":213},{"file":"object.h","functions":["git_object_lookup","git_object_lookup_prefix","git_object_lookup_bypath","git_object_id","git_object_short_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","git_object_dup"],"meta":{},"lines":237},{"file":"odb.h","functions":["git_odb_foreach_cb","git_odb_new","git_odb_open","git_odb_add_disk_alternate","git_odb_free","git_odb_read","git_odb_read_prefix","git_odb_read_header","git_odb_exists","git_odb_exists_prefix","git_odb_refresh","git_odb_foreach","git_odb_write","git_odb_open_wstream","git_odb_stream_write","git_odb_stream_finalize_write","git_odb_stream_read","git_odb_stream_free","git_odb_open_rstream","git_odb_write_pack","git_odb_hash","git_odb_hashfile","git_odb_object_dup","git_odb_object_free","git_odb_object_id","git_odb_object_data","git_odb_object_size","git_odb_object_type","git_odb_add_backend","git_odb_add_alternate","git_odb_num_backends","git_odb_get_backend"],"meta":{},"lines":491},{"file":"odb_backend.h","functions":["git_odb_backend_pack","git_odb_backend_loose","git_odb_backend_one_pack"],"meta":{},"lines":130},{"file":"oid.h","functions":["git_oid_fromstr","git_oid_fromstrp","git_oid_fromstrn","git_oid_fromraw","git_oid_fmt","git_oid_nfmt","git_oid_pathfmt","git_oid_tostr_s","git_oid_tostr","git_oid_cpy","git_oid_cmp","git_oid_equal","git_oid_ncmp","git_oid_streq","git_oid_strcmp","git_oid_iszero","git_oid_shorten_new","git_oid_shorten_add","git_oid_shorten_free"],"meta":{},"lines":265},{"file":"oidarray.h","functions":["git_oidarray_free"],"meta":{},"lines":34},{"file":"pack.h","functions":["git_packbuilder_new","git_packbuilder_set_threads","git_packbuilder_insert","git_packbuilder_insert_tree","git_packbuilder_insert_commit","git_packbuilder_insert_walk","git_packbuilder_insert_recur","git_packbuilder_write","git_packbuilder_hash","git_packbuilder_foreach","git_packbuilder_object_count","git_packbuilder_written","git_packbuilder_progress","git_packbuilder_set_callbacks","git_packbuilder_free"],"meta":{},"lines":236},{"file":"patch.h","functions":["git_patch_from_diff","git_patch_from_blobs","git_patch_from_blob_and_buffer","git_patch_from_buffers","git_patch_free","git_patch_get_delta","git_patch_num_hunks","git_patch_line_stats","git_patch_get_hunk","git_patch_num_lines_in_hunk","git_patch_get_line_in_hunk","git_patch_size","git_patch_print","git_patch_to_buf"],"meta":{},"lines":268},{"file":"pathspec.h","functions":["git_pathspec_new","git_pathspec_free","git_pathspec_matches_path","git_pathspec_match_workdir","git_pathspec_match_index","git_pathspec_match_tree","git_pathspec_match_diff","git_pathspec_match_list_free","git_pathspec_match_list_entrycount","git_pathspec_match_list_entry","git_pathspec_match_list_diff_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_failed_entry"],"meta":{},"lines":260},{"file":"rebase.h","functions":["git_rebase_init_options","git_rebase_init","git_rebase_open","git_rebase_operation_entrycount","git_rebase_operation_current","git_rebase_operation_byindex","git_rebase_next","git_rebase_commit","git_rebase_abort","git_rebase_finish","git_rebase_free"],"meta":{},"lines":286},{"file":"refdb.h","functions":["git_refdb_new","git_refdb_open","git_refdb_compress","git_refdb_free"],"meta":{},"lines":63},{"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_id_old","git_reflog_entry_id_new","git_reflog_entry_committer","git_reflog_entry_message","git_reflog_free"],"meta":{},"lines":166},{"file":"refs.h","functions":["git_reference_lookup","git_reference_name_to_id","git_reference_dwim","git_reference_symbolic_create_matching","git_reference_symbolic_create","git_reference_create","git_reference_create_matching","git_reference_target","git_reference_target_peel","git_reference_symbolic_target","git_reference_type","git_reference_name","git_reference_resolve","git_reference_owner","git_reference_symbolic_set_target","git_reference_set_target","git_reference_rename","git_reference_delete","git_reference_remove","git_reference_list","git_reference_foreach","git_reference_foreach_name","git_reference_free","git_reference_cmp","git_reference_iterator_new","git_reference_iterator_glob_new","git_reference_next","git_reference_next_name","git_reference_iterator_free","git_reference_foreach_glob","git_reference_has_log","git_reference_ensure_log","git_reference_is_branch","git_reference_is_remote","git_reference_is_tag","git_reference_is_note","git_reference_normalize_name","git_reference_peel","git_reference_is_valid_name","git_reference_shorthand"],"meta":{},"lines":730},{"file":"refspec.h","functions":["git_refspec_src","git_refspec_dst","git_refspec_string","git_refspec_force","git_refspec_direction","git_refspec_src_matches","git_refspec_dst_matches","git_refspec_transform","git_refspec_rtransform"],"meta":{},"lines":100},{"file":"remote.h","functions":["git_remote_rename_problem_cb","git_remote_create","git_remote_create_with_fetchspec","git_remote_create_anonymous","git_remote_lookup","git_remote_dup","git_remote_owner","git_remote_name","git_remote_url","git_remote_pushurl","git_remote_set_url","git_remote_set_pushurl","git_remote_add_fetch","git_remote_get_fetch_refspecs","git_remote_add_push","git_remote_get_push_refspecs","git_remote_refspec_count","git_remote_get_refspec","git_remote_connect","git_remote_ls","git_remote_connected","git_remote_stop","git_remote_disconnect","git_remote_free","git_remote_list","git_push_transfer_progress","git_push_negotiation","git_remote_init_callbacks","git_fetch_init_options","git_push_init_options","git_remote_download","git_remote_upload","git_remote_update_tips","git_remote_fetch","git_remote_prune","git_remote_push","git_remote_stats","git_remote_autotag","git_remote_set_autotag","git_remote_prune_refs","git_remote_rename","git_remote_is_valid_name","git_remote_delete","git_remote_default_branch"],"meta":{},"lines":796},{"file":"repository.h","functions":["git_repository_open","git_repository_wrap_odb","git_repository_discover","git_repository_open_ext","git_repository_open_bare","git_repository_free","git_repository_init","git_repository_init_init_options","git_repository_init_ext","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_is_empty","git_repository_path","git_repository_workdir","git_repository_set_workdir","git_repository_is_bare","git_repository_config","git_repository_config_snapshot","git_repository_odb","git_repository_refdb","git_repository_index","git_repository_message","git_repository_message_remove","git_repository_state_cleanup","git_repository_fetchhead_foreach","git_repository_mergehead_foreach","git_repository_hashfile","git_repository_set_head","git_repository_set_head_detached","git_repository_set_head_detached_from_annotated","git_repository_detach_head","git_repository_state","git_repository_set_namespace","git_repository_get_namespace","git_repository_is_shallow","git_repository_ident","git_repository_set_ident"],"meta":{},"lines":750},{"file":"reset.h","functions":["git_reset","git_reset_from_annotated","git_reset_default"],"meta":{},"lines":107},{"file":"revert.h","functions":["git_revert_init_options","git_revert_commit","git_revert"],"meta":{},"lines":84},{"file":"revparse.h","functions":["git_revparse_single","git_revparse_ext","git_revparse"],"meta":{},"lines":108},{"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_push_range","git_revwalk_simplify_first_parent","git_revwalk_free","git_revwalk_repository","git_revwalk_hide_cb","git_revwalk_add_hide_cb"],"meta":{},"lines":293},{"file":"signature.h","functions":["git_signature_new","git_signature_now","git_signature_default","git_signature_dup","git_signature_free"],"meta":{},"lines":86},{"file":"stash.h","functions":["git_stash_apply_progress_cb","git_stash_apply_init_options","git_stash_apply","git_stash_cb","git_stash_foreach","git_stash_drop","git_stash_pop"],"meta":{},"lines":253},{"file":"status.h","functions":["git_status_cb","git_status_init_options","git_status_foreach","git_status_foreach_ext","git_status_file","git_status_list_new","git_status_list_entrycount","git_status_byindex","git_status_list_free","git_status_should_ignore"],"meta":{},"lines":366},{"file":"strarray.h","functions":["git_strarray_free","git_strarray_copy"],"meta":{},"lines":53},{"file":"submodule.h","functions":["git_submodule_update_init_options","git_submodule_update","git_submodule_lookup","git_submodule_free","git_submodule_foreach","git_submodule_add_setup","git_submodule_add_finalize","git_submodule_add_to_index","git_submodule_owner","git_submodule_name","git_submodule_path","git_submodule_url","git_submodule_resolve_url","git_submodule_branch","git_submodule_set_branch","git_submodule_set_url","git_submodule_index_id","git_submodule_head_id","git_submodule_wd_id","git_submodule_ignore","git_submodule_set_ignore","git_submodule_update_strategy","git_submodule_set_update","git_submodule_fetch_recurse_submodules","git_submodule_set_fetch_recurse_submodules","git_submodule_init","git_submodule_repo_init","git_submodule_sync","git_submodule_open","git_submodule_reload","git_submodule_status","git_submodule_location"],"meta":{},"lines":622},{"file":"sys/commit.h","functions":["git_commit_create_from_ids","git_commit_create_from_callback"],"meta":{},"lines":76},{"file":"sys/config.h","functions":["git_config_init_backend","git_config_add_backend"],"meta":{},"lines":109},{"file":"sys/diff.h","functions":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_diff_get_perfdata","git_status_list_get_perfdata"],"meta":{},"lines":90},{"file":"sys/filter.h","functions":["git_filter_lookup","git_filter_list_new","git_filter_list_push","git_filter_list_length","git_filter_source_repo","git_filter_source_path","git_filter_source_filemode","git_filter_source_id","git_filter_source_mode","git_filter_source_flags","git_filter_init_fn","git_filter_shutdown_fn","git_filter_check_fn","git_filter_apply_fn","git_filter_cleanup_fn","git_filter_register","git_filter_unregister"],"meta":{},"lines":305},{"file":"sys/hashsig.h","functions":["git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free","git_hashsig_compare"],"meta":{},"lines":102},{"file":"sys/mempack.h","functions":["git_mempack_new","git_mempack_reset"],"meta":{},"lines":81},{"file":"sys/odb_backend.h","functions":["git_odb_init_backend"],"meta":{},"lines":102},{"file":"sys/openssl.h","functions":["git_openssl_set_locking"],"meta":{},"lines":34},{"file":"sys/refdb_backend.h","functions":["git_refdb_init_backend","git_refdb_backend_fs","git_refdb_set_backend"],"meta":{},"lines":213},{"file":"sys/refs.h","functions":["git_reference__alloc","git_reference__alloc_symbolic"],"meta":{},"lines":45},{"file":"sys/repository.h","functions":["git_repository_new","git_repository__cleanup","git_repository_reinit_filesystem","git_repository_set_config","git_repository_set_odb","git_repository_set_refdb","git_repository_set_index","git_repository_set_bare"],"meta":{},"lines":136},{"file":"sys/stream.h","functions":[],"meta":{},"lines":40},{"file":"sys/transport.h","functions":["git_transport_init","git_transport_new","git_transport_ssh_with_paths","git_transport_unregister","git_transport_dummy","git_transport_local","git_transport_smart","git_smart_subtransport_http","git_smart_subtransport_git","git_smart_subtransport_ssh"],"meta":{},"lines":349},{"file":"tag.h","functions":["git_tag_lookup","git_tag_lookup_prefix","git_tag_free","git_tag_id","git_tag_owner","git_tag_target","git_tag_target_id","git_tag_target_type","git_tag_name","git_tag_tagger","git_tag_message","git_tag_create","git_tag_annotation_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":{},"lines":348},{"file":"trace.h","functions":["git_trace_callback","git_trace_set"],"meta":{},"lines":63},{"file":"transport.h","functions":["git_transport_cb","git_cred_has_username","git_cred_userpass_plaintext_new","git_cred_ssh_key_new","git_cred_ssh_interactive_new","git_cred_ssh_key_from_agent","git_cred_ssh_custom_new","git_cred_default_new","git_cred_username_new","git_cred_ssh_key_memory_new","git_cred_acquire_cb"],"meta":{},"lines":334},{"file":"tree.h","functions":["git_tree_lookup","git_tree_lookup_prefix","git_tree_free","git_tree_id","git_tree_owner","git_tree_entrycount","git_tree_entry_byname","git_tree_entry_byindex","git_tree_entry_byid","git_tree_entry_bypath","git_tree_entry_dup","git_tree_entry_free","git_tree_entry_name","git_tree_entry_id","git_tree_entry_type","git_tree_entry_filemode","git_tree_entry_filemode_raw","git_tree_entry_cmp","git_tree_entry_to_object","git_treebuilder_new","git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_remove","git_treebuilder_filter_cb","git_treebuilder_filter","git_treebuilder_write","git_treewalk_cb","git_tree_walk"],"meta":{},"lines":410},{"file":"types.h","functions":["git_transfer_progress_cb","git_transport_message_cb","git_transport_certificate_check_cb"],"meta":{},"lines":425}],"functions":{"git_annotated_commit_from_ref":{"type":"function","file":"annotated_commit.h","line":33,"lineto":36,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given reference"},{"name":"ref","type":"const git_reference *","comment":"reference to use to lookup the git_annotated_commit"}],"argline":"git_annotated_commit **out, git_repository *repo, const git_reference *ref","sig":"git_annotated_commit **::git_repository *::const git_reference *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"","group":"annotated"},"git_annotated_commit_from_fetchhead":{"type":"function","file":"annotated_commit.h","line":50,"lineto":55,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given commit"},{"name":"branch_name","type":"const char *","comment":"name of the (remote) branch"},{"name":"remote_url","type":"const char *","comment":"url of the remote"},{"name":"id","type":"const git_oid *","comment":"the commit object id of the remote branch"}],"argline":"git_annotated_commit **out, git_repository *repo, const char *branch_name, const char *remote_url, const git_oid *id","sig":"git_annotated_commit **::git_repository *::const char *::const char *::const git_oid *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given fetch head data.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"","group":"annotated"},"git_annotated_commit_lookup":{"type":"function","file":"annotated_commit.h","line":75,"lineto":78,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given commit"},{"name":"id","type":"const git_oid *","comment":"the commit object id to lookup"}],"argline":"git_annotated_commit **out, git_repository *repo, const git_oid *id","sig":"git_annotated_commit **::git_repository *::const git_oid *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n","comments":"

An annotated commit contains information about how it was\n looked up, which may be useful for functions like merge or\n rebase to provide context to the operation. For example,\n conflict files will include the name of the source or target\n branches being merged. It is therefore preferable to use the\n most specific function (eg git_annotated_commit_from_ref)\n instead of this one when that data is known.

\n","group":"annotated"},"git_annotated_commit_from_revspec":{"type":"function","file":"annotated_commit.h","line":92,"lineto":95,"args":[{"name":"out","type":"git_annotated_commit **","comment":"pointer to store the git_annotated_commit result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given commit"},{"name":"revspec","type":"const char *","comment":"the extended sha syntax string to use to lookup the commit"}],"argline":"git_annotated_commit **out, git_repository *repo, const char *revspec","sig":"git_annotated_commit **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Creates a git_annotated_comit from a revision string.

\n","comments":"

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n","group":"annotated"},"git_annotated_commit_id":{"type":"function","file":"annotated_commit.h","line":103,"lineto":104,"args":[{"name":"commit","type":"const git_annotated_commit *","comment":"the given annotated commit"}],"argline":"const git_annotated_commit *commit","sig":"const git_annotated_commit *","return":{"type":"const git_oid *","comment":" commit id"},"description":"

Gets the commit ID that the given git_annotated_commit refers to.

\n","comments":"","group":"annotated"},"git_annotated_commit_free":{"type":"function","file":"annotated_commit.h","line":111,"lineto":112,"args":[{"name":"commit","type":"git_annotated_commit *","comment":"annotated commit to free"}],"argline":"git_annotated_commit *commit","sig":"git_annotated_commit *","return":{"type":"void","comment":null},"description":"

Frees a git_annotated_commit.

\n","comments":"","group":"annotated"},"git_attr_value":{"type":"function","file":"attr.h","line":102,"lineto":102,"args":[{"name":"attr","type":"const char *","comment":"The attribute"}],"argline":"const char *attr","sig":"const char *","return":{"type":"git_attr_t","comment":" the value type for the attribute"},"description":"

Return the value type for a given attribute.

\n","comments":"

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute\n was not set at all), or VALUE, if the attribute was set to an\n actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally\n as a NULL-terminated C string.

\n","group":"attr"},"git_attr_get":{"type":"function","file":"attr.h","line":145,"lineto":150,"args":[{"name":"value_out","type":"const char **","comment":"Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n 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\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n 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, git_repository *repo, uint32_t flags, const char *path, const char *name","sig":"const char **::git_repository *::uint32_t::const char *::const char *","return":{"type":"int","comment":null},"description":"

Look up the value of one git attribute for path.

\n","comments":"","group":"attr"},"git_attr_get_many":{"type":"function","file":"attr.h","line":181,"lineto":187,"args":[{"name":"values_out","type":"const char **","comment":"An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)."},{"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\n does not have to exist, but if it does not, then\n 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, git_repository *repo, uint32_t flags, const char *path, size_t num_attr, const char **names","sig":"const char **::git_repository *::uint32_t::const char *::size_t::const char **","return":{"type":"int","comment":null},"description":"

Look up a list of git attributes for path.

\n","comments":"

Use this if you have a known list of attributes that you want to\n look up in a single call. This is somewhat more efficient than\n calling git_attr_get() multiple times.

\n\n

For 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
\n\n

Then you could loop through the 3 values to get the settings for\n the three attributes you asked about.

\n","group":"attr"},"git_attr_foreach":{"type":"function","file":"attr.h","line":209,"lineto":214,"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\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)."},{"name":"callback","type":"git_attr_foreach_cb","comment":"Function to invoke on each attribute name and value. The\n value may be NULL is the attribute is explicitly set to\n UNSPECIFIED using the '!' sign. Callback will be invoked\n only once per attribute name, even if there are multiple\n rules for a given file. The highest priority rule will be\n used. Return a non-zero value from this to stop looping.\n The value will be returned from `git_attr_foreach`."},{"name":"payload","type":"void *","comment":"Passed on as extra parameter to callback function."}],"argline":"git_repository *repo, uint32_t flags, const char *path, git_attr_foreach_cb callback, void *payload","sig":"git_repository *::uint32_t::const char *::git_attr_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all the git attributes for a path.

\n","comments":"","group":"attr"},"git_attr_cache_flush":{"type":"function","file":"attr.h","line":224,"lineto":225,"args":[{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void","comment":null},"description":"

Flush the gitattributes cache.

\n","comments":"

Call this if you have reason to believe that the attributes files on\n disk no longer match the cached contents of memory. This will cause\n the attributes files to be reloaded the next time that an attribute\n access function is called.

\n","group":"attr"},"git_attr_add_macro":{"type":"function","file":"attr.h","line":237,"lineto":240,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"name","type":"const char *","comment":null},{"name":"values","type":"const char *","comment":null}],"argline":"git_repository *repo, const char *name, const char *values","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Add a macro definition.

\n","comments":"

Macros will automatically be loaded from the top level .gitattributes\n file of the repository (plus the build-in "binary" macro). This\n function allows you to add others. For example, to add the default\n macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n","group":"attr"},"git_blame_init_options":{"type":"function","file":"blame.h","line":92,"lineto":94,"args":[{"name":"opts","type":"git_blame_options *","comment":"The `git_blame_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`"}],"argline":"git_blame_options *opts, unsigned int version","sig":"git_blame_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_blame_options with default values. Equivalent to\n creating an instance with GIT_BLAME_OPTIONS_INIT.

\n","comments":"","group":"blame"},"git_blame_get_hunk_count":{"type":"function","file":"blame.h","line":137,"lineto":137,"args":[{"name":"blame","type":"git_blame *","comment":null}],"argline":"git_blame *blame","sig":"git_blame *","return":{"type":"uint32_t","comment":null},"description":"

Gets the number of hunks that exist in the blame structure.

\n","comments":"","group":"blame"},"git_blame_get_hunk_byindex":{"type":"function","file":"blame.h","line":146,"lineto":148,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to query"},{"name":"index","type":"uint32_t","comment":"index of the hunk to retrieve"}],"argline":"git_blame *blame, uint32_t index","sig":"git_blame *::uint32_t","return":{"type":"const git_blame_hunk *","comment":" the hunk at the given index, or NULL on error"},"description":"

Gets the blame hunk at the given index.

\n","comments":"","group":"blame"},"git_blame_get_hunk_byline":{"type":"function","file":"blame.h","line":157,"lineto":159,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to query"},{"name":"lineno","type":"uint32_t","comment":"the (1-based) line number to find a hunk for"}],"argline":"git_blame *blame, uint32_t lineno","sig":"git_blame *::uint32_t","return":{"type":"const git_blame_hunk *","comment":" the hunk that contains the given line, or NULL on error"},"description":"

Gets the hunk that relates to the given line number in the newest commit.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blame_get_hunk_byline-1"]}},"git_blame_file":{"type":"function","file":"blame.h","line":172,"lineto":176,"args":[{"name":"out","type":"git_blame **","comment":"pointer that will receive the blame object"},{"name":"repo","type":"git_repository *","comment":"repository whose history is to be walked"},{"name":"path","type":"const char *","comment":"path to file to consider"},{"name":"options","type":"git_blame_options *","comment":"options for the blame operation. If NULL, this is treated as\n though GIT_BLAME_OPTIONS_INIT were passed."}],"argline":"git_blame **out, git_repository *repo, const char *path, git_blame_options *options","sig":"git_blame **::git_repository *::const char *::git_blame_options *","return":{"type":"int","comment":" 0 on success, or an error code. (use giterr_last for information\n about the error.)"},"description":"

Get the blame for a single file.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blame_file-2"]}},"git_blame_buffer":{"type":"function","file":"blame.h","line":196,"lineto":200,"args":[{"name":"out","type":"git_blame **","comment":"pointer that will receive the resulting blame data"},{"name":"reference","type":"git_blame *","comment":"cached blame from the history of the file (usually the output\n from git_blame_file)"},{"name":"buffer","type":"const char *","comment":"the (possibly) modified contents of the file"},{"name":"buffer_len","type":"size_t","comment":"number of valid bytes in the buffer"}],"argline":"git_blame **out, git_blame *reference, const char *buffer, size_t buffer_len","sig":"git_blame **::git_blame *::const char *::size_t","return":{"type":"int","comment":" 0 on success, or an error code. (use giterr_last for information\n about the error)"},"description":"

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n","comments":"

Lines that differ between the buffer and the committed version are marked as\n having a zero OID for their final_commit_id.

\n","group":"blame"},"git_blame_free":{"type":"function","file":"blame.h","line":207,"lineto":207,"args":[{"name":"blame","type":"git_blame *","comment":"the blame structure to free"}],"argline":"git_blame *blame","sig":"git_blame *","return":{"type":"void","comment":null},"description":"

Free memory allocated by git_blame_file or git_blame_buffer.

\n","comments":"","group":"blame","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blame_free-3"]}},"git_blob_lookup":{"type":"function","file":"blob.h","line":33,"lineto":33,"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.

\n","comments":"","group":"blob","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blob_lookup-4"],"general.c":["ex/v0.23.2/general.html#git_blob_lookup-1"]}},"git_blob_lookup_prefix":{"type":"function","file":"blob.h","line":47,"lineto":47,"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,\n given a prefix of its identifier (short id).

\n","comments":"","group":"blob"},"git_blob_free":{"type":"function","file":"blob.h","line":60,"lineto":60,"args":[{"name":"blob","type":"git_blob *","comment":"the blob to close"}],"argline":"git_blob *blob","sig":"git_blob *","return":{"type":"void","comment":null},"description":"

Close an open blob

\n","comments":"

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a blob. Failure to do so will cause a memory leak.

\n","group":"blob","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blob_free-5"]}},"git_blob_id":{"type":"function","file":"blob.h","line":68,"lineto":68,"args":[{"name":"blob","type":"const git_blob *","comment":"a previously loaded blob."}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"const git_oid *","comment":" SHA1 hash for this blob."},"description":"

Get the id of a blob.

\n","comments":"","group":"blob"},"git_blob_owner":{"type":"function","file":"blob.h","line":76,"lineto":76,"args":[{"name":"blob","type":"const git_blob *","comment":"A previously loaded blob."}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"git_repository *","comment":" Repository that contains this blob."},"description":"

Get the repository that contains the blob.

\n","comments":"","group":"blob"},"git_blob_rawcontent":{"type":"function","file":"blob.h","line":89,"lineto":89,"args":[{"name":"blob","type":"const git_blob *","comment":"pointer to the blob"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"const void *","comment":" the pointer"},"description":"

Get a read-only buffer with the raw content of a blob.

\n","comments":"

A pointer to the raw content of a blob is returned;\n this pointer is owned internally by the object and shall\n not be free'd. The pointer may be invalidated at a later\n time.

\n","group":"blob","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blob_rawcontent-6"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_blob_rawcontent-1"],"general.c":["ex/v0.23.2/general.html#git_blob_rawcontent-2"]}},"git_blob_rawsize":{"type":"function","file":"blob.h","line":97,"lineto":97,"args":[{"name":"blob","type":"const git_blob *","comment":"pointer to the blob"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"git_off_t","comment":" size on bytes"},"description":"

Get the size in bytes of the contents of a blob

\n","comments":"","group":"blob","examples":{"blame.c":["ex/v0.23.2/blame.html#git_blob_rawsize-7"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_blob_rawsize-2"],"general.c":["ex/v0.23.2/general.html#git_blob_rawsize-3","ex/v0.23.2/general.html#git_blob_rawsize-4"]}},"git_blob_filtered_content":{"type":"function","file":"blob.h","line":122,"lineto":126,"args":[{"name":"out","type":"git_buf *","comment":"The git_buf to be filled in"},{"name":"blob","type":"git_blob *","comment":"Pointer to the blob"},{"name":"as_path","type":"const char *","comment":"Path used for file attribute lookups, etc."},{"name":"check_for_binary_data","type":"int","comment":"Should this test if blob content contains\n NUL bytes / looks like binary data before applying filters?"}],"argline":"git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data","sig":"git_buf *::git_blob *::const char *::int","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Get a buffer with the filtered content of a blob.

\n","comments":"

This applies filters as if the blob was being checked out to the\n working directory under the specified filename. This may apply\n CRLF filtering or other types of changes depending on the file\n attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free\n when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just\n be populated with a pointer to the raw content of the blob. In\n that case, be careful to not free the blob until done with the\n buffer or copy it into memory you own.

\n","group":"blob"},"git_blob_create_fromworkdir":{"type":"function","file":"blob.h","line":139,"lineto":139,"args":[{"name":"id","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written.\n\tthis repository cannot be bare"},{"name":"relative_path","type":"const char *","comment":"file from which the blob will be created,\n\trelative to the repository's working dir"}],"argline":"git_oid *id, git_repository *repo, const char *relative_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\n and write it to the Object Database as a loose blob

\n","comments":"","group":"blob"},"git_blob_create_fromdisk":{"type":"function","file":"blob.h","line":151,"lineto":151,"args":[{"name":"id","type":"git_oid *","comment":"return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"repository where the blob will be written.\n\tthis repository can be bare or not"},{"name":"path","type":"const char *","comment":"file from which the blob will be created"}],"argline":"git_oid *id, 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\n to the Object Database as a loose blob

\n","comments":"","group":"blob"},"git_blob_create_fromchunks":{"type":"function","file":"blob.h","line":187,"lineto":192,"args":[{"name":"id","type":"git_oid *","comment":"Return the id of the written blob"},{"name":"repo","type":"git_repository *","comment":"Repository where the blob will be written.\n This repository can be bare or not."},{"name":"hintpath","type":"const char *","comment":"If not NULL, will be used to select data filters\n to apply onto the content of the blob to be created."},{"name":"callback","type":"git_blob_chunk_cb","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *hintpath, git_blob_chunk_cb callback, void *payload","sig":"git_oid *::git_repository *::const char *::git_blob_chunk_cb::void *","return":{"type":"int","comment":" 0 or error code (from either libgit2 or callback function)"},"description":"

Write a loose blob to the Object Database from a\n provider of chunks of data.

\n","comments":"

If the hintpath parameter is filled, it will be used to determine\n what git filters should be applied to the object before it is written\n to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n\n","group":"blob"},"git_blob_create_frombuffer":{"type":"function","file":"blob.h","line":203,"lineto":204,"args":[{"name":"id","type":"git_oid *","comment":"return the id 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 *id, 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

\n","comments":"","group":"blob"},"git_blob_is_binary":{"type":"function","file":"blob.h","line":217,"lineto":217,"args":[{"name":"blob","type":"const git_blob *","comment":"The blob which content should be analyzed"}],"argline":"const git_blob *blob","sig":"const git_blob *","return":{"type":"int","comment":" 1 if the content of the blob is detected\n as binary; 0 otherwise."},"description":"

Determine if the blob content is most certainly binary or not.

\n","comments":"

The heuristic used to guess if a file is binary is taken from core git:\n Searching for NUL bytes and looking for a reasonable ratio of printable\n to non-printable characters among the first 8000 bytes.

\n","group":"blob"},"git_branch_create":{"type":"function","file":"branch.h","line":50,"lineto":55,"args":[{"name":"out","type":"git_reference **","comment":"Pointer where to store the underlying reference."},{"name":"repo","type":"git_repository *","comment":null},{"name":"branch_name","type":"const char *","comment":"Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name."},{"name":"target","type":"const git_commit *","comment":"Commit to which this branch should point. This object\n must belong to the given `repo`."},{"name":"force","type":"int","comment":"Overwrite existing branch."}],"argline":"git_reference **out, git_repository *repo, const char *branch_name, const git_commit *target, int force","sig":"git_reference **::git_repository *::const char *::const git_commit *::int","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC or an error code.\n A proper reference is written in the refs/heads namespace\n pointing to the provided target commit."},"description":"

Create a new branch pointing at a target commit

\n","comments":"

A new direct reference will be created pointing to\n this target commit. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_create_from_annotated":{"type":"function","file":"branch.h","line":68,"lineto":73,"args":[{"name":"ref_out","type":"git_reference **","comment":null},{"name":"repository","type":"git_repository *","comment":null},{"name":"branch_name","type":"const char *","comment":null},{"name":"commit","type":"const git_annotated_commit *","comment":null},{"name":"force","type":"int","comment":null}],"argline":"git_reference **ref_out, git_repository *repository, const char *branch_name, const git_annotated_commit *commit, int force","sig":"git_reference **::git_repository *::const char *::const git_annotated_commit *::int","return":{"type":"int","comment":null},"description":"

Create a new branch pointing at a target commit

\n","comments":"

This behaves like git_branch_create() but takes an annotated\n commit, which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_branch_create().

\n","group":"branch"},"git_branch_delete":{"type":"function","file":"branch.h","line":85,"lineto":85,"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.

\n","comments":"

If the branch is successfully deleted, the passed reference\n object will be invalidated. The reference must be freed manually\n by the user.

\n","group":"branch"},"git_branch_iterator_new":{"type":"function","file":"branch.h","line":101,"lineto":104,"args":[{"name":"out","type":"git_branch_iterator **","comment":"the iterator"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the branches."},{"name":"list_flags","type":"git_branch_t","comment":"Filtering flags for the branch\n listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE\n or GIT_BRANCH_ALL."}],"argline":"git_branch_iterator **out, git_repository *repo, git_branch_t list_flags","sig":"git_branch_iterator **::git_repository *::git_branch_t","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Create an iterator which loops over the requested branches.

\n","comments":"","group":"branch"},"git_branch_next":{"type":"function","file":"branch.h","line":114,"lineto":114,"args":[{"name":"out","type":"git_reference **","comment":"the reference"},{"name":"out_type","type":"git_branch_t *","comment":"the type of branch (local or remote-tracking)"},{"name":"iter","type":"git_branch_iterator *","comment":"the branch iterator"}],"argline":"git_reference **out, git_branch_t *out_type, git_branch_iterator *iter","sig":"git_reference **::git_branch_t *::git_branch_iterator *","return":{"type":"int","comment":" 0 on success, GIT_ITEROVER if there are no more branches or an error code."},"description":"

Retrieve the next branch from the iterator

\n","comments":"","group":"branch"},"git_branch_iterator_free":{"type":"function","file":"branch.h","line":121,"lineto":121,"args":[{"name":"iter","type":"git_branch_iterator *","comment":"the iterator to free"}],"argline":"git_branch_iterator *iter","sig":"git_branch_iterator *","return":{"type":"void","comment":null},"description":"

Free a branch iterator

\n","comments":"","group":"branch"},"git_branch_move":{"type":"function","file":"branch.h","line":138,"lineto":142,"args":[{"name":"out","type":"git_reference **","comment":null},{"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\n is performed; this name is validated for consistency."},{"name":"force","type":"int","comment":"Overwrite existing branch."}],"argline":"git_reference **out, git_reference *branch, const char *new_branch_name, int force","sig":"git_reference **::git_reference *::const char *::int","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code."},"description":"

Move/rename an existing local branch reference.

\n","comments":"

The new branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_lookup":{"type":"function","file":"branch.h","line":165,"lineto":169,"args":[{"name":"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;\n this name is validated for consistency."},{"name":"branch_type","type":"git_branch_t","comment":"Type of the considered branch. This should\n be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE."}],"argline":"git_reference **out, git_repository *repo, const char *branch_name, git_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\n exists, GIT_EINVALIDSPEC, otherwise an error code."},"description":"

Lookup a branch by its name in a repository.

\n","comments":"

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"branch"},"git_branch_name":{"type":"function","file":"branch.h","line":186,"lineto":188,"args":[{"name":"out","type":"const char **","comment":"where the pointer of branch name is stored;\n this is valid as long as the ref is not freed."},{"name":"ref","type":"const git_reference *","comment":"the reference ideally pointing to a branch"}],"argline":"const char **out, const git_reference *ref","sig":"const char **::const git_reference *","return":{"type":"int","comment":" 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)."},"description":"

Return the name of the given local or remote branch.

\n","comments":"

The name of the branch matches the definition of the name\n for git_branch_lookup. That is, if the returned name is given\n to git_branch_lookup() then the reference is returned that\n was given to this function.

\n","group":"branch"},"git_branch_upstream":{"type":"function","file":"branch.h","line":202,"lineto":204,"args":[{"name":"out","type":"git_reference **","comment":"Pointer where to store the retrieved\n reference."},{"name":"branch","type":"const git_reference *","comment":"Current underlying reference of the branch."}],"argline":"git_reference **out, const git_reference *branch","sig":"git_reference **::const git_reference *","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code."},"description":"

Return the reference supporting the remote tracking branch,\n given a local branch reference.

\n","comments":"","group":"branch"},"git_branch_set_upstream":{"type":"function","file":"branch.h","line":216,"lineto":216,"args":[{"name":"branch","type":"git_reference *","comment":"the branch to configure"},{"name":"upstream_name","type":"const char *","comment":"remote-tracking or local branch to set as\n upstream. Pass NULL to unset."}],"argline":"git_reference *branch, const char *upstream_name","sig":"git_reference *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the upstream configuration for a given local branch

\n","comments":"","group":"branch"},"git_branch_is_head":{"type":"function","file":"branch.h","line":245,"lineto":246,"args":[{"name":"branch","type":"const git_reference *","comment":"Current underlying reference of the branch."}],"argline":"const git_reference *branch","sig":"const git_reference *","return":{"type":"int","comment":" 1 if HEAD points at the branch, 0 if it isn't,\n error code otherwise."},"description":"

Determine if the current local branch is pointed at by HEAD.

\n","comments":"","group":"branch"},"git_buf_free":{"type":"function","file":"buffer.h","line":72,"lineto":72,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to deallocate"}],"argline":"git_buf *buffer","sig":"git_buf *","return":{"type":"void","comment":null},"description":"

Free the memory referred to by the git_buf.

\n","comments":"

Note that this does not free the git_buf itself, just the memory\n pointed to by buffer->ptr. This will not free the memory if it looks\n like it was not allocated internally, but it will clear the buffer back\n to the empty state.

\n","group":"buf","examples":{"diff.c":["ex/v0.23.2/diff.html#git_buf_free-1"],"remote.c":["ex/v0.23.2/remote.html#git_buf_free-1"],"tag.c":["ex/v0.23.2/tag.html#git_buf_free-1"]}},"git_buf_grow":{"type":"function","file":"buffer.h","line":95,"lineto":95,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to be resized; may or may not be allocated yet"},{"name":"target_size","type":"size_t","comment":"The desired available size"}],"argline":"git_buf *buffer, size_t target_size","sig":"git_buf *::size_t","return":{"type":"int","comment":" 0 on success, -1 on allocation failure"},"description":"

Resize the buffer allocation to make more space.

\n","comments":"

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e.\n the asize field is zero), then ptr will be replaced with a newly\n allocated block of data. Be careful so that memory allocated by the\n caller is not lost. As a special variant, if you pass target_size as\n 0 and the memory is not allocated by libgit2, this will allocate a new\n buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be\n marked as invalid for future operations, invaliding the contents.

\n","group":"buf"},"git_buf_set":{"type":"function","file":"buffer.h","line":105,"lineto":106,"args":[{"name":"buffer","type":"git_buf *","comment":"The buffer to set"},{"name":"data","type":"const void *","comment":"The data to copy into the buffer"},{"name":"datalen","type":"size_t","comment":"The length of the data to copy into the buffer"}],"argline":"git_buf *buffer, const void *data, size_t datalen","sig":"git_buf *::const void *::size_t","return":{"type":"int","comment":" 0 on success, -1 on allocation failure"},"description":"

Set buffer to a copy of some raw data.

\n","comments":"","group":"buf"},"git_buf_is_binary":{"type":"function","file":"buffer.h","line":114,"lineto":114,"args":[{"name":"buf","type":"const git_buf *","comment":"Buffer to check"}],"argline":"const git_buf *buf","sig":"const git_buf *","return":{"type":"int","comment":" 1 if buffer looks like non-text data"},"description":"

Check quickly if buffer looks like it contains binary data

\n","comments":"","group":"buf"},"git_buf_contains_nul":{"type":"function","file":"buffer.h","line":122,"lineto":122,"args":[{"name":"buf","type":"const git_buf *","comment":"Buffer to check"}],"argline":"const git_buf *buf","sig":"const git_buf *","return":{"type":"int","comment":" 1 if buffer contains a NUL byte"},"description":"

Check quickly if buffer contains a NUL byte

\n","comments":"","group":"buf"},"git_checkout_init_options":{"type":"function","file":"checkout.h","line":308,"lineto":310,"args":[{"name":"opts","type":"git_checkout_options *","comment":"the `git_checkout_options` struct to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`"}],"argline":"git_checkout_options *opts, unsigned int version","sig":"git_checkout_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_checkout_options with default values. Equivalent to\n creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n","comments":"","group":"checkout"},"git_checkout_head":{"type":"function","file":"checkout.h","line":322,"lineto":324,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, const git_checkout_options *opts","sig":"git_repository *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n","comments":"","group":"checkout"},"git_checkout_index":{"type":"function","file":"checkout.h","line":335,"lineto":338,"args":[{"name":"repo","type":"git_repository *","comment":"repository into which to check out (must be non-bare)"},{"name":"index","type":"git_index *","comment":"index to be checked out (or NULL to use repository index)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, git_index *index, const git_checkout_options *opts","sig":"git_repository *::git_index *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the working tree to match the content of the index.

\n","comments":"","group":"checkout"},"git_checkout_tree":{"type":"function","file":"checkout.h","line":351,"lineto":354,"args":[{"name":"repo","type":"git_repository *","comment":"repository to check out (must be non-bare)"},{"name":"treeish","type":"const git_object *","comment":"a commit, tag or tree which content will be used to update\n the working directory (or NULL to use HEAD)"},{"name":"opts","type":"const git_checkout_options *","comment":"specifies checkout options (may be NULL)"}],"argline":"git_repository *repo, const git_object *treeish, const git_checkout_options *opts","sig":"git_repository *::const git_object *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)"},"description":"

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n","comments":"","group":"checkout"},"git_cherrypick_init_options":{"type":"function","file":"cherrypick.h","line":47,"lineto":49,"args":[{"name":"opts","type":"git_cherrypick_options *","comment":"the `git_cherrypick_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`"}],"argline":"git_cherrypick_options *opts, unsigned int version","sig":"git_cherrypick_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_cherrypick_options with default values. Equivalent to\n creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n","comments":"","group":"cherrypick"},"git_cherrypick_commit":{"type":"function","file":"cherrypick.h","line":65,"lineto":71,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"the repository that contains the given commits"},{"name":"cherrypick_commit","type":"git_commit *","comment":"the commit to cherry-pick"},{"name":"our_commit","type":"git_commit *","comment":"the commit to revert against (eg, HEAD)"},{"name":"mainline","type":"unsigned int","comment":"the parent of the revert commit, if it is a merge"},{"name":"merge_options","type":"const git_merge_options *","comment":"the merge options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, git_commit *cherrypick_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options","sig":"git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Cherry-picks the given commit against the given "our" commit, producing an\n index that reflects the result of the cherry-pick.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"cherrypick"},"git_cherrypick":{"type":"function","file":"cherrypick.h","line":81,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to cherry-pick"},{"name":"commit","type":"git_commit *","comment":"the commit to cherry-pick"},{"name":"cherrypick_options","type":"const git_cherrypick_options *","comment":"the cherry-pick options (or null for defaults)"}],"argline":"git_repository *repo, git_commit *commit, const git_cherrypick_options *cherrypick_options","sig":"git_repository *::git_commit *::const git_cherrypick_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Cherry-pick the given commit, producing changes in the index and working directory.

\n","comments":"","group":"cherrypick"},"git_clone_init_options":{"type":"function","file":"clone.h","line":179,"lineto":181,"args":[{"name":"opts","type":"git_clone_options *","comment":"The `git_clone_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`"}],"argline":"git_clone_options *opts, unsigned int version","sig":"git_clone_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_clone_options with default values. Equivalent to\n creating an instance with GIT_CLONE_OPTIONS_INIT.

\n","comments":"","group":"clone"},"git_clone":{"type":"function","file":"clone.h","line":199,"lineto":203,"args":[{"name":"out","type":"git_repository **","comment":"pointer that will receive the resulting repository object"},{"name":"url","type":"const char *","comment":"the remote repository to clone"},{"name":"local_path","type":"const char *","comment":"local directory to clone to"},{"name":"options","type":"const git_clone_options *","comment":"configuration options for the clone. If NULL, the\n function works as though GIT_OPTIONS_INIT were passed."}],"argline":"git_repository **out, const char *url, const char *local_path, const git_clone_options *options","sig":"git_repository **::const char *::const char *::const git_clone_options *","return":{"type":"int","comment":" 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)"},"description":"

Clone a remote repository.

\n","comments":"

By default this creates its repository and initial remote to match\n git's defaults. You can use the options in the callback to\n customize how these are created.

\n","group":"clone","examples":{"network/clone.c":["ex/v0.23.2/network/clone.html#git_clone-1"]}},"git_commit_lookup":{"type":"function","file":"commit.h","line":36,"lineto":37,"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\n\t\tan 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.

\n","comments":"

The returned object should be released with git_commit_free when no\n longer needed.

\n","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_lookup-5","ex/v0.23.2/general.html#git_commit_lookup-6","ex/v0.23.2/general.html#git_commit_lookup-7"],"log.c":["ex/v0.23.2/log.html#git_commit_lookup-1"]}},"git_commit_lookup_prefix":{"type":"function","file":"commit.h","line":55,"lineto":56,"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\n\t\tan 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, given a prefix of its\n identifier (short id).

\n","comments":"

The returned object should be released with git_commit_free when no\n longer needed.

\n","group":"commit"},"git_commit_free":{"type":"function","file":"commit.h","line":70,"lineto":70,"args":[{"name":"commit","type":"git_commit *","comment":"the commit to close"}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"void","comment":null},"description":"

Close an open commit

\n","comments":"

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a commit. Failure to do so will cause a memory leak.

\n","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_free-8","ex/v0.23.2/general.html#git_commit_free-9","ex/v0.23.2/general.html#git_commit_free-10","ex/v0.23.2/general.html#git_commit_free-11"],"log.c":["ex/v0.23.2/log.html#git_commit_free-2","ex/v0.23.2/log.html#git_commit_free-3","ex/v0.23.2/log.html#git_commit_free-4","ex/v0.23.2/log.html#git_commit_free-5"]}},"git_commit_id":{"type":"function","file":"commit.h","line":78,"lineto":78,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_oid *","comment":" object identity for the commit."},"description":"

Get the id of a commit.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_id-12"],"log.c":["ex/v0.23.2/log.html#git_commit_id-6"]}},"git_commit_owner":{"type":"function","file":"commit.h","line":86,"lineto":86,"args":[{"name":"commit","type":"const git_commit *","comment":"A previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"git_repository *","comment":" Repository that contains this commit."},"description":"

Get the repository that contains the commit.

\n","comments":"","group":"commit","examples":{"log.c":["ex/v0.23.2/log.html#git_commit_owner-7","ex/v0.23.2/log.html#git_commit_owner-8"]}},"git_commit_message_encoding":{"type":"function","file":"commit.h","line":98,"lineto":98,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" NULL, or the encoding"},"description":"

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n","comments":"

The encoding may be NULL if the encoding header\n in the commit is missing; in that case UTF-8 is assumed.

\n","group":"commit"},"git_commit_message":{"type":"function","file":"commit.h","line":109,"lineto":109,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the message of a commit"},"description":"

Get the full message of a commit.

\n","comments":"

The returned message will be slightly prettified by removing any\n potential leading newlines.

\n","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_message-3","ex/v0.23.2/cat-file.html#git_commit_message-4"],"general.c":["ex/v0.23.2/general.html#git_commit_message-13","ex/v0.23.2/general.html#git_commit_message-14","ex/v0.23.2/general.html#git_commit_message-15"],"log.c":["ex/v0.23.2/log.html#git_commit_message-9","ex/v0.23.2/log.html#git_commit_message-10"],"tag.c":["ex/v0.23.2/tag.html#git_commit_message-2"]}},"git_commit_message_raw":{"type":"function","file":"commit.h","line":117,"lineto":117,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the raw message of a commit"},"description":"

Get the full raw message of a commit.

\n","comments":"","group":"commit"},"git_commit_summary":{"type":"function","file":"commit.h","line":128,"lineto":128,"args":[{"name":"commit","type":"git_commit *","comment":"a previously loaded commit."}],"argline":"git_commit *commit","sig":"git_commit *","return":{"type":"const char *","comment":" the summary of a commit or NULL on error"},"description":"

Get the short "summary" of the git commit message.

\n","comments":"

The returned message is the summary of the commit, comprising the\n first paragraph of the message with whitespace trimmed and squashed.

\n","group":"commit"},"git_commit_time":{"type":"function","file":"commit.h","line":136,"lineto":136,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const 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.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_time-16","ex/v0.23.2/general.html#git_commit_time-17"]}},"git_commit_time_offset":{"type":"function","file":"commit.h","line":144,"lineto":144,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const 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.

\n","comments":"","group":"commit"},"git_commit_committer":{"type":"function","file":"commit.h","line":152,"lineto":152,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_signature *","comment":" the committer of a commit"},"description":"

Get the committer of a commit.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_committer-5"],"general.c":["ex/v0.23.2/general.html#git_commit_committer-18"],"log.c":["ex/v0.23.2/log.html#git_commit_committer-11"]}},"git_commit_author":{"type":"function","file":"commit.h","line":160,"lineto":160,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const git_signature *","comment":" the author of a commit"},"description":"

Get the author of a commit.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_author-6"],"general.c":["ex/v0.23.2/general.html#git_commit_author-19","ex/v0.23.2/general.html#git_commit_author-20"],"log.c":["ex/v0.23.2/log.html#git_commit_author-12","ex/v0.23.2/log.html#git_commit_author-13"]}},"git_commit_raw_header":{"type":"function","file":"commit.h","line":168,"lineto":168,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit"}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"const char *","comment":" the header text of the commit"},"description":"

Get the full raw text of the commit header.

\n","comments":"","group":"commit"},"git_commit_tree":{"type":"function","file":"commit.h","line":177,"lineto":177,"args":[{"name":"tree_out","type":"git_tree **","comment":"pointer where to store the tree object"},{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"git_tree **tree_out, const git_commit *commit","sig":"git_tree **::const git_commit *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the tree pointed to by a commit.

\n","comments":"","group":"commit","examples":{"log.c":["ex/v0.23.2/log.html#git_commit_tree-14","ex/v0.23.2/log.html#git_commit_tree-15","ex/v0.23.2/log.html#git_commit_tree-16","ex/v0.23.2/log.html#git_commit_tree-17","ex/v0.23.2/log.html#git_commit_tree-18"]}},"git_commit_tree_id":{"type":"function","file":"commit.h","line":187,"lineto":187,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const 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\n from the ODB.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_tree_id-7"]}},"git_commit_parentcount":{"type":"function","file":"commit.h","line":195,"lineto":195,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."}],"argline":"const git_commit *commit","sig":"const git_commit *","return":{"type":"unsigned int","comment":" integer of count of parents"},"description":"

Get the number of parents of this commit

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_parentcount-8"],"general.c":["ex/v0.23.2/general.html#git_commit_parentcount-21"],"log.c":["ex/v0.23.2/log.html#git_commit_parentcount-19","ex/v0.23.2/log.html#git_commit_parentcount-20"]}},"git_commit_parent":{"type":"function","file":"commit.h","line":205,"lineto":208,"args":[{"name":"out","type":"git_commit **","comment":"Pointer where to store the parent commit"},{"name":"commit","type":"const 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 **out, const git_commit *commit, unsigned int n","sig":"git_commit **::const git_commit *::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the specified parent of the commit.

\n","comments":"","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_parent-22"],"log.c":["ex/v0.23.2/log.html#git_commit_parent-21","ex/v0.23.2/log.html#git_commit_parent-22"]}},"git_commit_parent_id":{"type":"function","file":"commit.h","line":219,"lineto":221,"args":[{"name":"commit","type":"const git_commit *","comment":"a previously loaded commit."},{"name":"n","type":"unsigned int","comment":"the position of the parent (from 0 to `parentcount`)"}],"argline":"const git_commit *commit, unsigned int n","sig":"const 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\n the ODB.

\n","comments":"","group":"commit","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_commit_parent_id-9"],"log.c":["ex/v0.23.2/log.html#git_commit_parent_id-23"]}},"git_commit_nth_gen_ancestor":{"type":"function","file":"commit.h","line":237,"lineto":240,"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, const git_commit *commit, unsigned int n","sig":"git_commit **::const git_commit *::unsigned int","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND if no matching ancestor exists\n or an error code"},"description":"

Get the commit object that is the \n<n

\n\n
\n

th generation ancestor\n of the named commit object, following only the first parents.\n The returned commit has to be freed by the caller.

\n
\n","comments":"

Passing 0 as the generation number returns another instance of the\n base commit itself.

\n","group":"commit"},"git_commit_header_field":{"type":"function","file":"commit.h","line":251,"lineto":251,"args":[{"name":"out","type":"git_buf *","comment":"the buffer to fill"},{"name":"commit","type":"const git_commit *","comment":"the commit to look in"},{"name":"field","type":"const char *","comment":"the header field to return"}],"argline":"git_buf *out, const git_commit *commit, const char *field","sig":"git_buf *::const git_commit *::const char *","return":{"type":"int","comment":" 0 on succeess, GIT_ENOTFOUND if the field does not exist,\n or an error code"},"description":"

Get an arbitrary header field

\n","comments":"","group":"commit"},"git_commit_create":{"type":"function","file":"commit.h","line":297,"lineto":307,"args":[{"name":"id","type":"git_oid *","comment":"Pointer in which 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\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch."},{"name":"author","type":"const git_signature *","comment":"Signature with author and author time of commit"},{"name":"committer","type":"const git_signature *","comment":"Signature with committer and * commit time of commit"},{"name":"message_encoding","type":"const char *","comment":"The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed."},{"name":"message","type":"const char *","comment":"Full message for this commit"},{"name":"tree","type":"const git_tree *","comment":"An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`."},{"name":"parent_count","type":"size_t","comment":"Number of parents for this commit"},{"name":"parents","type":"const git_commit *[]","comment":"Array of `parent_count` pointers to `git_commit`\n objects that will be used as the parents for this commit. This\n array may be NULL if `parent_count` is 0 (root commit). All the\n given commits must be owned by the `repo`."}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]","return":{"type":"int","comment":" 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it"},"description":"

Create new commit in the repository from a list of git_object pointers

\n","comments":"

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n","group":"commit"},"git_commit_create_v":{"type":"function","file":"commit.h","line":323,"lineto":333,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_tree *","comment":null},{"name":"parent_count","type":"size_t","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t","return":{"type":"int","comment":null},"description":"

Create new commit in the repository using a variable argument list.

\n","comments":"

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers\n to const git_commit *. Note that this is a convenience method which may\n not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n","group":"commit","examples":{"general.c":["ex/v0.23.2/general.html#git_commit_create_v-23"],"init.c":["ex/v0.23.2/init.html#git_commit_create_v-1"]}},"git_commit_amend":{"type":"function","file":"commit.h","line":356,"lineto":364,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"commit_to_amend","type":"const git_commit *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_tree *","comment":null}],"argline":"git_oid *id, const git_commit *commit_to_amend, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree","sig":"git_oid *::const git_commit *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *","return":{"type":"int","comment":null},"description":"

Amend an existing commit by replacing only non-NULL values.

\n","comments":"

This creates a new commit that is exactly the same as the old commit,\n except that any non-NULL values will be updated. The new commit has\n the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(),\n updating the ref to point to the newly rewritten commit. If you want\n to amend a commit that is not currently the tip of the branch and then\n rewrite the following commits to reach a ref, pass this as NULL and\n update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message,\n message_encoding, and tree parameters can be NULL in which case this\n will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n","group":"commit"},"git_libgit2_version":{"type":"function","file":"common.h","line":94,"lineto":94,"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","comment":null},"description":"

Return the version of the libgit2 library\n being currently used.

\n","comments":"","group":"libgit2"},"git_libgit2_features":{"type":"function","file":"common.h","line":124,"lineto":124,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" A combination of GIT_FEATURE_* values."},"description":"

Query compile time options for libgit2.

\n","comments":"\n","group":"libgit2"},"git_libgit2_opts":{"type":"function","file":"common.h","line":245,"lineto":245,"args":[{"name":"option","type":"int","comment":"Option key"}],"argline":"int option","sig":"int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set or query a library global option

\n","comments":"

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time\n    by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must\n    > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, or\n    > `GIT_CONFIG_LEVEL_XDG`.  The search path is written to the `out`\n    > buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path\n    > applied to shared attributes and ignore files, too.\n    >\n    > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.\n    >   Pass NULL to reset to the default (generally based on environment\n    >   variables).  Use magic path `$PATH` to include the old value\n    >   of the path (if you want to prepend or append, for instance).\n    >\n    > - `level` must be GIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_GLOBAL,\n    >   or GIT_CONFIG_LEVEL_XDG.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be\n    > considered eligible for caching in memory.  Setting to value to\n    > zero means that that type of object will not be cached.\n    > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k\n    > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory\n    > across all repositories before libgit2 starts evicting objects\n    > from the cache.  This is a soft limit, in that the library might\n    > briefly exceed it, but will start aggressively evicting objects\n    > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.\n    >\n    > Because caches are repository-specific, disabling the cache\n    > cannot immediately clear all cached objects, but each cache will\n    > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be\n    > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.\n    > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.\n    >\n    > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.\n    >\n    > - `file` is the location of a file containing several\n    >   certificates concatenated together.\n    > - `path` is the location of a directory holding several\n    >   certificates, one per file.\n    >\n    > Either parameter may be `NULL`, but not both.\n
\n","group":"libgit2"},"git_config_entry_free":{"type":"function","file":"config.h","line":72,"lineto":72,"args":[{"name":"","type":"git_config_entry *","comment":null}],"argline":"git_config_entry *","sig":"git_config_entry *","return":{"type":"void","comment":null},"description":"

Free a config entry

\n","comments":"","group":"config"},"git_config_find_global":{"type":"function","file":"config.h","line":113,"lineto":113,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a global configuration file has been found. Its path will be stored in `out`."},"description":"

Locate the path to the global configuration file

\n","comments":"

The user or global configuration file is usually\n located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n global configuration file.

\n\n

This method will not guess the path to the xdg compatible\n config file (.config/git/config).

\n","group":"config"},"git_config_find_xdg":{"type":"function","file":"config.h","line":130,"lineto":130,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a xdg compatible configuration file has been\n\tfound. Its path will be stored in `out`."},"description":"

Locate the path to the global xdg compatible configuration file

\n","comments":"

The xdg compatible configuration file is usually\n located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n xdg compatible configuration file.

\n","group":"config"},"git_config_find_system":{"type":"function","file":"config.h","line":142,"lineto":142,"args":[{"name":"out","type":"git_buf *","comment":"Pointer to a user-allocated git_buf in which to store the path"}],"argline":"git_buf *out","sig":"git_buf *","return":{"type":"int","comment":" 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`."},"description":"

Locate the path to the system configuration file

\n","comments":"

If /etc/gitconfig doesn't exist, it will look for\n %PROGRAMFILES%

\n\n

.

\n","group":"config"},"git_config_open_default":{"type":"function","file":"config.h","line":154,"lineto":154,"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

\n","comments":"

Utility wrapper that finds the global, XDG and system configuration files\n and opens them into a single prioritized config object that can be\n used when accessing default config data outside a repository.

\n","group":"config"},"git_config_new":{"type":"function","file":"config.h","line":165,"lineto":165,"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

\n","comments":"

This object is empty, so you have to add a file to it before you\n can do anything with it.

\n","group":"config"},"git_config_add_file_ondisk":{"type":"function","file":"config.h","line":192,"lineto":196,"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 to add"},{"name":"level","type":"git_config_level_t","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"replace config file at the given priority level"}],"argline":"git_config *cfg, const char *path, git_config_level_t level, int force","sig":"git_config *::const char *::git_config_level_t::int","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code"},"description":"

Add an on-disk config file instance to an existing config

\n","comments":"

The on-disk file pointed at by path will be opened and\n parsed; it's expected to be a native Git config file following\n the default Git config syntax (see man git-config).

\n\n

If the file does not exist, the file will still be added and it\n will be created the first time we write to it.

\n\n

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n","group":"config"},"git_config_open_ondisk":{"type":"function","file":"config.h","line":210,"lineto":210,"args":[{"name":"out","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 **out, const char *path","sig":"git_config **::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Create a new config instance containing a single on-disk file

\n","comments":"

This method is a simple utility wrapper for the following sequence\n of calls:\n - git_config_new\n - git_config_add_file_ondisk

\n","group":"config","examples":{"general.c":["ex/v0.23.2/general.html#git_config_open_ondisk-24"]}},"git_config_open_level":{"type":"function","file":"config.h","line":228,"lineto":231,"args":[{"name":"out","type":"git_config **","comment":"The configuration instance to create"},{"name":"parent","type":"const git_config *","comment":"Multi-level config to search for the given level"},{"name":"level","type":"git_config_level_t","comment":"Configuration level to search for"}],"argline":"git_config **out, const git_config *parent, git_config_level_t level","sig":"git_config **::const git_config *::git_config_level_t","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if the passed level cannot be found in the\n multi-level parent config, or an error code"},"description":"

Build a single-level focused config object from a multi-level one.

\n","comments":"

The returned config object can be used to perform get/set/delete operations\n on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config\n will return different config instances, but containing the same config_file\n instance.

\n","group":"config"},"git_config_open_global":{"type":"function","file":"config.h","line":245,"lineto":245,"args":[{"name":"out","type":"git_config **","comment":"pointer in which to store the config object"},{"name":"config","type":"git_config *","comment":"the config object in which to look"}],"argline":"git_config **out, git_config *config","sig":"git_config **::git_config *","return":{"type":"int","comment":null},"description":"

Open the global/XDG configuration file according to git's rules

\n","comments":"

Git allows you to store your global configuration at\n $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards\n compatability, the XDG file shouldn't be used unless the use has\n created it explicitly. With this function you'll open the correct\n one to write to.

\n","group":"config"},"git_config_snapshot":{"type":"function","file":"config.h","line":261,"lineto":261,"args":[{"name":"out","type":"git_config **","comment":"pointer in which to store the snapshot config object"},{"name":"config","type":"git_config *","comment":"configuration to snapshot"}],"argline":"git_config **out, git_config *config","sig":"git_config **::git_config *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a snapshot of the configuration

\n","comments":"

Create a snapshot of the current state of a configuration, which\n allows you to look into a consistent view of the configuration for\n looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid\n until it is freed.

\n","group":"config"},"git_config_free":{"type":"function","file":"config.h","line":268,"lineto":268,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to free"}],"argline":"git_config *cfg","sig":"git_config *","return":{"type":"void","comment":null},"description":"

Free the configuration and its associated memory and files

\n","comments":"","group":"config"},"git_config_get_entry":{"type":"function","file":"config.h","line":280,"lineto":283,"args":[{"name":"out","type":"git_config_entry **","comment":"pointer to the variable git_config_entry"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"git_config_entry **out, const git_config *cfg, const char *name","sig":"git_config_entry **::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the git_config_entry of a config variable.

\n","comments":"

Free the git_config_entry after use with git_config_entry_free().

\n","group":"config"},"git_config_get_int32":{"type":"function","file":"config.h","line":297,"lineto":297,"args":[{"name":"out","type":"int32_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int32_t *out, const git_config *cfg, const char *name","sig":"int32_t *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of an integer config variable.

\n","comments":"

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config","examples":{"general.c":["ex/v0.23.2/general.html#git_config_get_int32-25"]}},"git_config_get_int64":{"type":"function","file":"config.h","line":311,"lineto":311,"args":[{"name":"out","type":"int64_t *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int64_t *out, const git_config *cfg, const char *name","sig":"int64_t *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a long integer config variable.

\n","comments":"

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_bool":{"type":"function","file":"config.h","line":328,"lineto":328,"args":[{"name":"out","type":"int *","comment":"pointer to the variable where the value should be stored"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"int *out, const git_config *cfg, const char *name","sig":"int *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a boolean config variable.

\n","comments":"

This function uses the usual C convention of 0 being false and\n anything else true.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_path":{"type":"function","file":"config.h","line":346,"lineto":346,"args":[{"name":"out","type":"git_buf *","comment":"the buffer in which to store the result"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"git_buf *out, const git_config *cfg, const char *name","sig":"git_buf *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a path config variable.

\n","comments":"

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_string":{"type":"function","file":"config.h","line":364,"lineto":364,"args":[{"name":"out","type":"const char **","comment":"pointer to the string"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"const char **out, const git_config *cfg, const char *name","sig":"const char **::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a string config variable.

\n","comments":"

This function can only be used on snapshot config objects. The\n string is owned by the config and should not be freed by the\n user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config","examples":{"general.c":["ex/v0.23.2/general.html#git_config_get_string-26"]}},"git_config_get_string_buf":{"type":"function","file":"config.h","line":380,"lineto":380,"args":[{"name":"out","type":"git_buf *","comment":"buffer in which to store the string"},{"name":"cfg","type":"const git_config *","comment":"where to look for the variable"},{"name":"name","type":"const char *","comment":"the variable's name"}],"argline":"git_buf *out, const git_config *cfg, const char *name","sig":"git_buf *::const git_config *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the value of a string config variable.

\n","comments":"

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n","group":"config"},"git_config_get_multivar_foreach":{"type":"function","file":"config.h","line":394,"lineto":394,"args":[{"name":"cfg","type":"const 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\n interested in. Use NULL to indicate all"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to be called on each value of the variable"},{"name":"payload","type":"void *","comment":"opaque pointer to pass to the callback"}],"argline":"const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"const git_config *::const char *::const char *::git_config_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Get each value of a multivar in a foreach callback

\n","comments":"

The callback will be called on each variable found

\n","group":"config"},"git_config_multivar_iterator_new":{"type":"function","file":"config.h","line":405,"lineto":405,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const 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\n interested in. Use NULL to indicate all"}],"argline":"git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp","sig":"git_config_iterator **::const git_config *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Get each value of a multivar

\n","comments":"","group":"config"},"git_config_next":{"type":"function","file":"config.h","line":417,"lineto":417,"args":[{"name":"entry","type":"git_config_entry **","comment":"pointer to store the entry"},{"name":"iter","type":"git_config_iterator *","comment":"the iterator"}],"argline":"git_config_entry **entry, git_config_iterator *iter","sig":"git_config_entry **::git_config_iterator *","return":{"type":"int","comment":" 0 or an error code. GIT_ITEROVER if the iteration has completed"},"description":"

Return the current entry and advance the iterator

\n","comments":"

The pointers returned by this function are valid until the iterator\n is freed.

\n","group":"config"},"git_config_iterator_free":{"type":"function","file":"config.h","line":424,"lineto":424,"args":[{"name":"iter","type":"git_config_iterator *","comment":"the iterator to free"}],"argline":"git_config_iterator *iter","sig":"git_config_iterator *","return":{"type":"void","comment":null},"description":"

Free a config iterator

\n","comments":"","group":"config"},"git_config_set_int32":{"type":"function","file":"config.h","line":435,"lineto":435,"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\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_int64":{"type":"function","file":"config.h","line":446,"lineto":446,"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\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_bool":{"type":"function","file":"config.h","line":457,"lineto":457,"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\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_set_string":{"type":"function","file":"config.h","line":471,"lineto":471,"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\n with the highest level (usually the local one).

\n","comments":"

A copy of the string is made and the user is free to use it\n afterwards.

\n","group":"config"},"git_config_set_multivar":{"type":"function","file":"config.h","line":481,"lineto":481,"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","comment":null},"description":"

Set a multivar in the local config file.

\n","comments":"","group":"config"},"git_config_delete_entry":{"type":"function","file":"config.h","line":490,"lineto":490,"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","comment":null},"description":"

Delete a config variable from the config file\n with the highest level (usually the local one).

\n","comments":"","group":"config"},"git_config_delete_multivar":{"type":"function","file":"config.h","line":501,"lineto":501,"args":[{"name":"cfg","type":"git_config *","comment":"where to look for the variables"},{"name":"name","type":"const char *","comment":"the variable's name"},{"name":"regexp","type":"const char *","comment":"a regular expression to indicate which values to delete"}],"argline":"git_config *cfg, const char *name, const char *regexp","sig":"git_config *::const char *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Deletes one or several entries from a multivar in the local config file.

\n","comments":"","group":"config"},"git_config_foreach":{"type":"function","file":"config.h","line":519,"lineto":522,"args":[{"name":"cfg","type":"const git_config *","comment":"where to get the variables from"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"const git_config *cfg, git_config_foreach_cb callback, void *payload","sig":"const git_config *::git_config_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform an operation on each config variable.

\n","comments":"

The callback receives the normalized name and value of each variable\n in the config backend, and the data pointer passed to this function.\n If the callback returns a non-zero value, the function stops iterating\n and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n","group":"config"},"git_config_iterator_new":{"type":"function","file":"config.h","line":533,"lineto":533,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const git_config *","comment":"where to ge the variables from"}],"argline":"git_config_iterator **out, const git_config *cfg","sig":"git_config_iterator **::const git_config *","return":{"type":"int","comment":null},"description":"

Iterate over all the config variables

\n","comments":"

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n","group":"config"},"git_config_iterator_glob_new":{"type":"function","file":"config.h","line":545,"lineto":545,"args":[{"name":"out","type":"git_config_iterator **","comment":"pointer to store the iterator"},{"name":"cfg","type":"const git_config *","comment":"where to ge the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match the names"}],"argline":"git_config_iterator **out, const git_config *cfg, const char *regexp","sig":"git_config_iterator **::const git_config *::const char *","return":{"type":"int","comment":null},"description":"

Iterate over all the config variables whose name matches a pattern

\n","comments":"

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n","group":"config"},"git_config_foreach_match":{"type":"function","file":"config.h","line":563,"lineto":567,"args":[{"name":"cfg","type":"const 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":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"const git_config *cfg, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"const git_config *::const char *::git_config_foreach_cb::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.

\n","comments":"

This behaviors like git_config_foreach with an additional filter of a\n regular expression that filters which config keys are passed to the\n callback.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n","group":"config"},"git_config_get_mapped":{"type":"function","file":"config.h","line":603,"lineto":608,"args":[{"name":"out","type":"int *","comment":"place to store the result of the mapping"},{"name":"cfg","type":"const 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":"const 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, const git_config *cfg, const char *name, const git_cvar_map *maps, size_t map_n","sig":"int *::const git_config *::const char *::const 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\n an integer constant.

\n","comments":"

This is a helper method to easily map different possible values\n to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {\n    {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},\n    {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},\n    {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},\n    {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the\n mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing\n the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison),\n the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be\n returned.

\n","group":"config"},"git_config_lookup_map_value":{"type":"function","file":"config.h","line":618,"lineto":622,"args":[{"name":"out","type":"int *","comment":"place to store the result of the parsing"},{"name":"maps","type":"const 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, const git_cvar_map *maps, size_t map_n, const char *value","sig":"int *::const git_cvar_map *::size_t::const char *","return":{"type":"int","comment":null},"description":"

Maps a string value to an integer constant

\n","comments":"","group":"config"},"git_config_parse_bool":{"type":"function","file":"config.h","line":634,"lineto":634,"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","comment":null},"description":"

Parse a string value as a bool.

\n","comments":"

Valid values for true are: 'true', 'yes', 'on', 1 or any\n number different from 0\n Valid values for false are: 'false', 'no', 'off', 0

\n","group":"config"},"git_config_parse_int32":{"type":"function","file":"config.h","line":646,"lineto":646,"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","comment":null},"description":"

Parse a string value as an int32.

\n","comments":"

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n","group":"config"},"git_config_parse_int64":{"type":"function","file":"config.h","line":658,"lineto":658,"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","comment":null},"description":"

Parse a string value as an int64.

\n","comments":"

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n","group":"config"},"git_config_parse_path":{"type":"function","file":"config.h","line":673,"lineto":673,"args":[{"name":"out","type":"git_buf *","comment":"placae to store the result of parsing"},{"name":"value","type":"const char *","comment":"the path to evaluate"}],"argline":"git_buf *out, const char *value","sig":"git_buf *::const char *","return":{"type":"int","comment":null},"description":"

Parse a string value as a path.

\n","comments":"

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be\n returned.

\n","group":"config"},"git_config_backend_foreach_match":{"type":"function","file":"config.h","line":687,"lineto":691,"args":[{"name":"backend","type":"git_config_backend *","comment":"where to get the variables from"},{"name":"regexp","type":"const char *","comment":"regular expression to match against config names (can be NULL)"},{"name":"callback","type":"git_config_foreach_cb","comment":"the function to call on each variable"},{"name":"payload","type":"void *","comment":"the data to pass to the callback"}],"argline":"git_config_backend *backend, const char *regexp, git_config_foreach_cb callback, void *payload","sig":"git_config_backend *::const char *::git_config_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n","comments":"

This behaviors like git_config_foreach_match except instead of all config\n entries it just enumerates through the given backend entry.

\n","group":"config"},"git_cred_userpass":{"type":"function","file":"cred_helpers.h","line":43,"lineto":48,"args":[{"name":"cred","type":"git_cred **","comment":"The newly created credential object."},{"name":"url","type":"const char *","comment":"The resource for which we are demanding a credential."},{"name":"user_from_url","type":"const char *","comment":"The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included."},{"name":"allowed_types","type":"unsigned int","comment":"A bitmask stating which cred types are OK to return."},{"name":"payload","type":"void *","comment":"The payload provided when specifying this callback. (This is\n interpreted as a `git_cred_userpass_payload*`.)"}],"argline":"git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload","sig":"git_cred **::const char *::const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Stock callback usable as a git_cred_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

\n","comments":"","group":"cred"},"git_describe_commit":{"type":"function","file":"describe.h","line":120,"lineto":123,"args":[{"name":"result","type":"git_describe_result **","comment":"pointer to store the result. You must free this once\n you're done with it."},{"name":"committish","type":"git_object *","comment":"a committish to describe"},{"name":"opts","type":"git_describe_options *","comment":"the lookup options"}],"argline":"git_describe_result **result, git_object *committish, git_describe_options *opts","sig":"git_describe_result **::git_object *::git_describe_options *","return":{"type":"int","comment":null},"description":"

Describe a commit

\n","comments":"

Perform the describe operation on the given committish object.

\n","group":"describe","examples":{"describe.c":["ex/v0.23.2/describe.html#git_describe_commit-1"]}},"git_describe_workdir":{"type":"function","file":"describe.h","line":137,"lineto":140,"args":[{"name":"out","type":"git_describe_result **","comment":"pointer to store the result. You must free this once\n you're done with it."},{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the describe"},{"name":"opts","type":"git_describe_options *","comment":"the lookup options"}],"argline":"git_describe_result **out, git_repository *repo, git_describe_options *opts","sig":"git_describe_result **::git_repository *::git_describe_options *","return":{"type":"int","comment":null},"description":"

Describe a commit

\n","comments":"

Perform the describe operation on the current commit and the\n worktree. After peforming describe on HEAD, a status is run and the\n description is considered to be dirty if there are.

\n","group":"describe","examples":{"describe.c":["ex/v0.23.2/describe.html#git_describe_workdir-2"]}},"git_describe_format":{"type":"function","file":"describe.h","line":150,"lineto":153,"args":[{"name":"out","type":"git_buf *","comment":"The buffer to store the result"},{"name":"result","type":"const git_describe_result *","comment":"the result from `git_describe_commit()` or\n `git_describe_workdir()`."},{"name":"opts","type":"const git_describe_format_options *","comment":"the formatting options"}],"argline":"git_buf *out, const git_describe_result *result, const git_describe_format_options *opts","sig":"git_buf *::const git_describe_result *::const git_describe_format_options *","return":{"type":"int","comment":null},"description":"

Print the describe result to a buffer

\n","comments":"","group":"describe","examples":{"describe.c":["ex/v0.23.2/describe.html#git_describe_format-3"]}},"git_describe_result_free":{"type":"function","file":"describe.h","line":158,"lineto":158,"args":[{"name":"result","type":"git_describe_result *","comment":null}],"argline":"git_describe_result *result","sig":"git_describe_result *","return":{"type":"void","comment":null},"description":"

Free the describe result.

\n","comments":"","group":"describe"},"git_diff_init_options":{"type":"function","file":"diff.h","line":412,"lineto":414,"args":[{"name":"opts","type":"git_diff_options *","comment":"The `git_diff_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`"}],"argline":"git_diff_options *opts, unsigned int version","sig":"git_diff_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_options with default values. Equivalent to\n creating an instance with GIT_DIFF_OPTIONS_INIT.

\n","comments":"","group":"diff"},"git_diff_find_init_options":{"type":"function","file":"diff.h","line":697,"lineto":699,"args":[{"name":"opts","type":"git_diff_find_options *","comment":"The `git_diff_find_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`"}],"argline":"git_diff_find_options *opts, unsigned int version","sig":"git_diff_find_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_find_options with default values. Equivalent to\n creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n","comments":"","group":"diff"},"git_diff_free":{"type":"function","file":"diff.h","line":713,"lineto":713,"args":[{"name":"diff","type":"git_diff *","comment":"The previously created diff; cannot be used after free."}],"argline":"git_diff *diff","sig":"git_diff *","return":{"type":"void","comment":null},"description":"

Deallocate a diff.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_free-2"],"log.c":["ex/v0.23.2/log.html#git_diff_free-24","ex/v0.23.2/log.html#git_diff_free-25"]}},"git_diff_tree_to_tree":{"type":"function","file":"diff.h","line":731,"lineto":736,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the trees."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"new_tree","type":"git_tree *","comment":"A git_tree object to diff to, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff with the difference between two tree objects.

\n","comments":"

This is equivalent to git diff \n<old\n-tree> \n<new\n-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the\n second tree will be used for the "new_file" side of the delta. You can\n pass NULL to indicate an empty tree, although it is an error to pass\n NULL for both the old_tree and new_tree.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_tree_to_tree-3"],"log.c":["ex/v0.23.2/log.html#git_diff_tree_to_tree-26","ex/v0.23.2/log.html#git_diff_tree_to_tree-27"]}},"git_diff_tree_to_index":{"type":"function","file":"diff.h","line":757,"lineto":762,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree and index."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"index","type":"git_index *","comment":"The index to diff with; repo index used if NULL."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and repository index.

\n","comments":"

This is equivalent to `git diff --cached \n<treeish

\n\n
\n

or if you pass\n the HEAD tree, then likegit diff --cached`.

\n
\n\n

The tree you pass will be used for the "old_file" side of the delta, and\n the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_tree_to_index-4"]}},"git_diff_index_to_workdir":{"type":"function","file":"diff.h","line":784,"lineto":788,"args":[{"name":"diff","type":"git_diff **","comment":"Output pointer to a git_diff pointer to be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository."},{"name":"index","type":"git_index *","comment":"The index to diff from; repo index used if NULL."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_index *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between the repository index and the workdir directory.

\n","comments":"

This matches the git diff command. See the note below on\n git_diff_tree_to_workdir for a discussion of the difference between\n git diff and git diff HEAD and how to emulate a `git diff \n<treeish

\n\n
\n

`\n using libgit2.

\n
\n\n

The index will be used for the "old_file" side of the delta, and the\n working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_index_to_workdir-5"]}},"git_diff_tree_to_workdir":{"type":"function","file":"diff.h","line":813,"lineto":817,"args":[{"name":"diff","type":"git_diff **","comment":"A pointer to a git_diff pointer that will be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and the working directory.

\n","comments":"

The tree you provide will be used for the "old_file" side of the delta,\n and the working directory will be used for the "new_file" side.

\n\n

This is not the same as `git diff \n<treeish

\n\n
\n

orgit diff-index

\n
\n\n

<treeish

\n\n
\n

. Those commands use information from the index, whereas this\n function strictly returns the differences between the tree and the files\n in the working directory, regardless of the state of the index. Use\ngit_diff_tree_to_workdir_with_index` to emulate those commands.

\n
\n\n

To see difference between this and git_diff_tree_to_workdir_with_index,\n consider the example of a staged file deletion where the file has then\n been put back into the working dir and further modified. The\n tree-to-workdir diff for that file is 'modified', but git diff would\n show status 'deleted' since there is a staged delete.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_tree_to_workdir-6"]}},"git_diff_tree_to_workdir_with_index":{"type":"function","file":"diff.h","line":832,"lineto":836,"args":[{"name":"diff","type":"git_diff **","comment":"A pointer to a git_diff pointer that will be allocated."},{"name":"repo","type":"git_repository *","comment":"The repository containing the tree."},{"name":"old_tree","type":"git_tree *","comment":"A git_tree object to diff from, or NULL for empty tree."},{"name":"opts","type":"const git_diff_options *","comment":"Structure with options to influence diff or NULL for defaults."}],"argline":"git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts","sig":"git_diff **::git_repository *::git_tree *::const git_diff_options *","return":{"type":"int","comment":null},"description":"

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n","comments":"

This emulates `git diff \n<tree

\n\n
\n

` by diffing the tree to the index and\n the index to the working directory and blending the results into a\n single diff that includes staged deleted, etc.

\n
\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_tree_to_workdir_with_index-7"]}},"git_diff_merge":{"type":"function","file":"diff.h","line":851,"lineto":853,"args":[{"name":"onto","type":"git_diff *","comment":"Diff to merge into."},{"name":"from","type":"const git_diff *","comment":"Diff to merge."}],"argline":"git_diff *onto, const git_diff *from","sig":"git_diff *::const git_diff *","return":{"type":"int","comment":null},"description":"

Merge one diff into another.

\n","comments":"

This merges items from the "from" list into the "onto" list. The\n resulting diff will have all items that appear in either list.\n If an item appears in both lists, then it will be "merged" to appear\n as if the old version was from the "onto" list and the new version\n is from the "from" list (with the exception that if the item has a\n pending DELETE in the middle, then it will show as deleted).

\n","group":"diff"},"git_diff_find_similar":{"type":"function","file":"diff.h","line":867,"lineto":869,"args":[{"name":"diff","type":"git_diff *","comment":"diff to run detection algorithms on"},{"name":"options","type":"const git_diff_find_options *","comment":"Control how detection should be run, NULL for defaults"}],"argline":"git_diff *diff, const git_diff_find_options *options","sig":"git_diff *::const git_diff_find_options *","return":{"type":"int","comment":" 0 on success, -1 on failure"},"description":"

Transform a diff marking file renames, copies, etc.

\n","comments":"

This modifies a diff in place, replacing old entries that look\n like renames or copies with new entries reflecting those changes.\n This also will, if requested, break modified files into add/remove\n pairs if the amount of change is above a threshold.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_find_similar-8"]}},"git_diff_num_deltas":{"type":"function","file":"diff.h","line":887,"lineto":887,"args":[{"name":"diff","type":"const git_diff *","comment":"A git_diff generated by one of the above functions"}],"argline":"const git_diff *diff","sig":"const git_diff *","return":{"type":"size_t","comment":" Count of number of deltas in the list"},"description":"

Query how many diff records are there in a diff.

\n","comments":"","group":"diff","examples":{"log.c":["ex/v0.23.2/log.html#git_diff_num_deltas-28"]}},"git_diff_num_deltas_of_type":{"type":"function","file":"diff.h","line":900,"lineto":901,"args":[{"name":"diff","type":"const git_diff *","comment":"A git_diff generated by one of the above functions"},{"name":"type","type":"git_delta_t","comment":"A git_delta_t value to filter the count"}],"argline":"const git_diff *diff, git_delta_t type","sig":"const git_diff *::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 filtered by type.

\n","comments":"

This works just like git_diff_entrycount() with an extra parameter\n that is a git_delta_t and returns just the count of how many deltas\n match that particular type.

\n","group":"diff"},"git_diff_get_delta":{"type":"function","file":"diff.h","line":920,"lineto":921,"args":[{"name":"diff","type":"const git_diff *","comment":"Diff list object"},{"name":"idx","type":"size_t","comment":"Index into diff list"}],"argline":"const git_diff *diff, size_t idx","sig":"const git_diff *::size_t","return":{"type":"const git_diff_delta *","comment":" Pointer to git_diff_delta (or NULL if `idx` out of range)"},"description":"

Return the diff delta for an entry in the diff list.

\n","comments":"

The git_diff_delta pointer points to internal data and you do not\n have to release it when you are done with it. It will go away when\n the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary\n content or not may not be set if there are no attributes set for the\n file and there has been no reason to load the file data at this point.\n For now, if you need those flags to be up to date, your only option is\n to either use git_diff_foreach or create a git_patch.

\n","group":"diff"},"git_diff_is_sorted_icase":{"type":"function","file":"diff.h","line":929,"lineto":929,"args":[{"name":"diff","type":"const git_diff *","comment":"diff to check"}],"argline":"const git_diff *diff","sig":"const git_diff *","return":{"type":"int","comment":" 0 if case sensitive, 1 if case is ignored"},"description":"

Check if deltas are sorted case sensitively or insensitively.

\n","comments":"","group":"diff"},"git_diff_foreach":{"type":"function","file":"diff.h","line":957,"lineto":963,"args":[{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback function to make per file in the diff."},{"name":"binary_cb","type":"git_diff_binary_cb","comment":"Optional callback to make for binary files."},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files."},{"name":"line_cb","type":"git_diff_line_cb","comment":"Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callbacks."}],"argline":"git_diff *diff, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"git_diff *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all deltas in a diff issuing callbacks.

\n","comments":"

This will iterate through all of the files described in a diff. You\n should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the\n files will only be calculated if they are not NULL. Of course, these\n callbacks will not be invoked for binary files on the diff or for\n files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate\n the iteration and return the value to the user.

\n","group":"diff"},"git_diff_status_char":{"type":"function","file":"diff.h","line":976,"lineto":976,"args":[{"name":"status","type":"git_delta_t","comment":"The git_delta_t value to look up"}],"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.

\n","comments":"

When you run git diff --name-status it uses single letter codes in\n the output such as 'A' for added, 'D' for deleted, 'M' for modified,\n etc. This function converts a git_delta_t value into these letters for\n your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n","group":"diff"},"git_diff_print":{"type":"function","file":"diff.h","line":1001,"lineto":1005,"args":[{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."},{"name":"format","type":"git_diff_format_t","comment":"A git_diff_format_t value to pick the text format."},{"name":"print_cb","type":"git_diff_line_cb","comment":"Callback to make per line of diff text."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callback."}],"argline":"git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload","sig":"git_diff *::git_diff_format_t::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Iterate over a diff generating formatted text output.

\n","comments":"

Returning a non-zero value from the callbacks will terminate the\n iteration and return the non-zero value to the caller.

\n","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_print-9"],"log.c":["ex/v0.23.2/log.html#git_diff_print-29"]}},"git_diff_blobs":{"type":"function","file":"diff.h","line":1042,"lineto":1052,"args":[{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"new_blob","type":"const git_blob *","comment":"Blob for new side of diff, or NULL for empty blob"},{"name":"new_as_path","type":"const char *","comment":"Treat new blob as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"binary_cb","type":"git_diff_binary_cb","comment":"Callback for binary files; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff on two blobs.

\n","comments":"

Compared to a file, a blob lacks some contextual information. As such,\n the git_diff_file given to the callback will have some fake data; i.e.\n mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated\n as an empty blob, with the oid set to NULL in the git_diff_file data.\n Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob\n looks like binary data, the git_diff_delta binary attribute will be set\n to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass\n GIT_DIFF_FORCE_TEXT of course).

\n","group":"diff"},"git_diff_blob_to_buffer":{"type":"function","file":"diff.h","line":1079,"lineto":1090,"args":[{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"buffer_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"buffer_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"binary_cb","type":"git_diff_binary_cb","comment":"Callback for binary files; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff between a blob and a buffer.

\n","comments":"

As with git_diff_blobs, comparing a blob and buffer lacks some context,\n so the git_diff_file parameters to the callbacks will be faked a la the\n rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the\n file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the\n entire content of the buffer added). Passing NULL to the buffer will do\n the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n","group":"diff"},"git_diff_buffers":{"type":"function","file":"diff.h","line":1113,"lineto":1125,"args":[{"name":"old_buffer","type":"const void *","comment":"Raw data for old side of diff, or NULL for empty"},{"name":"old_len","type":"size_t","comment":"Length of the raw data for old side of the diff"},{"name":"old_as_path","type":"const char *","comment":"Treat old buffer as if it had this filename; can be NULL"},{"name":"new_buffer","type":"const void *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"new_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"new_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"options","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"},{"name":"file_cb","type":"git_diff_file_cb","comment":"Callback for \"file\"; made once if there is a diff; can be NULL"},{"name":"binary_cb","type":"git_diff_binary_cb","comment":"Callback for binary files; can be NULL"},{"name":"hunk_cb","type":"git_diff_hunk_cb","comment":"Callback for each hunk in diff; can be NULL"},{"name":"line_cb","type":"git_diff_line_cb","comment":"Callback for each line in diff; can be NULL"},{"name":"payload","type":"void *","comment":"Payload passed to each callback function"}],"argline":"const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload","sig":"const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Directly run a diff between two buffers.

\n","comments":"

Even more than with git_diff_blobs, comparing two buffer lacks\n context, so the git_diff_file parameters to the callbacks will be\n faked a la the rules for git_diff_blobs().

\n","group":"diff"},"git_diff_get_stats":{"type":"function","file":"diff.h","line":1161,"lineto":1163,"args":[{"name":"out","type":"git_diff_stats **","comment":"Structure containg the diff statistics."},{"name":"diff","type":"git_diff *","comment":"A git_diff generated by one of the above functions."}],"argline":"git_diff_stats **out, git_diff *diff","sig":"git_diff_stats **::git_diff *","return":{"type":"int","comment":" 0 on success; non-zero on error"},"description":"

Accumlate diff statistics for all patches.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_get_stats-10"]}},"git_diff_stats_files_changed":{"type":"function","file":"diff.h","line":1171,"lineto":1172,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of files changed in the diff"},"description":"

Get the total number of files changed in a diff

\n","comments":"","group":"diff"},"git_diff_stats_insertions":{"type":"function","file":"diff.h","line":1180,"lineto":1181,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of insertions in the diff"},"description":"

Get the total number of insertions in a diff

\n","comments":"","group":"diff"},"git_diff_stats_deletions":{"type":"function","file":"diff.h","line":1189,"lineto":1190,"args":[{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."}],"argline":"const git_diff_stats *stats","sig":"const git_diff_stats *","return":{"type":"size_t","comment":" total number of deletions in the diff"},"description":"

Get the total number of deletions in a diff

\n","comments":"","group":"diff"},"git_diff_stats_to_buf":{"type":"function","file":"diff.h","line":1201,"lineto":1205,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the formatted diff statistics in."},{"name":"stats","type":"const git_diff_stats *","comment":"A `git_diff_stats` generated by one of the above functions."},{"name":"format","type":"git_diff_stats_format_t","comment":"Formatting option."},{"name":"width","type":"size_t","comment":"Target width for output (only affects GIT_DIFF_STATS_FULL)"}],"argline":"git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width","sig":"git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t","return":{"type":"int","comment":" 0 on success; non-zero on error"},"description":"

Print diff statistics to a git_buf.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_stats_to_buf-11"]}},"git_diff_stats_free":{"type":"function","file":"diff.h","line":1213,"lineto":1213,"args":[{"name":"stats","type":"git_diff_stats *","comment":"The previously created statistics object;\n cannot be used after free."}],"argline":"git_diff_stats *stats","sig":"git_diff_stats *","return":{"type":"void","comment":null},"description":"

Deallocate a git_diff_stats.

\n","comments":"","group":"diff","examples":{"diff.c":["ex/v0.23.2/diff.html#git_diff_stats_free-12"]}},"git_diff_format_email":{"type":"function","file":"diff.h","line":1262,"lineto":1265,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the e-mail patch in"},{"name":"diff","type":"git_diff *","comment":"containing the commit"},{"name":"opts","type":"const git_diff_format_email_options *","comment":"structure with options to influence content and formatting."}],"argline":"git_buf *out, git_diff *diff, const git_diff_format_email_options *opts","sig":"git_buf *::git_diff *::const git_diff_format_email_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an e-mail ready patch from a diff.

\n","comments":"","group":"diff"},"git_diff_commit_as_email":{"type":"function","file":"diff.h","line":1281,"lineto":1288,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the e-mail patch in"},{"name":"repo","type":"git_repository *","comment":"containing the commit"},{"name":"commit","type":"git_commit *","comment":"pointer to up commit"},{"name":"patch_no","type":"size_t","comment":"patch number of the commit"},{"name":"total_patches","type":"size_t","comment":"total number of patches in the patch set"},{"name":"flags","type":"git_diff_format_email_flags_t","comment":"determines the formatting of the e-mail"},{"name":"diff_opts","type":"const git_diff_options *","comment":"structure with options to influence diff or NULL for defaults."}],"argline":"git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, git_diff_format_email_flags_t flags, const git_diff_options *diff_opts","sig":"git_buf *::git_repository *::git_commit *::size_t::size_t::git_diff_format_email_flags_t::const git_diff_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an e-mail ready patch for a commit.

\n","comments":"

Does not support creating patches for merge commits (yet).

\n","group":"diff"},"git_diff_format_email_init_options":{"type":"function","file":"diff.h","line":1299,"lineto":1301,"args":[{"name":"opts","type":"git_diff_format_email_options *","comment":"The `git_diff_format_email_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`"}],"argline":"git_diff_format_email_options *opts, unsigned int version","sig":"git_diff_format_email_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_diff_format_email_options with default values.

\n","comments":"

Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n","group":"diff"},"giterr_last":{"type":"function","file":"errors.h","line":109,"lineto":109,"args":[],"argline":"","sig":"","return":{"type":"const git_error *","comment":" A git_error object."},"description":"

Return the last git_error object that was generated for the\n current thread or NULL if no error has occurred.

\n","comments":"","group":"giterr","examples":{"general.c":["ex/v0.23.2/general.html#giterr_last-27"],"network/clone.c":["ex/v0.23.2/network/clone.html#giterr_last-2"],"network/git2.c":["ex/v0.23.2/network/git2.html#giterr_last-1","ex/v0.23.2/network/git2.html#giterr_last-2"]}},"giterr_clear":{"type":"function","file":"errors.h","line":114,"lineto":114,"args":[],"argline":"","sig":"","return":{"type":"void","comment":null},"description":"

Clear the last library error that occurred for this thread.

\n","comments":"","group":"giterr"},"giterr_detach":{"type":"function","file":"errors.h","line":126,"lineto":126,"args":[{"name":"cpy","type":"git_error *","comment":null}],"argline":"git_error *cpy","sig":"git_error *","return":{"type":"int","comment":null},"description":"

Get the last error data and clear it.

\n","comments":"

This copies the last error into the given git_error struct\n and returns 0 if the copy was successful, leaving the error\n cleared as if giterr_clear had been called.

\n\n

If there was no existing error in the library, -1 will be returned\n and the contents of cpy will be left unmodified.

\n","group":"giterr"},"giterr_set_str":{"type":"function","file":"errors.h","line":149,"lineto":149,"args":[{"name":"error_class","type":"int","comment":"One of the `git_error_t` enum above describing the\n general subsystem that is responsible for the error."},{"name":"string","type":"const char *","comment":"The formatted error message to keep"}],"argline":"int error_class, const char *string","sig":"int::const char *","return":{"type":"void","comment":null},"description":"

Set the error message string for this thread.

\n","comments":"

This function is public so that custom ODB backends and the like can\n relay an error message through libgit2. Most regular users of libgit2\n will never need to call this function -- actually, calling it in most\n circumstances (for example, calling from within a callback function)\n will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies\n to the particular thread that this libgit2 call is made from.

\n\n

NOTE: Passing the error_class as GITERR_OS has a special behavior: we\n attempt to append the system default error message for the last OS error\n that occurred and then clear the last error. The specific implementation\n of looking up and clearing this last OS error will vary by platform.

\n","group":"giterr"},"giterr_set_oom":{"type":"function","file":"errors.h","line":160,"lineto":160,"args":[],"argline":"","sig":"","return":{"type":"void","comment":null},"description":"

Set the error message to a special value for memory allocation failure.

\n","comments":"

The normal giterr_set_str() function attempts to strdup() the string\n that is passed in. This is not a good idea when the error in question\n is a memory allocation failure. That circumstance has a special setter\n function that sets the error string to a known and statically allocated\n internal value.

\n","group":"giterr"},"git_filter_list_load":{"type":"function","file":"filter.h","line":90,"lineto":96,"args":[{"name":"filters","type":"git_filter_list **","comment":"Output newly created git_filter_list (or NULL)"},{"name":"repo","type":"git_repository *","comment":"Repository object that contains `path`"},{"name":"blob","type":"git_blob *","comment":"The blob to which the filter will be applied (if known)"},{"name":"path","type":"const char *","comment":"Relative path of the file to be filtered"},{"name":"mode","type":"git_filter_mode_t","comment":"Filtering direction (WT->ODB or ODB->WT)"},{"name":"flags","type":"uint32_t","comment":"Combination of `git_filter_flag_t` flags"}],"argline":"git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t flags","sig":"git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t","return":{"type":"int","comment":" 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error"},"description":"

Load the filter list for a given path.

\n","comments":"

This will return 0 (success) but set the output git_filter_list to NULL\n if no filters are requested for the given file.

\n","group":"filter"},"git_filter_list_contains":{"type":"function","file":"filter.h","line":110,"lineto":112,"args":[{"name":"filters","type":"git_filter_list *","comment":"A loaded git_filter_list (or NULL)"},{"name":"name","type":"const char *","comment":"The name of the filter to query"}],"argline":"git_filter_list *filters, const char *name","sig":"git_filter_list *::const char *","return":{"type":"int","comment":" 1 if the filter is in the list, 0 otherwise"},"description":"

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n","comments":"

This will return 0 if the given filter is not in the list, or 1 if\n the filter will be applied.

\n","group":"filter"},"git_filter_list_apply_to_data":{"type":"function","file":"filter.h","line":134,"lineto":137,"args":[{"name":"out","type":"git_buf *","comment":"Buffer to store the result of the filtering"},{"name":"filters","type":"git_filter_list *","comment":"A loaded git_filter_list (or NULL)"},{"name":"in","type":"git_buf *","comment":"Buffer containing the data to filter"}],"argline":"git_buf *out, git_filter_list *filters, git_buf *in","sig":"git_buf *::git_filter_list *::git_buf *","return":{"type":"int","comment":" 0 on success, an error code otherwise"},"description":"

Apply filter list to a data buffer.

\n","comments":"

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is\n not zero), then it will be overwritten when applying the filters. If\n not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out\n buffer will reference the in buffer data (with asize set to zero)\n instead of allocating data. This keeps allocations to a minimum, but\n it means you have to be careful about freeing the in data since out\n may be pointing to it!

\n","group":"filter"},"git_filter_list_apply_to_file":{"type":"function","file":"filter.h","line":148,"lineto":152,"args":[{"name":"out","type":"git_buf *","comment":"buffer into which to store the filtered file"},{"name":"filters","type":"git_filter_list *","comment":"the list of filters to apply"},{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the filtering"},{"name":"path","type":"const char *","comment":"the path of the file to filter, a relative path will be\n taken as relative to the workdir"}],"argline":"git_buf *out, git_filter_list *filters, git_repository *repo, const char *path","sig":"git_buf *::git_filter_list *::git_repository *::const char *","return":{"type":"int","comment":null},"description":"

Apply a filter list to the contents of a file on disk

\n","comments":"","group":"filter"},"git_filter_list_apply_to_blob":{"type":"function","file":"filter.h","line":161,"lineto":164,"args":[{"name":"out","type":"git_buf *","comment":"buffer into which to store the filtered file"},{"name":"filters","type":"git_filter_list *","comment":"the list of filters to apply"},{"name":"blob","type":"git_blob *","comment":"the blob to filter"}],"argline":"git_buf *out, git_filter_list *filters, git_blob *blob","sig":"git_buf *::git_filter_list *::git_blob *","return":{"type":"int","comment":null},"description":"

Apply a filter list to the contents of a blob

\n","comments":"","group":"filter"},"git_filter_list_stream_data":{"type":"function","file":"filter.h","line":173,"lineto":176,"args":[{"name":"filters","type":"git_filter_list *","comment":"the list of filters to apply"},{"name":"data","type":"git_buf *","comment":"the buffer to filter"},{"name":"target","type":"git_writestream *","comment":"the stream into which the data will be written"}],"argline":"git_filter_list *filters, git_buf *data, git_writestream *target","sig":"git_filter_list *::git_buf *::git_writestream *","return":{"type":"int","comment":null},"description":"

Apply a filter list to an arbitrary buffer as a stream

\n","comments":"","group":"filter"},"git_filter_list_stream_file":{"type":"function","file":"filter.h","line":187,"lineto":191,"args":[{"name":"filters","type":"git_filter_list *","comment":"the list of filters to apply"},{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the filtering"},{"name":"path","type":"const char *","comment":"the path of the file to filter, a relative path will be\n taken as relative to the workdir"},{"name":"target","type":"git_writestream *","comment":"the stream into which the data will be written"}],"argline":"git_filter_list *filters, git_repository *repo, const char *path, git_writestream *target","sig":"git_filter_list *::git_repository *::const char *::git_writestream *","return":{"type":"int","comment":null},"description":"

Apply a filter list to a file as a stream

\n","comments":"","group":"filter"},"git_filter_list_stream_blob":{"type":"function","file":"filter.h","line":200,"lineto":203,"args":[{"name":"filters","type":"git_filter_list *","comment":"the list of filters to apply"},{"name":"blob","type":"git_blob *","comment":"the blob to filter"},{"name":"target","type":"git_writestream *","comment":"the stream into which the data will be written"}],"argline":"git_filter_list *filters, git_blob *blob, git_writestream *target","sig":"git_filter_list *::git_blob *::git_writestream *","return":{"type":"int","comment":null},"description":"

Apply a filter list to a blob as a stream

\n","comments":"","group":"filter"},"git_filter_list_free":{"type":"function","file":"filter.h","line":210,"lineto":210,"args":[{"name":"filters","type":"git_filter_list *","comment":"A git_filter_list created by `git_filter_list_load`"}],"argline":"git_filter_list *filters","sig":"git_filter_list *","return":{"type":"void","comment":null},"description":"

Free a git_filter_list

\n","comments":"","group":"filter"},"git_libgit2_init":{"type":"function","file":"global.h","line":26,"lineto":26,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" the number of initializations of the library, or an error code."},"description":"

Init the global state

\n","comments":"

This function must the called before any other libgit2 function in\n order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number\n of times the initialization has been called (including this one) that have\n not subsequently been shutdown.

\n","group":"libgit2","examples":{"blame.c":["ex/v0.23.2/blame.html#git_libgit2_init-8"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_libgit2_init-10"],"describe.c":["ex/v0.23.2/describe.html#git_libgit2_init-4"],"diff.c":["ex/v0.23.2/diff.html#git_libgit2_init-13"],"general.c":["ex/v0.23.2/general.html#git_libgit2_init-28"],"init.c":["ex/v0.23.2/init.html#git_libgit2_init-2"],"log.c":["ex/v0.23.2/log.html#git_libgit2_init-30"],"network/git2.c":["ex/v0.23.2/network/git2.html#git_libgit2_init-3"],"remote.c":["ex/v0.23.2/remote.html#git_libgit2_init-2"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_libgit2_init-1"],"status.c":["ex/v0.23.2/status.html#git_libgit2_init-1"],"tag.c":["ex/v0.23.2/tag.html#git_libgit2_init-3"]}},"git_libgit2_shutdown":{"type":"function","file":"global.h","line":39,"lineto":39,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" the number of remaining initializations of the library, or an\n error code."},"description":"

Shutdown the global state

\n","comments":"

Clean up the global state and threading context after calling it as\n many times as git_libgit2_init() was called - it will return the\n number of remainining initializations that have not been shutdown\n (after this one).

\n","group":"libgit2","examples":{"blame.c":["ex/v0.23.2/blame.html#git_libgit2_shutdown-9"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_libgit2_shutdown-11"],"describe.c":["ex/v0.23.2/describe.html#git_libgit2_shutdown-5"],"diff.c":["ex/v0.23.2/diff.html#git_libgit2_shutdown-14"],"init.c":["ex/v0.23.2/init.html#git_libgit2_shutdown-3"],"log.c":["ex/v0.23.2/log.html#git_libgit2_shutdown-31"],"network/git2.c":["ex/v0.23.2/network/git2.html#git_libgit2_shutdown-4"],"remote.c":["ex/v0.23.2/remote.html#git_libgit2_shutdown-3"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_libgit2_shutdown-2"],"status.c":["ex/v0.23.2/status.html#git_libgit2_shutdown-2"],"tag.c":["ex/v0.23.2/tag.html#git_libgit2_shutdown-4"]}},"git_graph_ahead_behind":{"type":"function","file":"graph.h","line":37,"lineto":37,"args":[{"name":"ahead","type":"size_t *","comment":"number of unique from commits in `upstream`"},{"name":"behind","type":"size_t *","comment":"number of unique from commits in `local`"},{"name":"repo","type":"git_repository *","comment":"the repository where the commits exist"},{"name":"local","type":"const git_oid *","comment":"the commit for local"},{"name":"upstream","type":"const git_oid *","comment":"the commit for upstream"}],"argline":"size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream","sig":"size_t *::size_t *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":null},"description":"

Count the number of unique commits between two commit objects

\n","comments":"

There is no need for branches containing the commits to have any\n upstream relationship, but it helps to think of one as a branch and\n the other as its upstream, the ahead and behind values will be\n what git would report for the branches.

\n","group":"graph"},"git_graph_descendant_of":{"type":"function","file":"graph.h","line":48,"lineto":51,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"commit","type":"const git_oid *","comment":"a previously loaded commit."},{"name":"ancestor","type":"const git_oid *","comment":"a potential ancestor commit."}],"argline":"git_repository *repo, const git_oid *commit, const git_oid *ancestor","sig":"git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":" 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise."},"description":"

Determine if a commit is the descendant of another commit.

\n","comments":"","group":"graph"},"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.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline."}],"argline":"git_repository *repo, const char *rules","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success"},"description":"

Add ignore rules for a repository.

\n","comments":"

Excludesfile rules (i.e. .gitignore rules) are generally read from\n .gitignore files in the repository tree or from a shared system file\n only if a "core.excludesfile" config value is set. The library also\n keeps a set of per-repository internal ignores that can be configured\n in-memory and will not persist. This function allows you to add to\n that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c\n
\n\n

/

\n\n

with space

\n\n

");

\n\n

This would add three rules to the ignores.

\n","group":"ignore"},"git_ignore_clear_internal_rules":{"type":"function","file":"ignore.h","line":52,"lineto":53,"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.

\n","comments":"

Resets to the default internal ignore rules. This will not turn off\n rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n","group":"ignore"},"git_ignore_path_is_ignored":{"type":"function","file":"ignore.h","line":71,"lineto":74,"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, git_repository *repo, const char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":" 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not."},"description":"

Test if the ignore rules apply to a given path.

\n","comments":"

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n","group":"ignore"},"git_index_open":{"type":"function","file":"index.h","line":189,"lineto":189,"args":[{"name":"out","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 **out, 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\n of the Git index file in 'index_path', without a repository\n to back it.

\n","comments":"

Since there is no ODB or working directory behind this index,\n any Index methods which rely on these (e.g. index_add_bypath)\n will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository,\n use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n","group":"index"},"git_index_new":{"type":"function","file":"index.h","line":202,"lineto":202,"args":[{"name":"out","type":"git_index **","comment":"the pointer for the new index"}],"argline":"git_index **out","sig":"git_index **","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an in-memory index object.

\n","comments":"

This index object cannot be read/written to the filesystem,\n but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n","group":"index"},"git_index_free":{"type":"function","file":"index.h","line":209,"lineto":209,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"void","comment":null},"description":"

Free an existing index object.

\n","comments":"","group":"index","examples":{"general.c":["ex/v0.23.2/general.html#git_index_free-29"],"init.c":["ex/v0.23.2/init.html#git_index_free-4"]}},"git_index_owner":{"type":"function","file":"index.h","line":217,"lineto":217,"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

\n","comments":"","group":"index"},"git_index_caps":{"type":"function","file":"index.h","line":225,"lineto":225,"args":[{"name":"index","type":"const git_index *","comment":"An existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"int","comment":" A combination of GIT_INDEXCAP values"},"description":"

Read index capabilities flags.

\n","comments":"","group":"index"},"git_index_set_caps":{"type":"function","file":"index.h","line":238,"lineto":238,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"caps","type":"int","comment":"A combination of GIT_INDEXCAP values"}],"argline":"git_index *index, int caps","sig":"git_index *::int","return":{"type":"int","comment":" 0 on success, -1 on failure"},"description":"

Set index capabilities flags.

\n","comments":"

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the\n capabilities will be read from the config of the owner object,\n looking at core.ignorecase, core.filemode, core.symlinks.

\n","group":"index"},"git_index_read":{"type":"function","file":"index.h","line":257,"lineto":257,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"force","type":"int","comment":"if true, always reload, vs. only read if file has changed"}],"argline":"git_index *index, int force","sig":"git_index *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n","comments":"

If force is true, this performs a "hard" read that discards in-memory\n changes and always reloads the on-disk index data. If there is no\n on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index\n data from disk only if it has changed since the last time it was\n loaded. Purely in-memory index data will be untouched. Be aware: if\n there are changes on disk, unwritten in-memory changes are discarded.

\n","group":"index"},"git_index_write":{"type":"function","file":"index.h","line":266,"lineto":266,"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\n using an atomic file lock.

\n","comments":"","group":"index"},"git_index_path":{"type":"function","file":"index.h","line":274,"lineto":274,"args":[{"name":"index","type":"const git_index *","comment":"an existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"const char *","comment":" path to index file or NULL for in-memory index"},"description":"

Get the full path to the index file on disk.

\n","comments":"","group":"index"},"git_index_checksum":{"type":"function","file":"index.h","line":286,"lineto":286,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"const git_oid *","comment":" a pointer to the checksum of the index"},"description":"

Get the checksum of the index

\n","comments":"

This checksum is the SHA-1 hash over the index file (except the\n last 20 bytes which are the checksum itself). In cases where the\n index does not exist on-disk, it will be zeroed out.

\n","group":"index"},"git_index_read_tree":{"type":"function","file":"index.h","line":297,"lineto":297,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"tree","type":"const git_tree *","comment":"tree to read"}],"argline":"git_index *index, const git_tree *tree","sig":"git_index *::const git_tree *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read a tree into the index file with stats

\n","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":318,"lineto":318,"args":[{"name":"out","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 *out, git_index *index","sig":"git_oid *::git_index *","return":{"type":"int","comment":" 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code"},"description":"

Write the index as a tree

\n","comments":"

This method will scan the index and write a representation\n of its current state back to disk; it recursively creates\n tree objects for each of the subtrees stored in the index,\n but only returns the OID of the root tree. This is the OID\n that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated\n to an existing repository.

\n\n

The index must not contain any file in conflict.

\n","group":"index","examples":{"init.c":["ex/v0.23.2/init.html#git_index_write_tree-5"]}},"git_index_write_tree_to":{"type":"function","file":"index.h","line":335,"lineto":335,"args":[{"name":"out","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 *out, 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\n or an error code"},"description":"

Write the index as a tree to the given repository

\n","comments":"

This method will do the same as git_index_write_tree, but\n letting the user choose the repository where the tree will\n be written.

\n\n

The index must not contain any file in conflict.

\n","group":"index"},"git_index_entrycount":{"type":"function","file":"index.h","line":354,"lineto":354,"args":[{"name":"index","type":"const git_index *","comment":"an existing index object"}],"argline":"const git_index *index","sig":"const git_index *","return":{"type":"size_t","comment":" integer of count of current entries"},"description":"

Get the count of entries currently in the index

\n","comments":"","group":"index","examples":{"general.c":["ex/v0.23.2/general.html#git_index_entrycount-30"]}},"git_index_clear":{"type":"function","file":"index.h","line":365,"lineto":365,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"}],"argline":"git_index *index","sig":"git_index *","return":{"type":"int","comment":" 0 on success, error code \n<\n 0 on failure"},"description":"

Clear the contents (all the entries) of an index object.

\n","comments":"

This clears the index object in memory; changes must be explicitly\n written to disk for them to take effect persistently.

\n","group":"index"},"git_index_get_byindex":{"type":"function","file":"index.h","line":378,"lineto":379,"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_entry *","comment":" a pointer to the entry; NULL if out of bounds"},"description":"

Get a pointer to one of the entries in the index

\n","comments":"

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index","examples":{"general.c":["ex/v0.23.2/general.html#git_index_get_byindex-31"]}},"git_index_get_bypath":{"type":"function","file":"index.h","line":393,"lineto":394,"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":"const 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

\n","comments":"

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index"},"git_index_remove":{"type":"function","file":"index.h","line":404,"lineto":404,"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

\n","comments":"","group":"index"},"git_index_remove_directory":{"type":"function","file":"index.h","line":414,"lineto":415,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"dir","type":"const char *","comment":"container directory path"},{"name":"stage","type":"int","comment":"stage to search"}],"argline":"git_index *index, const char *dir, int stage","sig":"git_index *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove all entries from the index under a given directory

\n","comments":"","group":"index"},"git_index_add":{"type":"function","file":"index.h","line":431,"lineto":431,"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

\n","comments":"

If a previous index entry exists that has the same path and stage\n as the given 'source_entry', it will be replaced. Otherwise, the\n 'source_entry' will be added.

\n\n

A 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":443,"lineto":443,"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","comment":" the stage number"},"description":"

Return the stage number from a git index entry

\n","comments":"

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags \n
\n\n

&\n GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT

\n","group":"index"},"git_index_entry_is_conflict":{"type":"function","file":"index.h","line":452,"lineto":452,"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","comment":" 1 if the entry is a conflict entry, 0 otherwise"},"description":"

Return whether the given index entry is a conflict (has a high stage\n entry). This is simply shorthand for git_index_entry_stage > 0.

\n","comments":"","group":"index"},"git_index_add_bypath":{"type":"function","file":"index.h","line":483,"lineto":483,"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 on disk

\n","comments":"

The file path must be relative to the repository's\n working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n","group":"index"},"git_index_add_frombuffer":{"type":"function","file":"index.h","line":512,"lineto":515,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"entry","type":"const git_index_entry *","comment":"filename to add"},{"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_index *index, const git_index_entry *entry, const void *buffer, size_t len","sig":"git_index *::const git_index_entry *::const void *::size_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add or update an index entry from a buffer in memory

\n","comments":"

This method will create a blob in the repository that owns the\n index and then add the index entry to the index. The path of the\n entry represents the position of the blob relative to the\n repository's root folder.

\n\n

If a previous index entry exists that has the same path as the\n given 'entry', it will be replaced. Otherwise, the 'entry' will be\n added. The id and the file_size of the 'entry' are updated with the\n real value of the blob.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n","group":"index"},"git_index_remove_bypath":{"type":"function","file":"index.h","line":531,"lineto":531,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"filename to remove"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove an index entry corresponding to a file on disk

\n","comments":"

The file path must be relative to the repository's\n working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n","group":"index"},"git_index_add_all":{"type":"function","file":"index.h","line":578,"lineto":583,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"flags","type":"unsigned int","comment":"combination of git_index_add_option_t flags"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Add or update index entries matching files in the working directory.

\n","comments":"

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will\n matched against files in the repository's working directory. Each file\n that matches will be added to the index (either updating an existing\n entry or adding a new entry). You can disable glob expansion and force\n exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath).\n If a file is already tracked in the index, then it will be updated\n even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to\n skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains\n the exact path of an ignored file (when not using FORCE), add the\n GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry\n in the pathspec that is an exact match to a filename on disk is\n either not ignored or already in the index. If this check fails, the\n function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback\n function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files\n will no longer be marked as conflicting. The data about the conflicts\n will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the working directory immediately before it is added to /\n updated in the index. Returning zero will add the item to the index,\n greater than zero will skip the item, and less than zero will abort the\n scan and return that value to the caller.

\n","group":"index"},"git_index_remove_all":{"type":"function","file":"index.h","line":600,"lineto":604,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Remove all matching index entries.

\n","comments":"

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is removed. Return 0 to\n remove the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n","group":"index"},"git_index_update_all":{"type":"function","file":"index.h","line":629,"lineto":633,"args":[{"name":"index","type":"git_index *","comment":"An existing index object"},{"name":"pathspec","type":"const git_strarray *","comment":"array of path patterns"},{"name":"callback","type":"git_index_matched_path_cb","comment":"notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan."},{"name":"payload","type":"void *","comment":"payload passed through to callback function"}],"argline":"git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload","sig":"git_index *::const git_strarray *::git_index_matched_path_cb::void *","return":{"type":"int","comment":" 0 on success, negative callback return value, or error code"},"description":"

Update all index entries to match the working directory

\n","comments":"

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the\n working directory, deleting them if the corresponding working directory\n file no longer exists otherwise updating the information (including\n adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is updated (either refreshed\n or removed depending on working directory state). Return 0 to proceed\n with updating the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n","group":"index"},"git_index_find":{"type":"function","file":"index.h","line":644,"lineto":644,"args":[{"name":"at_pos","type":"size_t *","comment":"the address to which the position of the index entry is written (optional)"},{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to search"}],"argline":"size_t *at_pos, git_index *index, const char *path","sig":"size_t *::git_index *::const char *","return":{"type":"int","comment":" a zero-based position in the index if found; GIT_ENOTFOUND otherwise"},"description":"

Find the first position of any entries which point to given\n path in the Git index.

\n","comments":"","group":"index"},"git_index_conflict_add":{"type":"function","file":"index.h","line":669,"lineto":673,"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, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const 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. Any staged\n entries that exist at the given paths will be removed.

\n","comments":"

The entries are the entries from the tree included in the merge. Any\n entry may be null to indicate that that file was not present in the\n trees during the merge. For example, ancestor_entry may be NULL to\n indicate 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":689,"lineto":694,"args":[{"name":"ancestor_out","type":"const git_index_entry **","comment":"Pointer to store the ancestor entry"},{"name":"our_out","type":"const git_index_entry **","comment":"Pointer to store the our entry"},{"name":"their_out","type":"const 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":"const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path","sig":"const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the index entries that represent a conflict of a single file.

\n","comments":"

The entries are not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n","group":"index"},"git_index_conflict_remove":{"type":"function","file":"index.h","line":703,"lineto":703,"args":[{"name":"index","type":"git_index *","comment":"an existing index object"},{"name":"path","type":"const char *","comment":"path to remove conflicts for"}],"argline":"git_index *index, const char *path","sig":"git_index *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Removes the index entries that represent a conflict of a single file.

\n","comments":"","group":"index"},"git_index_conflict_cleanup":{"type":"function","file":"index.h","line":711,"lineto":711,"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":"

Remove all conflicts in the index (entries with a stage greater than 0).

\n","comments":"","group":"index"},"git_index_has_conflicts":{"type":"function","file":"index.h","line":718,"lineto":718,"args":[{"name":"index","type":"const git_index *","comment":null}],"argline":"const git_index *index","sig":"const 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.

\n","comments":"","group":"index"},"git_index_conflict_iterator_new":{"type":"function","file":"index.h","line":729,"lineto":731,"args":[{"name":"iterator_out","type":"git_index_conflict_iterator **","comment":"The newly created conflict iterator"},{"name":"index","type":"git_index *","comment":"The index to scan"}],"argline":"git_index_conflict_iterator **iterator_out, git_index *index","sig":"git_index_conflict_iterator **::git_index *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the conflicts in the index.

\n","comments":"

The index must not be modified while iterating; the results are undefined.

\n","group":"index"},"git_index_conflict_next":{"type":"function","file":"index.h","line":743,"lineto":747,"args":[{"name":"ancestor_out","type":"const git_index_entry **","comment":"Pointer to store the ancestor side of the conflict"},{"name":"our_out","type":"const git_index_entry **","comment":"Pointer to store our side of the conflict"},{"name":"their_out","type":"const git_index_entry **","comment":"Pointer to store their side of the conflict"},{"name":"iterator","type":"git_index_conflict_iterator *","comment":null}],"argline":"const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator","sig":"const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *","return":{"type":"int","comment":" 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)"},"description":"

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n","comments":"","group":"index"},"git_index_conflict_iterator_free":{"type":"function","file":"index.h","line":754,"lineto":755,"args":[{"name":"iterator","type":"git_index_conflict_iterator *","comment":"pointer to the iterator"}],"argline":"git_index_conflict_iterator *iterator","sig":"git_index_conflict_iterator *","return":{"type":"void","comment":null},"description":"

Frees a git_index_conflict_iterator.

\n","comments":"","group":"index"},"git_indexer_new":{"type":"function","file":"indexer.h","line":30,"lineto":36,"args":[{"name":"out","type":"git_indexer **","comment":"where to store the indexer instance"},{"name":"path","type":"const char *","comment":"to the directory where the packfile should be stored"},{"name":"mode","type":"unsigned int","comment":"permissions to use creating packfile or 0 for defaults"},{"name":"odb","type":"git_odb *","comment":"object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)"},{"name":"progress_cb","type":"git_transfer_progress_cb","comment":"function to call with progress information"},{"name":"progress_cb_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_cb_payload","sig":"git_indexer **::const char *::unsigned int::git_odb *::git_transfer_progress_cb::void *","return":{"type":"int","comment":null},"description":"

Create a new indexer instance

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_indexer_new-1"]}},"git_indexer_append":{"type":"function","file":"indexer.h","line":46,"lineto":46,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer"},{"name":"data","type":"const void *","comment":"the data to add"},{"name":"size","type":"size_t","comment":"the size of the data in bytes"},{"name":"stats","type":"git_transfer_progress *","comment":"stat storage"}],"argline":"git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats","sig":"git_indexer *::const void *::size_t::git_transfer_progress *","return":{"type":"int","comment":null},"description":"

Add data to the indexer

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_indexer_append-2"]}},"git_indexer_commit":{"type":"function","file":"indexer.h","line":55,"lineto":55,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer"},{"name":"stats","type":"git_transfer_progress *","comment":null}],"argline":"git_indexer *idx, git_transfer_progress *stats","sig":"git_indexer *::git_transfer_progress *","return":{"type":"int","comment":null},"description":"

Finalize the pack and index

\n","comments":"

Resolve any pending deltas and write out the index file

\n","group":"indexer","examples":{"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_indexer_commit-3"]}},"git_indexer_hash":{"type":"function","file":"indexer.h","line":65,"lineto":65,"args":[{"name":"idx","type":"const git_indexer *","comment":"the indexer instance"}],"argline":"const git_indexer *idx","sig":"const git_indexer *","return":{"type":"const git_oid *","comment":null},"description":"

Get the packfile's hash

\n","comments":"

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the index has been finalized.

\n","group":"indexer","examples":{"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_indexer_hash-4"]}},"git_indexer_free":{"type":"function","file":"indexer.h","line":72,"lineto":72,"args":[{"name":"idx","type":"git_indexer *","comment":"the indexer to free"}],"argline":"git_indexer *idx","sig":"git_indexer *","return":{"type":"void","comment":null},"description":"

Free the indexer and its resources

\n","comments":"","group":"indexer","examples":{"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_indexer_free-5"]}},"git_merge_file_init_input":{"type":"function","file":"merge.h","line":60,"lineto":62,"args":[{"name":"opts","type":"git_merge_file_input *","comment":"the `git_merge_file_input` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here."}],"argline":"git_merge_file_input *opts, unsigned int version","sig":"git_merge_file_input *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n","comments":"","group":"merge"},"git_merge_file_init_options":{"type":"function","file":"merge.h","line":188,"lineto":190,"args":[{"name":"opts","type":"git_merge_file_options *","comment":"the `git_merge_file_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_FILE_OPTIONS_VERSION` here."}],"argline":"git_merge_file_options *opts, unsigned int version","sig":"git_merge_file_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_file_options with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n","comments":"","group":"merge"},"git_merge_init_options":{"type":"function","file":"merge.h","line":265,"lineto":267,"args":[{"name":"opts","type":"git_merge_options *","comment":"the `git_merge_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_MERGE_OPTIONS_VERSION` here."}],"argline":"git_merge_options *opts, unsigned int version","sig":"git_merge_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_merge_options with default values. Equivalent to\n creating an instance with GIT_MERGE_OPTIONS_INIT.

\n","comments":"","group":"merge"},"git_merge_analysis":{"type":"function","file":"merge.h","line":336,"lineto":341,"args":[{"name":"analysis_out","type":"git_merge_analysis_t *","comment":"analysis enumeration that the result is written into"},{"name":"preference_out","type":"git_merge_preference_t *","comment":null},{"name":"repo","type":"git_repository *","comment":"the repository to merge"},{"name":"their_heads","type":"const git_annotated_commit **","comment":"the heads to merge into"},{"name":"their_heads_len","type":"size_t","comment":"the number of heads to merge"}],"argline":"git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len","sig":"git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n","comments":"","group":"merge"},"git_merge_base":{"type":"function","file":"merge.h","line":352,"lineto":356,"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","comment":" 0 on success, GIT_ENOTFOUND if not found or error code"},"description":"

Find a merge base between two commits

\n","comments":"","group":"merge","examples":{"log.c":["ex/v0.23.2/log.html#git_merge_base-32"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_merge_base-3"]}},"git_merge_bases":{"type":"function","file":"merge.h","line":367,"lineto":371,"args":[{"name":"out","type":"git_oidarray *","comment":"array in which to store the resulting ids"},{"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_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two","sig":"git_oidarray *::git_repository *::const git_oid *::const git_oid *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if not found or error code"},"description":"

Find merge bases between two commits

\n","comments":"","group":"merge"},"git_merge_base_many":{"type":"function","file":"merge.h","line":382,"lineto":386,"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`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oid *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find a merge base given a list of commits

\n","comments":"","group":"merge"},"git_merge_bases_many":{"type":"function","file":"merge.h","line":397,"lineto":401,"args":[{"name":"out","type":"git_oidarray *","comment":"array in which to store the resulting ids"},{"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`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oidarray *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find all merge bases given a list of commits

\n","comments":"","group":"merge"},"git_merge_base_octopus":{"type":"function","file":"merge.h","line":412,"lineto":416,"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`"},{"name":"input_array","type":"const git_oid []","comment":"oids of the commits"}],"argline":"git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array","sig":"git_oid *::git_repository *::size_t::const git_oid []","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND or -1 on failure."},"description":"

Find a merge base in preparation for an octopus merge

\n","comments":"","group":"merge"},"git_merge_file":{"type":"function","file":"merge.h","line":434,"lineto":439,"args":[{"name":"out","type":"git_merge_file_result *","comment":"The git_merge_file_result to be filled in"},{"name":"ancestor","type":"const git_merge_file_input *","comment":"The contents of the ancestor file"},{"name":"ours","type":"const git_merge_file_input *","comment":"The contents of the file in \"our\" side"},{"name":"theirs","type":"const git_merge_file_input *","comment":"The contents of the file in \"their\" side"},{"name":"opts","type":"const git_merge_file_options *","comment":"The merge file options or `NULL` for defaults"}],"argline":"git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts","sig":"git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n","comments":"

Note that this function does not reference a repository and any\n configuration must be passed as git_merge_file_options.

\n","group":"merge"},"git_merge_file_from_index":{"type":"function","file":"merge.h","line":455,"lineto":461,"args":[{"name":"out","type":"git_merge_file_result *","comment":"The git_merge_file_result to be filled in"},{"name":"repo","type":"git_repository *","comment":"The repository"},{"name":"ancestor","type":"const git_index_entry *","comment":"The index entry for the ancestor file (stage level 1)"},{"name":"ours","type":"const git_index_entry *","comment":"The index entry for our file (stage level 2)"},{"name":"theirs","type":"const git_index_entry *","comment":"The index entry for their file (stage level 3)"},{"name":"opts","type":"const git_merge_file_options *","comment":"The merge file options or NULL"}],"argline":"git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts","sig":"git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n","comments":"","group":"merge"},"git_merge_file_result_free":{"type":"function","file":"merge.h","line":468,"lineto":468,"args":[{"name":"result","type":"git_merge_file_result *","comment":"The result to free or `NULL`"}],"argline":"git_merge_file_result *result","sig":"git_merge_file_result *","return":{"type":"void","comment":null},"description":"

Frees a git_merge_file_result.

\n","comments":"","group":"merge"},"git_merge_trees":{"type":"function","file":"merge.h","line":486,"lineto":492,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given trees"},{"name":"ancestor_tree","type":"const git_tree *","comment":"the common ancestor between the trees (or null if none)"},{"name":"our_tree","type":"const git_tree *","comment":"the tree that reflects the destination tree"},{"name":"their_tree","type":"const git_tree *","comment":"the tree to merge in to `our_tree`"},{"name":"opts","type":"const git_merge_options *","comment":"the merge tree options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts","sig":"git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"merge"},"git_merge_commits":{"type":"function","file":"merge.h","line":513,"lineto":518,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"repository that contains the given trees"},{"name":"our_commit","type":"const git_commit *","comment":"the commit that reflects the destination tree"},{"name":"their_commit","type":"const git_commit *","comment":"the commit to merge in to `our_commit`"},{"name":"opts","type":"const git_merge_options *","comment":"the merge tree options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts","sig":"git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n","comments":"

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

The returned index must be freed explicitly with git_index_free.

\n","group":"merge"},"git_merge":{"type":"function","file":"merge.h","line":542,"lineto":547,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to merge"},{"name":"their_heads","type":"const git_annotated_commit **","comment":"the heads to merge into"},{"name":"their_heads_len","type":"size_t","comment":"the number of heads to merge"},{"name":"merge_opts","type":"const git_merge_options *","comment":"merge options"},{"name":"checkout_opts","type":"const git_checkout_options *","comment":"checkout options"}],"argline":"git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts","sig":"git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n","comments":"

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

For compatibility with git, the repository is put into a merging\n state. Once the commit is done (or if the uses wishes to abort),\n you should clear this state by calling\n git_repository_state_cleanup().

\n","group":"merge"},"git_message_prettify":{"type":"function","file":"message.h","line":39,"lineto":39,"args":[{"name":"out","type":"git_buf *","comment":"The user-allocated git_buf which will be filled with the\n cleaned up message."},{"name":"message","type":"const char *","comment":"The message to be prettified."},{"name":"strip_comments","type":"int","comment":"Non-zero to remove comment lines, 0 to leave them in."},{"name":"comment_char","type":"char","comment":"Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero."}],"argline":"git_buf *out, const char *message, int strip_comments, char comment_char","sig":"git_buf *::const char *::int::char","return":{"type":"int","comment":" 0 or an error code."},"description":"

Clean up message from excess whitespace and make sure that the last line\n ends with a '

\n\n

'.

\n","comments":"

Optionally, can remove lines starting with a "#".

\n","group":"message"},"git_note_iterator_new":{"type":"function","file":"notes.h","line":49,"lineto":52,"args":[{"name":"out","type":"git_note_iterator **","comment":"pointer to the iterator"},{"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\n \"refs/notes/commits\""}],"argline":"git_note_iterator **out, git_repository *repo, const char *notes_ref","sig":"git_note_iterator **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Creates a new iterator for notes

\n","comments":"

The iterator must be freed manually by the user.

\n","group":"note"},"git_note_iterator_free":{"type":"function","file":"notes.h","line":59,"lineto":59,"args":[{"name":"it","type":"git_note_iterator *","comment":"pointer to the iterator"}],"argline":"git_note_iterator *it","sig":"git_note_iterator *","return":{"type":"void","comment":null},"description":"

Frees an git_note_iterator

\n","comments":"","group":"note"},"git_note_next":{"type":"function","file":"notes.h","line":72,"lineto":75,"args":[{"name":"note_id","type":"git_oid *","comment":"id of blob containing the message"},{"name":"annotated_id","type":"git_oid *","comment":"id of the git object being annotated"},{"name":"it","type":"git_note_iterator *","comment":"pointer to the iterator"}],"argline":"git_oid *note_id, git_oid *annotated_id, git_note_iterator *it","sig":"git_oid *::git_oid *::git_note_iterator *","return":{"type":"int","comment":" 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)"},"description":"

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n","comments":"","group":"note"},"git_note_read":{"type":"function","file":"notes.h","line":91,"lineto":95,"args":[{"name":"out","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\n \"refs/notes/commits\""},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to read the note from"}],"argline":"git_note **out, git_repository *repo, 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

\n","comments":"

The note must be freed manually by the user.

\n","group":"note"},"git_note_author":{"type":"function","file":"notes.h","line":103,"lineto":103,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_signature *","comment":" the author"},"description":"

Get the note author

\n","comments":"","group":"note"},"git_note_committer":{"type":"function","file":"notes.h","line":111,"lineto":111,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_signature *","comment":" the committer"},"description":"

Get the note committer

\n","comments":"","group":"note"},"git_note_message":{"type":"function","file":"notes.h","line":120,"lineto":120,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const char *","comment":" the note message"},"description":"

Get the note message

\n","comments":"","group":"note"},"git_note_id":{"type":"function","file":"notes.h","line":129,"lineto":129,"args":[{"name":"note","type":"const git_note *","comment":"the note"}],"argline":"const git_note *note","sig":"const git_note *","return":{"type":"const git_oid *","comment":" the note object's id"},"description":"

Get the note object's id

\n","comments":"","group":"note"},"git_note_create":{"type":"function","file":"notes.h","line":146,"lineto":154,"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":"notes_ref","type":"const char *","comment":"canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\""},{"name":"author","type":"const git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"const git_signature *","comment":"signature of the notes commit committer"},{"name":"oid","type":"const git_oid *","comment":"OID of the git object to decorate"},{"name":"note","type":"const char *","comment":"Content of the note to add for object oid"},{"name":"force","type":"int","comment":"Overwrite existing note"}],"argline":"git_oid *out, git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid, const char *note, int force","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *::const char *::int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add a note for an object

\n","comments":"","group":"note"},"git_note_remove":{"type":"function","file":"notes.h","line":169,"lineto":174,"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);\n\t\t\t\t\tdefaults to \"refs/notes/commits\""},{"name":"author","type":"const git_signature *","comment":"signature of the notes commit author"},{"name":"committer","type":"const 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, const git_signature *author, const git_signature *committer, const git_oid *oid","sig":"git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Remove the note for an object

\n","comments":"","group":"note"},"git_note_free":{"type":"function","file":"notes.h","line":181,"lineto":181,"args":[{"name":"note","type":"git_note *","comment":"git_note object"}],"argline":"git_note *note","sig":"git_note *","return":{"type":"void","comment":null},"description":"

Free a git_note object

\n","comments":"","group":"note"},"git_note_foreach":{"type":"function","file":"notes.h","line":209,"lineto":213,"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\n \"refs/notes/commits\"."},{"name":"note_cb","type":"git_note_foreach_cb","comment":"Callback to invoke per found annotation. Return non-zero\n to stop looping."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo, const char *notes_ref, git_note_foreach_cb note_cb, void *payload","sig":"git_repository *::const char *::git_note_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Loop over all the notes within a specified namespace\n and issue a callback for each one.

\n","comments":"","group":"note"},"git_object_lookup":{"type":"function","file":"object.h","line":42,"lineto":46,"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, git_repository *repo, const git_oid *id, git_otype type","sig":"git_object **::git_repository *::const git_oid *::git_otype","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a reference to one of the objects in a repository.

\n","comments":"

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n","group":"object","examples":{"log.c":["ex/v0.23.2/log.html#git_object_lookup-33"]}},"git_object_lookup_prefix":{"type":"function","file":"object.h","line":75,"lineto":80,"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, git_repository *repo, const git_oid *id, size_t len, git_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,\n given a prefix of its identifier (short id).

\n","comments":"

The object obtained will be so that its identifier\n matches the first 'len' hexadecimal characters\n (packets of 4 bits) of the given 'id'.\n 'len' must be at least GIT_OID_MINPREFIXLEN, and\n long enough to identify a unique object matching\n the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n","group":"object"},"git_object_lookup_bypath":{"type":"function","file":"object.h","line":93,"lineto":97,"args":[{"name":"out","type":"git_object **","comment":"buffer that receives a pointer to the object (which must be freed\n by the caller)"},{"name":"treeish","type":"const git_object *","comment":"root object that can be peeled to a tree"},{"name":"path","type":"const char *","comment":"relative path from the root object to the desired object"},{"name":"type","type":"git_otype","comment":"type of object desired"}],"argline":"git_object **out, const git_object *treeish, const char *path, git_otype type","sig":"git_object **::const git_object *::const char *::git_otype","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Lookup an object that represents a tree entry.

\n","comments":"","group":"object"},"git_object_id":{"type":"function","file":"object.h","line":105,"lineto":105,"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

\n","comments":"","group":"object","examples":{"blame.c":["ex/v0.23.2/blame.html#git_object_id-10","ex/v0.23.2/blame.html#git_object_id-11","ex/v0.23.2/blame.html#git_object_id-12","ex/v0.23.2/blame.html#git_object_id-13"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_object_id-12","ex/v0.23.2/cat-file.html#git_object_id-13"],"log.c":["ex/v0.23.2/log.html#git_object_id-34","ex/v0.23.2/log.html#git_object_id-35","ex/v0.23.2/log.html#git_object_id-36","ex/v0.23.2/log.html#git_object_id-37"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_object_id-4","ex/v0.23.2/rev-parse.html#git_object_id-5","ex/v0.23.2/rev-parse.html#git_object_id-6","ex/v0.23.2/rev-parse.html#git_object_id-7","ex/v0.23.2/rev-parse.html#git_object_id-8"]}},"git_object_short_id":{"type":"function","file":"object.h","line":119,"lineto":119,"args":[{"name":"out","type":"git_buf *","comment":"Buffer to write string into"},{"name":"obj","type":"const git_object *","comment":"The object to get an ID for"}],"argline":"git_buf *out, const git_object *obj","sig":"git_buf *::const git_object *","return":{"type":"int","comment":" 0 on success, \n<\n0 for error"},"description":"

Get a short abbreviated OID string for the object

\n","comments":"

This starts at the "core.abbrev" length (default 7 characters) and\n iteratively extends to a longer string if that length is ambiguous.\n The result will be unambiguous (at least until new objects are added to\n the repository).

\n","group":"object","examples":{"tag.c":["ex/v0.23.2/tag.html#git_object_short_id-5"]}},"git_object_type":{"type":"function","file":"object.h","line":127,"lineto":127,"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

\n","comments":"","group":"object","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_object_type-14","ex/v0.23.2/cat-file.html#git_object_type-15","ex/v0.23.2/cat-file.html#git_object_type-16"],"tag.c":["ex/v0.23.2/tag.html#git_object_type-6"]}},"git_object_owner":{"type":"function","file":"object.h","line":141,"lineto":141,"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

\n","comments":"

Freeing or calling git_repository_close on the\n returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without\n affecting the object.

\n","group":"object"},"git_object_free":{"type":"function","file":"object.h","line":158,"lineto":158,"args":[{"name":"object","type":"git_object *","comment":"the object to close"}],"argline":"git_object *object","sig":"git_object *","return":{"type":"void","comment":null},"description":"

Close an open object

\n","comments":"

This method instructs the library to close an existing\n object; note that git_objects are owned and cached by the repository\n so the object may or may not be freed after this library call,\n depending on how aggressive is the caching mechanism used\n by the repository.

\n\n

IMPORTANT:\n It is necessary to call this method when you stop using\n an object. Failure to do so will cause a memory leak.

\n","group":"object","examples":{"blame.c":["ex/v0.23.2/blame.html#git_object_free-14","ex/v0.23.2/blame.html#git_object_free-15","ex/v0.23.2/blame.html#git_object_free-16","ex/v0.23.2/blame.html#git_object_free-17"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_object_free-17"],"general.c":["ex/v0.23.2/general.html#git_object_free-32"],"log.c":["ex/v0.23.2/log.html#git_object_free-38"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_object_free-9","ex/v0.23.2/rev-parse.html#git_object_free-10","ex/v0.23.2/rev-parse.html#git_object_free-11"],"tag.c":["ex/v0.23.2/tag.html#git_object_free-7","ex/v0.23.2/tag.html#git_object_free-8","ex/v0.23.2/tag.html#git_object_free-9","ex/v0.23.2/tag.html#git_object_free-10"]}},"git_object_type2string":{"type":"function","file":"object.h","line":169,"lineto":169,"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 its string representation.

\n","comments":"

The result is a pointer to a string in static memory and\n should not be free()'ed.

\n","group":"object","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_object_type2string-18","ex/v0.23.2/cat-file.html#git_object_type2string-19","ex/v0.23.2/cat-file.html#git_object_type2string-20","ex/v0.23.2/cat-file.html#git_object_type2string-21"],"general.c":["ex/v0.23.2/general.html#git_object_type2string-33"]}},"git_object_string2type":{"type":"function","file":"object.h","line":177,"lineto":177,"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.

\n","comments":"","group":"object"},"git_object_typeisloose":{"type":"function","file":"object.h","line":186,"lineto":186,"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,\n false otherwise."},"description":"

Determine if the given git_otype is a valid loose object type.

\n","comments":"","group":"object"},"git_object__size":{"type":"function","file":"object.h","line":200,"lineto":200,"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\n acts as an in-memory representation of any given\n object type.

\n","comments":"

For all the core types, this would the equivalent\n of calling sizeof(git_commit) if the core types\n were not opaque on the external API.

\n","group":"object"},"git_object_peel":{"type":"function","file":"object.h","line":225,"lineto":228,"args":[{"name":"peeled","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"object","type":"const git_object *","comment":"The object to be processed"},{"name":"target_type","type":"git_otype","comment":"The type of the requested object (a GIT_OBJ_ value)"}],"argline":"git_object **peeled, const git_object *object, git_otype target_type","sig":"git_object **::const git_object *::git_otype","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code"},"description":"

Recursively peel an object until an object of the specified type is met.

\n","comments":"

If the query cannot be satisfied due to the object model,\n GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a\n tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will\n be peeled until the type changes. A tag will be peeled until the\n referenced object is no longer a tag, and a commit will be peeled\n to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to\n the target type due to the object model, GIT_EPEEL will be\n returned.

\n\n

You must free the returned object.

\n","group":"object"},"git_object_dup":{"type":"function","file":"object.h","line":237,"lineto":237,"args":[{"name":"dest","type":"git_object **","comment":"Pointer to store the copy of the object"},{"name":"source","type":"git_object *","comment":"Original object to copy"}],"argline":"git_object **dest, git_object *source","sig":"git_object **::git_object *","return":{"type":"int","comment":null},"description":"

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n","comments":"","group":"object"},"git_odb_new":{"type":"function","file":"odb.h","line":38,"lineto":38,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet 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.

\n","comments":"

Before the ODB can be used for read/writing, a custom database\n backend must be manually added using git_odb_add_backend()

\n","group":"odb"},"git_odb_open":{"type":"function","file":"odb.h","line":56,"lineto":56,"args":[{"name":"out","type":"git_odb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet 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\n the two default backends:

\n","comments":"
- git_odb_backend_loose: read and write loose object files\n    from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,\n    assuming `objects_dir` as the Objects folder which\n    contains a 'pack/' folder with the corresponding data\n
\n","group":"odb"},"git_odb_add_disk_alternate":{"type":"function","file":"odb.h","line":73,"lineto":73,"args":[{"name":"odb","type":"git_odb *","comment":"database to add the backend to"},{"name":"path","type":"const char *","comment":"path to the objects folder for the alternate"}],"argline":"git_odb *odb, const char *path","sig":"git_odb *::const char *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Add an on-disk alternate to an existing Object DB.

\n","comments":"

Note that the added path must point to an objects, not\n to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n","group":"odb"},"git_odb_free":{"type":"function","file":"odb.h","line":80,"lineto":80,"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","comment":null},"description":"

Close an open object database.

\n","comments":"","group":"odb","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_odb_free-22"]}},"git_odb_read":{"type":"function","file":"odb.h","line":99,"lineto":99,"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;\n - GIT_ENOTFOUND if the object is not in the database."},"description":"

Read an object from the database.

\n","comments":"

This method queries all available ODB backends\n trying to read the given OID.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_odb_read-23"],"general.c":["ex/v0.23.2/general.html#git_odb_read-34"]}},"git_odb_read_prefix":{"type":"function","file":"odb.h","line":128,"lineto":128,"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;\n - GIT_ENOTFOUND if the object is not in the database.\n - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)"},"description":"

Read an object from the database, given a prefix\n of its identifier.

\n","comments":"

This method queries all available ODB backends\n trying to match the 'len' first hexadecimal\n characters of the 'short_id'.\n The remaining (GIT_OID_HEXSZ-len)*4 bits of\n 'short_id' must be 0s.\n 'len' must be at least GIT_OID_MINPREFIXLEN,\n and the prefix must be long enough to identify\n a unique object in all the backends; the\n method will fail otherwise.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n","group":"odb"},"git_odb_read_header":{"type":"function","file":"odb.h","line":148,"lineto":148,"args":[{"name":"len_out","type":"size_t *","comment":"pointer where to store the length"},{"name":"type_out","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_out, git_otype *type_out, 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;\n - GIT_ENOTFOUND if the object is not in the database."},"description":"

Read the header of an object from the database, without\n reading its full contents.

\n","comments":"

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header\n of an object, so the whole object will be read and then the\n header will be returned.

\n","group":"odb"},"git_odb_exists":{"type":"function","file":"odb.h","line":159,"lineto":159,"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\n - 0, otherwise"},"description":"

Determine if the given object can be found in the object database.

\n","comments":"","group":"odb"},"git_odb_exists_prefix":{"type":"function","file":"odb.h","line":171,"lineto":172,"args":[{"name":"out","type":"git_oid *","comment":"The full OID of the found object if just one is found."},{"name":"db","type":"git_odb *","comment":"The database to be searched for the given object."},{"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_oid *out, git_odb *db, const git_oid *short_id, size_t len","sig":"git_oid *::git_odb *::const git_oid *::size_t","return":{"type":"int","comment":" 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error."},"description":"

Determine if objects can be found in the object database from a short OID.

\n","comments":"","group":"odb"},"git_odb_refresh":{"type":"function","file":"odb.h","line":192,"lineto":192,"args":[{"name":"db","type":"struct git_odb *","comment":"database to refresh"}],"argline":"struct git_odb *db","sig":"struct git_odb *","return":{"type":"int","comment":" 0 on success, error code otherwise"},"description":"

Refresh the object database to load newly added files.

\n","comments":"

If the object databases have changed on disk while the library\n is running, this function will force a reload of the underlying\n indexes.

\n\n

Use this function when you're confident that an external\n application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The\n library will automatically attempt to refresh the ODB\n when a lookup fails, to see if the looked up object exists\n on disk but hasn't been loaded yet.

\n","group":"odb"},"git_odb_foreach":{"type":"function","file":"odb.h","line":207,"lineto":207,"args":[{"name":"db","type":"git_odb *","comment":"database to use"},{"name":"cb","type":"git_odb_foreach_cb","comment":"the callback to call for each object"},{"name":"payload","type":"void *","comment":"data to pass to the callback"}],"argline":"git_odb *db, git_odb_foreach_cb cb, void *payload","sig":"git_odb *::git_odb_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

List all objects available in the database

\n","comments":"

The callback will be called for each object available in the\n database. Note that the objects are likely to be returned in the index\n order, which would make accessing the objects in that order inefficient.\n Return a non-zero value from the callback to stop looping.

\n","group":"odb"},"git_odb_write":{"type":"function","file":"odb.h","line":227,"lineto":227,"args":[{"name":"out","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 *out, 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

\n","comments":"

This method writes a full object straight into the ODB.\n For most cases, it is preferred to write objects through a write\n stream, which is both faster and less memory intensive, specially\n for big objects.

\n\n

This method is provided for compatibility with custom backends\n which are not able to support streaming writes

\n","group":"odb","examples":{"general.c":["ex/v0.23.2/general.html#git_odb_write-35"]}},"git_odb_open_wstream":{"type":"function","file":"odb.h","line":250,"lineto":250,"args":[{"name":"out","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":"git_off_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 **out, git_odb *db, git_off_t size, git_otype type","sig":"git_odb_stream **::git_odb *::git_off_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

\n","comments":"

The type and final length of the object must be specified\n when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it\n won't be effective until git_odb_stream_finalize_write is called\n and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or\n will leak memory.

\n","group":"odb"},"git_odb_stream_write":{"type":"function","file":"odb.h","line":263,"lineto":263,"args":[{"name":"stream","type":"git_odb_stream *","comment":"the stream"},{"name":"buffer","type":"const char *","comment":"the data to write"},{"name":"len","type":"size_t","comment":"the buffer's length"}],"argline":"git_odb_stream *stream, const char *buffer, size_t len","sig":"git_odb_stream *::const char *::size_t","return":{"type":"int","comment":" 0 if the write succeeded; error code otherwise"},"description":"

Write to an odb stream

\n","comments":"

This method will fail if the total number of received bytes exceeds the\n size declared with git_odb_open_wstream()

\n","group":"odb"},"git_odb_stream_finalize_write":{"type":"function","file":"odb.h","line":278,"lineto":278,"args":[{"name":"out","type":"git_oid *","comment":"pointer to store the resulting object's id"},{"name":"stream","type":"git_odb_stream *","comment":"the stream"}],"argline":"git_oid *out, git_odb_stream *stream","sig":"git_oid *::git_odb_stream *","return":{"type":"int","comment":" 0 on success; an error code otherwise"},"description":"

Finish writing to an odb stream

\n","comments":"

The object will take its final name and will be available to the\n odb.

\n\n

This method will fail if the total number of received bytes\n differs from the size declared with git_odb_open_wstream()

\n","group":"odb"},"git_odb_stream_read":{"type":"function","file":"odb.h","line":285,"lineto":285,"args":[{"name":"stream","type":"git_odb_stream *","comment":null},{"name":"buffer","type":"char *","comment":null},{"name":"len","type":"size_t","comment":null}],"argline":"git_odb_stream *stream, char *buffer, size_t len","sig":"git_odb_stream *::char *::size_t","return":{"type":"int","comment":null},"description":"

Read from an odb stream

\n","comments":"

Most backends don't implement streaming reads

\n","group":"odb"},"git_odb_stream_free":{"type":"function","file":"odb.h","line":292,"lineto":292,"args":[{"name":"stream","type":"git_odb_stream *","comment":"the stream to free"}],"argline":"git_odb_stream *stream","sig":"git_odb_stream *","return":{"type":"void","comment":null},"description":"

Free an odb stream

\n","comments":"","group":"odb"},"git_odb_open_rstream":{"type":"function","file":"odb.h","line":318,"lineto":318,"args":[{"name":"out","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 **out, 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

\n","comments":"

Note that most backends do not support streaming reads\n because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is\n assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and\n will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream\n    - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n","group":"odb"},"git_odb_write_pack":{"type":"function","file":"odb.h","line":338,"lineto":342,"args":[{"name":"out","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_cb","comment":"function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected."},{"name":"progress_payload","type":"void *","comment":"payload for the progress callback"}],"argline":"git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload","sig":"git_odb_writepack **::git_odb *::git_transfer_progress_cb::void *","return":{"type":"int","comment":null},"description":"

Open a stream for writing a pack file to the ODB.

\n","comments":"

If the ODB layer understands pack files, then the given\n packfile will likely be streamed directly to disk (and a\n corresponding index created). If the ODB layer does not\n understand pack files, the objects will be stored in whatever\n format the ODB layer uses.

\n","group":"odb"},"git_odb_hash":{"type":"function","file":"odb.h","line":356,"lineto":356,"args":[{"name":"out","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 *out, 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

\n","comments":"

The resulting SHA-1 OID will be the identifier for the data\n buffer as if the data buffer it were to written to the ODB.

\n","group":"odb"},"git_odb_hashfile":{"type":"function","file":"odb.h","line":371,"lineto":371,"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\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n","comments":"","group":"odb"},"git_odb_object_dup":{"type":"function","file":"odb.h","line":385,"lineto":385,"args":[{"name":"dest","type":"git_odb_object **","comment":"pointer where to store the copy"},{"name":"source","type":"git_odb_object *","comment":"object to copy"}],"argline":"git_odb_object **dest, git_odb_object *source","sig":"git_odb_object **::git_odb_object *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an odb_object

\n","comments":"

The returned copy must be manually freed with git_odb_object_free.\n Note that because of an implementation detail, the returned copy will be\n the same pointer as source: the object is internally refcounted, so the\n copy still needs to be freed twice.

\n","group":"odb"},"git_odb_object_free":{"type":"function","file":"odb.h","line":395,"lineto":395,"args":[{"name":"object","type":"git_odb_object *","comment":"object to close"}],"argline":"git_odb_object *object","sig":"git_odb_object *","return":{"type":"void","comment":null},"description":"

Close an ODB object

\n","comments":"

This method must always be called once a git_odb_object is no\n longer needed, otherwise memory will leak.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_odb_object_free-24"],"general.c":["ex/v0.23.2/general.html#git_odb_object_free-36"]}},"git_odb_object_id":{"type":"function","file":"odb.h","line":405,"lineto":405,"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

\n","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":418,"lineto":418,"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

\n","comments":"

This is the uncompressed, raw data as read from the ODB,\n without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n","group":"odb","examples":{"general.c":["ex/v0.23.2/general.html#git_odb_object_data-37"]}},"git_odb_object_size":{"type":"function","file":"odb.h","line":429,"lineto":429,"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

\n","comments":"

This is the real size of the data buffer, not the\n actual size of the object.

\n","group":"odb","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_odb_object_size-25"],"general.c":["ex/v0.23.2/general.html#git_odb_object_size-38"]}},"git_odb_object_type":{"type":"function","file":"odb.h","line":437,"lineto":437,"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

\n","comments":"","group":"odb","examples":{"general.c":["ex/v0.23.2/general.html#git_odb_object_type-39"]}},"git_odb_add_backend":{"type":"function","file":"odb.h","line":452,"lineto":452,"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

\n","comments":"

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Read \n for more information.

\n","group":"odb"},"git_odb_add_alternate":{"type":"function","file":"odb.h","line":473,"lineto":473,"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\n backend will work as an alternate.

\n","comments":"

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read \n for more information.

\n","group":"odb"},"git_odb_num_backends":{"type":"function","file":"odb.h","line":481,"lineto":481,"args":[{"name":"odb","type":"git_odb *","comment":"object database"}],"argline":"git_odb *odb","sig":"git_odb *","return":{"type":"size_t","comment":" number of backends in the ODB"},"description":"

Get the number of ODB backend objects

\n","comments":"","group":"odb"},"git_odb_get_backend":{"type":"function","file":"odb.h","line":491,"lineto":491,"args":[{"name":"out","type":"git_odb_backend **","comment":"output pointer to ODB backend at pos"},{"name":"odb","type":"git_odb *","comment":"object database"},{"name":"pos","type":"size_t","comment":"index into object database backend list"}],"argline":"git_odb_backend **out, git_odb *odb, size_t pos","sig":"git_odb_backend **::git_odb *::size_t","return":{"type":"int","comment":" 0 on success; GIT_ENOTFOUND if pos is invalid; other errors \n<\n 0"},"description":"

Lookup an ODB backend object by index

\n","comments":"","group":"odb"},"git_odb_backend_pack":{"type":"function","file":"odb_backend.h","line":34,"lineto":34,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"objects_dir","type":"const char *","comment":"the Git repository's objects directory"}],"argline":"git_odb_backend **out, const char *objects_dir","sig":"git_odb_backend **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend for the packfiles.

\n","comments":"","group":"odb"},"git_odb_backend_loose":{"type":"function","file":"odb_backend.h","line":48,"lineto":54,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"objects_dir","type":"const char *","comment":"the Git repository's objects directory"},{"name":"compression_level","type":"int","comment":"zlib compression level to use"},{"name":"do_fsync","type":"int","comment":"whether to do an fsync() after writing (currently ignored)"},{"name":"dir_mode","type":"unsigned int","comment":"permissions to use creating a directory or 0 for defaults"},{"name":"file_mode","type":"unsigned int","comment":"permissions to use creating a file or 0 for defaults"}],"argline":"git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode","sig":"git_odb_backend **::const char *::int::int::unsigned int::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend for loose objects

\n","comments":"","group":"odb"},"git_odb_backend_one_pack":{"type":"function","file":"odb_backend.h","line":67,"lineto":67,"args":[{"name":"out","type":"git_odb_backend **","comment":"location to store the odb backend pointer"},{"name":"index_file","type":"const char *","comment":"path to the packfile's .idx file"}],"argline":"git_odb_backend **out, const char *index_file","sig":"git_odb_backend **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a backend out of a single packfile

\n","comments":"

This can be useful for inspecting the contents of a single\n packfile.

\n","group":"odb"},"git_oid_fromstr":{"type":"function","file":"oid.h","line":47,"lineto":47,"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\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded 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.

\n","comments":"","group":"oid","examples":{"general.c":["ex/v0.23.2/general.html#git_oid_fromstr-40","ex/v0.23.2/general.html#git_oid_fromstr-41","ex/v0.23.2/general.html#git_oid_fromstr-42","ex/v0.23.2/general.html#git_oid_fromstr-43","ex/v0.23.2/general.html#git_oid_fromstr-44","ex/v0.23.2/general.html#git_oid_fromstr-45","ex/v0.23.2/general.html#git_oid_fromstr-46","ex/v0.23.2/general.html#git_oid_fromstr-47"]}},"git_oid_fromstrp":{"type":"function","file":"oid.h","line":57,"lineto":57,"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 at least 4 characters\n long and null-terminated."}],"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 null-terminated string into a git_oid.

\n","comments":"","group":"oid"},"git_oid_fromstrn":{"type":"function","file":"oid.h","line":70,"lineto":70,"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

\n","comments":"

If N is odd, N-1 characters will be parsed instead.\n The remaining space in the git_oid will be set to zero.

\n","group":"oid"},"git_oid_fromraw":{"type":"function","file":"oid.h","line":78,"lineto":78,"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","comment":null},"description":"

Copy an already raw oid into a git_oid structure.

\n","comments":"","group":"oid"},"git_oid_fmt":{"type":"function","file":"oid.h","line":90,"lineto":90,"args":[{"name":"out","type":"char *","comment":"output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required."},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, const git_oid *id","sig":"char *::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a hex string.

\n","comments":"","group":"oid","examples":{"general.c":["ex/v0.23.2/general.html#git_oid_fmt-48","ex/v0.23.2/general.html#git_oid_fmt-49","ex/v0.23.2/general.html#git_oid_fmt-50","ex/v0.23.2/general.html#git_oid_fmt-51","ex/v0.23.2/general.html#git_oid_fmt-52"],"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_oid_fmt-1","ex/v0.23.2/network/fetch.html#git_oid_fmt-2"],"network/index-pack.c":["ex/v0.23.2/network/index-pack.html#git_oid_fmt-6"],"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_oid_fmt-1"]}},"git_oid_nfmt":{"type":"function","file":"oid.h","line":101,"lineto":101,"args":[{"name":"out","type":"char *","comment":"output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_HEXSZ, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added."},{"name":"n","type":"size_t","comment":"number of characters to write into out string"},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, size_t n, const git_oid *id","sig":"char *::size_t::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a partial hex string.

\n","comments":"","group":"oid"},"git_oid_pathfmt":{"type":"function","file":"oid.h","line":116,"lineto":116,"args":[{"name":"out","type":"char *","comment":"output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required."},{"name":"id","type":"const git_oid *","comment":"oid structure to format."}],"argline":"char *out, const git_oid *id","sig":"char *::const git_oid *","return":{"type":"void","comment":null},"description":"

Format a git_oid into a loose-object path string.

\n","comments":"

The resulting string is "aa/...", where "aa" is the first two\n hex digits of the oid and "..." is the remaining 38 digits.

\n","group":"oid"},"git_oid_tostr_s":{"type":"function","file":"oid.h","line":129,"lineto":129,"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"},"description":"

Format a git_oid into a statically allocated c-string.

\n","comments":"

The c-string is owned by the library and should not be freed\n by the user. If libgit2 is built with thread support, the string\n will be stored in TLS (i.e. one buffer per thread) to allow for\n concurrent calls of the function.

\n","group":"oid"},"git_oid_tostr":{"type":"function","file":"oid.h","line":148,"lineto":148,"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":"id","type":"const git_oid *","comment":"the oid structure to format."}],"argline":"char *out, size_t n, const git_oid *id","sig":"char *::size_t::const git_oid *","return":{"type":"char *","comment":" the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string."},"description":"

Format a git_oid into a buffer as a hex format c-string.

\n","comments":"

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting\n oid c-string will be truncated to n-1 characters (but will still be\n NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid ==\n NULL), then a pointer to an empty string is returned, so that the\n return value can always be printed.

\n","group":"oid","examples":{"blame.c":["ex/v0.23.2/blame.html#git_oid_tostr-18","ex/v0.23.2/blame.html#git_oid_tostr-19"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_oid_tostr-26","ex/v0.23.2/cat-file.html#git_oid_tostr-27","ex/v0.23.2/cat-file.html#git_oid_tostr-28","ex/v0.23.2/cat-file.html#git_oid_tostr-29","ex/v0.23.2/cat-file.html#git_oid_tostr-30"],"log.c":["ex/v0.23.2/log.html#git_oid_tostr-39","ex/v0.23.2/log.html#git_oid_tostr-40"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_oid_tostr-12","ex/v0.23.2/rev-parse.html#git_oid_tostr-13","ex/v0.23.2/rev-parse.html#git_oid_tostr-14","ex/v0.23.2/rev-parse.html#git_oid_tostr-15"]}},"git_oid_cpy":{"type":"function","file":"oid.h","line":156,"lineto":156,"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","comment":null},"description":"

Copy an oid from one structure to another.

\n","comments":"","group":"oid","examples":{"blame.c":["ex/v0.23.2/blame.html#git_oid_cpy-20","ex/v0.23.2/blame.html#git_oid_cpy-21","ex/v0.23.2/blame.html#git_oid_cpy-22"]}},"git_oid_cmp":{"type":"function","file":"oid.h","line":165,"lineto":165,"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":" \n<\n0, 0, >0 if a \n<\n b, a == b, a > b."},"description":"

Compare two oid structures.

\n","comments":"","group":"oid"},"git_oid_equal":{"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."}],"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

\n","comments":"","group":"oid"},"git_oid_ncmp":{"type":"function","file":"oid.h","line":185,"lineto":185,"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)\n of two oid structures.

\n","comments":"","group":"oid"},"git_oid_streq":{"type":"function","file":"oid.h","line":194,"lineto":194,"args":[{"name":"id","type":"const git_oid *","comment":"oid structure."},{"name":"str","type":"const char *","comment":"input hex string of an object id."}],"argline":"const git_oid *id, const char *str","sig":"const git_oid *::const char *","return":{"type":"int","comment":" 0 in case of a match, -1 otherwise."},"description":"

Check if an oid equals an hex formatted object id.

\n","comments":"","group":"oid"},"git_oid_strcmp":{"type":"function","file":"oid.h","line":204,"lineto":204,"args":[{"name":"id","type":"const git_oid *","comment":"oid structure."},{"name":"str","type":"const char *","comment":"input hex string of an object id."}],"argline":"const git_oid *id, const char *str","sig":"const git_oid *::const char *","return":{"type":"int","comment":" -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str."},"description":"

Compare an oid to an hex formatted object id.

\n","comments":"","group":"oid"},"git_oid_iszero":{"type":"function","file":"oid.h","line":211,"lineto":211,"args":[{"name":"id","type":"const git_oid *","comment":null}],"argline":"const git_oid *id","sig":"const git_oid *","return":{"type":"int","comment":" 1 if all zeros, 0 otherwise."},"description":"

Check is an oid is all zeros.

\n","comments":"","group":"oid","examples":{"blame.c":["ex/v0.23.2/blame.html#git_oid_iszero-23"],"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_oid_iszero-3"]}},"git_oid_shorten_new":{"type":"function","file":"oid.h","line":232,"lineto":232,"args":[{"name":"min_length","type":"size_t","comment":"The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe 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.

\n","comments":"

The OID shortener is used to process a list of OIDs\n in text form and return the shortest length that would\n uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n","group":"oid"},"git_oid_shorten_add":{"type":"function","file":"oid.h","line":258,"lineto":258,"args":[{"name":"os","type":"git_oid_shorten *","comment":"a `git_oid_shorten` instance"},{"name":"text_id","type":"const char *","comment":"an OID in text form"}],"argline":"git_oid_shorten *os, const char *text_id","sig":"git_oid_shorten *::const char *","return":{"type":"int","comment":" the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs."},"description":"

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n","comments":"

The OID is expected to be a 40-char hexadecimal string.\n The OID is owned by the user and will not be modified\n or freed.

\n\n

For performance reasons, there is a hard-limit of how many\n OIDs can be added to a single set (around ~32000, assuming\n a mostly randomized distribution), which should be enough\n for any kind of program, and keeps the algorithm fast and\n memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a\n GITERR_INVALID error

\n","group":"oid"},"git_oid_shorten_free":{"type":"function","file":"oid.h","line":265,"lineto":265,"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","comment":null},"description":"

Free an OID shortener instance

\n","comments":"","group":"oid"},"git_oidarray_free":{"type":"function","file":"oidarray.h","line":34,"lineto":34,"args":[{"name":"array","type":"git_oidarray *","comment":"git_oidarray from which to free oid data"}],"argline":"git_oidarray *array","sig":"git_oidarray *","return":{"type":"void","comment":null},"description":"

Free the OID array

\n","comments":"

This method must (and must only) be called on git_oidarray\n objects where the array is allocated by the library. Not doing so,\n will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n","group":"oidarray"},"git_packbuilder_new":{"type":"function","file":"pack.h","line":64,"lineto":64,"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

\n","comments":"","group":"packbuilder"},"git_packbuilder_set_threads":{"type":"function","file":"pack.h","line":77,"lineto":77,"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":"unsigned int","comment":" number of actual threads to be used"},"description":"

Set number of threads to spawn

\n","comments":"

By default, libgit2 won't spawn any threads at all;\n when set to 0, libgit2 will autodetect the number of\n CPUs.

\n","group":"packbuilder"},"git_packbuilder_insert":{"type":"function","file":"pack.h","line":91,"lineto":91,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the commit"},{"name":"name","type":"const char *","comment":"The name; might be NULL"}],"argline":"git_packbuilder *pb, const git_oid *id, const char *name","sig":"git_packbuilder *::const git_oid *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a single object

\n","comments":"

For an optimal pack it's mandatory to insert objects in recency order,\n commits followed by trees and blobs.

\n","group":"packbuilder"},"git_packbuilder_insert_tree":{"type":"function","file":"pack.h","line":103,"lineto":103,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the root tree"}],"argline":"git_packbuilder *pb, const git_oid *id","sig":"git_packbuilder *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a root tree object

\n","comments":"

This will add the tree as well as all referenced trees and blobs.

\n","group":"packbuilder"},"git_packbuilder_insert_commit":{"type":"function","file":"pack.h","line":115,"lineto":115,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"id","type":"const git_oid *","comment":"The oid of the commit"}],"argline":"git_packbuilder *pb, const git_oid *id","sig":"git_packbuilder *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert a commit object

\n","comments":"

This will add a commit as well as the completed referenced tree.

\n","group":"packbuilder"},"git_packbuilder_insert_walk":{"type":"function","file":"pack.h","line":128,"lineto":128,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"},{"name":"walk","type":"git_revwalk *","comment":"the revwalk to use to fill the packbuilder"}],"argline":"git_packbuilder *pb, git_revwalk *walk","sig":"git_packbuilder *::git_revwalk *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Insert objects as given by the walk

\n","comments":"

Those commits and all objects they reference will be inserted into\n the packbuilder.

\n","group":"packbuilder"},"git_packbuilder_insert_recur":{"type":"function","file":"pack.h","line":140,"lineto":140,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"},{"name":"id","type":"const git_oid *","comment":"the id of the root object to insert"},{"name":"name","type":"const char *","comment":"optional name for the object"}],"argline":"git_packbuilder *pb, const git_oid *id, const char *name","sig":"git_packbuilder *::const git_oid *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Recursively insert an object and its referenced objects

\n","comments":"

Insert the object as well as any object it references.

\n","group":"packbuilder"},"git_packbuilder_write":{"type":"function","file":"pack.h","line":164,"lineto":169,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"},{"name":"path","type":"const char *","comment":"to the directory where the packfile and index should be stored"},{"name":"mode","type":"unsigned int","comment":"permissions to use creating a packfile or 0 for defaults"},{"name":"progress_cb","type":"git_transfer_progress_cb","comment":"function to call with progress information from the indexer (optional)"},{"name":"progress_cb_payload","type":"void *","comment":"payload for the progress callback (optional)"}],"argline":"git_packbuilder *pb, const char *path, unsigned int mode, git_transfer_progress_cb progress_cb, void *progress_cb_payload","sig":"git_packbuilder *::const char *::unsigned int::git_transfer_progress_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write the new pack and corresponding index file to path.

\n","comments":"","group":"packbuilder"},"git_packbuilder_hash":{"type":"function","file":"pack.h","line":179,"lineto":179,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder object"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"const git_oid *","comment":null},"description":"

Get the packfile's hash

\n","comments":"

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the packfile has been written.

\n","group":"packbuilder"},"git_packbuilder_foreach":{"type":"function","file":"pack.h","line":191,"lineto":191,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"},{"name":"cb","type":"git_packbuilder_foreach_cb","comment":"the callback to call with each packed object's buffer"},{"name":"payload","type":"void *","comment":"the callback's data"}],"argline":"git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload","sig":"git_packbuilder *::git_packbuilder_foreach_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create the new pack and pass each object to the callback

\n","comments":"","group":"packbuilder"},"git_packbuilder_object_count":{"type":"function","file":"pack.h","line":199,"lineto":199,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t","comment":" the number of objects in the packfile"},"description":"

Get the total number of objects the packbuilder will write out

\n","comments":"","group":"packbuilder"},"git_packbuilder_written":{"type":"function","file":"pack.h","line":207,"lineto":207,"args":[{"name":"pb","type":"git_packbuilder *","comment":"the packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"uint32_t","comment":" the number of objects which have already been written"},"description":"

Get the number of objects the packbuilder has already written out

\n","comments":"","group":"packbuilder"},"git_packbuilder_set_callbacks":{"type":"function","file":"pack.h","line":226,"lineto":229,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder object"},{"name":"progress_cb","type":"git_packbuilder_progress","comment":"Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected."},{"name":"progress_cb_payload","type":"void *","comment":"Payload for progress callback."}],"argline":"git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload","sig":"git_packbuilder *::git_packbuilder_progress::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the callbacks for a packbuilder

\n","comments":"","group":"packbuilder"},"git_packbuilder_free":{"type":"function","file":"pack.h","line":236,"lineto":236,"args":[{"name":"pb","type":"git_packbuilder *","comment":"The packbuilder"}],"argline":"git_packbuilder *pb","sig":"git_packbuilder *","return":{"type":"void","comment":null},"description":"

Free the packbuilder and all associated data

\n","comments":"","group":"packbuilder"},"git_patch_from_diff":{"type":"function","file":"patch.h","line":51,"lineto":52,"args":[{"name":"out","type":"git_patch **","comment":"Output parameter for the delta patch object"},{"name":"diff","type":"git_diff *","comment":"Diff list object"},{"name":"idx","type":"size_t","comment":"Index into diff list"}],"argline":"git_patch **out, git_diff *diff, size_t idx","sig":"git_patch **::git_diff *::size_t","return":{"type":"int","comment":" 0 on success, other value \n<\n 0 on error"},"description":"

Return a patch for an entry in the diff list.

\n","comments":"

The git_patch is a newly created object contains the text diffs\n for the delta. You have to call git_patch_free() when you are\n done with it. You can use the patch object to loop over all the hunks\n and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be\n created, the output will be set to NULL, and the binary flag will be\n set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass\n NULL for the git_patch, then the text diff will not be calculated.

\n","group":"patch"},"git_patch_from_blobs":{"type":"function","file":"patch.h","line":70,"lineto":76,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"new_blob","type":"const git_blob *","comment":"Blob for new side of diff, or NULL for empty blob"},{"name":"new_as_path","type":"const char *","comment":"Treat new blob as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts","sig":"git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between two blobs.

\n","comments":"

This is just like git_diff_blobs() except it generates a patch object\n for the difference instead of directly making callbacks. You can use the\n standard git_patch accessor functions to read the patch data, and\n you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_from_blob_and_buffer":{"type":"function","file":"patch.h","line":95,"lineto":102,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_blob","type":"const git_blob *","comment":"Blob for old side of diff, or NULL for empty blob"},{"name":"old_as_path","type":"const char *","comment":"Treat old blob as if it had this filename; can be NULL"},{"name":"buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"buffer_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"buffer_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts","sig":"git_patch **::const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between a blob and a buffer.

\n","comments":"

This is just like git_diff_blob_to_buffer() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_from_buffers":{"type":"function","file":"patch.h","line":122,"lineto":130,"args":[{"name":"out","type":"git_patch **","comment":"The generated patch; NULL on error"},{"name":"old_buffer","type":"const void *","comment":"Raw data for old side of diff, or NULL for empty"},{"name":"old_len","type":"size_t","comment":"Length of the raw data for old side of the diff"},{"name":"old_as_path","type":"const char *","comment":"Treat old buffer as if it had this filename; can be NULL"},{"name":"new_buffer","type":"const char *","comment":"Raw data for new side of diff, or NULL for empty"},{"name":"new_len","type":"size_t","comment":"Length of raw data for new side of diff"},{"name":"new_as_path","type":"const char *","comment":"Treat buffer as if it had this filename; can be NULL"},{"name":"opts","type":"const git_diff_options *","comment":"Options for diff, or NULL for default options"}],"argline":"git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const char *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts","sig":"git_patch **::const void *::size_t::const char *::const char *::size_t::const char *::const git_diff_options *","return":{"type":"int","comment":" 0 on success or error code \n<\n 0"},"description":"

Directly generate a patch from the difference between two buffers.

\n","comments":"

This is just like git_diff_buffers() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n","group":"patch"},"git_patch_free":{"type":"function","file":"patch.h","line":135,"lineto":135,"args":[{"name":"patch","type":"git_patch *","comment":null}],"argline":"git_patch *patch","sig":"git_patch *","return":{"type":"void","comment":null},"description":"

Free a git_patch object.

\n","comments":"","group":"patch"},"git_patch_get_delta":{"type":"function","file":"patch.h","line":141,"lineto":141,"args":[{"name":"patch","type":"const git_patch *","comment":null}],"argline":"const git_patch *patch","sig":"const git_patch *","return":{"type":"const git_diff_delta *","comment":null},"description":"

Get the delta associated with a patch. This delta points to internal\n data and you do not have to release it when you are done with it.

\n","comments":"","group":"patch"},"git_patch_num_hunks":{"type":"function","file":"patch.h","line":146,"lineto":146,"args":[{"name":"patch","type":"const git_patch *","comment":null}],"argline":"const git_patch *patch","sig":"const git_patch *","return":{"type":"size_t","comment":null},"description":"

Get the number of hunks in a patch

\n","comments":"","group":"patch"},"git_patch_line_stats":{"type":"function","file":"patch.h","line":164,"lineto":168,"args":[{"name":"total_context","type":"size_t *","comment":"Count of context lines in output, can be NULL."},{"name":"total_additions","type":"size_t *","comment":"Count of addition lines in output, can be NULL."},{"name":"total_deletions","type":"size_t *","comment":"Count of deletion lines in output, can be NULL."},{"name":"patch","type":"const git_patch *","comment":"The git_patch object"}],"argline":"size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch","sig":"size_t *::size_t *::size_t *::const git_patch *","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get line counts of each type in a patch.

\n","comments":"

This helps imitate a diff --numstat type of output. For that purpose,\n you only need the total_additions and total_deletions values, but we\n include the total_context line count in case you want the total number\n of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n","group":"patch"},"git_patch_get_hunk":{"type":"function","file":"patch.h","line":183,"lineto":187,"args":[{"name":"out","type":"const git_diff_hunk **","comment":"Output pointer to git_diff_hunk of hunk"},{"name":"lines_in_hunk","type":"size_t *","comment":"Output count of total lines in this hunk"},{"name":"patch","type":"git_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_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx","sig":"const git_diff_hunk **::size_t *::git_patch *::size_t","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error"},"description":"

Get the information about a hunk in a patch

\n","comments":"

Given a patch and a hunk index into the patch, this returns detailed\n information about that hunk. Any of the output pointers can be passed\n as NULL if you don't care about that particular piece of information.

\n","group":"patch"},"git_patch_num_lines_in_hunk":{"type":"function","file":"patch.h","line":196,"lineto":198,"args":[{"name":"patch","type":"const git_patch *","comment":"The git_patch object"},{"name":"hunk_idx","type":"size_t","comment":"Index of the hunk"}],"argline":"const git_patch *patch, size_t hunk_idx","sig":"const git_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.

\n","comments":"","group":"patch"},"git_patch_get_line_in_hunk":{"type":"function","file":"patch.h","line":214,"lineto":218,"args":[{"name":"out","type":"const git_diff_line **","comment":"The git_diff_line data for this line"},{"name":"patch","type":"git_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","comment":"The index of the line in the hunk"}],"argline":"const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk","sig":"const git_diff_line **::git_patch *::size_t::size_t","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Get data about a line in a hunk of a patch.

\n","comments":"

Given a patch, a hunk index, and a line index in the hunk, this\n will return a lot of details about that line. If you pass a hunk\n index larger than the number of hunks or a line index larger than\n the number of lines in the hunk, this will return -1.

\n","group":"patch"},"git_patch_size":{"type":"function","file":"patch.h","line":236,"lineto":240,"args":[{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"},{"name":"include_context","type":"int","comment":"Include context lines in size if non-zero"},{"name":"include_hunk_headers","type":"int","comment":"Include hunk header lines if non-zero"},{"name":"include_file_headers","type":"int","comment":"Include file header lines if non-zero"}],"argline":"git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers","sig":"git_patch *::int::int::int","return":{"type":"size_t","comment":" The number of bytes of data"},"description":"

Look up size of patch diff data in bytes

\n","comments":"

This returns the raw size of the patch data. This only includes the\n actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size\n of all of the diff output; if you pass it as false (zero), this will\n only include the actual changed lines (as if context_lines was 0).

\n","group":"patch"},"git_patch_print":{"type":"function","file":"patch.h","line":254,"lineto":257,"args":[{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"},{"name":"print_cb","type":"git_diff_line_cb","comment":"Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines."},{"name":"payload","type":"void *","comment":"Reference pointer that will be passed to your callbacks."}],"argline":"git_patch *patch, git_diff_line_cb print_cb, void *payload","sig":"git_patch *::git_diff_line_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Serialize the patch to text via callback.

\n","comments":"

Returning a non-zero value from the callback will terminate the iteration\n and return that value to the caller.

\n","group":"patch"},"git_patch_to_buf":{"type":"function","file":"patch.h","line":266,"lineto":268,"args":[{"name":"out","type":"git_buf *","comment":"The git_buf to be filled in"},{"name":"patch","type":"git_patch *","comment":"A git_patch representing changes to one file"}],"argline":"git_buf *out, git_patch *patch","sig":"git_buf *::git_patch *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Get the content of a patch as a single diff text.

\n","comments":"","group":"patch"},"git_pathspec_new":{"type":"function","file":"pathspec.h","line":65,"lineto":66,"args":[{"name":"out","type":"git_pathspec **","comment":"Output of the compiled pathspec"},{"name":"pathspec","type":"const git_strarray *","comment":"A git_strarray of the paths to match"}],"argline":"git_pathspec **out, const git_strarray *pathspec","sig":"git_pathspec **::const git_strarray *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Compile a pathspec

\n","comments":"","group":"pathspec","examples":{"log.c":["ex/v0.23.2/log.html#git_pathspec_new-41"]}},"git_pathspec_free":{"type":"function","file":"pathspec.h","line":73,"lineto":73,"args":[{"name":"ps","type":"git_pathspec *","comment":"The compiled pathspec"}],"argline":"git_pathspec *ps","sig":"git_pathspec *","return":{"type":"void","comment":null},"description":"

Free a pathspec

\n","comments":"","group":"pathspec","examples":{"log.c":["ex/v0.23.2/log.html#git_pathspec_free-42"]}},"git_pathspec_matches_path":{"type":"function","file":"pathspec.h","line":88,"lineto":89,"args":[{"name":"ps","type":"const git_pathspec *","comment":"The compiled pathspec"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"path","type":"const char *","comment":"The pathname to attempt to match"}],"argline":"const git_pathspec *ps, uint32_t flags, const char *path","sig":"const git_pathspec *::uint32_t::const char *","return":{"type":"int","comment":" 1 is path matches spec, 0 if it does not"},"description":"

Try to match a path against a pathspec

\n","comments":"

Unlike most of the other pathspec matching functions, this will not\n fall back on the native case-sensitivity for your platform. You must\n explicitly pass flags to control case sensitivity or else this will\n fall back on being case sensitive.

\n","group":"pathspec"},"git_pathspec_match_workdir":{"type":"function","file":"pathspec.h","line":113,"lineto":117,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"repo","type":"git_repository *","comment":"The repository in which to match; bare repo is an error"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given"},"description":"

Match a pathspec against the working directory of a repository.

\n","comments":"

This matches the pathspec against the current files in the working\n directory of the repository. It is an error to invoke this on a bare\n repo. This handles git ignores (i.e. ignored files will not be\n considered to match the pathspec unless the file is tracked in the\n index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_index":{"type":"function","file":"pathspec.h","line":142,"lineto":146,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"index","type":"git_index *","comment":"The index to match against"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against entries in an index.

\n","comments":"

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled\n by the current case-sensitivity of the index object itself and the\n USE_CASE and IGNORE_CASE flags will have no effect. This behavior will\n be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_tree":{"type":"function","file":"pathspec.h","line":166,"lineto":170,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"tree","type":"git_tree *","comment":"The root-level tree to match against"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against files in a tree.

\n","comments":"

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec","examples":{"log.c":["ex/v0.23.2/log.html#git_pathspec_match_tree-43"]}},"git_pathspec_match_diff":{"type":"function","file":"pathspec.h","line":190,"lineto":194,"args":[{"name":"out","type":"git_pathspec_match_list **","comment":"Output list of matches; pass NULL to just get return value"},{"name":"diff","type":"git_diff *","comment":"A generated diff list"},{"name":"flags","type":"uint32_t","comment":"Combination of git_pathspec_flag_t options to control match"},{"name":"ps","type":"git_pathspec *","comment":"Pathspec to be matched"}],"argline":"git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps","sig":"git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *","return":{"type":"int","comment":" 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used"},"description":"

Match a pathspec against files in a diff list.

\n","comments":"

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n","group":"pathspec"},"git_pathspec_match_list_free":{"type":"function","file":"pathspec.h","line":201,"lineto":201,"args":[{"name":"m","type":"git_pathspec_match_list *","comment":"The git_pathspec_match_list to be freed"}],"argline":"git_pathspec_match_list *m","sig":"git_pathspec_match_list *","return":{"type":"void","comment":null},"description":"

Free memory associates with a git_pathspec_match_list

\n","comments":"","group":"pathspec"},"git_pathspec_match_list_entrycount":{"type":"function","file":"pathspec.h","line":209,"lineto":210,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"}],"argline":"const git_pathspec_match_list *m","sig":"const git_pathspec_match_list *","return":{"type":"size_t","comment":" Number of items in match list"},"description":"

Get the number of items in a match list.

\n","comments":"","group":"pathspec"},"git_pathspec_match_list_entry":{"type":"function","file":"pathspec.h","line":222,"lineto":223,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the list"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const char *","comment":" The filename of the match"},"description":"

Get a matching filename by position.

\n","comments":"

This routine cannot be used if the match list was generated by\n git_pathspec_match_diff. If so, it will always return NULL.

\n","group":"pathspec"},"git_pathspec_match_list_diff_entry":{"type":"function","file":"pathspec.h","line":235,"lineto":236,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the list"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const git_diff_delta *","comment":" The filename of the match"},"description":"

Get a matching diff delta by position.

\n","comments":"

This routine can only be used if the match list was generated by\n git_pathspec_match_diff. Otherwise it will always return NULL.

\n","group":"pathspec"},"git_pathspec_match_list_failed_entrycount":{"type":"function","file":"pathspec.h","line":247,"lineto":248,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"}],"argline":"const git_pathspec_match_list *m","sig":"const git_pathspec_match_list *","return":{"type":"size_t","comment":" Number of items in original pathspec that had no matches"},"description":"

Get the number of pathspec items that did not match.

\n","comments":"

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when\n generating the git_pathspec_match_list.

\n","group":"pathspec"},"git_pathspec_match_list_failed_entry":{"type":"function","file":"pathspec.h","line":259,"lineto":260,"args":[{"name":"m","type":"const git_pathspec_match_list *","comment":"The git_pathspec_match_list object"},{"name":"pos","type":"size_t","comment":"The index into the failed items"}],"argline":"const git_pathspec_match_list *m, size_t pos","sig":"const git_pathspec_match_list *::size_t","return":{"type":"const char *","comment":" The pathspec pattern that didn't match anything"},"description":"

Get an original pathspec string that had no matches.

\n","comments":"

This will be return NULL for positions out of range.

\n","group":"pathspec"},"git_rebase_init_options":{"type":"function","file":"rebase.h","line":141,"lineto":143,"args":[{"name":"opts","type":"git_rebase_options *","comment":"the `git_rebase_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_REBASE_OPTIONS_VERSION` here."}],"argline":"git_rebase_options *opts, unsigned int version","sig":"git_rebase_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_rebase_options with default values. Equivalent to\n creating an instance with GIT_REBASE_OPTIONS_INIT.

\n","comments":"","group":"rebase"},"git_rebase_init":{"type":"function","file":"rebase.h","line":162,"lineto":168,"args":[{"name":"out","type":"git_rebase **","comment":"Pointer to store the rebase object"},{"name":"repo","type":"git_repository *","comment":"The repository to perform the rebase"},{"name":"branch","type":"const git_annotated_commit *","comment":"The terminal commit to rebase, or NULL to rebase the\n current branch"},{"name":"upstream","type":"const git_annotated_commit *","comment":"The commit to begin rebasing from, or NULL to rebase all\n reachable commits"},{"name":"onto","type":"const git_annotated_commit *","comment":"The branch to rebase onto, or NULL to rebase onto the given\n upstream"},{"name":"opts","type":"const git_rebase_options *","comment":"Options to specify how rebase is performed, or NULL"}],"argline":"git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_rebase_options *opts","sig":"git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_rebase_options *","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n","comments":"","group":"rebase"},"git_rebase_open":{"type":"function","file":"rebase.h","line":179,"lineto":182,"args":[{"name":"out","type":"git_rebase **","comment":"Pointer to store the rebase object"},{"name":"repo","type":"git_repository *","comment":"The repository that has a rebase in-progress"},{"name":"opts","type":"const git_rebase_options *","comment":"Options to specify how rebase is performed"}],"argline":"git_rebase **out, git_repository *repo, const git_rebase_options *opts","sig":"git_rebase **::git_repository *::const git_rebase_options *","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n","comments":"","group":"rebase"},"git_rebase_operation_entrycount":{"type":"function","file":"rebase.h","line":190,"lineto":190,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"size_t","comment":" The number of rebase operations in total"},"description":"

Gets the count of rebase operations that are to be applied.

\n","comments":"","group":"rebase"},"git_rebase_operation_current":{"type":"function","file":"rebase.h","line":201,"lineto":201,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"size_t","comment":" The index of the rebase operation currently being applied."},"description":"

Gets the index of the rebase operation that is currently being applied.\n If the first operation has not yet been applied (because you have\n called init but not yet next) then this returns\n GIT_REBASE_NO_OPERATION.

\n","comments":"","group":"rebase"},"git_rebase_operation_byindex":{"type":"function","file":"rebase.h","line":210,"lineto":212,"args":[{"name":"rebase","type":"git_rebase *","comment":"The in-progress rebase"},{"name":"idx","type":"size_t","comment":"The index of the rebase operation to retrieve"}],"argline":"git_rebase *rebase, size_t idx","sig":"git_rebase *::size_t","return":{"type":"git_rebase_operation *","comment":" The rebase operation or NULL if `idx` was out of bounds"},"description":"

Gets the rebase operation specified by the given index.

\n","comments":"","group":"rebase"},"git_rebase_next":{"type":"function","file":"rebase.h","line":225,"lineto":227,"args":[{"name":"operation","type":"git_rebase_operation **","comment":"Pointer to store the rebase operation that is to be performed next"},{"name":"rebase","type":"git_rebase *","comment":"The rebase in progress"}],"argline":"git_rebase_operation **operation, git_rebase *rebase","sig":"git_rebase_operation **::git_rebase *","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Performs the next rebase operation and returns the information about it.\n If the operation is one that applies a patch (which is any operation except\n GIT_REBASE_OPERATION_EXEC) then the patch will be applied and the index and\n working directory will be updated with the changes. If there are conflicts,\n you will need to address those before committing the changes.

\n","comments":"","group":"rebase"},"git_rebase_commit":{"type":"function","file":"rebase.h","line":251,"lineto":257,"args":[{"name":"id","type":"git_oid *","comment":"Pointer in which to store the OID of the newly created commit"},{"name":"rebase","type":"git_rebase *","comment":"The rebase that is in-progress"},{"name":"author","type":"const git_signature *","comment":"The author of the updated commit, or NULL to keep the\n author from the original commit"},{"name":"committer","type":"const git_signature *","comment":"The committer of the rebase"},{"name":"message_encoding","type":"const char *","comment":"The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used."},{"name":"message","type":"const char *","comment":"The message for this commit, or NULL to use the message\n from the original commit."}],"argline":"git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message","sig":"git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *","return":{"type":"int","comment":" Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure."},"description":"

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n","comments":"","group":"rebase"},"git_rebase_abort":{"type":"function","file":"rebase.h","line":267,"lineto":267,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase that is in-progress"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"int","comment":" Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors."},"description":"

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n","comments":"","group":"rebase"},"git_rebase_finish":{"type":"function","file":"rebase.h","line":277,"lineto":279,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase that is in-progress"},{"name":"signature","type":"const git_signature *","comment":"The identity that is finishing the rebase (optional)"}],"argline":"git_rebase *rebase, const git_signature *signature","sig":"git_rebase *::const git_signature *","return":{"type":"int","comment":" Zero on success; -1 on error"},"description":"

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n","comments":"","group":"rebase"},"git_rebase_free":{"type":"function","file":"rebase.h","line":286,"lineto":286,"args":[{"name":"rebase","type":"git_rebase *","comment":"The rebase object"}],"argline":"git_rebase *rebase","sig":"git_rebase *","return":{"type":"void","comment":null},"description":"

Frees the git_rebase object.

\n","comments":"","group":"rebase"},"git_refdb_new":{"type":"function","file":"refdb.h","line":35,"lineto":35,"args":[{"name":"out","type":"git_refdb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new reference database with no backends.

\n","comments":"

Before the Ref DB can be used for read/writing, a custom database\n backend must be manually set using git_refdb_set_backend()

\n","group":"refdb"},"git_refdb_open":{"type":"function","file":"refdb.h","line":49,"lineto":49,"args":[{"name":"out","type":"git_refdb **","comment":"location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed."},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a new reference database and automatically add\n the default backends:

\n","comments":"\n","group":"refdb"},"git_refdb_compress":{"type":"function","file":"refdb.h","line":56,"lineto":56,"args":[{"name":"refdb","type":"git_refdb *","comment":null}],"argline":"git_refdb *refdb","sig":"git_refdb *","return":{"type":"int","comment":null},"description":"

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n","comments":"","group":"refdb"},"git_refdb_free":{"type":"function","file":"refdb.h","line":63,"lineto":63,"args":[{"name":"refdb","type":"git_refdb *","comment":"reference database pointer or NULL"}],"argline":"git_refdb *refdb","sig":"git_refdb *","return":{"type":"void","comment":null},"description":"

Close an open reference database.

\n","comments":"","group":"refdb"},"git_reflog_read":{"type":"function","file":"reflog.h","line":38,"lineto":38,"args":[{"name":"out","type":"git_reflog **","comment":"pointer to reflog"},{"name":"repo","type":"git_repository *","comment":"the repostiory"},{"name":"name","type":"const char *","comment":"reference to look up"}],"argline":"git_reflog **out, git_repository *repo, const char *name","sig":"git_reflog **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Read the reflog for the given reference

\n","comments":"

If there is no reflog file for the given\n reference yet, an empty reflog object will\n be returned.

\n\n

The reflog must be freed manually by using\n git_reflog_free().

\n","group":"reflog"},"git_reflog_write":{"type":"function","file":"reflog.h","line":47,"lineto":47,"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\n using an atomic file lock.

\n","comments":"","group":"reflog"},"git_reflog_append":{"type":"function","file":"reflog.h","line":60,"lineto":60,"args":[{"name":"reflog","type":"git_reflog *","comment":"an existing reflog object"},{"name":"id","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 *id, 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 in-memory reflog.

\n","comments":"

msg is optional and can be NULL.

\n","group":"reflog"},"git_reflog_rename":{"type":"function","file":"reflog.h","line":75,"lineto":75,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"old_name","type":"const char *","comment":"the old name of the reference"},{"name":"name","type":"const char *","comment":"the new name of the reference"}],"argline":"git_repository *repo, const char *old_name, const char *name","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Rename a reflog

\n","comments":"

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity.\n See git_reference_create_symbolic() for rules about valid names.

\n","group":"reflog"},"git_reflog_delete":{"type":"function","file":"reflog.h","line":84,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"name","type":"const char *","comment":"the reflog to delete"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Delete the reflog for the given reference

\n","comments":"","group":"reflog"},"git_reflog_entrycount":{"type":"function","file":"reflog.h","line":92,"lineto":92,"args":[{"name":"reflog","type":"git_reflog *","comment":"the previously loaded reflog"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"size_t","comment":" the number of log entries"},"description":"

Get the number of log entries in a reflog

\n","comments":"","group":"reflog"},"git_reflog_entry_byindex":{"type":"function","file":"reflog.h","line":105,"lineto":105,"args":[{"name":"reflog","type":"const git_reflog *","comment":"a previously loaded reflog"},{"name":"idx","type":"size_t","comment":"the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`."}],"argline":"const git_reflog *reflog, size_t idx","sig":"const git_reflog *::size_t","return":{"type":"const git_reflog_entry *","comment":" the entry; NULL if not found"},"description":"

Lookup an entry by its index

\n","comments":"

Requesting the reflog entry with an index of 0 (zero) will\n return the most recently created entry.

\n","group":"reflog"},"git_reflog_drop":{"type":"function","file":"reflog.h","line":124,"lineto":127,"args":[{"name":"reflog","type":"git_reflog *","comment":"a previously loaded reflog."},{"name":"idx","type":"size_t","comment":"the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`."},{"name":"rewrite_previous_entry","type":"int","comment":"1 to rewrite the history; 0 otherwise."}],"argline":"git_reflog *reflog, size_t idx, int rewrite_previous_entry","sig":"git_reflog *::size_t::int","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code."},"description":"

Remove an entry from the reflog by its index

\n","comments":"

To ensure there's no gap in the log history, set rewrite_previous_entry\n param 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_id_old":{"type":"function","file":"reflog.h","line":135,"lineto":135,"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

\n","comments":"","group":"reflog"},"git_reflog_entry_id_new":{"type":"function","file":"reflog.h","line":143,"lineto":143,"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

\n","comments":"","group":"reflog"},"git_reflog_entry_committer":{"type":"function","file":"reflog.h","line":151,"lineto":151,"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_signature *","comment":" the committer"},"description":"

Get the committer of this entry

\n","comments":"","group":"reflog"},"git_reflog_entry_message":{"type":"function","file":"reflog.h","line":159,"lineto":159,"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 char *","comment":" the log msg"},"description":"

Get the log message

\n","comments":"","group":"reflog"},"git_reflog_free":{"type":"function","file":"reflog.h","line":166,"lineto":166,"args":[{"name":"reflog","type":"git_reflog *","comment":"reflog to free"}],"argline":"git_reflog *reflog","sig":"git_reflog *","return":{"type":"void","comment":null},"description":"

Free the reflog

\n","comments":"","group":"reflog"},"git_reference_lookup":{"type":"function","file":"refs.h","line":37,"lineto":37,"args":[{"name":"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 **out, git_repository *repo, const char *name","sig":"git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code."},"description":"

Lookup a reference by name in a repository.

\n","comments":"

The returned reference must be freed by the user.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference","examples":{"general.c":["ex/v0.23.2/general.html#git_reference_lookup-53"]}},"git_reference_name_to_id":{"type":"function","file":"refs.h","line":54,"lineto":55,"args":[{"name":"out","type":"git_oid *","comment":"Pointer to oid to be filled in"},{"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 (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)"}],"argline":"git_oid *out, git_repository *repo, const char *name","sig":"git_oid *::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code."},"description":"

Lookup a reference by name and resolve immediately to OID.

\n","comments":"

This function provides a quick way to resolve a reference name straight\n through to the object id that it refers to. This avoids having to\n allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_dwim":{"type":"function","file":"refs.h","line":68,"lineto":68,"args":[{"name":"out","type":"git_reference **","comment":"pointer in which to store the reference"},{"name":"repo","type":"git_repository *","comment":"the repository in which to look"},{"name":"shorthand","type":"const char *","comment":"the short name for the reference"}],"argline":"git_reference **out, git_repository *repo, const char *shorthand","sig":"git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Lookup a reference by DWIMing its short name

\n","comments":"

Apply the git precendence rules to the given shorthand to determine\n which reference the user is referring to.

\n","group":"reference"},"git_reference_symbolic_create_matching":{"type":"function","file":"refs.h","line":109,"lineto":109,"args":[{"name":"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"},{"name":"current_value","type":"const char *","comment":"The expected value of the reference when updating"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message","sig":"git_reference **::git_repository *::const char *::const char *::int::const char *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code"},"description":"

Conditionally create a new symbolic reference.

\n","comments":"

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_value\n (i.e. if the ref has changed since the user read it).

\n","group":"reference"},"git_reference_symbolic_create":{"type":"function","file":"refs.h","line":145,"lineto":145,"args":[{"name":"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"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message","sig":"git_reference **::git_repository *::const char *::const char *::int::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new symbolic reference.

\n","comments":"

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n","group":"reference"},"git_reference_create":{"type":"function","file":"refs.h","line":182,"lineto":182,"args":[{"name":"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"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message","sig":"git_reference **::git_repository *::const char *::const git_oid *::int::const char *","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new direct reference.

\n","comments":"

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n","group":"reference"},"git_reference_create_matching":{"type":"function","file":"refs.h","line":225,"lineto":225,"args":[{"name":"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"},{"name":"current_id","type":"const git_oid *","comment":"The expected value of the reference at the time of update"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message","sig":"git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code"},"description":"

Conditionally create new direct reference

\n","comments":"

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_id\n (i.e. if the ref has changed since the user read it).

\n","group":"reference"},"git_reference_target":{"type":"function","file":"refs.h","line":240,"lineto":240,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const 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.

\n","comments":"

Only available if the reference is direct (i.e. an object id reference,\n not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and\n then this function (or maybe use git_reference_name_to_id() to\n directly resolve a reference name all the way through to an OID).

\n","group":"reference","examples":{"general.c":["ex/v0.23.2/general.html#git_reference_target-54"]}},"git_reference_target_peel":{"type":"function","file":"refs.h","line":251,"lineto":251,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const git_oid *","comment":" a pointer to the oid if available, NULL otherwise"},"description":"

Return the peeled OID target of this reference.

\n","comments":"

This peeled OID only applies to direct references that point to\n a hard Tag object: it is the result of peeling such Tag.

\n","group":"reference"},"git_reference_symbolic_target":{"type":"function","file":"refs.h","line":261,"lineto":261,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const 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.

\n","comments":"

Only available if the reference is symbolic.

\n","group":"reference","examples":{"general.c":["ex/v0.23.2/general.html#git_reference_symbolic_target-55"]}},"git_reference_type":{"type":"function","file":"refs.h","line":271,"lineto":271,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"git_ref_t","comment":" the type"},"description":"

Get the type of a reference.

\n","comments":"

Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)

\n","group":"reference","examples":{"general.c":["ex/v0.23.2/general.html#git_reference_type-56"]}},"git_reference_name":{"type":"function","file":"refs.h","line":281,"lineto":281,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const char *","comment":" the full name for the ref"},"description":"

Get the full name of a reference.

\n","comments":"

See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_resolve":{"type":"function","file":"refs.h","line":299,"lineto":299,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the peeled reference"},{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"git_reference **out, const git_reference *ref","sig":"git_reference **::const git_reference *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Resolve a symbolic reference to a direct reference.

\n","comments":"

This method iteratively peels a symbolic reference until it resolves to\n a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and\n must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that\n reference is returned. This copy must be manually freed too.

\n","group":"reference"},"git_reference_owner":{"type":"function","file":"refs.h","line":307,"lineto":307,"args":[{"name":"ref","type":"const git_reference *","comment":"The reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"git_repository *","comment":" a pointer to the repo"},"description":"

Get the repository where a reference resides.

\n","comments":"","group":"reference"},"git_reference_symbolic_set_target":{"type":"function","file":"refs.h","line":329,"lineto":333,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"target","type":"const char *","comment":"The new target for the reference"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_reference *ref, const char *target, const char *log_message","sig":"git_reference **::git_reference *::const char *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n","comments":"

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n","group":"reference"},"git_reference_set_target":{"type":"function","file":"refs.h","line":349,"lineto":353,"args":[{"name":"out","type":"git_reference **","comment":"Pointer to the newly created reference"},{"name":"ref","type":"git_reference *","comment":"The reference"},{"name":"id","type":"const git_oid *","comment":"The new target OID for the reference"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **out, git_reference *ref, const git_oid *id, const char *log_message","sig":"git_reference **::git_reference *::const git_oid *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code"},"description":"

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n","comments":"

The new reference will be written to disk, overwriting the given reference.

\n","group":"reference"},"git_reference_rename":{"type":"function","file":"refs.h","line":378,"lineto":383,"args":[{"name":"new_ref","type":"git_reference **","comment":null},{"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"},{"name":"log_message","type":"const char *","comment":"The one line long message to be appended to the reflog"}],"argline":"git_reference **new_ref, git_reference *ref, const char *new_name, int force, const char *log_message","sig":"git_reference **::git_reference *::const char *::int::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Rename an existing reference.

\n","comments":"

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already\n a reference with the given name, the renaming will fail.

\n\n

IMPORTANT:\n The user needs to write a proper reflog entry if the\n reflog is enabled for the repository. We only rename\n the reflog if it exists.

\n","group":"reference"},"git_reference_delete":{"type":"function","file":"refs.h","line":398,"lineto":398,"args":[{"name":"ref","type":"git_reference *","comment":"The reference to remove"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"int","comment":" 0, GIT_EMODIFIED or an error code"},"description":"

Delete an existing reference.

\n","comments":"

This method works for both direct and symbolic references. The reference\n will be immediately removed on disk but the memory will not be freed.\n Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed\n from the time it was looked up.

\n","group":"reference"},"git_reference_remove":{"type":"function","file":"refs.h","line":409,"lineto":409,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"name","type":"const char *","comment":"The reference to remove"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Delete an existing reference by name

\n","comments":"

This method removes the named reference from the repository without\n looking at its old value.

\n","group":"reference"},"git_reference_list":{"type":"function","file":"refs.h","line":423,"lineto":423,"args":[{"name":"array","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe reference names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"}],"argline":"git_strarray *array, git_repository *repo","sig":"git_strarray *::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Fill a list with all the references that can be found in a repository.

\n","comments":"

The string array will be filled with the names of all references; these\n values are owned by the user and should be free'd manually when no\n longer needed, using git_strarray_free().

\n","group":"reference","examples":{"general.c":["ex/v0.23.2/general.html#git_reference_list-57"]}},"git_reference_foreach":{"type":"function","file":"refs.h","line":441,"lineto":444,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"callback","type":"git_reference_foreach_cb","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, git_reference_foreach_cb callback, void *payload","sig":"git_repository *::git_reference_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform a callback on each reference in the repository.

\n","comments":"

The callback function will be called for each reference in the\n repository, receiving the reference object and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n","group":"reference"},"git_reference_foreach_name":{"type":"function","file":"refs.h","line":459,"lineto":462,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the refs"},{"name":"callback","type":"git_reference_foreach_name_cb","comment":"Function which will be called for every listed ref name"},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback"}],"argline":"git_repository *repo, git_reference_foreach_name_cb callback, void *payload","sig":"git_repository *::git_reference_foreach_name_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Perform a callback on the fully-qualified name of each reference.

\n","comments":"

The callback function will be called for each reference in the\n repository, receiving the name of the reference and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n","group":"reference"},"git_reference_free":{"type":"function","file":"refs.h","line":469,"lineto":469,"args":[{"name":"ref","type":"git_reference *","comment":"git_reference"}],"argline":"git_reference *ref","sig":"git_reference *","return":{"type":"void","comment":null},"description":"

Free the given reference.

\n","comments":"","group":"reference","examples":{"status.c":["ex/v0.23.2/status.html#git_reference_free-3"]}},"git_reference_cmp":{"type":"function","file":"refs.h","line":478,"lineto":480,"args":[{"name":"ref1","type":"const git_reference *","comment":"The first git_reference"},{"name":"ref2","type":"const git_reference *","comment":"The second git_reference"}],"argline":"const git_reference *ref1, const git_reference *ref2","sig":"const git_reference *::const git_reference *","return":{"type":"int","comment":" 0 if the same, else a stable but meaningless ordering."},"description":"

Compare two references.

\n","comments":"","group":"reference"},"git_reference_iterator_new":{"type":"function","file":"refs.h","line":489,"lineto":491,"args":[{"name":"out","type":"git_reference_iterator **","comment":"pointer in which to store the iterator"},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_reference_iterator **out, git_repository *repo","sig":"git_reference_iterator **::git_repository *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the repo's references

\n","comments":"","group":"reference"},"git_reference_iterator_glob_new":{"type":"function","file":"refs.h","line":502,"lineto":505,"args":[{"name":"out","type":"git_reference_iterator **","comment":"pointer in which to store the iterator"},{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"glob","type":"const char *","comment":"the glob to match against the reference names"}],"argline":"git_reference_iterator **out, git_repository *repo, const char *glob","sig":"git_reference_iterator **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an iterator for the repo's references that match the\n specified glob

\n","comments":"","group":"reference"},"git_reference_next":{"type":"function","file":"refs.h","line":514,"lineto":514,"args":[{"name":"out","type":"git_reference **","comment":"pointer in which to store the reference"},{"name":"iter","type":"git_reference_iterator *","comment":"the iterator"}],"argline":"git_reference **out, git_reference_iterator *iter","sig":"git_reference **::git_reference_iterator *","return":{"type":"int","comment":" 0, GIT_ITEROVER if there are no more; or an error code"},"description":"

Get the next reference

\n","comments":"","group":"reference"},"git_reference_next_name":{"type":"function","file":"refs.h","line":527,"lineto":527,"args":[{"name":"out","type":"const char **","comment":"pointer in which to store the string"},{"name":"iter","type":"git_reference_iterator *","comment":"the iterator"}],"argline":"const char **out, git_reference_iterator *iter","sig":"const char **::git_reference_iterator *","return":{"type":"int","comment":" 0, GIT_ITEROVER if there are no more; or an error code"},"description":"

Get the next reference's name

\n","comments":"

This function is provided for convenience in case only the names\n are interesting as it avoids the allocation of the git_reference\n object which git_reference_next() needs.

\n","group":"reference"},"git_reference_iterator_free":{"type":"function","file":"refs.h","line":534,"lineto":534,"args":[{"name":"iter","type":"git_reference_iterator *","comment":"the iterator to free"}],"argline":"git_reference_iterator *iter","sig":"git_reference_iterator *","return":{"type":"void","comment":null},"description":"

Free the iterator and its associated resources

\n","comments":"","group":"reference"},"git_reference_foreach_glob":{"type":"function","file":"refs.h","line":554,"lineto":558,"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":"callback","type":"git_reference_foreach_name_cb","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, const char *glob, git_reference_foreach_name_cb callback, void *payload","sig":"git_repository *::const char *::git_reference_foreach_name_cb::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\n matches the given pattern.

\n","comments":"

This function acts like git_reference_foreach() with an additional\n pattern match being applied to the reference name before issuing the\n callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches\n any sequence of letters, a '?' matches any letter, and square brackets\n can 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":568,"lineto":568,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"refname","type":"const char *","comment":"the reference's name"}],"argline":"git_repository *repo, const char *refname","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 when no reflog can be found, 1 when it exists;\n otherwise an error code."},"description":"

Check if a reflog exists for the specified reference.

\n","comments":"","group":"reference"},"git_reference_ensure_log":{"type":"function","file":"refs.h","line":580,"lineto":580,"args":[{"name":"repo","type":"git_repository *","comment":"the repository"},{"name":"refname","type":"const char *","comment":"the reference's name"}],"argline":"git_repository *repo, const char *refname","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code."},"description":"

Ensure there is a reflog for a particular reference.

\n","comments":"

Make sure that successive updates to the reference will append to\n its log.

\n","group":"reference"},"git_reference_is_branch":{"type":"function","file":"refs.h","line":590,"lineto":590,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/heads\n namespace; 0 otherwise."},"description":"

Check if a reference is a local branch.

\n","comments":"","group":"reference"},"git_reference_is_remote":{"type":"function","file":"refs.h","line":600,"lineto":600,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise."},"description":"

Check if a reference is a remote tracking branch

\n","comments":"","group":"reference"},"git_reference_is_tag":{"type":"function","file":"refs.h","line":610,"lineto":610,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/tags\n namespace; 0 otherwise."},"description":"

Check if a reference is a tag

\n","comments":"","group":"reference"},"git_reference_is_note":{"type":"function","file":"refs.h","line":620,"lineto":620,"args":[{"name":"ref","type":"const git_reference *","comment":"A git reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"int","comment":" 1 when the reference lives in the refs/notes\n namespace; 0 otherwise."},"description":"

Check if a reference is a note

\n","comments":"","group":"reference"},"git_reference_normalize_name":{"type":"function","file":"refs.h","line":676,"lineto":680,"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\n GIT_REF_FORMAT constants above."}],"argline":"char *buffer_out, size_t buffer_size, const char *name, unsigned int flags","sig":"char *::size_t::const char *::unsigned int","return":{"type":"int","comment":" 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC\n or an error code."},"description":"

Normalize reference name and check validity.

\n","comments":"

This will normalize the reference name by removing any leading slash\n '/' characters and collapsing runs of adjacent slashes between name\n components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in\n the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n","group":"reference"},"git_reference_peel":{"type":"function","file":"refs.h","line":697,"lineto":700,"args":[{"name":"out","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"ref","type":"git_reference *","comment":"The reference to be processed"},{"name":"type","type":"git_otype","comment":"The type of the requested object (GIT_OBJ_COMMIT,\n GIT_OBJ_TAG, GIT_OBJ_TREE, GIT_OBJ_BLOB or GIT_OBJ_ANY)."}],"argline":"git_object **out, git_reference *ref, git_otype type","sig":"git_object **::git_reference *::git_otype","return":{"type":"int","comment":" 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code"},"description":"

Recursively peel reference until object of the specified type is found.

\n","comments":"

The retrieved peeled object is owned by the repository\n and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object\n will be peeled until a non-tag object is met.

\n","group":"reference"},"git_reference_is_valid_name":{"type":"function","file":"refs.h","line":716,"lineto":716,"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.

\n","comments":"

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n","group":"reference"},"git_reference_shorthand":{"type":"function","file":"refs.h","line":730,"lineto":730,"args":[{"name":"ref","type":"const git_reference *","comment":"a reference"}],"argline":"const git_reference *ref","sig":"const git_reference *","return":{"type":"const char *","comment":" the human-readable version of the name"},"description":"

Get the reference's short name

\n","comments":"

This will transform the reference name into a name "human-readable"\n version. If no shortname is appropriate, it will return the full\n name.

\n\n

The memory is owned by the reference and must not be freed.

\n","group":"reference","examples":{"status.c":["ex/v0.23.2/status.html#git_reference_shorthand-4"]}},"git_refspec_src":{"type":"function","file":"refspec.h","line":30,"lineto":30,"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

\n","comments":"","group":"refspec"},"git_refspec_dst":{"type":"function","file":"refspec.h","line":38,"lineto":38,"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

\n","comments":"","group":"refspec"},"git_refspec_string":{"type":"function","file":"refspec.h","line":46,"lineto":46,"args":[{"name":"refspec","type":"const git_refspec *","comment":"the refspec"}],"argline":"const git_refspec *refspec","sig":"const git_refspec *","return":{"type":"const char *","comment":null},"description":"

Get the refspec's string

\n","comments":"","group":"refspec"},"git_refspec_force":{"type":"function","file":"refspec.h","line":54,"lineto":54,"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

\n","comments":"","group":"refspec"},"git_refspec_direction":{"type":"function","file":"refspec.h","line":62,"lineto":62,"args":[{"name":"spec","type":"const git_refspec *","comment":"refspec"}],"argline":"const git_refspec *spec","sig":"const git_refspec *","return":{"type":"git_direction","comment":" GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH"},"description":"

Get the refspec's direction.

\n","comments":"","group":"refspec"},"git_refspec_src_matches":{"type":"function","file":"refspec.h","line":71,"lineto":71,"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

\n","comments":"","group":"refspec"},"git_refspec_dst_matches":{"type":"function","file":"refspec.h","line":80,"lineto":80,"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 destination descriptor matches a reference

\n","comments":"","group":"refspec"},"git_refspec_transform":{"type":"function","file":"refspec.h","line":90,"lineto":90,"args":[{"name":"out","type":"git_buf *","comment":"where to store the target name"},{"name":"spec","type":"const git_refspec *","comment":"the refspec"},{"name":"name","type":"const char *","comment":"the name of the reference to transform"}],"argline":"git_buf *out, const git_refspec *spec, const char *name","sig":"git_buf *::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

\n","comments":"","group":"refspec"},"git_refspec_rtransform":{"type":"function","file":"refspec.h","line":100,"lineto":100,"args":[{"name":"out","type":"git_buf *","comment":"where to store the source reference name"},{"name":"spec","type":"const git_refspec *","comment":"the refspec"},{"name":"name","type":"const char *","comment":"the name of the reference to transform"}],"argline":"git_buf *out, const git_refspec *spec, const char *name","sig":"git_buf *::const git_refspec *::const char *","return":{"type":"int","comment":" 0, GIT_EBUFS or another error"},"description":"

Transform a target reference to its source reference following the refspec's rules

\n","comments":"","group":"refspec"},"git_remote_create":{"type":"function","file":"remote.h","line":39,"lineto":43,"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, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Add a remote with the default fetch refspec to the repository's configuration.

\n","comments":"","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_create-4"]}},"git_remote_create_with_fetchspec":{"type":"function","file":"remote.h","line":56,"lineto":61,"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"},{"name":"fetch","type":"const char *","comment":"the remote fetch value"}],"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, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Add a remote with the provided fetch refspec (or default if NULL) to the repository's\n configuration.

\n","comments":"","group":"remote"},"git_remote_create_anonymous":{"type":"function","file":"remote.h","line":74,"lineto":77,"args":[{"name":"out","type":"git_remote **","comment":"pointer to the new remote objects"},{"name":"repo","type":"git_repository *","comment":"the associated repository"},{"name":"url","type":"const char *","comment":"the remote repository's URL"}],"argline":"git_remote **out, git_repository *repo, const char *url","sig":"git_remote **::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an anonymous remote

\n","comments":"

Create a remote with the given url in-memory. You can use this when\n you have a URL instead of a remote's name.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_create_anonymous-4"],"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_remote_create_anonymous-2"]}},"git_remote_lookup":{"type":"function","file":"remote.h","line":90,"lineto":90,"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, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code"},"description":"

Get the information for a particular remote

\n","comments":"

The name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_lookup-5"],"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_remote_lookup-3"],"remote.c":["ex/v0.23.2/remote.html#git_remote_lookup-5"]}},"git_remote_dup":{"type":"function","file":"remote.h","line":102,"lineto":102,"args":[{"name":"dest","type":"git_remote **","comment":"pointer where to store the copy"},{"name":"source","type":"git_remote *","comment":"object to copy"}],"argline":"git_remote **dest, git_remote *source","sig":"git_remote **::git_remote *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an existing remote. All internal strings are also\n duplicated. Callbacks are not duplicated.

\n","comments":"

Call git_remote_free to free the data.

\n","group":"remote"},"git_remote_owner":{"type":"function","file":"remote.h","line":110,"lineto":110,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"git_repository *","comment":" a pointer to the repository"},"description":"

Get the remote's repository

\n","comments":"","group":"remote"},"git_remote_name":{"type":"function","file":"remote.h","line":118,"lineto":118,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"const char *","comment":" a pointer to the name or NULL for in-memory remotes"},"description":"

Get the remote's name

\n","comments":"","group":"remote"},"git_remote_url":{"type":"function","file":"remote.h","line":129,"lineto":129,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"const char *","comment":" a pointer to the url"},"description":"

Get the remote's url

\n","comments":"

If url.*.insteadOf has been configured for this URL, it will\n return the modified URL.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_url-6"]}},"git_remote_pushurl":{"type":"function","file":"remote.h","line":140,"lineto":140,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const 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

\n","comments":"

If url.*.pushInsteadOf has been configured for this URL, it\n will return the modified URL.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_pushurl-7"]}},"git_remote_set_url":{"type":"function","file":"remote.h","line":153,"lineto":153,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the change"},{"name":"remote","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the url to set"}],"argline":"git_repository *repo, const char *remote, const char *url","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 or an error value"},"description":"

Set the remote's url in the configuration

\n","comments":"

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_set_url-8"]}},"git_remote_set_pushurl":{"type":"function","file":"remote.h","line":166,"lineto":166,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to perform the change"},{"name":"remote","type":"const char *","comment":"the remote's name"},{"name":"url","type":"const char *","comment":"the url to set"}],"argline":"git_repository *repo, const char *remote, const char *url","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Set the remote's url for pushing in the configuration.

\n","comments":"

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_set_pushurl-9"]}},"git_remote_add_fetch":{"type":"function","file":"remote.h","line":179,"lineto":179,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to change the configuration"},{"name":"remote","type":"const char *","comment":"the name of the remote to change"},{"name":"refspec","type":"const char *","comment":"the new fetch refspec"}],"argline":"git_repository *repo, const char *remote, const char *refspec","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC if refspec is invalid or an error value"},"description":"

Add a fetch refspec to the remote's configuration

\n","comments":"

Add the given refspec to the fetch list in the configuration. No\n loaded remote instances will be affected.

\n","group":"remote"},"git_remote_get_fetch_refspecs":{"type":"function","file":"remote.h","line":190,"lineto":190,"args":[{"name":"array","type":"git_strarray *","comment":"pointer to the array in which to store the strings"},{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"git_strarray *array, const git_remote *remote","sig":"git_strarray *::const git_remote *","return":{"type":"int","comment":null},"description":"

Get the remote's list of fetch refspecs

\n","comments":"

The memory is owned by the user and should be freed with\n git_strarray_free.

\n","group":"remote"},"git_remote_add_push":{"type":"function","file":"remote.h","line":203,"lineto":203,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to change the configuration"},{"name":"remote","type":"const char *","comment":"the name of the remote to change"},{"name":"refspec","type":"const char *","comment":"the new push refspec"}],"argline":"git_repository *repo, const char *remote, const char *refspec","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC if refspec is invalid or an error value"},"description":"

Add a push refspec to the remote's configuration

\n","comments":"

Add the given refspec to the push list in the configuration. No\n loaded remote instances will be affected.

\n","group":"remote"},"git_remote_get_push_refspecs":{"type":"function","file":"remote.h","line":214,"lineto":214,"args":[{"name":"array","type":"git_strarray *","comment":"pointer to the array in which to store the strings"},{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"git_strarray *array, const git_remote *remote","sig":"git_strarray *::const git_remote *","return":{"type":"int","comment":null},"description":"

Get the remote's list of push refspecs

\n","comments":"

The memory is owned by the user and should be freed with\n git_strarray_free.

\n","group":"remote"},"git_remote_refspec_count":{"type":"function","file":"remote.h","line":222,"lineto":222,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"size_t","comment":" the amount of refspecs configured in this remote"},"description":"

Get the number of refspecs for a remote

\n","comments":"","group":"remote"},"git_remote_get_refspec":{"type":"function","file":"remote.h","line":231,"lineto":231,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"},{"name":"n","type":"size_t","comment":"the refspec to get"}],"argline":"const git_remote *remote, size_t n","sig":"const git_remote *::size_t","return":{"type":"const git_refspec *","comment":" the nth refspec"},"description":"

Get a refspec from the remote

\n","comments":"","group":"remote"},"git_remote_connect":{"type":"function","file":"remote.h","line":246,"lineto":246,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to connect to"},{"name":"direction","type":"git_direction","comment":"GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push"},{"name":"callbacks","type":"const git_remote_callbacks *","comment":"the callbacks to use for this connection"}],"argline":"git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks","sig":"git_remote *::git_direction::const git_remote_callbacks *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Open a connection to a remote

\n","comments":"

The transport is selected based on the URL. The direction argument\n is due to a limitation of the git protocol (over TCP or SSH) which\n starts up a specific binary which can only do the one or the other.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_connect-6"],"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_remote_connect-4"]}},"git_remote_ls":{"type":"function","file":"remote.h","line":268,"lineto":268,"args":[{"name":"out","type":"const git_remote_head ***","comment":"pointer to the array"},{"name":"size","type":"size_t *","comment":"the number of remote heads"},{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"const git_remote_head ***out, size_t *size, git_remote *remote","sig":"const git_remote_head ***::size_t *::git_remote *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Get the remote repository's reference advertisement list

\n","comments":"

Get the list of references with which the server responds to a new\n connection.

\n\n

The remote (or more exactly its transport) must have connected to\n the remote repository. This list is available as soon as the\n connection to the remote is initiated and it remains available\n after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long\n as a new connection is not initiated, but it is recommended that\n you make a copy in order to make use of the data.

\n","group":"remote","examples":{"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_remote_ls-5"]}},"git_remote_connected":{"type":"function","file":"remote.h","line":279,"lineto":279,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":" 1 if it's connected, 0 otherwise."},"description":"

Check whether the remote is connected

\n","comments":"

Check whether the remote's underlying transport is connected to the\n remote host.

\n","group":"remote"},"git_remote_stop":{"type":"function","file":"remote.h","line":289,"lineto":289,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Cancel the operation

\n","comments":"

At certain points in its operation, the network code checks whether\n the operation has been cancelled and if so stops the operation.

\n","group":"remote"},"git_remote_disconnect":{"type":"function","file":"remote.h","line":298,"lineto":298,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to disconnect from"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Disconnect from the remote

\n","comments":"

Close the connection to the remote.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_disconnect-7"]}},"git_remote_free":{"type":"function","file":"remote.h","line":308,"lineto":308,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to free"}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"void","comment":null},"description":"

Free the memory associated with a remote

\n","comments":"

This also disconnects from the remote, if the connection\n has not been closed yet (using git_remote_disconnect).

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_free-8","ex/v0.23.2/network/fetch.html#git_remote_free-9"],"network/ls-remote.c":["ex/v0.23.2/network/ls-remote.html#git_remote_free-6"],"remote.c":["ex/v0.23.2/remote.html#git_remote_free-10"]}},"git_remote_list":{"type":"function","file":"remote.h","line":319,"lineto":319,"args":[{"name":"out","type":"git_strarray *","comment":"a string array which receives the names of the remotes"},{"name":"repo","type":"git_repository *","comment":"the repository to query"}],"argline":"git_strarray *out, 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

\n","comments":"

The string array must be freed by the user.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_list-11"]}},"git_remote_init_callbacks":{"type":"function","file":"remote.h","line":470,"lineto":472,"args":[{"name":"opts","type":"git_remote_callbacks *","comment":"the `git_remote_callbacks` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REMOTE_CALLBACKS_VERSION`"}],"argline":"git_remote_callbacks *opts, unsigned int version","sig":"git_remote_callbacks *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_remote_callbacks with default values. Equivalent to\n creating an instance with GIT_REMOTE_CALLBACKS_INIT.

\n","comments":"","group":"remote"},"git_fetch_init_options":{"type":"function","file":"remote.h","line":563,"lineto":565,"args":[{"name":"opts","type":"git_fetch_options *","comment":"the `git_push_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_FETCH_OPTIONS_VERSION` here."}],"argline":"git_fetch_options *opts, unsigned int version","sig":"git_fetch_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_fetch_options with default values. Equivalent to\n creating an instance with GIT_FETCH_OPTIONS_INIT.

\n","comments":"","group":"fetch"},"git_push_init_options":{"type":"function","file":"remote.h","line":602,"lineto":604,"args":[{"name":"opts","type":"git_push_options *","comment":"the `git_push_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_PUSH_OPTIONS_VERSION` here."}],"argline":"git_push_options *opts, unsigned int version","sig":"git_push_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_push_options with default values. Equivalent to\n creating an instance with GIT_PUSH_OPTIONS_INIT.

\n","comments":"","group":"push"},"git_remote_download":{"type":"function","file":"remote.h","line":622,"lineto":622,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this negotiation and\n download. Use NULL or an empty array to use the base refspecs"},{"name":"opts","type":"const git_fetch_options *","comment":"the options to use for this fetch"}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts","sig":"git_remote *::const git_strarray *::const git_fetch_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Download and index the packfile

\n","comments":"

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, download and index the\n packfile.

\n\n

The .idx file will be created and both it and the packfile with be\n renamed to their final name.

\n","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_download-10"]}},"git_remote_upload":{"type":"function","file":"remote.h","line":636,"lineto":636,"args":[{"name":"remote","type":"git_remote *","comment":"the remote"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this negotiation and\n upload. Use NULL or an empty array to use the base refspecs"},{"name":"opts","type":"const git_push_options *","comment":"the options to use for this push"}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_push_options *opts","sig":"git_remote *::const git_strarray *::const git_push_options *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a packfile and send it to the server

\n","comments":"

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, create a packfile with the missing objects and send it.

\n","group":"remote"},"git_remote_update_tips":{"type":"function","file":"remote.h","line":652,"lineto":657,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to update"},{"name":"callbacks","type":"const git_remote_callbacks *","comment":"pointer to the callback structure to use"},{"name":"update_fetchhead","type":"int","comment":"whether to write to FETCH_HEAD. Pass 1 to behave like git."},{"name":"download_tags","type":"git_remote_autotag_option_t","comment":"what the behaviour for downloading tags is for this fetch. This is\n ignored for push. This must be the same value passed to `git_remote_download()`."},{"name":"reflog_message","type":"const char *","comment":"The message to insert into the reflogs. If\n NULL and fetching, the default is \"fetch \n\", where \n is\n the name of the remote (or its url, for in-memory remotes). This\n parameter is ignored when pushing."}],"argline":"git_remote *remote, const git_remote_callbacks *callbacks, int update_fetchhead, git_remote_autotag_option_t download_tags, const char *reflog_message","sig":"git_remote *::const git_remote_callbacks *::int::git_remote_autotag_option_t::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Update the tips to the new state

\n","comments":"","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_update_tips-11"]}},"git_remote_fetch":{"type":"function","file":"remote.h","line":673,"lineto":677,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to fetch from"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for this fetch. Pass NULL or an\n empty array to use the base refspecs."},{"name":"opts","type":"const git_fetch_options *","comment":"options to use for this fetch"},{"name":"reflog_message","type":"const char *","comment":"The message to insert into the reflogs. If NULL, the\n\t\t\t\t\t\t\t\t default is \"fetch\""}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts, const char *reflog_message","sig":"git_remote *::const git_strarray *::const git_fetch_options *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Download new data and update tips

\n","comments":"

Convenience function to connect to a remote, download the data,\n disconnect and update the remote-tracking branches.

\n","group":"remote"},"git_remote_prune":{"type":"function","file":"remote.h","line":686,"lineto":686,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to prune"},{"name":"callbacks","type":"const git_remote_callbacks *","comment":"callbacks to use for this prune"}],"argline":"git_remote *remote, const git_remote_callbacks *callbacks","sig":"git_remote *::const git_remote_callbacks *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Prune tracking refs that are no longer present on remote

\n","comments":"","group":"remote"},"git_remote_push":{"type":"function","file":"remote.h","line":698,"lineto":700,"args":[{"name":"remote","type":"git_remote *","comment":"the remote to push to"},{"name":"refspecs","type":"const git_strarray *","comment":"the refspecs to use for pushing. If none are\n passed, the configured refspecs will be used"},{"name":"opts","type":"const git_push_options *","comment":"options to use for this push"}],"argline":"git_remote *remote, const git_strarray *refspecs, const git_push_options *opts","sig":"git_remote *::const git_strarray *::const git_push_options *","return":{"type":"int","comment":null},"description":"

Perform a push

\n","comments":"

Peform all the steps from a push.

\n","group":"remote"},"git_remote_stats":{"type":"function","file":"remote.h","line":705,"lineto":705,"args":[{"name":"remote","type":"git_remote *","comment":null}],"argline":"git_remote *remote","sig":"git_remote *","return":{"type":"const git_transfer_progress *","comment":null},"description":"

Get the statistics structure that is filled in by the fetch operation.

\n","comments":"","group":"remote","examples":{"network/fetch.c":["ex/v0.23.2/network/fetch.html#git_remote_stats-12"]}},"git_remote_autotag":{"type":"function","file":"remote.h","line":713,"lineto":713,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"git_remote_autotag_option_t","comment":" the auto-follow setting"},"description":"

Retrieve the tag auto-follow setting

\n","comments":"","group":"remote"},"git_remote_set_autotag":{"type":"function","file":"remote.h","line":725,"lineto":725,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to make the change"},{"name":"remote","type":"const char *","comment":"the name of the remote"},{"name":"value","type":"git_remote_autotag_option_t","comment":"the new value to take."}],"argline":"git_repository *repo, const char *remote, git_remote_autotag_option_t value","sig":"git_repository *::const char *::git_remote_autotag_option_t","return":{"type":"int","comment":null},"description":"

Set the remote's tag following setting.

\n","comments":"

The change will be made in the configuration. No loaded remotes\n will be affected.

\n","group":"remote"},"git_remote_prune_refs":{"type":"function","file":"remote.h","line":732,"lineto":732,"args":[{"name":"remote","type":"const git_remote *","comment":"the remote to query"}],"argline":"const git_remote *remote","sig":"const git_remote *","return":{"type":"int","comment":" the ref-prune setting"},"description":"

Retrieve the ref-prune setting

\n","comments":"","group":"remote"},"git_remote_rename":{"type":"function","file":"remote.h","line":754,"lineto":758,"args":[{"name":"problems","type":"git_strarray *","comment":"non-default refspecs cannot be renamed and will be\n stored here for further processing by the caller. Always free this\n strarray on successful return."},{"name":"repo","type":"git_repository *","comment":"the repository in which to rename"},{"name":"name","type":"const char *","comment":"the current name of the remote"},{"name":"new_name","type":"const char *","comment":"the new name the remote should bear"}],"argline":"git_strarray *problems, git_repository *repo, const char *name, const char *new_name","sig":"git_strarray *::git_repository *::const char *::const char *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

Give the remote a new name

\n","comments":"

All remote-tracking branches and configuration settings\n for the remote are updated.

\n\n

The new name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change\n their name or their list of refspecs.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_rename-12"]}},"git_remote_is_valid_name":{"type":"function","file":"remote.h","line":766,"lineto":766,"args":[{"name":"remote_name","type":"const char *","comment":"name to be checked."}],"argline":"const char *remote_name","sig":"const char *","return":{"type":"int","comment":" 1 if the reference name is acceptable; 0 if it isn't"},"description":"

Ensure the remote name is well-formed.

\n","comments":"","group":"remote"},"git_remote_delete":{"type":"function","file":"remote.h","line":778,"lineto":778,"args":[{"name":"repo","type":"git_repository *","comment":"the repository in which to act"},{"name":"name","type":"const char *","comment":"the name of the remove to delete"}],"argline":"git_repository *repo, const char *name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, or an error code."},"description":"

Delete an existing persisted remote.

\n","comments":"

All remote-tracking branches and configuration settings\n for the remote will be removed.

\n","group":"remote","examples":{"remote.c":["ex/v0.23.2/remote.html#git_remote_delete-13"]}},"git_remote_default_branch":{"type":"function","file":"remote.h","line":796,"lineto":796,"args":[{"name":"out","type":"git_buf *","comment":"the buffern in which to store the reference name"},{"name":"remote","type":"git_remote *","comment":"the remote"}],"argline":"git_buf *out, git_remote *remote","sig":"git_buf *::git_remote *","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if the remote does not have any references\n or none of them point to HEAD's commit, or an error message."},"description":"

Retrieve the name of the remote's default branch

\n","comments":"

The default branch of a repository is the branch which HEAD points\n to. If the remote does not support reporting this information\n directly, it performs the guess as git does; that is, if there are\n multiple branches which point to the same commit, the first one is\n chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n","group":"remote"},"git_repository_open":{"type":"function","file":"repository.h","line":37,"lineto":37,"args":[{"name":"out","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 **out, const char *path","sig":"git_repository **::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Open a git repository.

\n","comments":"

The 'path' argument must point to either a git repository\n folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal\n or bare repository or fail is 'path' is neither.

\n","group":"repository","examples":{"general.c":["ex/v0.23.2/general.html#git_repository_open-58"],"network/git2.c":["ex/v0.23.2/network/git2.html#git_repository_open-5"],"remote.c":["ex/v0.23.2/remote.html#git_repository_open-14"]}},"git_repository_wrap_odb":{"type":"function","file":"repository.h","line":50,"lineto":50,"args":[{"name":"out","type":"git_repository **","comment":"pointer to the repo"},{"name":"odb","type":"git_odb *","comment":"the object database to wrap"}],"argline":"git_repository **out, 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

\n","comments":"

Create a repository object to wrap an object database to be used\n with the API when all you have is an object database. This doesn't\n have any paths associated with it, so use with care.

\n","group":"repository"},"git_repository_discover":{"type":"function","file":"repository.h","line":78,"lineto":82,"args":[{"name":"out","type":"git_buf *","comment":"A pointer to a user-allocated git_buf which will contain\n the found path."},{"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\n filesystem device change is detected while exploring parent directories."},{"name":"ceiling_dirs","type":"const char *","comment":"A GIT_PATH_LIST_SEPARATOR separated list of\n absolute symbolic link free paths. The lookup will stop when any\n of this paths is reached. Note that the lookup always performs on\n start_path no matter start_path appears in ceiling_dirs ceiling_dirs\n might be NULL (which is equivalent to an empty string)"}],"argline":"git_buf *out, const char *start_path, int across_fs, const char *ceiling_dirs","sig":"git_buf *::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.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n","comments":"

The method will automatically detect if the repository is bare\n (if there is a repository).

\n","group":"repository","examples":{"remote.c":["ex/v0.23.2/remote.html#git_repository_discover-15"]}},"git_repository_open_ext":{"type":"function","file":"repository.h","line":122,"lineto":126,"args":[{"name":"out","type":"git_repository **","comment":"Pointer to the repo which will be opened. This can\n actually be NULL if you only want to use the error code to\n see if a repo at this path could be opened."},{"name":"path","type":"const char *","comment":"Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository."},{"name":"flags","type":"unsigned int","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\n prefixes at which the search for a containing repository should\n terminate."}],"argline":"git_repository **out, const char *path, unsigned int flags, const char *ceiling_dirs","sig":"git_repository **::const char *::unsigned int::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if no repository could be found,\n or -1 if there was a repository but open failed for some reason\n (such as repo corruption or system errors)."},"description":"

Find and open a repository with extended controls.

\n","comments":"","group":"repository","examples":{"blame.c":["ex/v0.23.2/blame.html#git_repository_open_ext-24"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_repository_open_ext-31"],"describe.c":["ex/v0.23.2/describe.html#git_repository_open_ext-6"],"diff.c":["ex/v0.23.2/diff.html#git_repository_open_ext-15"],"log.c":["ex/v0.23.2/log.html#git_repository_open_ext-44","ex/v0.23.2/log.html#git_repository_open_ext-45"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_repository_open_ext-16"],"status.c":["ex/v0.23.2/status.html#git_repository_open_ext-5"],"tag.c":["ex/v0.23.2/tag.html#git_repository_open_ext-11"]}},"git_repository_open_bare":{"type":"function","file":"repository.h","line":139,"lineto":139,"args":[{"name":"out","type":"git_repository **","comment":"Pointer to the repo which will be opened."},{"name":"bare_path","type":"const char *","comment":"Direct path to the bare repository"}],"argline":"git_repository **out, const char *bare_path","sig":"git_repository **::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Open a bare repository on the serverside.

\n","comments":"

This is a fast open for bare repositories that will come in handy\n if you're e.g. hosting git repositories and need to access them\n efficiently

\n","group":"repository"},"git_repository_free":{"type":"function","file":"repository.h","line":152,"lineto":152,"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","comment":null},"description":"

Free a previously allocated repository

\n","comments":"

Note that after a repository is free'd, all the objects it has spawned\n will still exist until they are manually closed by the user\n with git_object_free, but accessing any of the attributes of\n an object without a backing repository will result in undefined\n behavior

\n","group":"repository","examples":{"blame.c":["ex/v0.23.2/blame.html#git_repository_free-25"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_repository_free-32"],"describe.c":["ex/v0.23.2/describe.html#git_repository_free-7"],"diff.c":["ex/v0.23.2/diff.html#git_repository_free-16"],"general.c":["ex/v0.23.2/general.html#git_repository_free-59"],"init.c":["ex/v0.23.2/init.html#git_repository_free-6"],"log.c":["ex/v0.23.2/log.html#git_repository_free-46"],"network/clone.c":["ex/v0.23.2/network/clone.html#git_repository_free-3"],"network/git2.c":["ex/v0.23.2/network/git2.html#git_repository_free-6"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_repository_free-17"],"status.c":["ex/v0.23.2/status.html#git_repository_free-6"],"tag.c":["ex/v0.23.2/tag.html#git_repository_free-12"]}},"git_repository_init":{"type":"function","file":"repository.h","line":169,"lineto":172,"args":[{"name":"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 int","comment":"if true, a Git repository without a working directory is\n\t\tcreated at the pointed path. If false, provided path will be\n\t\tconsidered as the working directory into which the .git directory\n\t\twill be created."}],"argline":"git_repository **out, const char *path, unsigned int is_bare","sig":"git_repository **::const char *::unsigned int","return":{"type":"int","comment":" 0 or an error code"},"description":"

Creates a new Git repository in the given folder.

\n","comments":"

TODO:\n - Reinit the repository

\n","group":"repository","examples":{"init.c":["ex/v0.23.2/init.html#git_repository_init-7"]}},"git_repository_init_init_options":{"type":"function","file":"repository.h","line":281,"lineto":283,"args":[{"name":"opts","type":"git_repository_init_options *","comment":"the `git_repository_init_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`"}],"argline":"git_repository_init_options *opts, unsigned int version","sig":"git_repository_init_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_repository_init_options with default values. Equivalent\n to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n","comments":"","group":"repository"},"git_repository_init_ext":{"type":"function","file":"repository.h","line":298,"lineto":301,"args":[{"name":"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 **out, const char *repo_path, git_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.

\n","comments":"

This will initialize a new git repository (creating the repo_path\n if requested by flags) and working directory as needed. It will\n auto-detect the case sensitivity of the file system and if the\n file system supports file mode bits correctly.

\n","group":"repository","examples":{"init.c":["ex/v0.23.2/init.html#git_repository_init_ext-8"]}},"git_repository_head":{"type":"function","file":"repository.h","line":316,"lineto":316,"args":[{"name":"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 **out, git_repository *repo","sig":"git_reference **::git_repository *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise"},"description":"

Retrieve and resolve the reference pointed at by HEAD.

\n","comments":"

The returned git_reference will be owned by caller and\n git_reference_free() must be called when done with it to release the\n allocated memory and prevent a leak.

\n","group":"repository","examples":{"status.c":["ex/v0.23.2/status.html#git_repository_head-7"]}},"git_repository_head_detached":{"type":"function","file":"repository.h","line":328,"lineto":328,"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\n was an error."},"description":"

Check if a repository's HEAD is detached

\n","comments":"

A repository's HEAD is detached when it points directly to a commit\n instead of a branch.

\n","group":"repository"},"git_repository_head_unborn":{"type":"function","file":"repository.h","line":340,"lineto":340,"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 unborn, 0 if it's not; error\n code if there was an error"},"description":"

Check if the current branch is unborn

\n","comments":"

An unborn branch is one named from HEAD but which doesn't exist in\n the 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":352,"lineto":352,"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\n if the repository is corrupted"},"description":"

Check if a repository is empty

\n","comments":"

An empty repository has just been initialized and contains no references\n apart from HEAD, which must be pointing to the unborn master branch.

\n","group":"repository"},"git_repository_path":{"type":"function","file":"repository.h","line":363,"lineto":363,"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

\n","comments":"

This is the path of the .git folder for normal repositories,\n or of the repository itself for bare repositories.

\n","group":"repository","examples":{"init.c":["ex/v0.23.2/init.html#git_repository_path-9"],"status.c":["ex/v0.23.2/status.html#git_repository_path-8"]}},"git_repository_workdir":{"type":"function","file":"repository.h","line":374,"lineto":374,"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

\n","comments":"

If the repository is bare, this function will always return\n NULL.

\n","group":"repository","examples":{"init.c":["ex/v0.23.2/init.html#git_repository_workdir-10"]}},"git_repository_set_workdir":{"type":"function","file":"repository.h","line":393,"lineto":394,"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\n \"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

\n","comments":"

The working directory doesn't need to be the same one\n that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory\n will turn it into a normal repository, capable of performing\n all the common workdir operations (checkout, status, index\n manipulation, etc).

\n","group":"repository"},"git_repository_is_bare":{"type":"function","file":"repository.h","line":402,"lineto":402,"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

\n","comments":"","group":"repository","examples":{"status.c":["ex/v0.23.2/status.html#git_repository_is_bare-9"]}},"git_repository_config":{"type":"function","file":"repository.h","line":418,"lineto":418,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the loaded configuration"},{"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.

\n","comments":"

If a configuration file has not been set, the default\n config set for the repository will be returned, including\n global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n","group":"repository"},"git_repository_config_snapshot":{"type":"function","file":"repository.h","line":434,"lineto":434,"args":[{"name":"out","type":"git_config **","comment":"Pointer to store the loaded configuration"},{"name":"repo","type":"git_repository *","comment":"the repository"}],"argline":"git_config **out, git_repository *repo","sig":"git_config **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get a snapshot of the repository's configuration

\n","comments":"

Convenience function to take a snapshot from the repository's\n configuration. The contents of this snapshot will not change,\n even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n","group":"repository"},"git_repository_odb":{"type":"function","file":"repository.h","line":450,"lineto":450,"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.

\n","comments":"

If a custom ODB has not been set, the default\n database for the repository will be returned (the one\n located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by\n the user.

\n","group":"repository","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_repository_odb-33"],"general.c":["ex/v0.23.2/general.html#git_repository_odb-60"]}},"git_repository_refdb":{"type":"function","file":"repository.h","line":466,"lineto":466,"args":[{"name":"out","type":"git_refdb **","comment":"Pointer to store the loaded refdb"},{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_refdb **out, git_repository *repo","sig":"git_refdb **::git_repository *","return":{"type":"int","comment":" 0, or an error code"},"description":"

Get the Reference Database Backend for this repository.

\n","comments":"

If a custom refsdb has not been set, the default database for\n the repository will be returned (the one that manipulates loose\n and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by\n the user.

\n","group":"repository"},"git_repository_index":{"type":"function","file":"repository.h","line":482,"lineto":482,"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.

\n","comments":"

If a custom index has not been set, the default\n index for the repository will be returned (the one\n located in .git/index).

\n\n

The index must be freed once it's no longer being used by\n the user.

\n","group":"repository","examples":{"general.c":["ex/v0.23.2/general.html#git_repository_index-61"],"init.c":["ex/v0.23.2/init.html#git_repository_index-11"]}},"git_repository_message":{"type":"function","file":"repository.h","line":500,"lineto":500,"args":[{"name":"out","type":"git_buf *","comment":"git_buf to write data into"},{"name":"repo","type":"git_repository *","comment":"Repository to read prepared message from"}],"argline":"git_buf *out, git_repository *repo","sig":"git_buf *::git_repository *","return":{"type":"int","comment":" 0, GIT_ENOTFOUND if no message exists or an error code"},"description":"

Retrieve git's prepared message

\n","comments":"

Operations such as git revert/cherry-pick/merge with the -n option\n stop just short of creating a commit with the changes and save\n their prepared message in .git/MERGE_MSG so the next git-commit\n execution can present it to the user for them to amend if they\n wish.

\n\n

Use this function to get the contents of this file. Don't forget to\n remove the file after you create the commit.

\n","group":"repository"},"git_repository_message_remove":{"type":"function","file":"repository.h","line":507,"lineto":507,"args":[{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":null},"description":"

Remove git's prepared message.

\n","comments":"

Remove the message that git_repository_message retrieves.

\n","group":"repository"},"git_repository_state_cleanup":{"type":"function","file":"repository.h","line":516,"lineto":516,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 0 on success, or error"},"description":"

Remove all the metadata associated with an ongoing command like merge,\n revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.

\n","comments":"","group":"repository"},"git_repository_fetchhead_foreach":{"type":"function","file":"repository.h","line":535,"lineto":538,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_repository_fetchhead_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_repository_fetchhead_foreach_cb callback, void *payload","sig":"git_repository *::git_repository_fetchhead_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no FETCH_HEAD file, or other error code."},"description":"

Invoke 'callback' for each entry in the given FETCH_HEAD file.

\n","comments":"

Return a non-zero value from the callback to stop the loop.

\n","group":"repository"},"git_repository_mergehead_foreach":{"type":"function","file":"repository.h","line":555,"lineto":558,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_repository_mergehead_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_repository_mergehead_foreach_cb callback, void *payload","sig":"git_repository *::git_repository_mergehead_foreach_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no MERGE_HEAD file, or other error code."},"description":"

If a merge is in progress, invoke 'callback' for each commit ID in the\n MERGE_HEAD file.

\n","comments":"

Return a non-zero value from the callback to stop the loop.

\n","group":"repository"},"git_repository_hashfile":{"type":"function","file":"repository.h","line":583,"lineto":588,"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\n 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\n NULL, then the `path` parameter will be used instead. If\n this is passed as the empty string, then no filters will be\n applied when calculating the hash."}],"argline":"git_oid *out, git_repository *repo, const char *path, git_otype type, const char *as_path","sig":"git_oid *::git_repository *::const char *::git_otype::const char *","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Calculate hash of file using repository filtering rules.

\n","comments":"

If you simply want to calculate the hash of a file on disk with no filters,\n you can just use the git_odb_hashfile() API. However, if you want to\n hash a file in the repository and you want to apply filtering rules (e.g.\n crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the\n filtering triggers that failure, then this function will return an\n error and not calculate the hash of the file.

\n","group":"repository"},"git_repository_set_head":{"type":"function","file":"repository.h","line":608,"lineto":610,"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, const 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.

\n","comments":"

If the provided reference points to a Tree or a Blob, the HEAD is\n unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point\n to that branch, staying attached, or become attached if it isn't yet.\n If the branch doesn't exist yet, no error will be return. The HEAD\n will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to\n the Commit.

\n","group":"repository"},"git_repository_set_head_detached":{"type":"function","file":"repository.h","line":628,"lineto":630,"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, const 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.

\n","comments":"

If the provided committish cannot be found in the repository, the HEAD\n is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD\n is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to\n the peeled Commit.

\n","group":"repository"},"git_repository_set_head_detached_from_annotated":{"type":"function","file":"repository.h","line":644,"lineto":646,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"commitish","type":"const git_annotated_commit *","comment":null}],"argline":"git_repository *repo, const git_annotated_commit *commitish","sig":"git_repository *::const git_annotated_commit *","return":{"type":"int","comment":null},"description":"

Make the repository HEAD directly point to the Commit.

\n","comments":"

This behaves like git_repository_set_head_detached() but takes an\n annotated commit, which lets you specify which extended sha syntax\n string was specified by a user, allowing for more exact reflog\n messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n","group":"repository"},"git_repository_detach_head":{"type":"function","file":"repository.h","line":665,"lineto":666,"args":[{"name":"repo","type":"git_repository *","comment":"Repository pointer"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code"},"description":"

Detach the HEAD.

\n","comments":"

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is\n updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is\n unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n","group":"repository"},"git_repository_state":{"type":"function","file":"repository.h","line":694,"lineto":694,"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.

\n","comments":"","group":"repository"},"git_repository_set_namespace":{"type":"function","file":"repository.h","line":708,"lineto":708,"args":[{"name":"repo","type":"git_repository *","comment":"The repo"},{"name":"nmspace","type":"const char *","comment":"The namespace. This should not include the refs\n\tfolder, e.g. to namespace all references under `refs/namespaces/foo/`,\n\tuse `foo` as the namespace."}],"argline":"git_repository *repo, const char *nmspace","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, -1 on error"},"description":"

Sets the active namespace for this Git Repository

\n","comments":"

This namespace affects all reference operations for the repo.\n See man gitnamespaces

\n","group":"repository"},"git_repository_get_namespace":{"type":"function","file":"repository.h","line":716,"lineto":716,"args":[{"name":"repo","type":"git_repository *","comment":"The repo"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"const char *","comment":" the active namespace, or NULL if there isn't one"},"description":"

Get the currently active namespace for this repository

\n","comments":"","group":"repository"},"git_repository_is_shallow":{"type":"function","file":"repository.h","line":725,"lineto":725,"args":[{"name":"repo","type":"git_repository *","comment":"The repository"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 1 if shallow, zero if not"},"description":"

Determine if the repository was a shallow clone

\n","comments":"","group":"repository"},"git_repository_ident":{"type":"function","file":"repository.h","line":737,"lineto":737,"args":[{"name":"name","type":"const char **","comment":"where to store the pointer to the name"},{"name":"email","type":"const char **","comment":"where to store the pointer to the email"},{"name":"repo","type":"const git_repository *","comment":"the repository"}],"argline":"const char **name, const char **email, const git_repository *repo","sig":"const char **::const char **::const git_repository *","return":{"type":"int","comment":null},"description":"

Retrieve the configured identity to use for reflogs

\n","comments":"

The memory is owned by the repository and must not be freed by the\n user.

\n","group":"repository"},"git_repository_set_ident":{"type":"function","file":"repository.h","line":750,"lineto":750,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to configure"},{"name":"name","type":"const char *","comment":"the name to use for the reflog entries"},{"name":"email","type":"const char *","comment":"the email to use for the reflog entries"}],"argline":"git_repository *repo, const char *name, const char *email","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":null},"description":"

Set the identity to be used for writing reflogs

\n","comments":"

If both are set, this name and email will be used to write to the\n reflog. Pass NULL to unset. When unset, the identity will be taken\n from the repository's configuration.

\n","group":"repository"},"git_reset":{"type":"function","file":"reset.h","line":62,"lineto":66,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to perform the reset operation."},{"name":"target","type":"git_object *","comment":"Committish to which the Head should be moved to. This object\n must belong to the given `repo` and can either be a git_commit or a\n git_tag. When a git_tag is being passed, it should be dereferencable\n to a git_commit which oid will be used as the target of the branch."},{"name":"reset_type","type":"git_reset_t","comment":"Kind of reset operation to perform."},{"name":"checkout_opts","type":"const git_checkout_options *","comment":"Checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks."}],"argline":"git_repository *repo, git_object *target, git_reset_t reset_type, const git_checkout_options *checkout_opts","sig":"git_repository *::git_object *::git_reset_t::const git_checkout_options *","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n","comments":"

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced\n with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be\n replaced with the content of the index. (Untracked and ignored files\n will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n","group":"reset"},"git_reset_from_annotated":{"type":"function","file":"reset.h","line":80,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":null},{"name":"commit","type":"git_annotated_commit *","comment":null},{"name":"reset_type","type":"git_reset_t","comment":null},{"name":"checkout_opts","type":"const git_checkout_options *","comment":null}],"argline":"git_repository *repo, git_annotated_commit *commit, git_reset_t reset_type, const git_checkout_options *checkout_opts","sig":"git_repository *::git_annotated_commit *::git_reset_t::const git_checkout_options *","return":{"type":"int","comment":null},"description":"

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n","comments":"

This behaves like git_reset() but takes an annotated commit,\n which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n","group":"reset"},"git_reset_default":{"type":"function","file":"reset.h","line":104,"lineto":107,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to perform the reset operation."},{"name":"target","type":"git_object *","comment":"The committish which content will be used to reset the content\n of the index."},{"name":"pathspecs","type":"git_strarray *","comment":"List of pathspecs to operate on."}],"argline":"git_repository *repo, git_object *target, git_strarray *pathspecs","sig":"git_repository *::git_object *::git_strarray *","return":{"type":"int","comment":" 0 on success or an error code \n<\n 0"},"description":"

Updates some entries in the index from the target commit tree.

\n","comments":"

The scope of the updated entries is determined by the paths\n being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing\n entries in the index matching the provided pathspecs.

\n","group":"reset"},"git_revert_init_options":{"type":"function","file":"revert.h","line":47,"lineto":49,"args":[{"name":"opts","type":"git_revert_options *","comment":"the `git_revert_options` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REVERT_OPTIONS_VERSION`"}],"argline":"git_revert_options *opts, unsigned int version","sig":"git_revert_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_revert_options with default values. Equivalent to\n creating an instance with GIT_REVERT_OPTIONS_INIT.

\n","comments":"","group":"revert"},"git_revert_commit":{"type":"function","file":"revert.h","line":65,"lineto":71,"args":[{"name":"out","type":"git_index **","comment":"pointer to store the index result in"},{"name":"repo","type":"git_repository *","comment":"the repository that contains the given commits"},{"name":"revert_commit","type":"git_commit *","comment":"the commit to revert"},{"name":"our_commit","type":"git_commit *","comment":"the commit to revert against (eg, HEAD)"},{"name":"mainline","type":"unsigned int","comment":"the parent of the revert commit, if it is a merge"},{"name":"merge_options","type":"const git_merge_options *","comment":"the merge options (or null for defaults)"}],"argline":"git_index **out, git_repository *repo, git_commit *revert_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options","sig":"git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Reverts the given commit against the given "our" commit, producing an\n index that reflects the result of the revert.

\n","comments":"

The returned index must be freed explicitly with git_index_free.

\n","group":"revert"},"git_revert":{"type":"function","file":"revert.h","line":81,"lineto":84,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to revert"},{"name":"commit","type":"git_commit *","comment":"the commit to revert"},{"name":"given_opts","type":"const git_revert_options *","comment":"merge flags"}],"argline":"git_repository *repo, git_commit *commit, const git_revert_options *given_opts","sig":"git_repository *::git_commit *::const git_revert_options *","return":{"type":"int","comment":" zero on success, -1 on failure."},"description":"

Reverts the given commit, producing changes in the index and working directory.

\n","comments":"","group":"revert"},"git_revparse_single":{"type":"function","file":"revparse.h","line":37,"lineto":38,"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":" 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code"},"description":"

Find a single object, as specified by a revision string.

\n","comments":"

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no\n longer needed.

\n","group":"revparse","examples":{"blame.c":["ex/v0.23.2/blame.html#git_revparse_single-26"],"cat-file.c":["ex/v0.23.2/cat-file.html#git_revparse_single-34"],"describe.c":["ex/v0.23.2/describe.html#git_revparse_single-8"],"log.c":["ex/v0.23.2/log.html#git_revparse_single-47"],"tag.c":["ex/v0.23.2/tag.html#git_revparse_single-13","ex/v0.23.2/tag.html#git_revparse_single-14","ex/v0.23.2/tag.html#git_revparse_single-15","ex/v0.23.2/tag.html#git_revparse_single-16"]}},"git_revparse_ext":{"type":"function","file":"revparse.h","line":61,"lineto":65,"args":[{"name":"object_out","type":"git_object **","comment":"pointer to output object"},{"name":"reference_out","type":"git_reference **","comment":"pointer to output reference or NULL"},{"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 **object_out, git_reference **reference_out, git_repository *repo, const char *spec","sig":"git_object **::git_reference **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC\n or an error code"},"description":"

Find a single object and intermediate reference by a revision string.

\n","comments":"

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

In some cases (\n@\n{\n<\n-n>} or `\n<branchname

\n\n
\n

@\n{upstream}), the expression may\n point to an intermediate reference. When such expressions are being passed\n in,reference_out` will be valued as well.

\n
\n\n

The returned object should be released with git_object_free and the\n returned reference with git_reference_free when no longer needed.

\n","group":"revparse"},"git_revparse":{"type":"function","file":"revparse.h","line":105,"lineto":108,"args":[{"name":"revspec","type":"git_revspec *","comment":"Pointer to an user-allocated git_revspec struct where\n\t the result of the rev-parse will be stored"},{"name":"repo","type":"git_repository *","comment":"the repository to search in"},{"name":"spec","type":"const char *","comment":"the rev-parse spec to parse"}],"argline":"git_revspec *revspec, git_repository *repo, const char *spec","sig":"git_revspec *::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code"},"description":"

Parse a revision string for from, to, and intent.

\n","comments":"

See man gitrevisions or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n","group":"revparse","examples":{"blame.c":["ex/v0.23.2/blame.html#git_revparse-27"],"log.c":["ex/v0.23.2/log.html#git_revparse-48"],"rev-parse.c":["ex/v0.23.2/rev-parse.html#git_revparse-18","ex/v0.23.2/rev-parse.html#git_revparse-19"]}},"git_revwalk_new":{"type":"function","file":"revwalk.h","line":75,"lineto":75,"args":[{"name":"out","type":"git_revwalk **","comment":"pointer to the new revision walker"},{"name":"repo","type":"git_repository *","comment":"the repo to walk through"}],"argline":"git_revwalk **out, 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.

\n","comments":"

This revision walker uses a custom memory pool and an internal\n commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be\n reused for different walks.

\n\n

This revision walker is not thread safe: it may only be\n used to walk a repository on a single thread; however,\n it is possible to have several revision walkers in\n several different threads walking the same repository.

\n","group":"revwalk","examples":{"general.c":["ex/v0.23.2/general.html#git_revwalk_new-62"],"log.c":["ex/v0.23.2/log.html#git_revwalk_new-49","ex/v0.23.2/log.html#git_revwalk_new-50"]}},"git_revwalk_reset":{"type":"function","file":"revwalk.h","line":90,"lineto":90,"args":[{"name":"walker","type":"git_revwalk *","comment":"handle to reset."}],"argline":"git_revwalk *walker","sig":"git_revwalk *","return":{"type":"void","comment":null},"description":"

Reset the revision walker for reuse.

\n","comments":"

This will clear all the pushed and hidden commits, and\n leave the walker in a blank state (just like at\n creation) ready to receive new commit pushes and\n start a new walk.

\n\n

The revision walk is automatically reset when a walk\n is over.

\n","group":"revwalk"},"git_revwalk_push":{"type":"function","file":"revwalk.h","line":109,"lineto":109,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"id","type":"const git_oid *","comment":"the oid of the commit to start from."}],"argline":"git_revwalk *walk, const git_oid *id","sig":"git_revwalk *::const git_oid *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Add a new root for the traversal

\n","comments":"

The pushed commit will be marked as one of the roots from which to\n start the walk. This commit may not be walked if it or a child is\n hidden.

\n\n

At least one commit must be pushed onto the walker before a walk\n can be started.

\n\n

The given id must belong to a committish on the walked\n repository.

\n","group":"revwalk","examples":{"general.c":["ex/v0.23.2/general.html#git_revwalk_push-63"],"log.c":["ex/v0.23.2/log.html#git_revwalk_push-51"]}},"git_revwalk_push_glob":{"type":"function","file":"revwalk.h","line":127,"lineto":127,"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

\n","comments":"

The OIDs pointed to by the references that match the given glob\n pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n","group":"revwalk"},"git_revwalk_push_head":{"type":"function","file":"revwalk.h","line":135,"lineto":135,"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

\n","comments":"","group":"revwalk","examples":{"log.c":["ex/v0.23.2/log.html#git_revwalk_push_head-52"]}},"git_revwalk_hide":{"type":"function","file":"revwalk.h","line":150,"lineto":150,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal."},{"name":"commit_id","type":"const git_oid *","comment":"the oid of commit that will be ignored during the traversal"}],"argline":"git_revwalk *walk, const git_oid *commit_id","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.

\n","comments":"

The given id must belong to a committish on the walked\n repository.

\n\n

The resolved commit and all its parents will be hidden from the\n output on the revision walk.

\n","group":"revwalk","examples":{"log.c":["ex/v0.23.2/log.html#git_revwalk_hide-53"]}},"git_revwalk_hide_glob":{"type":"function","file":"revwalk.h","line":169,"lineto":169,"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.

\n","comments":"

The OIDs pointed to by the references that match the given glob\n pattern and their ancestors will be hidden from the output on the\n revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n","group":"revwalk"},"git_revwalk_hide_head":{"type":"function","file":"revwalk.h","line":177,"lineto":177,"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

\n","comments":"","group":"revwalk"},"git_revwalk_push_ref":{"type":"function","file":"revwalk.h","line":188,"lineto":188,"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

\n","comments":"

The reference must point to a committish.

\n","group":"revwalk"},"git_revwalk_hide_ref":{"type":"function","file":"revwalk.h","line":199,"lineto":199,"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

\n","comments":"

The reference must point to a committish.

\n","group":"revwalk"},"git_revwalk_next":{"type":"function","file":"revwalk.h","line":219,"lineto":219,"args":[{"name":"out","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 *out, git_revwalk *walk","sig":"git_oid *::git_revwalk *","return":{"type":"int","comment":" 0 if the next commit was found;\n\tGIT_ITEROVER if there are no commits left to iterate"},"description":"

Get the next commit from the revision walk.

\n","comments":"

The initial call to this method is not blocking when\n iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial\n call blocking to preprocess the commit list, but this block should be\n mostly unnoticeable on most repositories (topological preprocessing\n times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n","group":"revwalk","examples":{"general.c":["ex/v0.23.2/general.html#git_revwalk_next-64"],"log.c":["ex/v0.23.2/log.html#git_revwalk_next-54"]}},"git_revwalk_sorting":{"type":"function","file":"revwalk.h","line":230,"lineto":230,"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","comment":null},"description":"

Change the sorting mode when iterating through the\n repository's contents.

\n","comments":"

Changing the sorting mode resets the walker.

\n","group":"revwalk","examples":{"general.c":["ex/v0.23.2/general.html#git_revwalk_sorting-65"],"log.c":["ex/v0.23.2/log.html#git_revwalk_sorting-55","ex/v0.23.2/log.html#git_revwalk_sorting-56"]}},"git_revwalk_push_range":{"type":"function","file":"revwalk.h","line":245,"lineto":245,"args":[{"name":"walk","type":"git_revwalk *","comment":"the walker being used for the traversal"},{"name":"range","type":"const char *","comment":"the range"}],"argline":"git_revwalk *walk, const char *range","sig":"git_revwalk *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Push and hide the respective endpoints of the given range.

\n","comments":"

The range should be of the form

\n\n

<commit

\n\n
\n

..\n<commit

\n\n

where each \n<commit\nis in the form accepted by 'git_revparse_single'.\n The left-hand commit will be hidden and the right-hand commit pushed.

\n
\n","group":"revwalk"},"git_revwalk_simplify_first_parent":{"type":"function","file":"revwalk.h","line":252,"lineto":252,"args":[{"name":"walk","type":"git_revwalk *","comment":null}],"argline":"git_revwalk *walk","sig":"git_revwalk *","return":{"type":"void","comment":null},"description":"

Simplify the history by first-parent

\n","comments":"

No parents other than the first for each commit will be enqueued.

\n","group":"revwalk"},"git_revwalk_free":{"type":"function","file":"revwalk.h","line":260,"lineto":260,"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","comment":null},"description":"

Free a revision walker previously allocated.

\n","comments":"","group":"revwalk","examples":{"general.c":["ex/v0.23.2/general.html#git_revwalk_free-66"],"log.c":["ex/v0.23.2/log.html#git_revwalk_free-57"]}},"git_revwalk_repository":{"type":"function","file":"revwalk.h","line":269,"lineto":269,"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\n is operating.

\n","comments":"","group":"revwalk"},"git_revwalk_add_hide_cb":{"type":"function","file":"revwalk.h","line":290,"lineto":293,"args":[{"name":"walk","type":"git_revwalk *","comment":"the revision walker"},{"name":"hide_cb","type":"git_revwalk_hide_cb","comment":"callback function to hide a commit and its parents"},{"name":"payload","type":"void *","comment":"data payload to be passed to callback function"}],"argline":"git_revwalk *walk, git_revwalk_hide_cb hide_cb, void *payload","sig":"git_revwalk *::git_revwalk_hide_cb::void *","return":{"type":"int","comment":null},"description":"

Adds a callback function to hide a commit and its parents

\n","comments":"","group":"revwalk"},"git_signature_new":{"type":"function","file":"signature.h","line":37,"lineto":37,"args":[{"name":"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 **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.

\n","comments":"

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('\n<\n' and '>') characters are not allowed\n to be used in either the name or the email parameter.

\n","group":"signature","examples":{"general.c":["ex/v0.23.2/general.html#git_signature_new-67","ex/v0.23.2/general.html#git_signature_new-68"]}},"git_signature_now":{"type":"function","file":"signature.h","line":49,"lineto":49,"args":[{"name":"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 **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'.

\n","comments":"

Call git_signature_free() to free the data.

\n","group":"signature"},"git_signature_default":{"type":"function","file":"signature.h","line":63,"lineto":63,"args":[{"name":"out","type":"git_signature **","comment":"new signature"},{"name":"repo","type":"git_repository *","comment":"repository pointer"}],"argline":"git_signature **out, git_repository *repo","sig":"git_signature **::git_repository *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if config is missing, or error code"},"description":"

Create a new action signature with default user and now timestamp.

\n","comments":"

This looks up the user.name and user.email from the configuration and\n uses the current time as the timestamp, and creates a new signature\n based on that information. It will return GIT_ENOTFOUND if either the\n user.name or user.email are not set.

\n","group":"signature","examples":{"init.c":["ex/v0.23.2/init.html#git_signature_default-12"],"tag.c":["ex/v0.23.2/tag.html#git_signature_default-17"]}},"git_signature_dup":{"type":"function","file":"signature.h","line":75,"lineto":75,"args":[{"name":"dest","type":"git_signature **","comment":"pointer where to store the copy"},{"name":"sig","type":"const git_signature *","comment":"signature to duplicate"}],"argline":"git_signature **dest, const git_signature *sig","sig":"git_signature **::const git_signature *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create a copy of an existing signature. All internal strings are also\n duplicated.

\n","comments":"

Call git_signature_free() to free the data.

\n","group":"signature"},"git_signature_free":{"type":"function","file":"signature.h","line":86,"lineto":86,"args":[{"name":"sig","type":"git_signature *","comment":"signature to free"}],"argline":"git_signature *sig","sig":"git_signature *","return":{"type":"void","comment":null},"description":"

Free an existing signature.

\n","comments":"

Because the signature is not an opaque structure, it is legal to free it\n manually, but be sure to free the "name" and "email" strings in addition\n to the structure itself.

\n","group":"signature","examples":{"init.c":["ex/v0.23.2/init.html#git_signature_free-13"],"tag.c":["ex/v0.23.2/tag.html#git_signature_free-18"]}},"git_stash_apply_init_options":{"type":"function","file":"stash.h","line":153,"lineto":154,"args":[{"name":"opts","type":"git_stash_apply_options *","comment":"the `git_stash_apply_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"the version of the struct; you should pass\n `GIT_STASH_APPLY_OPTIONS_INIT` here."}],"argline":"git_stash_apply_options *opts, unsigned int version","sig":"git_stash_apply_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_stash_apply_options with default values. Equivalent to\n creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n","comments":"","group":"stash"},"git_stash_apply":{"type":"function","file":"stash.h","line":182,"lineto":185,"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\n most recent stashed state."},{"name":"options","type":"const git_stash_apply_options *","comment":"Options to control how stashes are applied."}],"argline":"git_repository *repo, size_t index, const git_stash_apply_options *options","sig":"git_repository *::size_t::const git_stash_apply_options *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if there's no stashed state for the\n given index, GIT_EMERGECONFLICT if changes exist in the working\n directory, or an error code"},"description":"

Apply a single stashed state from the stash list.

\n","comments":"

If local changes in the working directory conflict with changes in the\n stash then GIT_EMERGECONFLICT will be returned. In this case, the index\n will always remain unmodified and all files in the working directory will\n remain unmodified. However, if you are restoring untracked files or\n ignored files and there is a conflict when applying the modified files,\n then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be\n conflicts when reinstating the index, the function will return\n GIT_EMERGECONFLICT and both the working directory and index will be left\n unmodified.

\n\n

Note that a minimum checkout strategy of GIT_CHECKOUT_SAFE is implied.

\n","group":"stash"},"git_stash_foreach":{"type":"function","file":"stash.h","line":218,"lineto":221,"args":[{"name":"repo","type":"git_repository *","comment":"Repository where to find the stash."},{"name":"callback","type":"git_stash_cb","comment":"Callback to invoke per found stashed state. The most\n recent stash state will be enumerated first."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"git_repository *repo, git_stash_cb callback, void *payload","sig":"git_repository *::git_stash_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code."},"description":"

Loop over all the stashed states and issue a callback for each one.

\n","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":234,"lineto":236,"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\n most recent stashed state."}],"argline":"git_repository *repo, size_t index","sig":"git_repository *::size_t","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code."},"description":"

Remove a single stashed state from the stash list.

\n","comments":"","group":"stash"},"git_stash_pop":{"type":"function","file":"stash.h","line":250,"lineto":253,"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\n most recent stashed state."},{"name":"options","type":"const git_stash_apply_options *","comment":"Options to control how stashes are applied."}],"argline":"git_repository *repo, size_t index, const git_stash_apply_options *options","sig":"git_repository *::size_t::const git_stash_apply_options *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code. (see git_stash_apply() above for details)"},"description":"

Apply a single stashed state from the stash list and remove it from the list\n if successful.

\n","comments":"","group":"stash"},"git_status_init_options":{"type":"function","file":"status.h","line":195,"lineto":197,"args":[{"name":"opts","type":"git_status_options *","comment":"The `git_status_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_STATUS_OPTIONS_VERSION`"}],"argline":"git_status_options *opts, unsigned int version","sig":"git_status_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_status_options with default values. Equivalent to\n creating an instance with GIT_STATUS_OPTIONS_INIT.

\n","comments":"","group":"status"},"git_status_foreach":{"type":"function","file":"status.h","line":235,"lineto":238,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"callback","type":"git_status_cb","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo, git_status_cb callback, void *payload","sig":"git_repository *::git_status_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Gather file statuses and run a callback for each one.

\n","comments":"

The callback is passed the path of the file, the status (a combination of\n the git_status_t values above) and the payload data pointer passed\n into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping\n and return that value to caller.

\n","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_foreach-10"]}},"git_status_foreach_ext":{"type":"function","file":"status.h","line":259,"lineto":263,"args":[{"name":"repo","type":"git_repository *","comment":"Repository object"},{"name":"opts","type":"const git_status_options *","comment":"Status options structure"},{"name":"callback","type":"git_status_cb","comment":"The function to call on each file"},{"name":"payload","type":"void *","comment":"Pointer to pass through to callback function"}],"argline":"git_repository *repo, const git_status_options *opts, git_status_cb callback, void *payload","sig":"git_repository *::const git_status_options *::git_status_cb::void *","return":{"type":"int","comment":" 0 on success, non-zero callback return value, or error code"},"description":"

Gather file status information and run callbacks as requested.

\n","comments":"

This is an extended version of the git_status_foreach() API that\n allows for more granular control over which paths will be processed and\n in what order. See the git_status_options structure for details\n about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_foreach_ext-11"]}},"git_status_file":{"type":"function","file":"status.h","line":291,"lineto":294,"args":[{"name":"status_flags","type":"unsigned int *","comment":"Output combination of git_status_t values for file"},{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"path","type":"const char *","comment":"The exact path to retrieve status for relative to the\n repository working directory"}],"argline":"unsigned int *status_flags, git_repository *repo, const 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,\n index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files\n or if it refers to a folder, and -1 on other errors."},"description":"

Get file status for a single file.

\n","comments":"

This tries to get status for the filename that you give. If no files\n match that name (in either the HEAD, index, or working directory), this\n returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a\n directory or if running on a case- insensitive filesystem and yet the\n HEAD has two entries that both match the path), then this returns\n GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of\n targets and because of the path filtering, there is not enough\n information to check renames correctly. To check file status with rename\n detection, there is no choice but to do a full git_status_list_new and\n scan through looking for the path that you are interested in.

\n","group":"status"},"git_status_list_new":{"type":"function","file":"status.h","line":309,"lineto":312,"args":[{"name":"out","type":"git_status_list **","comment":"Pointer to store the status results in"},{"name":"repo","type":"git_repository *","comment":"Repository object"},{"name":"opts","type":"const git_status_options *","comment":"Status options structure"}],"argline":"git_status_list **out, git_repository *repo, const git_status_options *opts","sig":"git_status_list **::git_repository *::const git_status_options *","return":{"type":"int","comment":" 0 on success or error code"},"description":"

Gather file status information and populate the git_status_list.

\n","comments":"

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_list_new-12","ex/v0.23.2/status.html#git_status_list_new-13"]}},"git_status_list_entrycount":{"type":"function","file":"status.h","line":323,"lineto":324,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"}],"argline":"git_status_list *statuslist","sig":"git_status_list *","return":{"type":"size_t","comment":" the number of status entries"},"description":"

Gets the count of status entries in this list.

\n","comments":"

If there are no changes in status (at least according the options given\n when the status list was created), this can return 0.

\n","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_list_entrycount-14","ex/v0.23.2/status.html#git_status_list_entrycount-15"]}},"git_status_byindex":{"type":"function","file":"status.h","line":335,"lineto":337,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"},{"name":"idx","type":"size_t","comment":"Position of the entry"}],"argline":"git_status_list *statuslist, size_t idx","sig":"git_status_list *::size_t","return":{"type":"const git_status_entry *","comment":" Pointer to the entry; NULL if out of bounds"},"description":"

Get a pointer to one of the entries in the status list.

\n","comments":"

The entry is not modifiable and should not be freed.

\n","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_byindex-16","ex/v0.23.2/status.html#git_status_byindex-17","ex/v0.23.2/status.html#git_status_byindex-18","ex/v0.23.2/status.html#git_status_byindex-19","ex/v0.23.2/status.html#git_status_byindex-20","ex/v0.23.2/status.html#git_status_byindex-21"]}},"git_status_list_free":{"type":"function","file":"status.h","line":344,"lineto":345,"args":[{"name":"statuslist","type":"git_status_list *","comment":"Existing status list object"}],"argline":"git_status_list *statuslist","sig":"git_status_list *","return":{"type":"void","comment":null},"description":"

Free an existing status list

\n","comments":"","group":"status","examples":{"status.c":["ex/v0.23.2/status.html#git_status_list_free-22"]}},"git_status_should_ignore":{"type":"function","file":"status.h","line":363,"lineto":366,"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, git_repository *repo, const char *path","sig":"int *::git_repository *::const char *","return":{"type":"int","comment":" 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not."},"description":"

Test if the ignore rules apply to a given file.

\n","comments":"

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n","group":"status"},"git_strarray_free":{"type":"function","file":"strarray.h","line":41,"lineto":41,"args":[{"name":"array","type":"git_strarray *","comment":"git_strarray from which to free string data"}],"argline":"git_strarray *array","sig":"git_strarray *","return":{"type":"void","comment":null},"description":"

Close a string array object

\n","comments":"

This method should be called on git_strarray objects where the strings\n array is allocated and contains allocated strings, such as what you\n would get from git_strarray_copy(). Not doing so, will result in a\n memory leak.

\n\n

This does not free the git_strarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n","group":"strarray","examples":{"general.c":["ex/v0.23.2/general.html#git_strarray_free-69"],"remote.c":["ex/v0.23.2/remote.html#git_strarray_free-16","ex/v0.23.2/remote.html#git_strarray_free-17"],"tag.c":["ex/v0.23.2/tag.html#git_strarray_free-19"]}},"git_strarray_copy":{"type":"function","file":"strarray.h","line":53,"lineto":53,"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","comment":" 0 on success, \n<\n 0 on allocation failure"},"description":"

Copy a string array object from source to target.

\n","comments":"

Note: target is overwritten and hence should be empty, otherwise its\n contents are leaked. Call git_strarray_free() if necessary.

\n","group":"strarray"},"git_submodule_update_init_options":{"type":"function","file":"submodule.h","line":162,"lineto":163,"args":[{"name":"opts","type":"git_submodule_update_options *","comment":"The `git_submodule_update_options` instance to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`"}],"argline":"git_submodule_update_options *opts, unsigned int version","sig":"git_submodule_update_options *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_submodule_update_options with default values.\n Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n","comments":"","group":"submodule"},"git_submodule_update":{"type":"function","file":"submodule.h","line":181,"lineto":181,"args":[{"name":"submodule","type":"git_submodule *","comment":"Submodule object"},{"name":"init","type":"int","comment":"If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialzed repository.\n but setting this to true forces them to be updated."},{"name":"options","type":"git_submodule_update_options *","comment":"configuration options for the update. If NULL, the\n function works as though GIT_SUBMODULE_UPDATE_OPTIONS_INIT was passed."}],"argline":"git_submodule *submodule, int init, git_submodule_update_options *options","sig":"git_submodule *::int::git_submodule_update_options *","return":{"type":"int","comment":" 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)."},"description":"

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n containing repository.

\n","comments":"","group":"submodule"},"git_submodule_lookup":{"type":"function","file":"submodule.h","line":210,"lineto":213,"args":[{"name":"out","type":"git_submodule **","comment":"Output ptr to submodule; pass NULL to just get return code"},{"name":"repo","type":"git_repository *","comment":"The parent repository"},{"name":"name","type":"const char *","comment":"The name of or path to the submodule; trailing slashes okay"}],"argline":"git_submodule **out, git_repository *repo, const char *name","sig":"git_submodule **::git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_ENOTFOUND if submodule does not exist,\n GIT_EEXISTS if a repository is found in working directory only,\n -1 on other errors."},"description":"

Lookup submodule information by name or path.

\n","comments":"

Given either the submodule name or path (they are usually the same), this\n returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n
    \n
  • The submodule is not mentioned in the HEAD, the index, and the config,\nbut does "exist" in the working directory (i.e. there is a subdirectory\nthat appears to be a Git repository). In this case, this function\nreturns GIT_EEXISTS to indicate a sub-repository exists but not in a\nstate where a git_submodule can be instantiated.
  • \n
  • The submodule is not mentioned in the HEAD, index, or config and the\nworking directory doesn't contain a value git repo at that path.\nThere may or may not be anything else at that path, but nothing that\nlooks like a submodule. In this case, this returns GIT_ENOTFOUND.
  • \n
\n\n

You must call git_submodule_free when done with the submodule.

\n","group":"submodule"},"git_submodule_free":{"type":"function","file":"submodule.h","line":220,"lineto":220,"args":[{"name":"submodule","type":"git_submodule *","comment":"Submodule object"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"void","comment":null},"description":"

Release a submodule

\n","comments":"","group":"submodule"},"git_submodule_foreach":{"type":"function","file":"submodule.h","line":240,"lineto":243,"args":[{"name":"repo","type":"git_repository *","comment":"The repository"},{"name":"callback","type":"int (*)(git_submodule *, const char *, void *)","comment":"Function to be called with the name of each submodule.\n Return a non-zero value to terminate the iteration."},{"name":"payload","type":"void *","comment":"Extra data to pass to callback"}],"argline":"git_repository *repo, int (*)(git_submodule *, const char *, void *) callback, void *payload","sig":"git_repository *::int (*)(git_submodule *, const char *, void *)::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.

\n","comments":"

See the note on git_submodule above. This iterates over the tracked\n submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like\n submodules but are not tracked, the diff API will generate a diff record\n for workdir items that look like submodules but are not tracked, showing\n them as added in the workdir. Also, the status API will treat the entire\n subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n","group":"submodule","examples":{"status.c":["ex/v0.23.2/status.html#git_submodule_foreach-23"]}},"git_submodule_add_setup":{"type":"function","file":"submodule.h","line":270,"lineto":275,"args":[{"name":"out","type":"git_submodule **","comment":"The newly created submodule ready to open for clone"},{"name":"repo","type":"git_repository *","comment":"The repository in which you want to create the submodule"},{"name":"url","type":"const char *","comment":"URL for the submodule's 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\n .git/modules vs. repo directly in workdir."}],"argline":"git_submodule **out, git_repository *repo, const char *url, const char *path, int 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,\n -1 on other errors."},"description":"

Set up a new git submodule for checkout.

\n","comments":"

This does "git submodule add" up to the fetch and checkout of the\n submodule contents. It preps a new submodule, creates an entry in\n .gitmodules and creates an empty initialized repository either at the\n given path in the working directory or in .git/modules with a gitlink\n from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the\n submodule 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\n

You must call git_submodule_free on the submodule object when done.

\n","group":"submodule"},"git_submodule_add_finalize":{"type":"function","file":"submodule.h","line":287,"lineto":287,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to finish adding."}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":null},"description":"

Resolve the setup of a new git submodule.

\n","comments":"

This should be called on a submodule once you have called add setup\n and done the clone of the submodule. This adds the .gitmodules file\n and 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":299,"lineto":301,"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\n file. If you pass this as false, you will have to get the\n git_index and explicitly call `git_index_write()` on it to\n save the change."}],"argline":"git_submodule *submodule, int write_index","sig":"git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Add current submodule HEAD commit to index of superproject.

\n","comments":"","group":"submodule"},"git_submodule_owner":{"type":"function","file":"submodule.h","line":314,"lineto":314,"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.

\n","comments":"

This returns a pointer to the repository that contains the submodule.\n This is a just a reference to the repository that was passed to the\n original git_submodule_lookup() call, so if that repository has been\n freed, then this may be a dangling reference.

\n","group":"submodule"},"git_submodule_name":{"type":"function","file":"submodule.h","line":322,"lineto":322,"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.

\n","comments":"","group":"submodule","examples":{"status.c":["ex/v0.23.2/status.html#git_submodule_name-24"]}},"git_submodule_path":{"type":"function","file":"submodule.h","line":333,"lineto":333,"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.

\n","comments":"

The path is almost always the same as the submodule name, but the\n two are actually not required to match.

\n","group":"submodule","examples":{"status.c":["ex/v0.23.2/status.html#git_submodule_path-25"]}},"git_submodule_url":{"type":"function","file":"submodule.h","line":341,"lineto":341,"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.

\n","comments":"","group":"submodule"},"git_submodule_resolve_url":{"type":"function","file":"submodule.h","line":351,"lineto":351,"args":[{"name":"out","type":"git_buf *","comment":"buffer to store the absolute submodule url in"},{"name":"repo","type":"git_repository *","comment":"Pointer to repository object"},{"name":"url","type":"const char *","comment":"Relative url"}],"argline":"git_buf *out, git_repository *repo, const char *url","sig":"git_buf *::git_repository *::const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Resolve a submodule url relative to the given repository.

\n","comments":"","group":"submodule"},"git_submodule_branch":{"type":"function","file":"submodule.h","line":359,"lineto":359,"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 branch"},"description":"

Get the branch for the submodule.

\n","comments":"","group":"submodule"},"git_submodule_set_branch":{"type":"function","file":"submodule.h","line":372,"lineto":372,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to affect"},{"name":"name","type":"const char *","comment":"the name of the submodule to configure"},{"name":"branch","type":"const char *","comment":"Branch that should be used for the submodule"}],"argline":"git_repository *repo, const char *name, const char *branch","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set the branch for the submodule in the configuration

\n","comments":"

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n","group":"submodule"},"git_submodule_set_url":{"type":"function","file":"submodule.h","line":386,"lineto":386,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to affect"},{"name":"name","type":"const char *","comment":"the name of the submodule to configure"},{"name":"url","type":"const char *","comment":"URL that should be used for the submodule"}],"argline":"git_repository *repo, const char *name, const char *url","sig":"git_repository *::const char *::const char *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set the URL for the submodule in the configuration

\n","comments":"

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n","group":"submodule"},"git_submodule_index_id":{"type":"function","file":"submodule.h","line":394,"lineto":394,"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.

\n","comments":"","group":"submodule"},"git_submodule_head_id":{"type":"function","file":"submodule.h","line":402,"lineto":402,"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.

\n","comments":"","group":"submodule"},"git_submodule_wd_id":{"type":"function","file":"submodule.h","line":415,"lineto":415,"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.

\n","comments":"

This returns the OID that corresponds to looking up 'HEAD' in the checked\n out submodule. If there are pending changes in the index or anything\n else, this won't notice that. You should call git_submodule_status()\n for a more complete picture about the state of the working directory.

\n","group":"submodule"},"git_submodule_ignore":{"type":"function","file":"submodule.h","line":440,"lineto":441,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to check"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_ignore_t","comment":" The current git_submodule_ignore_t valyue what will be used for\n this submodule."},"description":"

Get the ignore rule that will be used for the submodule.

\n","comments":"

These values control the behavior of git_submodule_status() for this\n submodule. There are four ignore values:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_NONE will consider any change to the contents\nof the submodule from a clean checkout to be dirty, including the\naddition of untracked files. This is the default if unspecified.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED examines the contents of the\nworking tree (i.e. call git_status_foreach() on the submodule) but\nUNTRACKED files will not count as making the submodule dirty.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY means to only check if the HEAD of the\nsubmodule has moved for status. This is fast since it does not need to\nscan the working tree of the submodule at all.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL means not to open the submodule repo.\nThe working directory will be consider clean so long as there is a\nchecked out version present.
  • \n
\n","group":"submodule"},"git_submodule_set_ignore":{"type":"function","file":"submodule.h","line":453,"lineto":456,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to affect"},{"name":"name","type":"const char *","comment":"the name of the submdule"},{"name":"ignore","type":"git_submodule_ignore_t","comment":"The new value for the ignore rule"}],"argline":"git_repository *repo, const char *name, git_submodule_ignore_t ignore","sig":"git_repository *::const char *::git_submodule_ignore_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the ignore rule for the submodule in the configuration

\n","comments":"

This does not affect any currently-loaded instances.

\n","group":"submodule"},"git_submodule_update_strategy":{"type":"function","file":"submodule.h","line":468,"lineto":469,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to check"}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_update_t","comment":" The current git_submodule_update_t value that will be used\n for this submodule."},"description":"

Get the update rule that will be used for the submodule.

\n","comments":"

This value controls the behavior of the git submodule update command.\n There are four useful values documented with git_submodule_update_t.

\n","group":"submodule"},"git_submodule_set_update":{"type":"function","file":"submodule.h","line":481,"lineto":484,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to affect"},{"name":"name","type":"const char *","comment":"the name of the submodule to configure"},{"name":"update","type":"git_submodule_update_t","comment":"The new value to use"}],"argline":"git_repository *repo, const char *name, git_submodule_update_t update","sig":"git_repository *::const char *::git_submodule_update_t","return":{"type":"int","comment":" 0 or an error code"},"description":"

Set the update rule for the submodule in the configuration

\n","comments":"

This setting won't affect any existing instances.

\n","group":"submodule"},"git_submodule_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":497,"lineto":498,"args":[{"name":"submodule","type":"git_submodule *","comment":null}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"git_submodule_recurse_t","comment":" 0 if fetchRecurseSubmodules is false, 1 if true"},"description":"

Read the fetchRecurseSubmodules rule for a submodule.

\n","comments":"

This accesses the submodule.\n<name

\n\n
\n

.fetchRecurseSubmodules value for\n the submodule that controls fetching behavior for the submodule.

\n
\n\n

Note that at this time, libgit2 does not honor this setting and the\n fetch functionality current ignores submodules.

\n","group":"submodule"},"git_submodule_set_fetch_recurse_submodules":{"type":"function","file":"submodule.h","line":510,"lineto":513,"args":[{"name":"repo","type":"git_repository *","comment":"the repository to affect"},{"name":"name","type":"const char *","comment":"the submodule to configure"},{"name":"fetch_recurse_submodules","type":"git_submodule_recurse_t","comment":"Boolean value"}],"argline":"git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules","sig":"git_repository *::const char *::git_submodule_recurse_t","return":{"type":"int","comment":" old value for fetchRecurseSubmodules"},"description":"

Set the fetchRecurseSubmodules rule for a submodule in the configuration

\n","comments":"

This setting won't affect any existing instances.

\n","group":"submodule"},"git_submodule_init":{"type":"function","file":"submodule.h","line":528,"lineto":528,"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,\n 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, \n<\n0 on failure."},"description":"

Copy submodule info into ".git/config" file.

\n","comments":"

Just like "git submodule init", this copies information about the\n submodule into ".git/config". You can use the accessor functions\n above to alter the in-memory git_submodule object and control what\n is written to the config, overriding what is in .gitmodules.

\n","group":"submodule"},"git_submodule_repo_init":{"type":"function","file":"submodule.h","line":543,"lineto":546,"args":[{"name":"out","type":"git_repository **","comment":"Output pointer to the created git repository."},{"name":"sm","type":"const git_submodule *","comment":"The submodule to create a new subrepository from."},{"name":"use_gitlink","type":"int","comment":"Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir."}],"argline":"git_repository **out, const git_submodule *sm, int use_gitlink","sig":"git_repository **::const git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure."},"description":"

Set up the subrepository for a submodule in preparation for clone.

\n","comments":"

This function can be called to init and set up a submodule\n repository from a submodule in preparation to clone it from\n its remote.

\n","group":"submodule"},"git_submodule_sync":{"type":"function","file":"submodule.h","line":556,"lineto":556,"args":[{"name":"submodule","type":"git_submodule *","comment":null}],"argline":"git_submodule *submodule","sig":"git_submodule *","return":{"type":"int","comment":null},"description":"

Copy submodule remote info into submodule repo.

\n","comments":"

This copies the information about the submodules URL into the checked out\n submodule config, acting like "git submodule sync". This is useful if\n you have altered the URL for the submodule (or it has been altered by a\n fetch of upstream changes) and you need to update your local repo.

\n","group":"submodule"},"git_submodule_open":{"type":"function","file":"submodule.h","line":570,"lineto":572,"args":[{"name":"repo","type":"git_repository **","comment":"Pointer to the submodule repo which was opened"},{"name":"submodule","type":"git_submodule *","comment":"Submodule to be opened"}],"argline":"git_repository **repo, git_submodule *submodule","sig":"git_repository **::git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 if submodule repo could not be opened."},"description":"

Open the repository for a submodule.

\n","comments":"

This is a newly opened repository object. The caller is responsible for\n calling git_repository_free() on it when done. Multiple calls to this\n function will return distinct git_repository objects. This will only\n work if the submodule is checked out into the working directory.

\n","group":"submodule"},"git_submodule_reload":{"type":"function","file":"submodule.h","line":584,"lineto":584,"args":[{"name":"submodule","type":"git_submodule *","comment":"The submodule to reload"},{"name":"force","type":"int","comment":"Force reload even if the data doesn't seem out of date"}],"argline":"git_submodule *submodule, int force","sig":"git_submodule *::int","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Reread submodule info from config, index, and HEAD.

\n","comments":"

Call this to reread cached submodule information for this submodule if\n you have reason to believe that it has changed.

\n","group":"submodule"},"git_submodule_status":{"type":"function","file":"submodule.h","line":600,"lineto":604,"args":[{"name":"status","type":"unsigned int *","comment":"Combination of `GIT_SUBMODULE_STATUS` flags"},{"name":"repo","type":"git_repository *","comment":"the repository in which to look"},{"name":"name","type":"const char *","comment":"name of the submodule"},{"name":"ignore","type":"git_submodule_ignore_t","comment":"the ignore rules to follow"}],"argline":"unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore","sig":"unsigned int *::git_repository *::const char *::git_submodule_ignore_t","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get the status for a submodule.

\n","comments":"

This looks at a submodule and tries to determine the status. It\n will return a combination of the GIT_SUBMODULE_STATUS values above.\n How deeply it examines the working directory to do this will depend\n on the git_submodule_ignore_t value for the submodule.

\n","group":"submodule","examples":{"status.c":["ex/v0.23.2/status.html#git_submodule_status-26"]}},"git_submodule_location":{"type":"function","file":"submodule.h","line":620,"lineto":622,"args":[{"name":"location_status","type":"unsigned int *","comment":"Combination of first four `GIT_SUBMODULE_STATUS` flags"},{"name":"submodule","type":"git_submodule *","comment":"Submodule for which to get status"}],"argline":"unsigned int *location_status, git_submodule *submodule","sig":"unsigned int *::git_submodule *","return":{"type":"int","comment":" 0 on success, \n<\n0 on error"},"description":"

Get the locations of submodule information.

\n","comments":"

This is a bit like a very lightweight version of git_submodule_status.\n It just returns a made of the first four submodule status values (i.e.\n the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the\n submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.).\n This can be useful if you want to know if the submodule is present in the\n working directory at this point in time, etc.

\n","group":"submodule"},"git_commit_create_from_ids":{"type":"function","file":"sys/commit.h","line":34,"lineto":44,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_oid *","comment":null},{"name":"parent_count","type":"size_t","comment":null},{"name":"parents","type":"const git_oid *[]","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]","return":{"type":"int","comment":null},"description":"

Create new commit in the repository from a list of git_oid values.

\n","comments":"

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree and\n parents now take git_oid. This is a dangerous API in that nor\n the tree, neither the parents list of git_oids are checked for\n validity.

\n","group":"commit"},"git_commit_create_from_callback":{"type":"function","file":"sys/commit.h","line":66,"lineto":76,"args":[{"name":"id","type":"git_oid *","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"update_ref","type":"const char *","comment":null},{"name":"author","type":"const git_signature *","comment":null},{"name":"committer","type":"const git_signature *","comment":null},{"name":"message_encoding","type":"const char *","comment":null},{"name":"message","type":"const char *","comment":null},{"name":"tree","type":"const git_oid *","comment":null},{"name":"parent_cb","type":"git_commit_parent_callback","comment":null},{"name":"parent_payload","type":"void *","comment":null}],"argline":"git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, void *parent_payload","sig":"git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::git_commit_parent_callback::void *","return":{"type":"int","comment":null},"description":"

Create a new commit in the repository with an callback to supply parents.

\n","comments":"

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree takes a\n git_oid and doesn't check for validity, and parent_cb is invoked\n with parent_payload and should return git_oid values or NULL to\n indicate that all parents are accounted for.

\n","group":"commit"},"git_config_init_backend":{"type":"function","file":"sys/config.h","line":83,"lineto":85,"args":[{"name":"backend","type":"git_config_backend *","comment":"the `git_config_backend` struct to initialize."},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`"}],"argline":"git_config_backend *backend, unsigned int version","sig":"git_config_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_config_backend with default values. Equivalent to\n creating an instance with GIT_CONFIG_BACKEND_INIT.

\n","comments":"","group":"config"},"git_config_add_backend":{"type":"function","file":"sys/config.h","line":105,"lineto":109,"args":[{"name":"cfg","type":"git_config *","comment":"the configuration to add the file to"},{"name":"file","type":"git_config_backend *","comment":"the configuration file (backend) to add"},{"name":"level","type":"git_config_level_t","comment":"the priority level of the backend"},{"name":"force","type":"int","comment":"if a config file already exists for the given\n priority level, replace it"}],"argline":"git_config *cfg, git_config_backend *file, git_config_level_t level, int force","sig":"git_config *::git_config_backend *::git_config_level_t::int","return":{"type":"int","comment":" 0 on success, GIT_EEXISTS when adding more than one file\n 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

\n","comments":"

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n","group":"config"},"git_diff_print_callback__to_buf":{"type":"function","file":"sys/diff.h","line":37,"lineto":41,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

Diff print callback that writes to a git_buf.

\n","comments":"

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You\n must pass a git_buf * value as the payload to the git_diff_print\n and/or git_patch_print function. The data will be appended to the\n buffer (after any existing content).

\n","group":"diff"},"git_diff_print_callback__to_file_handle":{"type":"function","file":"sys/diff.h","line":57,"lineto":61,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

Diff print callback that writes to stdio FILE handle.

\n","comments":"

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You\n must pass a FILE * value (such as stdout or stderr or the return\n value from fopen()) as the payload to the git_diff_print\n and/or git_patch_print function. If you pass NULL, this will write\n data to stdout.

\n","group":"diff"},"git_diff_get_perfdata":{"type":"function","file":"sys/diff.h","line":83,"lineto":84,"args":[{"name":"out","type":"git_diff_perfdata *","comment":"Structure to be filled with diff performance data"},{"name":"diff","type":"const git_diff *","comment":"Diff to read performance data from"}],"argline":"git_diff_perfdata *out, const git_diff *diff","sig":"git_diff_perfdata *::const git_diff *","return":{"type":"int","comment":" 0 for success, \n<\n0 for error"},"description":"

Get performance data for a diff object.

\n","comments":"","group":"diff"},"git_status_list_get_perfdata":{"type":"function","file":"sys/diff.h","line":89,"lineto":90,"args":[{"name":"out","type":"git_diff_perfdata *","comment":null},{"name":"status","type":"const git_status_list *","comment":null}],"argline":"git_diff_perfdata *out, const git_status_list *status","sig":"git_diff_perfdata *::const git_status_list *","return":{"type":"int","comment":null},"description":"

Get performance data for diffs from a git_status_list

\n","comments":"","group":"status"},"git_filter_lookup":{"type":"function","file":"sys/filter.h","line":27,"lineto":27,"args":[{"name":"name","type":"const char *","comment":"The name of the filter"}],"argline":"const char *name","sig":"const char *","return":{"type":"git_filter *","comment":" Pointer to the filter object or NULL if not found"},"description":"

Look up a filter by name

\n","comments":"","group":"filter"},"git_filter_list_new":{"type":"function","file":"sys/filter.h","line":57,"lineto":61,"args":[{"name":"out","type":"git_filter_list **","comment":null},{"name":"repo","type":"git_repository *","comment":null},{"name":"mode","type":"git_filter_mode_t","comment":null},{"name":"options","type":"uint32_t","comment":null}],"argline":"git_filter_list **out, git_repository *repo, git_filter_mode_t mode, uint32_t options","sig":"git_filter_list **::git_repository *::git_filter_mode_t::uint32_t","return":{"type":"int","comment":null},"description":"

Create a new empty filter list

\n","comments":"

Normally you won't use this because git_filter_list_load will create\n the filter list for you, but you can use this in combination with the\n git_filter_lookup and git_filter_list_push functions to assemble\n your own chains of filters.

\n","group":"filter"},"git_filter_list_push":{"type":"function","file":"sys/filter.h","line":76,"lineto":77,"args":[{"name":"fl","type":"git_filter_list *","comment":null},{"name":"filter","type":"git_filter *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_filter_list *fl, git_filter *filter, void *payload","sig":"git_filter_list *::git_filter *::void *","return":{"type":"int","comment":null},"description":"

Add a filter to a filter list with the given payload.

\n","comments":"

Normally you won't have to do this because the filter list is created\n by calling the "check" function on registered filters when the filter\n attributes are set, but this does allow more direct manipulation of\n filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the\n filter. Using this function, you can either pass in a payload if you\n know the expected payload format, or you can pass NULL. Some filters\n may fail with a NULL payload. Good luck!

\n","group":"filter"},"git_filter_list_length":{"type":"function","file":"sys/filter.h","line":90,"lineto":90,"args":[{"name":"fl","type":"const git_filter_list *","comment":"A filter list"}],"argline":"const git_filter_list *fl","sig":"const git_filter_list *","return":{"type":"size_t","comment":" The number of filters in the list"},"description":"

Look up how many filters are in the list

\n","comments":"

We will attempt to apply all of these filters to any data passed in,\n but note that the filter apply action still has the option of skipping\n data that is passed in (for example, the CRLF filter will skip data\n that appears to be binary).

\n","group":"filter"},"git_filter_source_repo":{"type":"function","file":"sys/filter.h","line":100,"lineto":100,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"git_repository *","comment":null},"description":"

Get the repository that the source data is coming from.

\n","comments":"","group":"filter"},"git_filter_source_path":{"type":"function","file":"sys/filter.h","line":105,"lineto":105,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"const char *","comment":null},"description":"

Get the path that the source data is coming from.

\n","comments":"","group":"filter"},"git_filter_source_filemode":{"type":"function","file":"sys/filter.h","line":111,"lineto":111,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"uint16_t","comment":null},"description":"

Get the file mode of the source file\n If the mode is unknown, this will return 0

\n","comments":"","group":"filter"},"git_filter_source_id":{"type":"function","file":"sys/filter.h","line":118,"lineto":118,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"const git_oid *","comment":null},"description":"

Get the OID of the source\n If the OID is unknown (often the case with GIT_FILTER_CLEAN) then\n this will return NULL.

\n","comments":"","group":"filter"},"git_filter_source_mode":{"type":"function","file":"sys/filter.h","line":123,"lineto":123,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"git_filter_mode_t","comment":null},"description":"

Get the git_filter_mode_t to be used

\n","comments":"","group":"filter"},"git_filter_source_flags":{"type":"function","file":"sys/filter.h","line":128,"lineto":128,"args":[{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"const git_filter_source *src","sig":"const git_filter_source *","return":{"type":"uint32_t","comment":null},"description":"

Get the combination git_filter_flag_t options to be applied

\n","comments":"","group":"filter"},"git_filter_register":{"type":"function","file":"sys/filter.h","line":289,"lineto":290,"args":[{"name":"name","type":"const char *","comment":"A name by which the filter can be referenced. Attempting\n \t\t\tto register with an in-use name will return GIT_EEXISTS."},{"name":"filter","type":"git_filter *","comment":"The filter definition. This pointer will be stored as is\n \t\t\tby libgit2 so it must be a durable allocation (either static\n \t\t\tor on the heap)."},{"name":"priority","type":"int","comment":"The priority for filter application"}],"argline":"const char *name, git_filter *filter, int priority","sig":"const char *::git_filter *::int","return":{"type":"int","comment":" 0 on successful registry, error code \n<\n0 on failure"},"description":"

Register a filter under a given name with a given priority.

\n","comments":"

As mentioned elsewhere, the initialize callback will not be invoked\n immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be\n issued in order of priority on smudge (to workdir), and in reverse\n order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2:\n - GIT_FILTER_CRLF with priority 0\n - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n","group":"filter"},"git_filter_unregister":{"type":"function","file":"sys/filter.h","line":305,"lineto":305,"args":[{"name":"name","type":"const char *","comment":"The name under which the filter was registered"}],"argline":"const char *name","sig":"const char *","return":{"type":"int","comment":" 0 on success, error code \n<\n0 on failure"},"description":"

Remove the filter with the given name

\n","comments":"

Attempting to remove the builtin libgit2 filters is not permitted and\n will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n","group":"filter"},"git_hashsig_create":{"type":"function","file":"sys/hashsig.h","line":62,"lineto":66,"args":[{"name":"out","type":"git_hashsig **","comment":"The computed similarity signature."},{"name":"buf","type":"const char *","comment":"The input buffer."},{"name":"buflen","type":"size_t","comment":"The input buffer size."},{"name":"opts","type":"git_hashsig_option_t","comment":"The signature computation options (see above)."}],"argline":"git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts","sig":"git_hashsig **::const char *::size_t::git_hashsig_option_t","return":{"type":"int","comment":" 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code."},"description":"

Compute a similarity signature for a text buffer

\n","comments":"

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the\n whitespace will be removed from the buffer while it is being processed,\n modifying the buffer in place. Sorry about that!

\n","group":"hashsig"},"git_hashsig_create_fromfile":{"type":"function","file":"sys/hashsig.h","line":81,"lineto":84,"args":[{"name":"out","type":"git_hashsig **","comment":"The computed similarity signature."},{"name":"path","type":"const char *","comment":"The path to the input file."},{"name":"opts","type":"git_hashsig_option_t","comment":"The signature computation options (see above)."}],"argline":"git_hashsig **out, const char *path, git_hashsig_option_t opts","sig":"git_hashsig **::const char *::git_hashsig_option_t","return":{"type":"int","comment":" 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code."},"description":"

Compute a similarity signature for a text file

\n","comments":"

This walks through the file, only loading a maximum of 4K of file data at\n a time. Otherwise, it acts just like git_hashsig_create.

\n","group":"hashsig"},"git_hashsig_free":{"type":"function","file":"sys/hashsig.h","line":91,"lineto":91,"args":[{"name":"sig","type":"git_hashsig *","comment":"The similarity signature to free."}],"argline":"git_hashsig *sig","sig":"git_hashsig *","return":{"type":"void","comment":null},"description":"

Release memory for a content similarity signature

\n","comments":"","group":"hashsig"},"git_hashsig_compare":{"type":"function","file":"sys/hashsig.h","line":100,"lineto":102,"args":[{"name":"a","type":"const git_hashsig *","comment":"The first similarity signature to compare."},{"name":"b","type":"const git_hashsig *","comment":"The second similarity signature to compare."}],"argline":"const git_hashsig *a, const git_hashsig *b","sig":"const git_hashsig *::const git_hashsig *","return":{"type":"int","comment":" [0 to 100] on success as the similarity score, or error code."},"description":"

Measure similarity score between two similarity signatures

\n","comments":"","group":"hashsig"},"git_mempack_new":{"type":"function","file":"sys/mempack.h","line":44,"lineto":44,"args":[{"name":"out","type":"git_odb_backend **","comment":"Poiter where to store the ODB backend"}],"argline":"git_odb_backend **out","sig":"git_odb_backend **","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"
Instantiate a new mempack backend.\n
\n","comments":"
The backend must be added to an existing ODB with the highest\npriority.\n\n    git_mempack_new(\n
\n\n

&mempacker\n);\n git_repository_odb(\n&odb\n, repository);\n git_odb_add_backend(odb, mempacker, 999);

\n\n
Once the backend has been loaded, all writes to the ODB will\ninstead be queued in memory, and can be finalized with\n`git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store\nto ensure consistency, until the memory store is dumped.\n
\n","group":"mempack"},"git_mempack_reset":{"type":"function","file":"sys/mempack.h","line":81,"lineto":81,"args":[{"name":"backend","type":"git_odb_backend *","comment":"The mempack backend"}],"argline":"git_odb_backend *backend","sig":"git_odb_backend *","return":{"type":"void","comment":null},"description":"
Reset the memory packer by clearing all the queued objects.\n
\n","comments":"
This assumes that `git_mempack_dump` has been called before to\nstore all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"\nall the recently written objects, giving transaction-like\nsemantics to the Git repository.\n
\n","group":"mempack"},"git_odb_init_backend":{"type":"function","file":"sys/odb_backend.h","line":100,"lineto":102,"args":[{"name":"backend","type":"git_odb_backend *","comment":"the `git_odb_backend` struct to initialize."},{"name":"version","type":"unsigned int","comment":"Version the struct; pass `GIT_ODB_BACKEND_VERSION`"}],"argline":"git_odb_backend *backend, unsigned int version","sig":"git_odb_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_odb_backend with default values. Equivalent to\n creating an instance with GIT_ODB_BACKEND_INIT.

\n","comments":"","group":"odb"},"git_openssl_set_locking":{"type":"function","file":"sys/openssl.h","line":34,"lineto":34,"args":[],"argline":"","sig":"","return":{"type":"int","comment":" 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support."},"description":"

Initialize the OpenSSL locks

\n","comments":"

OpenSSL requires the application to determine how it performs\n locking.

\n\n

This is a last-resort convenience function which libgit2 provides for\n allocating and initializing the locks as well as setting the\n locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed\n when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it\n likely sets up locking. You should very strongly prefer that over\n this function.

\n","group":"openssl"},"git_refdb_init_backend":{"type":"function","file":"sys/refdb_backend.h","line":182,"lineto":184,"args":[{"name":"backend","type":"git_refdb_backend *","comment":"the `git_refdb_backend` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_REFDB_BACKEND_VERSION`"}],"argline":"git_refdb_backend *backend, unsigned int version","sig":"git_refdb_backend *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_refdb_backend with default values. Equivalent to\n creating an instance with GIT_REFDB_BACKEND_INIT.

\n","comments":"","group":"refdb"},"git_refdb_backend_fs":{"type":"function","file":"sys/refdb_backend.h","line":197,"lineto":199,"args":[{"name":"backend_out","type":"git_refdb_backend **","comment":"Output pointer to the git_refdb_backend object"},{"name":"repo","type":"git_repository *","comment":"Git repository to access"}],"argline":"git_refdb_backend **backend_out, git_repository *repo","sig":"git_refdb_backend **::git_repository *","return":{"type":"int","comment":" 0 on success, \n<\n0 error code on failure"},"description":"

Constructors for default filesystem-based refdb backend

\n","comments":"

Under normal usage, this is called for you when the repository is\n opened / created, but you can use this to explicitly construct a\n filesystem refdb backend for a repository.

\n","group":"refdb"},"git_refdb_set_backend":{"type":"function","file":"sys/refdb_backend.h","line":211,"lineto":213,"args":[{"name":"refdb","type":"git_refdb *","comment":"database to add the backend to"},{"name":"backend","type":"git_refdb_backend *","comment":"pointer to a git_refdb_backend instance"}],"argline":"git_refdb *refdb, git_refdb_backend *backend","sig":"git_refdb *::git_refdb_backend *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Sets the custom backend to an existing reference DB

\n","comments":"

The git_refdb will take ownership of the git_refdb_backend so you\n should NOT free it after calling this function.

\n","group":"refdb"},"git_reference__alloc":{"type":"function","file":"sys/refs.h","line":31,"lineto":34,"args":[{"name":"name","type":"const char *","comment":"the reference name"},{"name":"oid","type":"const git_oid *","comment":"the object id for a direct reference"},{"name":"peel","type":"const git_oid *","comment":"the first non-tag object's OID, or NULL"}],"argline":"const char *name, const git_oid *oid, const git_oid *peel","sig":"const char *::const git_oid *::const git_oid *","return":{"type":"git_reference *","comment":" the created git_reference or NULL on error"},"description":"

Create a new direct reference from an OID.

\n","comments":"","group":"reference"},"git_reference__alloc_symbolic":{"type":"function","file":"sys/refs.h","line":43,"lineto":45,"args":[{"name":"name","type":"const char *","comment":"the reference name"},{"name":"target","type":"const char *","comment":"the target for a symbolic reference"}],"argline":"const char *name, const char *target","sig":"const char *::const char *","return":{"type":"git_reference *","comment":" the created git_reference or NULL on error"},"description":"

Create a new symbolic reference.

\n","comments":"","group":"reference"},"git_repository_new":{"type":"function","file":"sys/repository.h","line":31,"lineto":31,"args":[{"name":"out","type":"git_repository **","comment":"The blank repository"}],"argline":"git_repository **out","sig":"git_repository **","return":{"type":"int","comment":" 0 on success, or an error code"},"description":"

Create a new repository with neither backends nor config object

\n","comments":"

Note that this is only useful if you wish to associate the repository\n with a non-filesystem-backed object database and config store.

\n","group":"repository"},"git_repository__cleanup":{"type":"function","file":"sys/repository.h","line":44,"lineto":44,"args":[{"name":"repo","type":"git_repository *","comment":null}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"void","comment":null},"description":"

Reset all the internal state in a repository.

\n","comments":"

This will free all the mapped memory and internal objects\n of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're\n trying to aggressively cleanup the repo before its\n deallocation. git_repository_free already performs this operation\n before deallocation the repo.

\n","group":"repository"},"git_repository_reinit_filesystem":{"type":"function","file":"sys/repository.h","line":61,"lineto":63,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"recurse_submodules","type":"int","comment":"Should submodules be updated recursively"}],"argline":"git_repository *repo, int recurse_submodules","sig":"git_repository *::int","return":{"type":"int","comment":" 0 on success, \n<\n 0 on error"},"description":"

Update the filesystem config settings for an open repository

\n","comments":"

When a repository is initialized, config values are set based on the\n properties of the filesystem that the repository is on, such as\n "core.ignorecase", "core.filemode", "core.symlinks", etc. If the\n repository is moved to a new filesystem, these properties may no\n longer be correct and API calls may not behave as expected. This\n call reruns the phase of repository initialization that sets those\n properties to compensate for the current filesystem of the repo.

\n","group":"repository"},"git_repository_set_config":{"type":"function","file":"sys/repository.h","line":78,"lineto":78,"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","comment":null},"description":"

Set the configuration file for this repository

\n","comments":"

This configuration file will be used for all configuration\n queries involving this repository.

\n\n

The repository will keep a reference to the config file;\n the user must still free the config after setting it\n to the repository, or it will leak.

\n","group":"repository"},"git_repository_set_odb":{"type":"function","file":"sys/repository.h","line":93,"lineto":93,"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","comment":null},"description":"

Set the Object Database for this repository

\n","comments":"

The ODB will be used for all object-related operations\n involving this repository.

\n\n

The repository will keep a reference to the ODB; the user\n must still free the ODB object after setting it to the\n repository, or it will leak.

\n","group":"repository"},"git_repository_set_refdb":{"type":"function","file":"sys/repository.h","line":108,"lineto":108,"args":[{"name":"repo","type":"git_repository *","comment":"A repository object"},{"name":"refdb","type":"git_refdb *","comment":"An refdb object"}],"argline":"git_repository *repo, git_refdb *refdb","sig":"git_repository *::git_refdb *","return":{"type":"void","comment":null},"description":"

Set the Reference Database Backend for this repository

\n","comments":"

The refdb will be used for all reference related operations\n involving this repository.

\n\n

The repository will keep a reference to the refdb; the user\n must still free the refdb object after setting it to the\n repository, or it will leak.

\n","group":"repository"},"git_repository_set_index":{"type":"function","file":"sys/repository.h","line":123,"lineto":123,"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","comment":null},"description":"

Set the index file for this repository

\n","comments":"

This index will be used for all index-related operations\n involving this repository.

\n\n

The repository will keep a reference to the index file;\n the user must still free the index after setting it\n to the repository, or it will leak.

\n","group":"repository"},"git_repository_set_bare":{"type":"function","file":"sys/repository.h","line":136,"lineto":136,"args":[{"name":"repo","type":"git_repository *","comment":"Repo to make bare"}],"argline":"git_repository *repo","sig":"git_repository *","return":{"type":"int","comment":" 0 on success, \n<\n0 on failure"},"description":"

Set a repository to be bare.

\n","comments":"

Clear the working directory and set core.bare to true. You may also\n want to call git_repository_set_index(repo, NULL) since a bare repo\n typically does not have an index, but this function will not do that\n for you.

\n","group":"repository"},"git_transport_init":{"type":"function","file":"sys/transport.h","line":111,"lineto":113,"args":[{"name":"opts","type":"git_transport *","comment":"the `git_transport` struct to initialize"},{"name":"version","type":"unsigned int","comment":"Version of struct; pass `GIT_TRANSPORT_VERSION`"}],"argline":"git_transport *opts, unsigned int version","sig":"git_transport *::unsigned int","return":{"type":"int","comment":" Zero on success; -1 on failure."},"description":"

Initializes a git_transport with default values. Equivalent to\n creating an instance with GIT_TRANSPORT_INIT.

\n","comments":"","group":"transport"},"git_transport_new":{"type":"function","file":"sys/transport.h","line":125,"lineto":125,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"url","type":"const char *","comment":"The URL to connect to"}],"argline":"git_transport **out, git_remote *owner, const char *url","sig":"git_transport **::git_remote *::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\n is scanned to find a transport that implements the scheme of the URI (i.e.\n git:// or http://) and a transport object is returned to the caller.

\n","comments":"","group":"transport"},"git_transport_ssh_with_paths":{"type":"function","file":"sys/transport.h","line":141,"lineto":141,"args":[{"name":"out","type":"git_transport **","comment":"the resulting transport"},{"name":"owner","type":"git_remote *","comment":"the owning remote"},{"name":"payload","type":"void *","comment":"a strarray with the paths"}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an ssh transport with custom git command paths

\n","comments":"

This is a factory function suitable for setting as the transport\n callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for\n the git-upload-pack and git-receive-pack at index 0 and 1.

\n","group":"transport"},"git_transport_unregister":{"type":"function","file":"sys/transport.h","line":169,"lineto":170,"args":[{"name":"prefix","type":"const char *","comment":"From the previous call to git_transport_register"}],"argline":"const char *prefix","sig":"const char *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Unregister a custom transport definition which was previously registered\n with git_transport_register.

\n","comments":"","group":"transport"},"git_transport_dummy":{"type":"function","file":"sys/transport.h","line":183,"lineto":186,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the dummy transport.

\n","comments":"","group":"transport"},"git_transport_local":{"type":"function","file":"sys/transport.h","line":196,"lineto":199,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"You must pass NULL for this parameter."}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the local transport.

\n","comments":"","group":"transport"},"git_transport_smart":{"type":"function","file":"sys/transport.h","line":209,"lineto":212,"args":[{"name":"out","type":"git_transport **","comment":"The newly created transport (out)"},{"name":"owner","type":"git_remote *","comment":"The git_remote which will own this transport"},{"name":"payload","type":"void *","comment":"A pointer to a git_smart_subtransport_definition"}],"argline":"git_transport **out, git_remote *owner, void *payload","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the smart transport.

\n","comments":"","group":"transport"},"git_smart_subtransport_http":{"type":"function","file":"sys/transport.h","line":322,"lineto":325,"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"},{"name":"param","type":"void *","comment":null}],"argline":"git_smart_subtransport **out, git_transport *owner, void *param","sig":"git_smart_subtransport **::git_transport *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the http subtransport. This subtransport\n also supports https. On Win32, this subtransport may be implemented\n using the WinHTTP library.

\n","comments":"","group":"smart"},"git_smart_subtransport_git":{"type":"function","file":"sys/transport.h","line":334,"lineto":337,"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"},{"name":"param","type":"void *","comment":null}],"argline":"git_smart_subtransport **out, git_transport *owner, void *param","sig":"git_smart_subtransport **::git_transport *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the git subtransport.

\n","comments":"","group":"smart"},"git_smart_subtransport_ssh":{"type":"function","file":"sys/transport.h","line":346,"lineto":349,"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"},{"name":"param","type":"void *","comment":null}],"argline":"git_smart_subtransport **out, git_transport *owner, void *param","sig":"git_smart_subtransport **::git_transport *::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Create an instance of the ssh subtransport.

\n","comments":"","group":"smart"},"git_tag_lookup":{"type":"function","file":"tag.h","line":33,"lineto":34,"args":[{"name":"out","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 **out, 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.

\n","comments":"","group":"tag","examples":{"general.c":["ex/v0.23.2/general.html#git_tag_lookup-70"]}},"git_tag_lookup_prefix":{"type":"function","file":"tag.h","line":48,"lineto":49,"args":[{"name":"out","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 **out, 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,\n given a prefix of its identifier (short id).

\n","comments":"","group":"tag"},"git_tag_free":{"type":"function","file":"tag.h","line":61,"lineto":61,"args":[{"name":"tag","type":"git_tag *","comment":"the tag to close"}],"argline":"git_tag *tag","sig":"git_tag *","return":{"type":"void","comment":null},"description":"

Close an open tag

\n","comments":"

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to\n release memory. Failure to do so will cause a memory leak.

\n","group":"tag"},"git_tag_id":{"type":"function","file":"tag.h","line":69,"lineto":69,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_oid *","comment":" object identity for the tag."},"description":"

Get the id of a tag.

\n","comments":"","group":"tag"},"git_tag_owner":{"type":"function","file":"tag.h","line":77,"lineto":77,"args":[{"name":"tag","type":"const git_tag *","comment":"A previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"git_repository *","comment":" Repository that contains this tag."},"description":"

Get the repository that contains the tag.

\n","comments":"","group":"tag"},"git_tag_target":{"type":"function","file":"tag.h","line":89,"lineto":89,"args":[{"name":"target_out","type":"git_object **","comment":"pointer where to store the target"},{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"git_object **target_out, const git_tag *tag","sig":"git_object **::const git_tag *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Get the tagged object of a tag

\n","comments":"

This method performs a repository lookup for the\n given object and returns it

\n","group":"tag","examples":{"general.c":["ex/v0.23.2/general.html#git_tag_target-71"]}},"git_tag_target_id":{"type":"function","file":"tag.h","line":97,"lineto":97,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_oid *","comment":" pointer to the OID"},"description":"

Get the OID of the tagged object of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tag_target_id-35"]}},"git_tag_target_type":{"type":"function","file":"tag.h","line":105,"lineto":105,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"git_otype","comment":" type of the tagged object"},"description":"

Get the type of a tag's tagged object

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tag_target_type-36"],"general.c":["ex/v0.23.2/general.html#git_tag_target_type-72"]}},"git_tag_name":{"type":"function","file":"tag.h","line":113,"lineto":113,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const char *","comment":" name of the tag"},"description":"

Get the name of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tag_name-37"],"general.c":["ex/v0.23.2/general.html#git_tag_name-73"],"tag.c":["ex/v0.23.2/tag.html#git_tag_name-20"]}},"git_tag_tagger":{"type":"function","file":"tag.h","line":121,"lineto":121,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const git_signature *","comment":" reference to the tag's author or NULL when unspecified"},"description":"

Get the tagger (author) of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tag_tagger-38"]}},"git_tag_message":{"type":"function","file":"tag.h","line":129,"lineto":129,"args":[{"name":"tag","type":"const git_tag *","comment":"a previously loaded tag."}],"argline":"const git_tag *tag","sig":"const git_tag *","return":{"type":"const char *","comment":" message of the tag or NULL when unspecified"},"description":"

Get the message of a tag

\n","comments":"","group":"tag","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tag_message-39","ex/v0.23.2/cat-file.html#git_tag_message-40"],"general.c":["ex/v0.23.2/general.html#git_tag_message-74"],"tag.c":["ex/v0.23.2/tag.html#git_tag_message-21"]}},"git_tag_create":{"type":"function","file":"tag.h","line":171,"lineto":178,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n 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\n for consistency. It should also not conflict with an\n already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"tagger","type":"const git_signature *","comment":"Signature of the tagger for this tag, and\n 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, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force","sig":"git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it"},"description":"

Create a new tag in the repository from an object

\n","comments":"

A new reference will also be created pointing to\n this tag object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid\n the characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\n sequences ".." and "\n@\n{" which have special meaning to revparse.

\n","group":"tag","examples":{"tag.c":["ex/v0.23.2/tag.html#git_tag_create-22"]}},"git_tag_annotation_create":{"type":"function","file":"tag.h","line":203,"lineto":209,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the\n newly created tag"},{"name":"repo","type":"git_repository *","comment":"Repository where to store the tag"},{"name":"tag_name","type":"const char *","comment":"Name for the tag"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"tagger","type":"const git_signature *","comment":"Signature of the tagger for this tag, and\n of the tagging time"},{"name":"message","type":"const char *","comment":"Full message for this tag"}],"argline":"git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message","sig":"git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *","return":{"type":"int","comment":" 0 on success or an error code"},"description":"

Create a new tag in the object database pointing to a git_object

\n","comments":"

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n","group":"tag"},"git_tag_create_frombuffer":{"type":"function","file":"tag.h","line":220,"lineto":224,"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, git_repository *repo, const char *buffer, int 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

\n","comments":"","group":"tag"},"git_tag_create_lightweight":{"type":"function","file":"tag.h","line":256,"lineto":261,"args":[{"name":"oid","type":"git_oid *","comment":"Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n 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\n for consistency. It should also not conflict with an\n already existing tag name"},{"name":"target","type":"const git_object *","comment":"Object to which this tag points. This object\n must belong to the given `repo`."},{"name":"force","type":"int","comment":"Overwrite existing references"}],"argline":"git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force","sig":"git_oid *::git_repository *::const char *::const git_object *::int","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object"},"description":"

Create a new lightweight tag pointing at a target object

\n","comments":"

A new direct reference will be created pointing to\n this target object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"tag","examples":{"tag.c":["ex/v0.23.2/tag.html#git_tag_create_lightweight-23"]}},"git_tag_delete":{"type":"function","file":"tag.h","line":276,"lineto":278,"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;\n this name is validated for consistency."}],"argline":"git_repository *repo, const char *tag_name","sig":"git_repository *::const char *","return":{"type":"int","comment":" 0 on success, GIT_EINVALIDSPEC or an error code"},"description":"

Delete an existing tag reference.

\n","comments":"

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n","group":"tag","examples":{"tag.c":["ex/v0.23.2/tag.html#git_tag_delete-24"]}},"git_tag_list":{"type":"function","file":"tag.h","line":293,"lineto":295,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe tag names will be stored"},{"name":"repo","type":"git_repository *","comment":"Repository where to find the tags"}],"argline":"git_strarray *tag_names, git_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

\n","comments":"

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should 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":315,"lineto":318,"args":[{"name":"tag_names","type":"git_strarray *","comment":"Pointer to a git_strarray structure where\n\t\tthe 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, const char *pattern, git_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\n which name match a defined pattern

\n","comments":"

If an empty pattern is provided, all the tags\n will be returned.

\n\n

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n","group":"tag","examples":{"tag.c":["ex/v0.23.2/tag.html#git_tag_list_match-25"]}},"git_tag_foreach":{"type":"function","file":"tag.h","line":330,"lineto":333,"args":[{"name":"repo","type":"git_repository *","comment":"Repository"},{"name":"callback","type":"git_tag_foreach_cb","comment":"Callback function"},{"name":"payload","type":"void *","comment":"Pointer to callback data (optional)"}],"argline":"git_repository *repo, git_tag_foreach_cb callback, void *payload","sig":"git_repository *::git_tag_foreach_cb::void *","return":{"type":"int","comment":null},"description":"

Call callback `cb' for each tag in the repository

\n","comments":"","group":"tag"},"git_tag_peel":{"type":"function","file":"tag.h","line":346,"lineto":348,"args":[{"name":"tag_target_out","type":"git_object **","comment":"Pointer to the peeled git_object"},{"name":"tag","type":"const git_tag *","comment":"The tag to be processed"}],"argline":"git_object **tag_target_out, const git_tag *tag","sig":"git_object **::const git_tag *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Recursively peel a tag until a non tag git_object is found

\n","comments":"

The retrieved tag_target object is owned by the repository\n and should be closed with the git_object_free method.

\n","group":"tag"},"git_trace_set":{"type":"function","file":"trace.h","line":63,"lineto":63,"args":[{"name":"level","type":"git_trace_level_t","comment":"Level to set tracing to"},{"name":"cb","type":"git_trace_callback","comment":"Function to call with trace data"}],"argline":"git_trace_level_t level, git_trace_callback cb","sig":"git_trace_level_t::git_trace_callback","return":{"type":"int","comment":" 0 or an error code"},"description":"

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n","comments":"","group":"trace"},"git_cred_has_username":{"type":"function","file":"transport.h","line":197,"lineto":197,"args":[{"name":"cred","type":"git_cred *","comment":"object to check"}],"argline":"git_cred *cred","sig":"git_cred *","return":{"type":"int","comment":" 1 if the credential object has non-NULL username, 0 otherwise"},"description":"

Check whether a credential object contains username information.

\n","comments":"","group":"cred"},"git_cred_userpass_plaintext_new":{"type":"function","file":"transport.h","line":208,"lineto":211,"args":[{"name":"out","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 **out, const char *username, const char *password","sig":"git_cred **::const char *::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_key_new":{"type":"function","file":"transport.h","line":224,"lineto":229,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"},{"name":"publickey","type":"const char *","comment":"The path to the public key of the credential."},{"name":"privatekey","type":"const char *","comment":"The path to the private key of the credential."},{"name":"passphrase","type":"const char *","comment":"The passphrase of the credential."}],"argline":"git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase","sig":"git_cred **::const char *::const char *::const char *::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_interactive_new":{"type":"function","file":"transport.h","line":240,"lineto":244,"args":[{"name":"out","type":"git_cred **","comment":null},{"name":"username","type":"const char *","comment":"Username to use to authenticate."},{"name":"prompt_callback","type":"git_cred_ssh_interactive_callback","comment":"The callback method used for prompts."},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback."}],"argline":"git_cred **out, const char *username, git_cred_ssh_interactive_callback prompt_callback, void *payload","sig":"git_cred **::const char *::git_cred_ssh_interactive_callback::void *","return":{"type":"int","comment":" 0 for success or an error code for failure."},"description":"

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_key_from_agent":{"type":"function","file":"transport.h","line":254,"lineto":256,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"}],"argline":"git_cred **out, const char *username","sig":"git_cred **::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n","comments":"","group":"cred"},"git_cred_ssh_custom_new":{"type":"function","file":"transport.h","line":276,"lineto":282,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate"},{"name":"publickey","type":"const char *","comment":"The bytes of the public key."},{"name":"publickey_len","type":"size_t","comment":"The length of the public key in bytes."},{"name":"sign_callback","type":"git_cred_sign_callback","comment":"The callback method to sign the data during the challenge."},{"name":"payload","type":"void *","comment":"Additional data to pass to the callback."}],"argline":"git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload","sig":"git_cred **::const char *::const char *::size_t::git_cred_sign_callback::void *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create an ssh key credential with a custom signing function.

\n","comments":"

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness\n and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n","group":"cred"},"git_cred_default_new":{"type":"function","file":"transport.h","line":290,"lineto":290,"args":[{"name":"out","type":"git_cred **","comment":null}],"argline":"git_cred **out","sig":"git_cred **","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n","comments":"","group":"cred"},"git_cred_username_new":{"type":"function","file":"transport.h","line":298,"lineto":298,"args":[{"name":"cred","type":"git_cred **","comment":null},{"name":"username","type":"const char *","comment":null}],"argline":"git_cred **cred, const char *username","sig":"git_cred **::const char *","return":{"type":"int","comment":null},"description":"

Create a credential to specify a username.

\n","comments":"

This is used with ssh authentication to query for the username if\n none is specified in the url.

\n","group":"cred"},"git_cred_ssh_key_memory_new":{"type":"function","file":"transport.h","line":310,"lineto":315,"args":[{"name":"out","type":"git_cred **","comment":"The newly created credential object."},{"name":"username","type":"const char *","comment":"username to use to authenticate."},{"name":"publickey","type":"const char *","comment":"The public key of the credential."},{"name":"privatekey","type":"const char *","comment":"The private key of the credential."},{"name":"passphrase","type":"const char *","comment":"The passphrase of the credential."}],"argline":"git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase","sig":"git_cred **::const char *::const char *::const char *::const char *","return":{"type":"int","comment":" 0 for success or an error code for failure"},"description":"

Create a new ssh key credential object reading the keys from memory.

\n","comments":"","group":"cred"},"git_tree_lookup":{"type":"function","file":"tree.h","line":32,"lineto":33,"args":[{"name":"out","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 **out, 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.

\n","comments":"","group":"tree","examples":{"general.c":["ex/v0.23.2/general.html#git_tree_lookup-75","ex/v0.23.2/general.html#git_tree_lookup-76"],"init.c":["ex/v0.23.2/init.html#git_tree_lookup-14"]}},"git_tree_lookup_prefix":{"type":"function","file":"tree.h","line":47,"lineto":51,"args":[{"name":"out","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 **out, git_repository *repo, const git_oid *id, size_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,\n given a prefix of its identifier (short id).

\n","comments":"","group":"tree"},"git_tree_free":{"type":"function","file":"tree.h","line":63,"lineto":63,"args":[{"name":"tree","type":"git_tree *","comment":"The tree to close"}],"argline":"git_tree *tree","sig":"git_tree *","return":{"type":"void","comment":null},"description":"

Close an open tree

\n","comments":"

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to\n release memory. Failure to do so will cause a memory leak.

\n","group":"tree","examples":{"diff.c":["ex/v0.23.2/diff.html#git_tree_free-17","ex/v0.23.2/diff.html#git_tree_free-18"],"init.c":["ex/v0.23.2/init.html#git_tree_free-15"],"log.c":["ex/v0.23.2/log.html#git_tree_free-58","ex/v0.23.2/log.html#git_tree_free-59","ex/v0.23.2/log.html#git_tree_free-60","ex/v0.23.2/log.html#git_tree_free-61","ex/v0.23.2/log.html#git_tree_free-62"]}},"git_tree_id":{"type":"function","file":"tree.h","line":71,"lineto":71,"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.

\n","comments":"","group":"tree"},"git_tree_owner":{"type":"function","file":"tree.h","line":79,"lineto":79,"args":[{"name":"tree","type":"const git_tree *","comment":"A previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"git_repository *","comment":" Repository that contains this tree."},"description":"

Get the repository that contains the tree.

\n","comments":"","group":"tree"},"git_tree_entrycount":{"type":"function","file":"tree.h","line":87,"lineto":87,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."}],"argline":"const git_tree *tree","sig":"const git_tree *","return":{"type":"size_t","comment":" the number of entries in the tree"},"description":"

Get the number of entries listed in a tree

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entrycount-41"],"general.c":["ex/v0.23.2/general.html#git_tree_entrycount-77"]}},"git_tree_entry_byname":{"type":"function","file":"tree.h","line":99,"lineto":100,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"filename","type":"const char *","comment":"the filename of the desired entry"}],"argline":"const git_tree *tree, const char *filename","sig":"const 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

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n","group":"tree","examples":{"general.c":["ex/v0.23.2/general.html#git_tree_entry_byname-78"]}},"git_tree_entry_byindex":{"type":"function","file":"tree.h","line":112,"lineto":113,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"idx","type":"size_t","comment":"the position in the entry list"}],"argline":"const git_tree *tree, size_t idx","sig":"const 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

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entry_byindex-42"],"general.c":["ex/v0.23.2/general.html#git_tree_entry_byindex-79"]}},"git_tree_entry_byid":{"type":"function","file":"tree.h","line":127,"lineto":128,"args":[{"name":"tree","type":"const git_tree *","comment":"a previously loaded tree."},{"name":"id","type":"const git_oid *","comment":"the sha being looked for"}],"argline":"const git_tree *tree, const git_oid *id","sig":"const 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.

\n","comments":"

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n","group":"tree"},"git_tree_entry_bypath":{"type":"function","file":"tree.h","line":142,"lineto":145,"args":[{"name":"out","type":"git_tree_entry **","comment":"Pointer where to store the tree entry"},{"name":"root","type":"const git_tree *","comment":"Previously loaded tree which is the root of the relative path"},{"name":"path","type":"const char *","comment":"Path to the contained entry"}],"argline":"git_tree_entry **out, const git_tree *root, const char *path","sig":"git_tree_entry **::const 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 of its subtrees,\n given its relative path.

\n","comments":"

Unlike the other lookup functions, the returned tree entry is owned by\n the user and must be freed explicitly with git_tree_entry_free().

\n","group":"tree"},"git_tree_entry_dup":{"type":"function","file":"tree.h","line":157,"lineto":157,"args":[{"name":"dest","type":"git_tree_entry **","comment":"pointer where to store the copy"},{"name":"source","type":"const git_tree_entry *","comment":"tree entry to duplicate"}],"argline":"git_tree_entry **dest, const git_tree_entry *source","sig":"git_tree_entry **::const git_tree_entry *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Duplicate a tree entry

\n","comments":"

Create a copy of a tree entry. The returned copy is owned by the user,\n and must be freed explicitly with git_tree_entry_free().

\n","group":"tree"},"git_tree_entry_free":{"type":"function","file":"tree.h","line":168,"lineto":168,"args":[{"name":"entry","type":"git_tree_entry *","comment":"The entry to free"}],"argline":"git_tree_entry *entry","sig":"git_tree_entry *","return":{"type":"void","comment":null},"description":"

Free a user-owned tree entry

\n","comments":"

IMPORTANT: This function is only needed for tree entries owned by the\n user, such as the ones returned by git_tree_entry_dup() or\n git_tree_entry_bypath().

\n","group":"tree"},"git_tree_entry_name":{"type":"function","file":"tree.h","line":176,"lineto":176,"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

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entry_name-43"],"general.c":["ex/v0.23.2/general.html#git_tree_entry_name-80","ex/v0.23.2/general.html#git_tree_entry_name-81"]}},"git_tree_entry_id":{"type":"function","file":"tree.h","line":184,"lineto":184,"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

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entry_id-44"]}},"git_tree_entry_type":{"type":"function","file":"tree.h","line":192,"lineto":192,"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

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entry_type-45"]}},"git_tree_entry_filemode":{"type":"function","file":"tree.h","line":200,"lineto":200,"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

\n","comments":"","group":"tree","examples":{"cat-file.c":["ex/v0.23.2/cat-file.html#git_tree_entry_filemode-46"]}},"git_tree_entry_filemode_raw":{"type":"function","file":"tree.h","line":212,"lineto":212,"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 raw UNIX file attributes of a tree entry

\n","comments":"

This function does not perform any normalization and is only useful\n if you need to be able to recreate the original tree object.

\n","group":"tree"},"git_tree_entry_cmp":{"type":"function","file":"tree.h","line":220,"lineto":220,"args":[{"name":"e1","type":"const git_tree_entry *","comment":"first tree entry"},{"name":"e2","type":"const git_tree_entry *","comment":"second tree entry"}],"argline":"const git_tree_entry *e1, const git_tree_entry *e2","sig":"const git_tree_entry *::const git_tree_entry *","return":{"type":"int","comment":" \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2"},"description":"

Compare two tree entries

\n","comments":"","group":"tree"},"git_tree_entry_to_object":{"type":"function","file":"tree.h","line":232,"lineto":235,"args":[{"name":"object_out","type":"git_object **","comment":"pointer to the converted 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, git_repository *repo, const 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 to.

\n","comments":"

You must call git_object_free() on the object when you are done with it.

\n","group":"tree","examples":{"general.c":["ex/v0.23.2/general.html#git_tree_entry_to_object-82"]}},"git_treebuilder_new":{"type":"function","file":"tree.h","line":254,"lineto":255,"args":[{"name":"out","type":"git_treebuilder **","comment":"Pointer where to store the tree builder"},{"name":"repo","type":"git_repository *","comment":"Repository in which to store the object"},{"name":"source","type":"const git_tree *","comment":"Source tree to initialize the builder (optional)"}],"argline":"git_treebuilder **out, git_repository *repo, const git_tree *source","sig":"git_treebuilder **::git_repository *::const git_tree *","return":{"type":"int","comment":" 0 on success; error code otherwise"},"description":"

Create a new tree builder.

\n","comments":"

The tree builder can be used to create or modify trees in memory and\n write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be\n initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no\n entries and will have to be filled manually.

\n","group":"treebuilder"},"git_treebuilder_clear":{"type":"function","file":"tree.h","line":262,"lineto":262,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to clear"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void","comment":null},"description":"

Clear all the entires in the builder

\n","comments":"","group":"treebuilder"},"git_treebuilder_entrycount":{"type":"function","file":"tree.h","line":270,"lineto":270,"args":[{"name":"bld","type":"git_treebuilder *","comment":"a previously loaded treebuilder."}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"unsigned int","comment":" the number of entries in the treebuilder"},"description":"

Get the number of entries listed in a treebuilder

\n","comments":"","group":"treebuilder"},"git_treebuilder_free":{"type":"function","file":"tree.h","line":281,"lineto":281,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Builder to free"}],"argline":"git_treebuilder *bld","sig":"git_treebuilder *","return":{"type":"void","comment":null},"description":"

Free a tree builder

\n","comments":"

This will clear all the entries and free to builder.\n Failing to free the builder after you're done using it\n will result in a memory leak

\n","group":"treebuilder"},"git_treebuilder_get":{"type":"function","file":"tree.h","line":293,"lineto":294,"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

\n","comments":"

The returned entry is owned by the builder and should\n not be freed manually.

\n","group":"treebuilder"},"git_treebuilder_insert":{"type":"function","file":"tree.h","line":323,"lineto":328,"args":[{"name":"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\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000."}],"argline":"const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_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

\n","comments":"

Insert a new entry for filename in the builder with the\n given attributes.

\n\n

If an entry named filename already exists, its attributes\n will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the\n newly created/updated entry. Pass NULL if you do not need it. The\n pointer may not be valid past the next operation in this\n builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points\n to an existing git object in the object database, nor that the\n attributes make sense regarding the type of the pointed at object.

\n","group":"treebuilder"},"git_treebuilder_remove":{"type":"function","file":"tree.h","line":336,"lineto":337,"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","comment":null},"description":"

Remove an entry from the builder by its filename

\n","comments":"","group":"treebuilder"},"git_treebuilder_filter":{"type":"function","file":"tree.h","line":360,"lineto":363,"args":[{"name":"bld","type":"git_treebuilder *","comment":"Tree builder"},{"name":"filter","type":"git_treebuilder_filter_cb","comment":"Callback to filter entries"},{"name":"payload","type":"void *","comment":"Extra data to pass to filter callback"}],"argline":"git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload","sig":"git_treebuilder *::git_treebuilder_filter_cb::void *","return":{"type":"void","comment":null},"description":"

Selectively remove entries in the tree

\n","comments":"

The filter callback will be called for each entry in the tree with a\n pointer to the entry and the provided payload; if the callback returns\n non-zero, the entry will be filtered (removed from the builder).

\n","group":"treebuilder"},"git_treebuilder_write":{"type":"function","file":"tree.h","line":375,"lineto":376,"args":[{"name":"id","type":"git_oid *","comment":"Pointer to store the OID of the newly written tree"},{"name":"bld","type":"git_treebuilder *","comment":"Tree builder to write"}],"argline":"git_oid *id, git_treebuilder *bld","sig":"git_oid *::git_treebuilder *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Write the contents of the tree builder as a tree object

\n","comments":"

The tree builder will be written to the given repo, and its\n identifying SHA1 hash will be stored in the id pointer.

\n","group":"treebuilder"},"git_tree_walk":{"type":"function","file":"tree.h","line":406,"lineto":410,"args":[{"name":"tree","type":"const git_tree *","comment":"The tree to walk"},{"name":"mode","type":"git_treewalk_mode","comment":"Traversal mode (pre or post-order)"},{"name":"callback","type":"git_treewalk_cb","comment":"Function to call on each tree entry"},{"name":"payload","type":"void *","comment":"Opaque pointer to be passed on each callback"}],"argline":"const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload","sig":"const git_tree *::git_treewalk_mode::git_treewalk_cb::void *","return":{"type":"int","comment":" 0 or an error code"},"description":"

Traverse the entries in a tree and its subtrees in post or pre order.

\n","comments":"

The entries will be traversed in the specified order, children subtrees\n will be automatically loaded as required, and the callback will be\n called once per entry with the current (relative) root for the entry and\n the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be\n skipped on the traversal (in pre mode). A negative value stops the walk.

\n","group":"tree"}},"callbacks":{"git_checkout_notify_cb":{"type":"callback","file":"checkout.h","line":223,"lineto":229,"args":[{"name":"why","type":"git_checkout_notify_t","comment":null},{"name":"path","type":"const char *","comment":null},{"name":"baseline","type":"const git_diff_file *","comment":null},{"name":"target","type":"const git_diff_file *","comment":null},{"name":"workdir","type":"const git_diff_file *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload","sig":"git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *","return":{"type":"int","comment":null},"description":"

Checkout notification callback function

\n","comments":""},"git_checkout_progress_cb":{"type":"callback","file":"checkout.h","line":232,"lineto":236,"args":[{"name":"path","type":"const char *","comment":null},{"name":"completed_steps","type":"size_t","comment":null},{"name":"total_steps","type":"size_t","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, size_t completed_steps, size_t total_steps, void *payload","sig":"const char *::size_t::size_t::void *","return":{"type":"void","comment":null},"description":"

Checkout progress notification function

\n","comments":""},"git_checkout_perfdata_cb":{"type":"callback","file":"checkout.h","line":239,"lineto":241,"args":[{"name":"perfdata","type":"const git_checkout_perfdata *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_checkout_perfdata *perfdata, void *payload","sig":"const git_checkout_perfdata *::void *","return":{"type":"void","comment":null},"description":"

Checkout perfdata notification function

\n","comments":""},"git_remote_create_cb":{"type":"callback","file":"clone.h","line":69,"lineto":74,"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"},{"name":"payload","type":"void *","comment":"an opaque payload"}],"argline":"git_remote **out, git_repository *repo, const char *name, const char *url, void *payload","sig":"git_remote **::git_repository *::const char *::const char *::void *","return":{"type":"int","comment":" 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code"},"description":"

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n","comments":"

Callers of git_clone may provide a function matching this signature to override\n the remote creation and customization process during a clone operation.

\n"},"git_repository_create_cb":{"type":"callback","file":"clone.h","line":90,"lineto":94,"args":[{"name":"out","type":"git_repository **","comment":"the resulting repository"},{"name":"path","type":"const char *","comment":"path in which to create the repository"},{"name":"bare","type":"int","comment":"whether the repository is bare. This is the value from the clone options"},{"name":"payload","type":"void *","comment":"payload specified by the options"}],"argline":"git_repository **out, const char *path, int bare, void *payload","sig":"git_repository **::const char *::int::void *","return":{"type":"int","comment":" 0, or a negative value to indicate error"},"description":"

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n","comments":"

Callers of git_clone my provide a function matching this signature\n to override the repository creation and customization process\n during a clone operation.

\n"},"git_diff_notify_cb":{"type":"callback","file":"diff.h","line":343,"lineto":347,"args":[{"name":"diff_so_far","type":"const git_diff *","comment":null},{"name":"delta_to_add","type":"const git_diff_delta *","comment":null},{"name":"matched_pathspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload","sig":"const git_diff *::const git_diff_delta *::const char *::void *","return":{"type":"int","comment":null},"description":"

Diff notification callback function.

\n","comments":"

The callback will be called for each file, just before the git_delta_t\n gets inserted into the diff.

\n\n

When the callback:\n - returns \n<\n 0, the diff process will be aborted.\n - returns > 0, the delta will not be inserted into the diff, but the\n diff process continues.\n - returns 0, the delta is inserted into the diff, and the diff process\n continues.

\n"},"git_diff_file_cb":{"type":"callback","file":"diff.h","line":423,"lineto":426,"args":[{"name":"delta","type":"const git_diff_delta *","comment":"A pointer to the delta data for the file"},{"name":"progress","type":"float","comment":"Goes from 0 to 1 over the diff"},{"name":"payload","type":"void *","comment":"User-specified pointer from foreach function"}],"argline":"const git_diff_delta *delta, float progress, void *payload","sig":"const git_diff_delta *::float::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per file.

\n","comments":""},"git_diff_binary_cb":{"type":"callback","file":"diff.h","line":470,"lineto":473,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"binary","type":"const git_diff_binary *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_binary *binary, void *payload","sig":"const git_diff_delta *::const git_diff_binary *::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made for\n binary content within the diff.

\n","comments":""},"git_diff_hunk_cb":{"type":"callback","file":"diff.h","line":490,"lineto":493,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per hunk.

\n","comments":""},"git_diff_line_cb":{"type":"callback","file":"diff.h","line":543,"lineto":547,"args":[{"name":"delta","type":"const git_diff_delta *","comment":null},{"name":"hunk","type":"const git_diff_hunk *","comment":null},{"name":"line","type":"const git_diff_line *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload","sig":"const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *","return":{"type":"int","comment":null},"description":"

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n","comments":"

When printing a diff, callback that will be made to output each line\n of text. This uses some extra GIT_DIFF_LINE_... constants for output\n of lines of file and hunk headers.

\n"},"git_index_matched_path_cb":{"type":"callback","file":"index.h","line":146,"lineto":147,"args":[{"name":"path","type":"const char *","comment":null},{"name":"matched_pathspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, const char *matched_pathspec, void *payload","sig":"const char *::const char *::void *","return":{"type":"int","comment":null},"description":"

Callback for APIs that add/remove/update files matching pathspec

\n","comments":""},"git_headlist_cb":{"type":"callback","file":"net.h","line":55,"lineto":55,"args":[{"name":"rhead","type":"git_remote_head *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_remote_head *rhead, void *payload","sig":"git_remote_head *::void *","return":{"type":"int","comment":null},"description":"

Callback for listing the remote heads

\n","comments":""},"git_note_foreach_cb":{"type":"callback","file":"notes.h","line":29,"lineto":30,"args":[{"name":"blob_id","type":"const git_oid *","comment":null},{"name":"annotated_object_id","type":"const git_oid *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_oid *blob_id, const git_oid *annotated_object_id, void *payload","sig":"const git_oid *::const git_oid *::void *","return":{"type":"int","comment":null},"description":"

Callback for git_note_foreach.

\n","comments":"

Receives:\n - blob_id: Oid of the blob containing the message\n - annotated_object_id: Oid of the git object being annotated\n - payload: Payload data passed to git_note_foreach

\n"},"git_odb_foreach_cb":{"type":"callback","file":"odb.h","line":26,"lineto":26,"args":[{"name":"id","type":"const git_oid *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_oid *id, void *payload","sig":"const git_oid *::void *","return":{"type":"int","comment":null},"description":"

Function type for callbacks from git_odb_foreach.

\n","comments":""},"git_packbuilder_progress":{"type":"callback","file":"pack.h","line":210,"lineto":214,"args":[{"name":"stage","type":"int","comment":null},{"name":"current","type":"unsigned int","comment":null},{"name":"total","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"int stage, unsigned int current, unsigned int total, void *payload","sig":"int::unsigned int::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Packbuilder progress notification function

\n","comments":""},"git_remote_rename_problem_cb":{"type":"callback","file":"remote.h","line":28,"lineto":28,"args":[{"name":"problematic_refspec","type":"const char *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *problematic_refspec, void *payload","sig":"const char *::void *","return":{"type":"int","comment":null},"description":"

git2/remote.h

\n","comments":"

@\n{

\n"},"git_push_transfer_progress":{"type":"callback","file":"remote.h","line":332,"lineto":336,"args":[{"name":"current","type":"unsigned int","comment":null},{"name":"total","type":"unsigned int","comment":null},{"name":"bytes","type":"size_t","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"unsigned int current, unsigned int total, size_t bytes, void *payload","sig":"unsigned int::unsigned int::size_t::void *","return":{"type":"int","comment":null},"description":"

Push network progress notification function

\n","comments":""},"git_push_negotiation":{"type":"callback","file":"remote.h","line":365,"lineto":365,"args":[{"name":"updates","type":"const git_push_update **","comment":"an array containing the updates which will be sent\n as commands to the destination."},{"name":"len","type":"size_t","comment":"number of elements in `updates`"},{"name":"payload","type":"void *","comment":"Payload provided by the caller"}],"argline":"const git_push_update **updates, size_t len, void *payload","sig":"const git_push_update **::size_t::void *","return":{"type":"int","comment":null},"description":"","comments":""},"git_revwalk_hide_cb":{"type":"callback","file":"revwalk.h","line":279,"lineto":281,"args":[{"name":"commit_id","type":"const git_oid *","comment":"oid of Commit"},{"name":"payload","type":"void *","comment":"User-specified pointer to data to be passed as data payload"}],"argline":"const git_oid *commit_id, void *payload","sig":"const git_oid *::void *","return":{"type":"int","comment":null},"description":"

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n","comments":""},"git_stash_apply_progress_cb":{"type":"callback","file":"stash.h","line":113,"lineto":115,"args":[{"name":"progress","type":"git_stash_apply_progress_t","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_stash_apply_progress_t progress, void *payload","sig":"git_stash_apply_progress_t::void *","return":{"type":"int","comment":null},"description":"

Stash application progress notification function.\n Return 0 to continue processing, or a negative value to\n abort the stash application.

\n","comments":""},"git_stash_cb":{"type":"callback","file":"stash.h","line":198,"lineto":202,"args":[{"name":"index","type":"size_t","comment":"The position within the stash list. 0 points to the\n most recent stashed state."},{"name":"message","type":"const char *","comment":"The stash message."},{"name":"stash_id","type":"const int *","comment":"The commit oid of the stashed state."},{"name":"payload","type":"void *","comment":"Extra parameter to callback function."}],"argline":"size_t index, const char *message, const int *stash_id, void *payload","sig":"size_t::const char *::const int *::void *","return":{"type":"int","comment":" 0 to continue iterating or non-zero to stop."},"description":"

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n","comments":""},"git_status_cb":{"type":"callback","file":"status.h","line":61,"lineto":62,"args":[{"name":"path","type":"const char *","comment":null},{"name":"status_flags","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *path, unsigned int status_flags, void *payload","sig":"const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Function pointer to receive status on individual files

\n","comments":"

path is the relative path to the file from the root of the repository.

\n\n

status_flags is a combination of git_status_t values that apply.

\n\n

payload is the value you passed to the foreach function as payload.

\n"},"git_filter_init_fn":{"type":"callback","file":"sys/filter.h","line":152,"lineto":152,"args":[{"name":"self","type":"git_filter *","comment":null}],"argline":"git_filter *self","sig":"git_filter *","return":{"type":"int","comment":null},"description":"

Initialize callback on filter

\n","comments":"

Specified as filter.initialize, this is an optional callback invoked\n before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right\n before the first use of the filter, so you can defer expensive\n initialization operations (in case libgit2 is being used in a way that\n doesn't need the filter).

\n"},"git_filter_shutdown_fn":{"type":"callback","file":"sys/filter.h","line":164,"lineto":164,"args":[{"name":"self","type":"git_filter *","comment":null}],"argline":"git_filter *self","sig":"git_filter *","return":{"type":"void","comment":null},"description":"

Shutdown callback on filter

\n","comments":"

Specified as filter.shutdown, this is an optional callback invoked\n when the filter is unregistered or when libgit2 is shutting down. It\n will be called once at most and should release resources as needed.\n This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n"},"git_filter_check_fn":{"type":"callback","file":"sys/filter.h","line":186,"lineto":190,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void **","comment":null},{"name":"src","type":"const git_filter_source *","comment":null},{"name":"attr_values","type":"const char **","comment":null}],"argline":"git_filter *self, void **payload, const git_filter_source *src, const char **attr_values","sig":"git_filter *::void **::const git_filter_source *::const char **","return":{"type":"int","comment":null},"description":"

Callback to decide if a given source needs this filter

\n","comments":"

Specified as filter.check, this is an optional callback that checks\n if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success),\n GIT_PASSTHROUGH if the filter should not be applied, or an error code\n to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in\n the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter.\n This will start as NULL, but check can assign to this pointer for\n later use by the apply callback. Note that the value should be heap\n allocated (not stack), so that it doesn't go away before the apply\n callback can use it. If a filter allocates and assigns a value to the\n payload, it will need a cleanup callback to free the payload.

\n"},"git_filter_apply_fn":{"type":"callback","file":"sys/filter.h","line":204,"lineto":209,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void **","comment":null},{"name":"to","type":"git_buf *","comment":null},{"name":"from","type":"const git_buf *","comment":null},{"name":"src","type":"const git_filter_source *","comment":null}],"argline":"git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src","sig":"git_filter *::void **::git_buf *::const git_buf *::const git_filter_source *","return":{"type":"int","comment":null},"description":"

Callback to actually perform the data filtering

\n","comments":"

Specified as filter.apply, this is the callback that actually filters\n data. If it successfully writes the output, it should return 0. Like\n check, it can return GIT_PASSTHROUGH to indicate that the filter\n doesn't want to run. Other error codes will stop filter processing and\n return to the caller.

\n\n

The payload value will refer to any payload that was set by the\n check callback. It may be read from or written to as needed.

\n"},"git_filter_cleanup_fn":{"type":"callback","file":"sys/filter.h","line":226,"lineto":228,"args":[{"name":"self","type":"git_filter *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_filter *self, void *payload","sig":"git_filter *::void *","return":{"type":"void","comment":null},"description":"

Callback to clean up after filtering has been applied

\n","comments":"

Specified as filter.cleanup, this is an optional callback invoked\n after the filter has been applied. If the check or apply callbacks\n allocated a payload to keep per-source filter state, use this\n callback to free that payload and release resources as required.

\n"},"git_trace_callback":{"type":"callback","file":"trace.h","line":52,"lineto":52,"args":[{"name":"level","type":"git_trace_level_t","comment":null},{"name":"msg","type":"const char *","comment":null}],"argline":"git_trace_level_t level, const char *msg","sig":"git_trace_level_t::const char *","return":{"type":"void","comment":null},"description":"

An instance for a tracing function

\n","comments":""},"git_transport_cb":{"type":"callback","file":"transport.h","line":24,"lineto":24,"args":[{"name":"out","type":"git_transport **","comment":null},{"name":"owner","type":"git_remote *","comment":null},{"name":"param","type":"void *","comment":null}],"argline":"git_transport **out, git_remote *owner, void *param","sig":"git_transport **::git_remote *::void *","return":{"type":"int","comment":null},"description":"

Signature of a function which creates a transport

\n","comments":""},"git_cred_acquire_cb":{"type":"callback","file":"transport.h","line":329,"lineto":334,"args":[{"name":"cred","type":"git_cred **","comment":null},{"name":"url","type":"const char *","comment":null},{"name":"username_from_url","type":"const char *","comment":null},{"name":"allowed_types","type":"unsigned int","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload","sig":"git_cred **::const char *::const char *::unsigned int::void *","return":{"type":"int","comment":null},"description":"

Signature of a function which acquires a credential object.

\n","comments":"
    \n
  • cred: The newly created credential object.
  • \n
  • url: The resource for which we are demanding a credential.
  • \n
  • username_from_url: The username that was embedded in a "user\n@\nhost"\n remote url, or NULL if not included.
  • \n
  • allowed_types: A bitmask stating which cred types are OK to return.
  • \n
  • payload: The payload provided when specifying this callback.
  • \n
  • returns 0 for success, \n<\n0 to indicate an error, > 0 to indicate\n no credential was acquired
  • \n
\n"},"git_treebuilder_filter_cb":{"type":"callback","file":"tree.h","line":346,"lineto":347,"args":[{"name":"entry","type":"const git_tree_entry *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const git_tree_entry *entry, void *payload","sig":"const git_tree_entry *::void *","return":{"type":"int","comment":null},"description":"

Callback for git_treebuilder_filter

\n","comments":"

The return value is treated as a boolean, with zero indicating that the\n entry should be left alone and any non-zero value meaning that the\n entry should be removed from the treebuilder list (i.e. filtered out).

\n"},"git_treewalk_cb":{"type":"callback","file":"tree.h","line":380,"lineto":381,"args":[{"name":"root","type":"const char *","comment":null},{"name":"entry","type":"const git_tree_entry *","comment":null},{"name":"payload","type":"void *","comment":null}],"argline":"const char *root, const git_tree_entry *entry, void *payload","sig":"const char *::const git_tree_entry *::void *","return":{"type":"int","comment":null},"description":"

Callback for the tree traversal method

\n","comments":""},"git_transfer_progress_cb":{"type":"callback","file":"types.h","line":270,"lineto":270,"args":[{"name":"stats","type":"const git_transfer_progress *","comment":"Structure containing information about the state of the transfer"},{"name":"payload","type":"void *","comment":"Payload provided by caller"}],"argline":"const git_transfer_progress *stats, void *payload","sig":"const git_transfer_progress *::void *","return":{"type":"int","comment":null},"description":"

Type for progress callbacks during indexing. Return a value less than zero\n to cancel the transfer.

\n","comments":""},"git_transport_message_cb":{"type":"callback","file":"types.h","line":280,"lineto":280,"args":[{"name":"str","type":"const char *","comment":"The message from the transport"},{"name":"len","type":"int","comment":"The length of the message"},{"name":"payload","type":"void *","comment":"Payload provided by the caller"}],"argline":"const char *str, int len, void *payload","sig":"const char *::int::void *","return":{"type":"int","comment":null},"description":"

Type for messages delivered by the transport. Return a negative value\n to cancel the network operation.

\n","comments":""},"git_transport_certificate_check_cb":{"type":"callback","file":"types.h","line":330,"lineto":330,"args":[{"name":"cert","type":"git_cert *","comment":"The host certificate"},{"name":"valid","type":"int","comment":"Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid"},{"name":"host","type":"const char *","comment":"Hostname of the host libgit2 connected to"},{"name":"payload","type":"void *","comment":"Payload provided by the caller"}],"argline":"git_cert *cert, int valid, const char *host, void *payload","sig":"git_cert *::int::const char *::void *","return":{"type":"int","comment":null},"description":"

Callback for the user's custom certificate checks.

\n","comments":""}},"globals":{},"types":[["git_annotated_commit",{"decl":"git_annotated_commit","type":"struct","value":"git_annotated_commit","file":"types.h","line":178,"lineto":178,"tdef":"typedef","description":" Annotated commits, the input to merge and rebase. ","comments":"","used":{"returns":[],"needs":["git_annotated_commit_free","git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_from_revspec","git_annotated_commit_id","git_annotated_commit_lookup","git_branch_create_from_annotated","git_merge","git_merge_analysis","git_rebase_init","git_repository_set_head_detached_from_annotated","git_reset_from_annotated"]}}],["git_attr_t",{"decl":["GIT_ATTR_UNSPECIFIED_T","GIT_ATTR_TRUE_T","GIT_ATTR_FALSE_T","GIT_ATTR_VALUE_T"],"type":"enum","file":"attr.h","line":82,"lineto":87,"block":"GIT_ATTR_UNSPECIFIED_T\nGIT_ATTR_TRUE_T\nGIT_ATTR_FALSE_T\nGIT_ATTR_VALUE_T","tdef":"typedef","description":" Possible states for an attribute","comments":"","fields":[{"type":"int","name":"GIT_ATTR_UNSPECIFIED_T","comments":"

The attribute has been left unspecified

\n","value":0},{"type":"int","name":"GIT_ATTR_TRUE_T","comments":"

The attribute has been set

\n","value":1},{"type":"int","name":"GIT_ATTR_FALSE_T","comments":"

The attribute has been unset

\n","value":2},{"type":"int","name":"GIT_ATTR_VALUE_T","comments":"

This attribute has a value

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_blame_flag_t",{"decl":["GIT_BLAME_NORMAL","GIT_BLAME_TRACK_COPIES_SAME_FILE","GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES","GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES","GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES","GIT_BLAME_FIRST_PARENT"],"type":"enum","file":"blame.h","line":26,"lineto":46,"block":"GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT","tdef":"typedef","description":" Flags for indicating option behavior for git_blame APIs.","comments":"","fields":[{"type":"int","name":"GIT_BLAME_NORMAL","comments":"

Normal blame, the default

\n","value":0},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_FILE","comments":"

Track lines that have moved within a file (like git blame -M).\n NOT IMPLEMENTED.

\n","value":1},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES","comments":"

Track lines that have moved across files in the same commit (like git blame -C).\n NOT IMPLEMENTED.

\n","value":2},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES","comments":"

Track lines that have been copied from another file that exists in the\n same commit (like git blame -CC). Implies SAME_FILE.\n NOT IMPLEMENTED.

\n","value":4},{"type":"int","name":"GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES","comments":"

Track lines that have been copied from another file that exists in any\n commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.\n NOT IMPLEMENTED.

\n","value":8},{"type":"int","name":"GIT_BLAME_FIRST_PARENT","comments":"

Restrict the search of commits to those reachable following only the\n first parents.

\n","value":16}],"used":{"returns":[],"needs":[]}}],["git_blame_hunk",{"decl":["uint16_t lines_in_hunk","git_oid final_commit_id","uint16_t final_start_line_number","git_signature * final_signature","git_oid orig_commit_id","const char * orig_path","uint16_t orig_start_line_number","git_signature * orig_signature","char boundary"],"type":"struct","value":"git_blame_hunk","file":"blame.h","line":115,"lineto":128,"block":"uint16_t lines_in_hunk\ngit_oid final_commit_id\nuint16_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nuint16_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary","tdef":"typedef","description":" Structure that represents a blame hunk.","comments":"
    \n
  • lines_in_hunk is the number of lines in this hunk
  • \n
  • final_commit_id is the OID of the commit where this line was last\nchanged.
  • \n
  • final_start_line_number is the 1-based line number where this hunk\nbegins, in the final version of the file
  • \n
  • orig_commit_id is the OID of the commit where this hunk was found. This\nwill usually be the same as final_commit_id, except when\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES has been specified.
  • \n
  • orig_path is the path to the file where this hunk originated, as of the\ncommit specified by orig_commit_id.
  • \n
  • orig_start_line_number is the 1-based line number where this hunk begins\nin the file named by orig_path in the commit specified by\norig_commit_id.
  • \n
  • boundary is 1 iff the hunk has been tracked to a boundary commit (the\nroot, or the commit specified in git_blame_options.oldest_commit)
  • \n
\n","fields":[{"type":"uint16_t","name":"lines_in_hunk","comments":""},{"type":"git_oid","name":"final_commit_id","comments":""},{"type":"uint16_t","name":"final_start_line_number","comments":""},{"type":"git_signature *","name":"final_signature","comments":""},{"type":"git_oid","name":"orig_commit_id","comments":""},{"type":"const char *","name":"orig_path","comments":""},{"type":"uint16_t","name":"orig_start_line_number","comments":""},{"type":"git_signature *","name":"orig_signature","comments":""},{"type":"char","name":"boundary","comments":""}],"used":{"returns":["git_blame_get_hunk_byindex","git_blame_get_hunk_byline"],"needs":[]}}],["git_blame_options",{"decl":["unsigned int version","uint32_t flags","uint16_t min_match_characters","git_oid newest_commit","git_oid oldest_commit","uint32_t min_line","uint32_t max_line"],"type":"struct","value":"git_blame_options","file":"blame.h","line":70,"lineto":79,"block":"unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nuint32_t min_line\nuint32_t max_line","tdef":"typedef","description":" Blame options structure","comments":"

Use zeros to indicate default settings. It's easiest to use the\n GIT_BLAME_OPTIONS_INIT macro:\n git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n
    \n
  • flags is a combination of the git_blame_flag_t values above.
  • \n
  • min_match_characters is the lower bound on the number of alphanumeric\ncharacters that must be detected as moving/copying within a file for it to\nassociate those lines with the parent commit. The default value is 20.\nThis value only takes effect if any of the GIT_BLAME_TRACK_COPIES_*\nflags are specified.
  • \n
  • newest_commit is the id of the newest commit to consider. The default\n is HEAD.
  • \n
  • oldest_commit is the id of the oldest commit to consider. The default\n is the first commit encountered with a NULL parent.\n\n
      \n
    • min_line is the first line in the file to blame. The default is 1 (line\n numbers start with 1).
    • \n
    • max_line is the last line in the file to blame. The default is the last\n line of the file.
    • \n
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint16_t","name":"min_match_characters","comments":""},{"type":"git_oid","name":"newest_commit","comments":""},{"type":"git_oid","name":"oldest_commit","comments":""},{"type":"uint32_t","name":"min_line","comments":""},{"type":"uint32_t","name":"max_line","comments":""}],"used":{"returns":[],"needs":["git_blame_file","git_blame_init_options"]}}],["git_blob",{"decl":"git_blob","type":"struct","value":"git_blob","file":"types.h","line":117,"lineto":117,"tdef":"typedef","description":" In-memory representation of a blob object. ","comments":"","used":{"returns":[],"needs":["git_blob_filtered_content","git_blob_free","git_blob_id","git_blob_is_binary","git_blob_lookup","git_blob_lookup_prefix","git_blob_owner","git_blob_rawcontent","git_blob_rawsize","git_diff_blob_to_buffer","git_diff_blobs","git_filter_list_apply_to_blob","git_filter_list_load","git_filter_list_stream_blob","git_patch_from_blob_and_buffer","git_patch_from_blobs"]}}],["git_branch_iterator",{"decl":"git_branch_iterator","type":"struct","value":"git_branch_iterator","file":"branch.h","line":88,"lineto":88,"tdef":"typedef","description":" Iterator type for branches ","comments":"","used":{"returns":[],"needs":["git_branch_iterator_free","git_branch_iterator_new","git_branch_next"]}}],["git_branch_t",{"decl":["GIT_BRANCH_LOCAL","GIT_BRANCH_REMOTE","GIT_BRANCH_ALL"],"type":"enum","file":"types.h","line":198,"lineto":202,"block":"GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL","tdef":"typedef","description":" Basic type of any Git branch. ","comments":"","fields":[{"type":"int","name":"GIT_BRANCH_LOCAL","comments":"","value":1},{"type":"int","name":"GIT_BRANCH_REMOTE","comments":"","value":2},{"type":"int","name":"GIT_BRANCH_ALL","comments":"","value":3}],"used":{"returns":[],"needs":["git_branch_iterator_new","git_branch_lookup","git_branch_next"]}}],["git_buf",{"decl":["char * ptr","size_t asize","size_t size"],"type":"struct","value":"git_buf","file":"buffer.h","line":52,"lineto":55,"block":"char * ptr\nsize_t asize\nsize_t size","tdef":"typedef","description":" A data buffer for exporting data from libgit2","comments":"

Sometimes libgit2 wants to return an allocated data buffer to the\n caller and have the caller take responsibility for freeing that memory.\n This can be awkward if the caller does not have easy access to the same\n allocation functions that libgit2 is using. In those cases, libgit2\n will fill in a git_buf and the caller can use git_buf_free() to\n release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to\n a block of memory they hold. In this case, libgit2 will not resize or\n free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n
    \n
  • ptr points to the start of the allocated memory. If it is NULL,\nthen the git_buf is considered empty and libgit2 will feel free\nto overwrite it with new data.

  • \n
  • size holds the size (in bytes) of the data that is actually used.

  • \n
  • asize holds the known total amount of allocated memory if the ptr\nwas allocated by libgit2. It may be larger than size. If ptr\nwas not allocated by libgit2 and should not be resized and/or freed,\nthen asize will be set to zero.

  • \n
\n\n

Some APIs may occasionally do something slightly unusual with a buffer,\n such as setting ptr to a value that was passed in by the user. In\n those cases, the behavior will be clearly documented by the API.

\n","fields":[{"type":"char *","name":"ptr","comments":""},{"type":"size_t","name":"asize","comments":""},{"type":"size_t","name":"size","comments":""}],"used":{"returns":[],"needs":["git_blob_filtered_content","git_buf_contains_nul","git_buf_free","git_buf_grow","git_buf_is_binary","git_buf_set","git_commit_header_field","git_config_find_global","git_config_find_system","git_config_find_xdg","git_config_get_path","git_config_get_string_buf","git_config_parse_path","git_describe_format","git_diff_commit_as_email","git_diff_format_email","git_diff_stats_to_buf","git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_stream_data","git_message_prettify","git_object_short_id","git_patch_to_buf","git_refspec_rtransform","git_refspec_transform","git_remote_default_branch","git_repository_discover","git_repository_message","git_submodule_resolve_url"]}}],["git_cert",{"decl":["git_cert_t cert_type"],"type":"struct","value":"git_cert","file":"types.h","line":314,"lineto":319,"block":"git_cert_t cert_type","tdef":"typedef","description":" Parent type for `git_cert_hostkey` and `git_cert_x509`.","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. A `GIT_CERT_` value."}],"used":{"returns":[],"needs":[]}}],["git_cert_hostkey",{"decl":["git_cert_t cert_type","git_cert_ssh_t type","unsigned char [16] hash_md5","unsigned char [20] hash_sha1"],"type":"struct","value":"git_cert_hostkey","file":"transport.h","line":39,"lineto":62,"block":"git_cert_t cert_type\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1","tdef":"typedef","description":" Hostkey information taken from libssh2","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. Here to share the header with\n `git_cert`."},{"type":"git_cert_ssh_t","name":"type","comments":" A hostkey type from libssh2, either\n `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`"},{"type":"unsigned char [16]","name":"hash_md5","comments":" Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey."},{"type":"unsigned char [20]","name":"hash_sha1","comments":" Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey."}],"used":{"returns":[],"needs":[]}}],["git_cert_ssh_t",{"decl":["GIT_CERT_SSH_MD5","GIT_CERT_SSH_SHA1"],"type":"enum","file":"transport.h","line":29,"lineto":34,"block":"GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1","tdef":"typedef","description":" Type of SSH host fingerprint","comments":"","fields":[{"type":"int","name":"GIT_CERT_SSH_MD5","comments":"

MD5 is available

\n","value":1},{"type":"int","name":"GIT_CERT_SSH_SHA1","comments":"

SHA-1 is available

\n","value":2}],"used":{"returns":[],"needs":[]}}],["git_cert_t",{"decl":["GIT_CERT_NONE","GIT_CERT_X509","GIT_CERT_HOSTKEY_LIBSSH2","GIT_CERT_STRARRAY"],"type":"enum","file":"types.h","line":286,"lineto":309,"block":"GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY","tdef":"typedef","description":" Type of host certificate structure that is passed to the check callback","comments":"","fields":[{"type":"int","name":"GIT_CERT_NONE","comments":"

No information about the certificate is available. This may\n happen when using curl.

\n","value":0},{"type":"int","name":"GIT_CERT_X509","comments":"

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n","value":1},{"type":"int","name":"GIT_CERT_HOSTKEY_LIBSSH2","comments":"

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n","value":2},{"type":"int","name":"GIT_CERT_STRARRAY","comments":"

The data argument to the callback will be a pointer to a\n git_strarray with name:content strings containing\n information about the certificate. This is used when using\n curl.

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_cert_x509",{"decl":["git_cert_t cert_type","void * data","size_t len"],"type":"struct","value":"git_cert_x509","file":"transport.h","line":67,"lineto":81,"block":"git_cert_t cert_type\nvoid * data\nsize_t len","tdef":"typedef","description":" X.509 certificate information","comments":"","fields":[{"type":"git_cert_t","name":"cert_type","comments":" Type of certificate. Here to share the header with\n `git_cert`."},{"type":"void *","name":"data","comments":" Pointer to the X.509 certificate data"},{"type":"size_t","name":"len","comments":" Length of the memory block pointed to by `data`."}],"used":{"returns":[],"needs":[]}}],["git_checkout_notify_t",{"decl":["GIT_CHECKOUT_NOTIFY_NONE","GIT_CHECKOUT_NOTIFY_CONFLICT","GIT_CHECKOUT_NOTIFY_DIRTY","GIT_CHECKOUT_NOTIFY_UPDATED","GIT_CHECKOUT_NOTIFY_UNTRACKED","GIT_CHECKOUT_NOTIFY_IGNORED","GIT_CHECKOUT_NOTIFY_ALL"],"type":"enum","file":"checkout.h","line":205,"lineto":214,"block":"GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL","tdef":"typedef","description":" Checkout notification flags","comments":"

Checkout will invoke an options notification callback (notify_cb) for\n certain cases - you pick which ones via notify_flags:

\n\n
    \n
  • GIT_CHECKOUT_NOTIFY_CONFLICT invokes checkout on conflicting paths.

  • \n
  • GIT_CHECKOUT_NOTIFY_DIRTY notifies about "dirty" files, i.e. those that\ndo not need an update but no longer match the baseline. Core git\ndisplays these files when checkout runs, but won't stop the checkout.

  • \n
  • GIT_CHECKOUT_NOTIFY_UPDATED sends notification for any file changed.

  • \n
  • GIT_CHECKOUT_NOTIFY_UNTRACKED notifies about untracked files.

  • \n
  • GIT_CHECKOUT_NOTIFY_IGNORED notifies about ignored files.

  • \n
\n\n

Returning a non-zero value from this callback will cancel the checkout.\n The non-zero return value will be propagated back and returned by the\n git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk,\n so canceling on any notification will still happen prior to any files\n being modified.

\n","fields":[{"type":"int","name":"GIT_CHECKOUT_NOTIFY_NONE","comments":"","value":0},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_CONFLICT","comments":"","value":1},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_DIRTY","comments":"","value":2},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_UPDATED","comments":"","value":4},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_UNTRACKED","comments":"","value":8},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_IGNORED","comments":"","value":16},{"type":"int","name":"GIT_CHECKOUT_NOTIFY_ALL","comments":"","value":65535}],"used":{"returns":[],"needs":[]}}],["git_checkout_options",{"decl":["unsigned int version","unsigned int checkout_strategy","int disable_filters","unsigned int dir_mode","unsigned int file_mode","int file_open_flags","unsigned int notify_flags","git_checkout_notify_cb notify_cb","void * notify_payload","git_checkout_progress_cb progress_cb","void * progress_payload","git_strarray paths","git_tree * baseline","git_index * baseline_index","const char * target_directory","const char * ancestor_label","const char * our_label","const char * their_label","git_checkout_perfdata_cb perfdata_cb","void * perfdata_payload"],"type":"struct","value":"git_checkout_options","file":"checkout.h","line":251,"lineto":295,"block":"unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload","tdef":"typedef","description":" Checkout options structure","comments":"

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"checkout_strategy","comments":" default will be a dry run "},{"type":"int","name":"disable_filters","comments":" don't apply filters like CRLF conversion "},{"type":"unsigned int","name":"dir_mode","comments":" default is 0755 "},{"type":"unsigned int","name":"file_mode","comments":" default is 0644 or 0755 as dictated by blob "},{"type":"int","name":"file_open_flags","comments":" default is O_CREAT | O_TRUNC | O_WRONLY "},{"type":"unsigned int","name":"notify_flags","comments":" see `git_checkout_notify_t` above "},{"type":"git_checkout_notify_cb","name":"notify_cb","comments":""},{"type":"void *","name":"notify_payload","comments":""},{"type":"git_checkout_progress_cb","name":"progress_cb","comments":" Optional callback to notify the consumer of checkout progress. "},{"type":"void *","name":"progress_payload","comments":""},{"type":"git_strarray","name":"paths","comments":" When not zeroed out, array of fnmatch patterns specifying which\n paths should be taken into account, otherwise all files. Use\n GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list."},{"type":"git_tree *","name":"baseline","comments":" The expected content of the working directory; defaults to HEAD.\n If the working directory does not match this baseline information,\n that will produce a checkout conflict."},{"type":"git_index *","name":"baseline_index","comments":" expected content of workdir, expressed as an index. "},{"type":"const char *","name":"target_directory","comments":" alternative checkout path to workdir "},{"type":"const char *","name":"ancestor_label","comments":" the name of the common ancestor side of conflicts "},{"type":"const char *","name":"our_label","comments":" the name of the \"our\" side of conflicts "},{"type":"const char *","name":"their_label","comments":" the name of the \"their\" side of conflicts "},{"type":"git_checkout_perfdata_cb","name":"perfdata_cb","comments":" Optional callback to notify the consumer of performance data. "},{"type":"void *","name":"perfdata_payload","comments":""}],"used":{"returns":[],"needs":["git_checkout_head","git_checkout_index","git_checkout_init_options","git_checkout_tree","git_merge","git_reset","git_reset_from_annotated"]}}],["git_checkout_strategy_t",{"decl":["GIT_CHECKOUT_NONE","GIT_CHECKOUT_SAFE","GIT_CHECKOUT_FORCE","GIT_CHECKOUT_RECREATE_MISSING","GIT_CHECKOUT_ALLOW_CONFLICTS","GIT_CHECKOUT_REMOVE_UNTRACKED","GIT_CHECKOUT_REMOVE_IGNORED","GIT_CHECKOUT_UPDATE_ONLY","GIT_CHECKOUT_DONT_UPDATE_INDEX","GIT_CHECKOUT_NO_REFRESH","GIT_CHECKOUT_SKIP_UNMERGED","GIT_CHECKOUT_USE_OURS","GIT_CHECKOUT_USE_THEIRS","GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH","GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES","GIT_CHECKOUT_DONT_OVERWRITE_IGNORED","GIT_CHECKOUT_CONFLICT_STYLE_MERGE","GIT_CHECKOUT_CONFLICT_STYLE_DIFF3","GIT_CHECKOUT_DONT_REMOVE_EXISTING","GIT_CHECKOUT_DONT_WRITE_INDEX","GIT_CHECKOUT_UPDATE_SUBMODULES","GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED"],"type":"enum","file":"checkout.h","line":106,"lineto":177,"block":"GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED","tdef":"typedef","description":" Checkout behavior flags","comments":"

In libgit2, checkout is used to update the working directory and index\n to match a target tree. Unlike git checkout, it does not move the HEAD\n commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to\n check out, the "baseline" tree of what was checked out previously, the\n working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n
    \n
  • GIT_CHECKOUT_NONE is a dry-run strategy that checks for conflicts,\netc., but doesn't make any actual changes.

  • \n
  • GIT_CHECKOUT_FORCE is at the opposite extreme, taking any action to\nmake the working directory match the target (including potentially\ndiscarding modified files).

  • \n
  • GIT_CHECKOUT_SAFE is between these two options, it will only make\nmodifications that will not lose changes.

    \n\n
                     |  target == baseline   |  target != baseline  |\n
    \n\n

    ---------------------|-----------------------|----------------------|\n workdir == baseline | no action | create, update, or |\n | | delete file |\n---------------------|-----------------------|----------------------|\n workdir exists and | no action | conflict (notify |\n is != baseline | notify dirty MODIFIED | and cancel checkout) |\n---------------------|-----------------------|----------------------|\n workdir missing, | notify dirty DELETED | create file |\n baseline present | | |\n---------------------|-----------------------|----------------------|

  • \n
\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout\n notification callback (see below) that displays information about dirty\n files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a\n notification callback that cancels the operation if a dirty-but-existing\n file is found in the working directory. This core git command isn't\n quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n
    \n
  • GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates\neven if there are conflicts (instead of cancelling the checkout).

  • \n
  • GIT_CHECKOUT_REMOVE_UNTRACKED means remove untracked files (i.e. not\nin target, baseline, or index, and not ignored) from the working dir.

  • \n
  • GIT_CHECKOUT_REMOVE_IGNORED means remove ignored files (that are also\nuntracked) from the working directory as well.

  • \n
  • GIT_CHECKOUT_UPDATE_ONLY means to only update the content of files that\nalready exist. Files will not be created nor deleted. This just skips\napplying adds, deletes, and typechanges.

  • \n
  • GIT_CHECKOUT_DONT_UPDATE_INDEX prevents checkout from writing the\nupdated files' information to the index.

  • \n
  • Normally, checkout will reload the index and git attributes from disk\nbefore any operations. GIT_CHECKOUT_NO_REFRESH prevents this reload.

  • \n
  • Unmerged index entries are conflicts. GIT_CHECKOUT_SKIP_UNMERGED skips\nfiles with unmerged index entries instead. GIT_CHECKOUT_USE_OURS and\nGIT_CHECKOUT_USE_THEIRS to proceed with the checkout using either the\nstage 2 ("ours") or stage 3 ("theirs") version of files in the index.

  • \n
  • GIT_CHECKOUT_DONT_OVERWRITE_IGNORED prevents ignored files from being\noverwritten. Normally, files that are ignored in the working directory\nare not considered "precious" and may be overwritten if the checkout\ntarget contains that file.

  • \n
  • GIT_CHECKOUT_DONT_REMOVE_EXISTING prevents checkout from removing\nfiles or folders that fold to the same name on case insensitive\nfilesystems. This can cause files to retain their existing names\nand write through existing symbolic links.

  • \n
\n","fields":[{"type":"int","name":"GIT_CHECKOUT_NONE","comments":"

default is a dry run, no actual updates

\n","value":0},{"type":"int","name":"GIT_CHECKOUT_SAFE","comments":"

Allow safe updates that cannot overwrite uncommitted data

\n","value":1},{"type":"int","name":"GIT_CHECKOUT_FORCE","comments":"

Allow all updates to force working directory to look like index

\n","value":2},{"type":"int","name":"GIT_CHECKOUT_RECREATE_MISSING","comments":"

Allow checkout to recreate missing files

\n","value":4},{"type":"int","name":"GIT_CHECKOUT_ALLOW_CONFLICTS","comments":"

Allow checkout to make safe updates even if conflicts are found

\n","value":16},{"type":"int","name":"GIT_CHECKOUT_REMOVE_UNTRACKED","comments":"

Remove untracked files not in index (that are not ignored)

\n","value":32},{"type":"int","name":"GIT_CHECKOUT_REMOVE_IGNORED","comments":"

Remove ignored files not in index

\n","value":64},{"type":"int","name":"GIT_CHECKOUT_UPDATE_ONLY","comments":"

Only update existing files, don't create new ones

\n","value":128},{"type":"int","name":"GIT_CHECKOUT_DONT_UPDATE_INDEX","comments":"

Normally checkout updates index entries as it goes; this stops that.\n Implies GIT_CHECKOUT_DONT_WRITE_INDEX.

\n","value":256},{"type":"int","name":"GIT_CHECKOUT_NO_REFRESH","comments":"

Don't refresh index/config/etc before doing checkout

\n","value":512},{"type":"int","name":"GIT_CHECKOUT_SKIP_UNMERGED","comments":"

Allow checkout to skip unmerged files

\n","value":1024},{"type":"int","name":"GIT_CHECKOUT_USE_OURS","comments":"

For unmerged files, checkout stage 2 from index

\n","value":2048},{"type":"int","name":"GIT_CHECKOUT_USE_THEIRS","comments":"

For unmerged files, checkout stage 3 from index

\n","value":4096},{"type":"int","name":"GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH","comments":"

Treat pathspec as simple list of exact match file paths

\n","value":8192},{"type":"int","name":"GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES","comments":"

Ignore directories in use, they will be left empty

\n","value":262144},{"type":"int","name":"GIT_CHECKOUT_DONT_OVERWRITE_IGNORED","comments":"

Don't overwrite ignored files that exist in the checkout target

\n","value":524288},{"type":"int","name":"GIT_CHECKOUT_CONFLICT_STYLE_MERGE","comments":"

Write normal merge files for conflicts

\n","value":1048576},{"type":"int","name":"GIT_CHECKOUT_CONFLICT_STYLE_DIFF3","comments":"

Include common ancestor data in diff3 format files for conflicts

\n","value":2097152},{"type":"int","name":"GIT_CHECKOUT_DONT_REMOVE_EXISTING","comments":"

Don't overwrite existing files or folders

\n","value":4194304},{"type":"int","name":"GIT_CHECKOUT_DONT_WRITE_INDEX","comments":"

Normally checkout writes the index upon completion; this prevents that.

\n","value":8388608},{"type":"int","name":"GIT_CHECKOUT_UPDATE_SUBMODULES","comments":"

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n","value":65536},{"type":"int","name":"GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED","comments":"

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n","value":131072}],"used":{"returns":[],"needs":[]}}],["git_cherrypick_options",{"decl":["unsigned int version","unsigned int mainline","git_merge_options merge_opts","git_checkout_options checkout_opts"],"type":"struct","value":"git_cherrypick_options","file":"cherrypick.h","line":26,"lineto":34,"block":"unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts","tdef":"typedef","description":" Cherry-pick options","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"mainline","comments":" For merge commits, the \"mainline\" is treated as the parent. "},{"type":"git_merge_options","name":"merge_opts","comments":" Options for the merging "},{"type":"git_checkout_options","name":"checkout_opts","comments":" Options for the checkout "}],"used":{"returns":[],"needs":["git_cherrypick","git_cherrypick_init_options"]}}],["git_clone_local_t",{"decl":["GIT_CLONE_LOCAL_AUTO","GIT_CLONE_LOCAL","GIT_CLONE_NO_LOCAL","GIT_CLONE_LOCAL_NO_LINKS"],"type":"enum","file":"clone.h","line":33,"lineto":53,"block":"GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS","tdef":"typedef","description":" Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.","comments":"","fields":[{"type":"int","name":"GIT_CLONE_LOCAL_AUTO","comments":"

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n","value":0},{"type":"int","name":"GIT_CLONE_LOCAL","comments":"

Bypass the git-aware transport even for a file:// url.

\n","value":1},{"type":"int","name":"GIT_CLONE_NO_LOCAL","comments":"

Do no bypass the git-aware transport

\n","value":2},{"type":"int","name":"GIT_CLONE_LOCAL_NO_LINKS","comments":"

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_clone_options",{"decl":["unsigned int version","git_checkout_options checkout_opts","git_fetch_options fetch_opts","int bare","git_clone_local_t local","const char * checkout_branch","git_repository_create_cb repository_cb","void * repository_cb_payload","git_remote_create_cb remote_cb","void * remote_cb_payload"],"type":"struct","value":"git_clone_options","file":"clone.h","line":103,"lineto":164,"block":"unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload","tdef":"typedef","description":" Clone options structure","comments":"

Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_clone_options opts = GIT_CLONE_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":" These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`."},{"type":"git_fetch_options","name":"fetch_opts","comments":" Options which control the fetch, including callbacks.\n\n The callbacks are used for reporting fetch progress, and for acquiring\n credentials in the event they are needed."},{"type":"int","name":"bare","comments":" Set to zero (false) to create a standard repo, or non-zero\n for a bare repo"},{"type":"git_clone_local_t","name":"local","comments":" Whether to use a fetch or copy the object database."},{"type":"const char *","name":"checkout_branch","comments":" The name of the branch to checkout. NULL means use the\n remote's default branch."},{"type":"git_repository_create_cb","name":"repository_cb","comments":" A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository."},{"type":"void *","name":"repository_cb_payload","comments":" An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL."},{"type":"git_remote_create_cb","name":"remote_cb","comments":" A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior."},{"type":"void *","name":"remote_cb_payload","comments":" An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL."}],"used":{"returns":[],"needs":["git_clone","git_clone_init_options"]}}],["git_commit",{"decl":"git_commit","type":"struct","value":"git_commit","file":"types.h","line":120,"lineto":120,"tdef":"typedef","description":" Parsed representation of a commit object. ","comments":"","used":{"returns":[],"needs":["git_branch_create","git_cherrypick","git_cherrypick_commit","git_commit_amend","git_commit_author","git_commit_committer","git_commit_create","git_commit_free","git_commit_header_field","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_message_raw","git_commit_nth_gen_ancestor","git_commit_owner","git_commit_parent","git_commit_parent_id","git_commit_parentcount","git_commit_raw_header","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_id","git_diff_commit_as_email","git_merge_commits","git_revert","git_revert_commit"]}}],["git_config",{"decl":"git_config","type":"struct","value":"git_config","file":"types.h","line":138,"lineto":138,"tdef":"typedef","description":" Memory representation of a set of config files ","comments":"","used":{"returns":[],"needs":["git_config_add_backend","git_config_add_file_ondisk","git_config_delete_entry","git_config_delete_multivar","git_config_foreach","git_config_foreach_match","git_config_free","git_config_get_bool","git_config_get_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar_foreach","git_config_get_path","git_config_get_string","git_config_get_string_buf","git_config_iterator_glob_new","git_config_iterator_new","git_config_multivar_iterator_new","git_config_new","git_config_open_default","git_config_open_global","git_config_open_level","git_config_open_ondisk","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string","git_config_snapshot","git_repository_config","git_repository_config_snapshot","git_repository_set_config"]}}],["git_config_backend",{"decl":"git_config_backend","type":"struct","value":"git_config_backend","file":"types.h","line":141,"lineto":141,"block":"unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nvoid (*)(struct git_config_backend *) free","tdef":"typedef","description":" Interface to access a configuration file ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"int","name":"readonly","comments":" True if this backend is for a snapshot "},{"type":"struct git_config *","name":"cfg","comments":""},{"type":"int (*)(struct git_config_backend *, git_config_level_t)","name":"open","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, git_config_entry **)","name":"get","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, const char *)","name":"set","comments":""},{"type":"int (*)(git_config_backend *, const char *, const char *, const char *)","name":"set_multivar","comments":""},{"type":"int (*)(struct git_config_backend *, const char *)","name":"del","comments":""},{"type":"int (*)(struct git_config_backend *, const char *, const char *)","name":"del_multivar","comments":""},{"type":"int (*)(git_config_iterator **, struct git_config_backend *)","name":"iterator","comments":""},{"type":"int (*)(struct git_config_backend **, struct git_config_backend *)","name":"snapshot","comments":" Produce a read-only version of this backend "},{"type":"void (*)(struct git_config_backend *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_config_add_backend","git_config_backend_foreach_match","git_config_init_backend"]}}],["git_config_entry",{"decl":["const char * name","const char * value","git_config_level_t level","void (*)(struct git_config_entry *) free","void * payload"],"type":"struct","value":"git_config_entry","file":"config.h","line":61,"lineto":67,"block":"const char * name\nconst char * value\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload","tdef":"typedef","description":" An entry in a configuration file","comments":"","fields":[{"type":"const char *","name":"name","comments":" Name of the entry (normalised) "},{"type":"const char *","name":"value","comments":" String value of the entry "},{"type":"git_config_level_t","name":"level","comments":" Which config file this was found in "},{"type":"void (*)(struct git_config_entry *)","name":"free","comments":" Free function for this entry "},{"type":"void *","name":"payload","comments":" Opaque value for the free function. Do not read or write "}],"used":{"returns":[],"needs":["git_config_entry_free","git_config_get_entry","git_config_next"]}}],["git_config_iterator",{"decl":["git_config_backend * backend","unsigned int flags","int (*)(git_config_entry **, git_config_iterator *) next","void (*)(git_config_iterator *) free"],"type":"struct","value":"git_config_iterator","file":"sys/config.h","line":34,"lineto":48,"block":"git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free","tdef":null,"description":" Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as","comments":"
 struct my_iterator {\n         git_config_iterator parent;\n         ...\n }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n","fields":[{"type":"git_config_backend *","name":"backend","comments":""},{"type":"unsigned int","name":"flags","comments":""},{"type":"int (*)(git_config_entry **, git_config_iterator *)","name":"next","comments":" Return the current entry and advance the iterator. The\n memory belongs to the library."},{"type":"void (*)(git_config_iterator *)","name":"free","comments":" Free the iterator"}],"used":{"returns":[],"needs":["git_config_iterator_free","git_config_iterator_glob_new","git_config_iterator_new","git_config_multivar_iterator_new","git_config_next"]}}],["git_config_level_t",{"decl":["GIT_CONFIG_LEVEL_SYSTEM","GIT_CONFIG_LEVEL_XDG","GIT_CONFIG_LEVEL_GLOBAL","GIT_CONFIG_LEVEL_LOCAL","GIT_CONFIG_LEVEL_APP","GIT_CONFIG_HIGHEST_LEVEL"],"type":"enum","file":"config.h","line":31,"lineto":56,"block":"GIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL","tdef":"typedef","description":" Priority level of a config file.\n These priority levels correspond to the natural escalation logic\n (from higher to lower) when searching for config entries in git.git.","comments":"

git_config_open_default() and git_repository_config() honor those\n priority levels as well.

\n","fields":[{"type":"int","name":"GIT_CONFIG_LEVEL_SYSTEM","comments":"

System-wide configuration file; /etc/gitconfig on Linux systems

\n","value":1},{"type":"int","name":"GIT_CONFIG_LEVEL_XDG","comments":"

XDG compatible configuration file; typically ~/.config/git/config

\n","value":2},{"type":"int","name":"GIT_CONFIG_LEVEL_GLOBAL","comments":"

User-specific configuration file (also called Global configuration\n file); typically ~/.gitconfig

\n","value":3},{"type":"int","name":"GIT_CONFIG_LEVEL_LOCAL","comments":"

Repository specific configuration file; $WORK_DIR/.git/config on\n non-bare repos

\n","value":4},{"type":"int","name":"GIT_CONFIG_LEVEL_APP","comments":"

Application specific configuration file; freely defined by applications

\n","value":5},{"type":"int","name":"GIT_CONFIG_HIGHEST_LEVEL","comments":"

Represents the highest level available config file (i.e. the most\n specific config file available that actually is loaded)

\n","value":-1}],"used":{"returns":[],"needs":["git_config_add_backend","git_config_add_file_ondisk","git_config_open_level"]}}],["git_cred_default",{"decl":"git_cred_default","type":"struct","value":"git_cred_default","file":"transport.h","line":183,"lineto":183,"tdef":"typedef","description":" A key for NTLM/Kerberos \"default\" credentials ","comments":"","used":{"returns":[],"needs":[]}}],["git_cred_ssh_custom",{"decl":["git_cred parent","char * username","char * publickey","size_t publickey_len","git_cred_sign_callback sign_callback","void * payload"],"type":"struct","value":"git_cred_ssh_custom","file":"transport.h","line":173,"lineto":180,"block":"git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload","tdef":"typedef","description":" A key with a custom signature function","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"publickey","comments":""},{"type":"size_t","name":"publickey_len","comments":""},{"type":"git_cred_sign_callback","name":"sign_callback","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_ssh_interactive",{"decl":["git_cred parent","char * username","git_cred_ssh_interactive_callback prompt_callback","void * payload"],"type":"struct","value":"git_cred_ssh_interactive","file":"transport.h","line":163,"lineto":168,"block":"git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload","tdef":"typedef","description":" Keyboard-interactive based ssh authentication","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"git_cred_ssh_interactive_callback","name":"prompt_callback","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_ssh_key",{"decl":["git_cred parent","char * username","char * publickey","char * privatekey","char * passphrase"],"type":"struct","value":"git_cred_ssh_key","file":"transport.h","line":152,"lineto":158,"block":"git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase","tdef":"typedef","description":" A ssh key from disk","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"publickey","comments":""},{"type":"char *","name":"privatekey","comments":""},{"type":"char *","name":"passphrase","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_username",{"decl":["git_cred parent","char [1] username"],"type":"struct","value":"git_cred_username","file":"transport.h","line":186,"lineto":189,"block":"git_cred parent\nchar [1] username","tdef":"typedef","description":" Username-only credential information ","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char [1]","name":"username","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_userpass_payload",{"decl":["const char * username","const char * password"],"type":"struct","value":"git_cred_userpass_payload","file":"cred_helpers.h","line":24,"lineto":27,"block":"const char * username\nconst char * password","tdef":"typedef","description":" Payload for git_cred_stock_userpass_plaintext.","comments":"","fields":[{"type":"const char *","name":"username","comments":""},{"type":"const char *","name":"password","comments":""}],"used":{"returns":[],"needs":[]}}],["git_cred_userpass_plaintext",{"decl":["git_cred parent","char * username","char * password"],"type":"struct","value":"git_cred_userpass_plaintext","file":"transport.h","line":129,"lineto":133,"block":"git_cred parent\nchar * username\nchar * password","tdef":"typedef","description":" A plaintext username and password ","comments":"","fields":[{"type":"git_cred","name":"parent","comments":""},{"type":"char *","name":"username","comments":""},{"type":"char *","name":"password","comments":""}],"used":{"returns":[],"needs":[]}}],["git_credtype_t",{"decl":["GIT_CREDTYPE_USERPASS_PLAINTEXT","GIT_CREDTYPE_SSH_KEY","GIT_CREDTYPE_SSH_CUSTOM","GIT_CREDTYPE_DEFAULT","GIT_CREDTYPE_SSH_INTERACTIVE","GIT_CREDTYPE_USERNAME","GIT_CREDTYPE_SSH_MEMORY"],"type":"enum","file":"transport.h","line":88,"lineto":118,"block":"GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME\nGIT_CREDTYPE_SSH_MEMORY","tdef":"typedef","description":" Authentication type requested ","comments":"","fields":[{"type":"int","name":"GIT_CREDTYPE_USERPASS_PLAINTEXT","comments":"","value":1},{"type":"int","name":"GIT_CREDTYPE_SSH_KEY","comments":"","value":2},{"type":"int","name":"GIT_CREDTYPE_SSH_CUSTOM","comments":"","value":4},{"type":"int","name":"GIT_CREDTYPE_DEFAULT","comments":"","value":8},{"type":"int","name":"GIT_CREDTYPE_SSH_INTERACTIVE","comments":"","value":16},{"type":"int","name":"GIT_CREDTYPE_USERNAME","comments":"

Username-only information

\n\n

If the SSH transport does not know which username to use,\n it will ask via this credential type.

\n","value":32},{"type":"int","name":"GIT_CREDTYPE_SSH_MEMORY","comments":"

Credentials read from memory.

\n\n

Only available for libssh2+OpenSSL for now.

\n","value":64}],"used":{"returns":[],"needs":[]}}],["git_cvar_map",{"decl":["git_cvar_t cvar_type","const char * str_match","int map_value"],"type":"struct","value":"git_cvar_map","file":"config.h","line":90,"lineto":94,"block":"git_cvar_t cvar_type\nconst char * str_match\nint map_value","tdef":"typedef","description":" Mapping from config variables to values.","comments":"","fields":[{"type":"git_cvar_t","name":"cvar_type","comments":""},{"type":"const char *","name":"str_match","comments":""},{"type":"int","name":"map_value","comments":""}],"used":{"returns":[],"needs":["git_config_get_mapped","git_config_lookup_map_value"]}}],["git_cvar_t",{"decl":["GIT_CVAR_FALSE","GIT_CVAR_TRUE","GIT_CVAR_INT32","GIT_CVAR_STRING"],"type":"enum","file":"config.h","line":80,"lineto":85,"block":"GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING","tdef":"typedef","description":" Config var type","comments":"","fields":[{"type":"int","name":"GIT_CVAR_FALSE","comments":"","value":0},{"type":"int","name":"GIT_CVAR_TRUE","comments":"","value":1},{"type":"int","name":"GIT_CVAR_INT32","comments":"","value":2},{"type":"int","name":"GIT_CVAR_STRING","comments":"","value":3}],"used":{"returns":[],"needs":[]}}],["git_delta_t",{"decl":["GIT_DELTA_UNMODIFIED","GIT_DELTA_ADDED","GIT_DELTA_DELETED","GIT_DELTA_MODIFIED","GIT_DELTA_RENAMED","GIT_DELTA_COPIED","GIT_DELTA_IGNORED","GIT_DELTA_UNTRACKED","GIT_DELTA_TYPECHANGE","GIT_DELTA_UNREADABLE","GIT_DELTA_CONFLICTED"],"type":"enum","file":"diff.h","line":242,"lineto":254,"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\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED","tdef":"typedef","description":" What type of change is described by a git_diff_delta?","comments":"

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run\n git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE\n in the option flags (otherwise type changes will be split into ADDED /\n DELETED pairs).

\n","fields":[{"type":"int","name":"GIT_DELTA_UNMODIFIED","comments":"

no changes

\n","value":0},{"type":"int","name":"GIT_DELTA_ADDED","comments":"

entry does not exist in old version

\n","value":1},{"type":"int","name":"GIT_DELTA_DELETED","comments":"

entry does not exist in new version

\n","value":2},{"type":"int","name":"GIT_DELTA_MODIFIED","comments":"

entry content changed between old and new

\n","value":3},{"type":"int","name":"GIT_DELTA_RENAMED","comments":"

entry was renamed between old and new

\n","value":4},{"type":"int","name":"GIT_DELTA_COPIED","comments":"

entry was copied from another old entry

\n","value":5},{"type":"int","name":"GIT_DELTA_IGNORED","comments":"

entry is ignored item in workdir

\n","value":6},{"type":"int","name":"GIT_DELTA_UNTRACKED","comments":"

entry is untracked item in workdir

\n","value":7},{"type":"int","name":"GIT_DELTA_TYPECHANGE","comments":"

type of entry changed between old and new

\n","value":8},{"type":"int","name":"GIT_DELTA_UNREADABLE","comments":"

entry is unreadable

\n","value":9},{"type":"int","name":"GIT_DELTA_CONFLICTED","comments":"

entry in the index is conflicted

\n","value":10}],"used":{"returns":[],"needs":["git_diff_num_deltas_of_type","git_diff_status_char"]}}],["git_describe_format_options",{"decl":["unsigned int version","unsigned int abbreviated_size","int always_use_long_format","const char * dirty_suffix"],"type":"struct","value":"git_describe_format_options","file":"describe.h","line":78,"lineto":98,"block":"unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix","tdef":"typedef","description":" Options for formatting the describe string","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"abbreviated_size","comments":" Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7."},{"type":"int","name":"always_use_long_format","comments":" Set to use the long format even when a shorter name could be used."},{"type":"const char *","name":"dirty_suffix","comments":" If the workdir is dirty and this is set, this string will\n be appended to the description string."}],"used":{"returns":[],"needs":["git_describe_format"]}}],["git_describe_options",{"decl":["unsigned int version","unsigned int max_candidates_tags","unsigned int describe_strategy","const char * pattern","int only_follow_first_parent","int show_commit_oid_as_fallback"],"type":"struct","value":"git_describe_options","file":"describe.h","line":44,"lineto":62,"block":"unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback","tdef":"typedef","description":" Describe options structure","comments":"

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set\n the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"max_candidates_tags","comments":""},{"type":"unsigned int","name":"describe_strategy","comments":" default: 10 "},{"type":"const char *","name":"pattern","comments":" default: GIT_DESCRIBE_DEFAULT "},{"type":"int","name":"only_follow_first_parent","comments":" When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry."},{"type":"int","name":"show_commit_oid_as_fallback","comments":" If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit."}],"used":{"returns":[],"needs":["git_describe_commit","git_describe_workdir"]}}],["git_describe_strategy_t",{"decl":["GIT_DESCRIBE_DEFAULT","GIT_DESCRIBE_TAGS","GIT_DESCRIBE_ALL"],"type":"enum","file":"describe.h","line":30,"lineto":34,"block":"GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL","tdef":"typedef","description":" Reference lookup strategy","comments":"

These behave like the --tags and --all optios to git-describe,\n namely they say to look for any reference in either refs/tags/ or\n refs/ respectively.

\n","fields":[{"type":"int","name":"GIT_DESCRIBE_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_DESCRIBE_TAGS","comments":"","value":1},{"type":"int","name":"GIT_DESCRIBE_ALL","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_diff",{"decl":"git_diff","type":"struct","value":"git_diff","file":"diff.h","line":215,"lineto":215,"tdef":"typedef","description":" The diff object that contains all individual file deltas.","comments":"

This is an opaque structure which will be allocated by one of the diff\n generator functions below (such as git_diff_tree_to_tree). You are\n responsible for releasing the object memory when done, using the\n git_diff_free() function.

\n","used":{"returns":[],"needs":["git_diff_find_similar","git_diff_foreach","git_diff_format_email","git_diff_free","git_diff_get_delta","git_diff_get_perfdata","git_diff_get_stats","git_diff_index_to_workdir","git_diff_is_sorted_icase","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_print","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_patch_from_diff","git_pathspec_match_diff"]}}],["git_diff_binary",{"decl":["git_diff_binary_file old_file","git_diff_binary_file new_file"],"type":"struct","value":"git_diff_binary","file":"diff.h","line":461,"lineto":464,"block":"git_diff_binary_file old_file\ngit_diff_binary_file new_file","tdef":"typedef","description":" Structure describing the binary contents of a diff. ","comments":"","fields":[{"type":"git_diff_binary_file","name":"old_file","comments":" The contents of the old file. "},{"type":"git_diff_binary_file","name":"new_file","comments":" The contents of the new file. "}],"used":{"returns":[],"needs":[]}}],["git_diff_binary_file",{"decl":["git_diff_binary_t type","const char * data","size_t datalen","size_t inflatedlen"],"type":"struct","value":"git_diff_binary_file","file":"diff.h","line":446,"lineto":458,"block":"git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen","tdef":"typedef","description":" The contents of one of the files in a binary diff. ","comments":"","fields":[{"type":"git_diff_binary_t","name":"type","comments":" The type of binary data for this file. "},{"type":"const char *","name":"data","comments":" The binary data, deflated. "},{"type":"size_t","name":"datalen","comments":" The length of the binary data. "},{"type":"size_t","name":"inflatedlen","comments":" The length of the binary data after inflation. "}],"used":{"returns":[],"needs":[]}}],["git_diff_binary_t",{"decl":["GIT_DIFF_BINARY_NONE","GIT_DIFF_BINARY_LITERAL","GIT_DIFF_BINARY_DELTA"],"type":"enum","file":"diff.h","line":434,"lineto":443,"block":"GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA","tdef":"typedef","description":" When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).","comments":"","fields":[{"type":"int","name":"GIT_DIFF_BINARY_NONE","comments":"

There is no binary delta.

\n","value":0},{"type":"int","name":"GIT_DIFF_BINARY_LITERAL","comments":"

The binary data is the literal contents of the file.

\n","value":1},{"type":"int","name":"GIT_DIFF_BINARY_DELTA","comments":"

The binary data is the delta from one side to the other.

\n","value":2}],"used":{"returns":[],"needs":[]}}],["git_diff_delta",{"decl":["git_delta_t status","uint32_t flags","uint16_t similarity","uint16_t nfiles","git_diff_file old_file","git_diff_file new_file"],"type":"struct","value":"git_diff_delta","file":"diff.h","line":321,"lineto":328,"block":"git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file","tdef":"typedef","description":" Description of changes to one entry.","comments":"

When iterating over a diff, this will be passed to most callbacks and\n you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file\n represents to "to" side of the diff. What those means depend on the\n function that was used to generate the diff and will be documented below.\n You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file",\n they actually may correspond to entries that represent a file, a symbolic\n link, a submodule commit id, or even a tree (if you are tracking type\n changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will\n be filled in, but we generally try to fill in as much as possible. One\n example is that the "flags" field may not have either the BINARY or the\n NOT_BINARY flag set to avoid examining file contents if you do not pass\n in hunk and/or line callbacks to the diff foreach iteration function. It\n will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar()\n which does a similarity analysis of files in the diff. Use that\n function to do rename and copy detection, and to split heavily modified\n files in add/delete pairs. After that call, deltas with a status of\n GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score\n between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to\n break, but to not actually break the records, then GIT_DELTA_MODIFIED\n records may have a non-zero similarity score if the self-similarity is\n below the split threshold. To display this value like core Git, invert\n the score (a la printf("M%03d", 100 - delta->similarity)).

\n","fields":[{"type":"git_delta_t","name":"status","comments":""},{"type":"uint32_t","name":"flags","comments":" git_diff_flag_t values "},{"type":"uint16_t","name":"similarity","comments":" for RENAMED and COPIED, value 0-100 "},{"type":"uint16_t","name":"nfiles","comments":" number of files in this delta "},{"type":"git_diff_file","name":"old_file","comments":""},{"type":"git_diff_file","name":"new_file","comments":""}],"used":{"returns":["git_diff_get_delta","git_patch_get_delta","git_pathspec_match_list_diff_entry"],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle"]}}],["git_diff_file",{"decl":["git_oid id","const char * path","git_off_t size","uint32_t flags","uint16_t mode"],"type":"struct","value":"git_diff_file","file":"diff.h","line":277,"lineto":283,"block":"git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode","tdef":"typedef","description":" Description of one side of a delta.","comments":"

Although this is called a "file", it could represent a file, a symbolic\n link, a submodule commit id, or even a tree (although that only if you\n are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an\n absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta),\n then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working\n directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will\n be restricted to one of the git_filemode_t values.

\n","fields":[{"type":"git_oid","name":"id","comments":""},{"type":"const char *","name":"path","comments":""},{"type":"git_off_t","name":"size","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint16_t","name":"mode","comments":""}],"used":{"returns":[],"needs":[]}}],["git_diff_find_options",{"decl":["unsigned int version","uint32_t flags","uint16_t rename_threshold","uint16_t rename_from_rewrite_threshold","uint16_t copy_threshold","uint16_t break_rewrite_threshold","size_t rename_limit","git_diff_similarity_metric * metric"],"type":"struct","value":"git_diff_find_options","file":"diff.h","line":658,"lineto":684,"block":"unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric","tdef":"typedef","description":" Control behavior of rename and copy detection","comments":"

These options mostly mimic parameters that can be passed to git-diff.

\n\n
    \n
  • rename_threshold is the same as the -M option with a value
  • \n
  • copy_threshold is the same as the -C option with a value
  • \n
  • rename_from_rewrite_threshold matches the top of the -B option
  • \n
  • break_rewrite_threshold matches the bottom of the -B option
  • \n
  • rename_limit is the maximum number of matches to consider for\na particular file. This is a little different from the -l option\nto regular Git because we will still process up to this many matches\nbefore abandoning the search.
  • \n
\n\n

The metric option allows you to plug in a custom similarity metric.\n Set it to NULL for the default internal metric which is based on sampling\n hashes of ranges of data in the file. The default metric is a pretty\n good similarity approximation that should work fairly well for both text\n and binary data, and is pretty fast with fixed memory overhead.

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":" Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing."},{"type":"uint16_t","name":"rename_threshold","comments":" Similarity to consider a file renamed (default 50) "},{"type":"uint16_t","name":"rename_from_rewrite_threshold","comments":" Similarity of modified to be eligible rename source (default 50) "},{"type":"uint16_t","name":"copy_threshold","comments":" Similarity to consider a file a copy (default 50) "},{"type":"uint16_t","name":"break_rewrite_threshold","comments":" Similarity to split modify into delete/add pair (default 60) "},{"type":"size_t","name":"rename_limit","comments":" Maximum similarity sources to examine for a file (somewhat like\n git-diff's `-l` option or `diff.renameLimit` config) (default 200)"},{"type":"git_diff_similarity_metric *","name":"metric","comments":" Pluggable similarity metric; pass NULL to use internal metric "}],"used":{"returns":[],"needs":["git_diff_find_init_options","git_diff_find_similar"]}}],["git_diff_find_t",{"decl":["GIT_DIFF_FIND_BY_CONFIG","GIT_DIFF_FIND_RENAMES","GIT_DIFF_FIND_RENAMES_FROM_REWRITES","GIT_DIFF_FIND_COPIES","GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED","GIT_DIFF_FIND_REWRITES","GIT_DIFF_BREAK_REWRITES","GIT_DIFF_FIND_AND_BREAK_REWRITES","GIT_DIFF_FIND_FOR_UNTRACKED","GIT_DIFF_FIND_ALL","GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE","GIT_DIFF_FIND_IGNORE_WHITESPACE","GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE","GIT_DIFF_FIND_EXACT_MATCH_ONLY","GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY","GIT_DIFF_FIND_REMOVE_UNMODIFIED"],"type":"enum","file":"diff.h","line":552,"lineto":621,"block":"GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED","tdef":"typedef","description":" Flags to control the behavior of diff rename/copy detection.","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FIND_BY_CONFIG","comments":"

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n","value":0},{"type":"int","name":"GIT_DIFF_FIND_RENAMES","comments":"

Look for renames? (--find-renames)

\n","value":1},{"type":"int","name":"GIT_DIFF_FIND_RENAMES_FROM_REWRITES","comments":"

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n","value":2},{"type":"int","name":"GIT_DIFF_FIND_COPIES","comments":"

Look for copies? (a la --find-copies).

\n","value":4},{"type":"int","name":"GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED","comments":"

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n","value":8},{"type":"int","name":"GIT_DIFF_FIND_REWRITES","comments":"

Mark significant rewrites for split (--break-rewrites=/M)

\n","value":16},{"type":"int","name":"GIT_DIFF_BREAK_REWRITES","comments":"

Actually split large rewrites into delete/add pairs

\n","value":32},{"type":"int","name":"GIT_DIFF_FIND_AND_BREAK_REWRITES","comments":"

Mark rewrites for split and break into delete/add pairs

\n","value":48},{"type":"int","name":"GIT_DIFF_FIND_FOR_UNTRACKED","comments":"

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n","value":64},{"type":"int","name":"GIT_DIFF_FIND_ALL","comments":"

Turn on all finding features.

\n","value":255},{"type":"int","name":"GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE","comments":"

Measure similarity ignoring leading whitespace (default)

\n","value":0},{"type":"int","name":"GIT_DIFF_FIND_IGNORE_WHITESPACE","comments":"

Measure similarity ignoring all whitespace

\n","value":4096},{"type":"int","name":"GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE","comments":"

Measure similarity including all data

\n","value":8192},{"type":"int","name":"GIT_DIFF_FIND_EXACT_MATCH_ONLY","comments":"

Measure similarity only by comparing SHAs (fast and cheap)

\n","value":16384},{"type":"int","name":"GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY","comments":"

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n","value":32768},{"type":"int","name":"GIT_DIFF_FIND_REMOVE_UNMODIFIED","comments":"

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n","value":65536}],"used":{"returns":[],"needs":[]}}],["git_diff_flag_t",{"decl":["GIT_DIFF_FLAG_BINARY","GIT_DIFF_FLAG_NOT_BINARY","GIT_DIFF_FLAG_VALID_ID","GIT_DIFF_FLAG_EXISTS"],"type":"enum","file":"diff.h","line":225,"lineto":230,"block":"GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS","tdef":"typedef","description":" Flags for the delta object and the file objects on each side.","comments":"

These flags are used for both the flags value of the git_diff_delta\n and the flags for the git_diff_file objects representing the old and\n new sides of the delta. Values outside of this public range should be\n considered reserved for internal or future use.

\n","fields":[{"type":"int","name":"GIT_DIFF_FLAG_BINARY","comments":"

file(s) treated as binary data

\n","value":1},{"type":"int","name":"GIT_DIFF_FLAG_NOT_BINARY","comments":"

file(s) treated as text data

\n","value":2},{"type":"int","name":"GIT_DIFF_FLAG_VALID_ID","comments":"

id value is known correct

\n","value":4},{"type":"int","name":"GIT_DIFF_FLAG_EXISTS","comments":"

file exists at this side of the delta

\n","value":8}],"used":{"returns":[],"needs":[]}}],["git_diff_format_email_flags_t",{"decl":["GIT_DIFF_FORMAT_EMAIL_NONE","GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER"],"type":"enum","file":"diff.h","line":1218,"lineto":1225,"block":"GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER","tdef":"typedef","description":" Formatting options for diff e-mail generation","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FORMAT_EMAIL_NONE","comments":"

Normal patch, the default

\n","value":0},{"type":"int","name":"GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER","comments":"

Don't insert "[PATCH]" in the subject header

\n","value":1}],"used":{"returns":[],"needs":["git_diff_commit_as_email"]}}],["git_diff_format_email_options",{"decl":["unsigned int version","git_diff_format_email_flags_t flags","size_t patch_no","size_t total_patches","const git_oid * id","const char * summary","const git_signature * author"],"type":"struct","value":"git_diff_format_email_options","file":"diff.h","line":1230,"lineto":1249,"block":"unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst git_signature * author","tdef":"typedef","description":" Options for controlling the formatting of the generated e-mail.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_diff_format_email_flags_t","name":"flags","comments":""},{"type":"size_t","name":"patch_no","comments":" This patch number "},{"type":"size_t","name":"total_patches","comments":" Total number of patches in this series "},{"type":"const git_oid *","name":"id","comments":" id to use for the commit "},{"type":"const char *","name":"summary","comments":" Summary of the change "},{"type":"const git_signature *","name":"author","comments":" Author of the change "}],"used":{"returns":[],"needs":["git_diff_format_email","git_diff_format_email_init_options"]}}],["git_diff_format_t",{"decl":["GIT_DIFF_FORMAT_PATCH","GIT_DIFF_FORMAT_PATCH_HEADER","GIT_DIFF_FORMAT_RAW","GIT_DIFF_FORMAT_NAME_ONLY","GIT_DIFF_FORMAT_NAME_STATUS"],"type":"enum","file":"diff.h","line":981,"lineto":987,"block":"GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS","tdef":"typedef","description":" Possible output formats for diff data","comments":"","fields":[{"type":"int","name":"GIT_DIFF_FORMAT_PATCH","comments":"

full git diff

\n","value":1},{"type":"int","name":"GIT_DIFF_FORMAT_PATCH_HEADER","comments":"

just the file headers of patch

\n","value":2},{"type":"int","name":"GIT_DIFF_FORMAT_RAW","comments":"

like git diff --raw

\n","value":3},{"type":"int","name":"GIT_DIFF_FORMAT_NAME_ONLY","comments":"

like git diff --name-only

\n","value":4},{"type":"int","name":"GIT_DIFF_FORMAT_NAME_STATUS","comments":"

like git diff --name-status

\n","value":5}],"used":{"returns":[],"needs":["git_diff_print"]}}],["git_diff_hunk",{"decl":["int old_start","int old_lines","int new_start","int new_lines","size_t header_len","char [128] header"],"type":"struct","value":"git_diff_hunk","file":"diff.h","line":478,"lineto":485,"block":"int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header","tdef":"typedef","description":" Structure describing a hunk of a diff.","comments":"","fields":[{"type":"int","name":"old_start","comments":" Starting line number in old_file "},{"type":"int","name":"old_lines","comments":" Number of lines in old_file "},{"type":"int","name":"new_start","comments":" Starting line number in new_file "},{"type":"int","name":"new_lines","comments":" Number of lines in new_file "},{"type":"size_t","name":"header_len","comments":" Number of bytes in header text "},{"type":"char [128]","name":"header","comments":" Header text, NUL-byte terminated "}],"used":{"returns":[],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_patch_get_hunk"]}}],["git_diff_line",{"decl":["char origin","int old_lineno","int new_lineno","int num_lines","size_t content_len","git_off_t content_offset","const char * content"],"type":"struct","value":"git_diff_line","file":"diff.h","line":525,"lineto":533,"block":"char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content","tdef":"typedef","description":" Structure describing a line (or data span) of a diff.","comments":"","fields":[{"type":"char","name":"origin","comments":" A git_diff_line_t value "},{"type":"int","name":"old_lineno","comments":" Line number in old file or -1 for added line "},{"type":"int","name":"new_lineno","comments":" Line number in new file or -1 for deleted line "},{"type":"int","name":"num_lines","comments":" Number of newline characters in content "},{"type":"size_t","name":"content_len","comments":" Number of bytes of data "},{"type":"git_off_t","name":"content_offset","comments":" Offset in the original file to the content "},{"type":"const char *","name":"content","comments":" Pointer to diff text, not NUL-byte terminated "}],"used":{"returns":[],"needs":["git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_patch_get_line_in_hunk"]}}],["git_diff_line_t",{"decl":["GIT_DIFF_LINE_CONTEXT","GIT_DIFF_LINE_ADDITION","GIT_DIFF_LINE_DELETION","GIT_DIFF_LINE_CONTEXT_EOFNL","GIT_DIFF_LINE_ADD_EOFNL","GIT_DIFF_LINE_DEL_EOFNL","GIT_DIFF_LINE_FILE_HDR","GIT_DIFF_LINE_HUNK_HDR","GIT_DIFF_LINE_BINARY"],"type":"enum","file":"diff.h","line":504,"lineto":520,"block":"GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\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","description":" Line origin constants.","comments":"

These values describe where a line came from and will be passed to\n the git_diff_line_cb when iterating over a diff. There are some\n special origin constants at the end that are used for the text\n output callbacks to demarcate lines that are actually part of\n the file or hunk headers.

\n","fields":[{"type":"int","name":"GIT_DIFF_LINE_CONTEXT","comments":"","value":32},{"type":"int","name":"GIT_DIFF_LINE_ADDITION","comments":"","value":43},{"type":"int","name":"GIT_DIFF_LINE_DELETION","comments":"","value":45},{"type":"int","name":"GIT_DIFF_LINE_CONTEXT_EOFNL","comments":"

Both files have no LF at end

\n","value":61},{"type":"int","name":"GIT_DIFF_LINE_ADD_EOFNL","comments":"

Old has no LF at end, new does

\n","value":62},{"type":"int","name":"GIT_DIFF_LINE_DEL_EOFNL","comments":"

Old has LF at end, new does not

\n","value":60},{"type":"int","name":"GIT_DIFF_LINE_FILE_HDR","comments":"","value":70},{"type":"int","name":"GIT_DIFF_LINE_HUNK_HDR","comments":"","value":72},{"type":"int","name":"GIT_DIFF_LINE_BINARY","comments":"

For "Binary files x and y differ"

\n","value":66}],"used":{"returns":[],"needs":[]}}],["git_diff_option_t",{"decl":["GIT_DIFF_NORMAL","GIT_DIFF_REVERSE","GIT_DIFF_INCLUDE_IGNORED","GIT_DIFF_RECURSE_IGNORED_DIRS","GIT_DIFF_INCLUDE_UNTRACKED","GIT_DIFF_RECURSE_UNTRACKED_DIRS","GIT_DIFF_INCLUDE_UNMODIFIED","GIT_DIFF_INCLUDE_TYPECHANGE","GIT_DIFF_INCLUDE_TYPECHANGE_TREES","GIT_DIFF_IGNORE_FILEMODE","GIT_DIFF_IGNORE_SUBMODULES","GIT_DIFF_IGNORE_CASE","GIT_DIFF_INCLUDE_CASECHANGE","GIT_DIFF_DISABLE_PATHSPEC_MATCH","GIT_DIFF_SKIP_BINARY_CHECK","GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS","GIT_DIFF_UPDATE_INDEX","GIT_DIFF_INCLUDE_UNREADABLE","GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED","GIT_DIFF_FORCE_TEXT","GIT_DIFF_FORCE_BINARY","GIT_DIFF_IGNORE_WHITESPACE","GIT_DIFF_IGNORE_WHITESPACE_CHANGE","GIT_DIFF_IGNORE_WHITESPACE_EOL","GIT_DIFF_SHOW_UNTRACKED_CONTENT","GIT_DIFF_SHOW_UNMODIFIED","GIT_DIFF_PATIENCE","GIT_DIFF_MINIMAL","GIT_DIFF_SHOW_BINARY"],"type":"enum","file":"diff.h","line":72,"lineto":205,"block":"GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY","tdef":"typedef","description":" Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.","comments":"","fields":[{"type":"int","name":"GIT_DIFF_NORMAL","comments":"

Normal diff, the default

\n","value":0},{"type":"int","name":"GIT_DIFF_REVERSE","comments":"

Reverse the sides of the diff

\n","value":1},{"type":"int","name":"GIT_DIFF_INCLUDE_IGNORED","comments":"

Include ignored files in the diff

\n","value":2},{"type":"int","name":"GIT_DIFF_RECURSE_IGNORED_DIRS","comments":"

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n","value":4},{"type":"int","name":"GIT_DIFF_INCLUDE_UNTRACKED","comments":"

Include untracked files in the diff

\n","value":8},{"type":"int","name":"GIT_DIFF_RECURSE_UNTRACKED_DIRS","comments":"

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n","value":16},{"type":"int","name":"GIT_DIFF_INCLUDE_UNMODIFIED","comments":"

Include unmodified files in the diff

\n","value":32},{"type":"int","name":"GIT_DIFF_INCLUDE_TYPECHANGE","comments":"

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n","value":64},{"type":"int","name":"GIT_DIFF_INCLUDE_TYPECHANGE_TREES","comments":"

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n","value":128},{"type":"int","name":"GIT_DIFF_IGNORE_FILEMODE","comments":"

Ignore file mode changes

\n","value":256},{"type":"int","name":"GIT_DIFF_IGNORE_SUBMODULES","comments":"

Treat all submodules as unmodified

\n","value":512},{"type":"int","name":"GIT_DIFF_IGNORE_CASE","comments":"

Use case insensitive filename comparisons

\n","value":1024},{"type":"int","name":"GIT_DIFF_INCLUDE_CASECHANGE","comments":"

May be combined with GIT_DIFF_IGNORE_CASE to specify that a file\n that has changed case will be returned as an add/delete pair.

\n","value":2048},{"type":"int","name":"GIT_DIFF_DISABLE_PATHSPEC_MATCH","comments":"

If the pathspec is set in the diff options, this flags means to\n apply it as an exact match instead of as an fnmatch pattern.

\n","value":4096},{"type":"int","name":"GIT_DIFF_SKIP_BINARY_CHECK","comments":"

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n","value":8192},{"type":"int","name":"GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS","comments":"

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n","value":16384},{"type":"int","name":"GIT_DIFF_UPDATE_INDEX","comments":"

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n","value":32768},{"type":"int","name":"GIT_DIFF_INCLUDE_UNREADABLE","comments":"

Include unreadable files in the diff

\n","value":65536},{"type":"int","name":"GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED","comments":"

Include unreadable files in the diff

\n","value":131072},{"type":"int","name":"GIT_DIFF_FORCE_TEXT","comments":"

Treat all files as text, disabling binary attributes \n&\n detection

\n","value":1048576},{"type":"int","name":"GIT_DIFF_FORCE_BINARY","comments":"

Treat all files as binary, disabling text diffs

\n","value":2097152},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE","comments":"

Ignore all whitespace

\n","value":4194304},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE_CHANGE","comments":"

Ignore changes in amount of whitespace

\n","value":8388608},{"type":"int","name":"GIT_DIFF_IGNORE_WHITESPACE_EOL","comments":"

Ignore whitespace at end of line

\n","value":16777216},{"type":"int","name":"GIT_DIFF_SHOW_UNTRACKED_CONTENT","comments":"

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n","value":33554432},{"type":"int","name":"GIT_DIFF_SHOW_UNMODIFIED","comments":"

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n","value":67108864},{"type":"int","name":"GIT_DIFF_PATIENCE","comments":"

Use the "patience diff" algorithm

\n","value":268435456},{"type":"int","name":"GIT_DIFF_MINIMAL","comments":"

Take extra time to find minimal diff

\n","value":536870912},{"type":"int","name":"GIT_DIFF_SHOW_BINARY","comments":"

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n","value":1073741824}],"used":{"returns":[],"needs":[]}}],["git_diff_options",{"decl":["unsigned int version","uint32_t flags","git_submodule_ignore_t ignore_submodules","git_strarray pathspec","git_diff_notify_cb notify_cb","void * notify_payload","uint32_t context_lines","uint32_t interhunk_lines","uint16_t id_abbrev","git_off_t max_size","const char * old_prefix","const char * new_prefix"],"type":"struct","value":"git_diff_options","file":"diff.h","line":374,"lineto":393,"block":"unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\nvoid * notify_payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix","tdef":"typedef","description":" Structure describing options about how the diff should be executed.","comments":"

Setting all values of the structure to zero will yield the default\n values. Similarly, passing NULL for the options structure will\n give the defaults. The default values are marked below.

\n\n
    \n
  • flags is a combination of the git_diff_option_t values above
  • \n
  • context_lines is the number of unchanged lines that define the\nboundary of a hunk (and to display before and after)
  • \n
  • interhunk_lines is the maximum number of unchanged lines between\nhunk boundaries before the hunks will be merged into a one.
  • \n
  • old_prefix is the virtual "directory" to prefix to old file names\nin hunk headers (default "a")
  • \n
  • new_prefix is the virtual "directory" to prefix to new file names\nin hunk headers (default "b")
  • \n
  • pathspec is an array of paths / fnmatch patterns to constrain diff
  • \n
  • max_size is a file size (in bytes) above which a blob will be marked\nas binary automatically; pass a negative value to disable.
  • \n
  • notify_cb is an optional callback function, notifying the consumer of\nwhich files are being examined as the diff is generated
  • \n
  • notify_payload is the payload data to pass to the notify_cb function
  • \n
  • ignore_submodules overrides the submodule ignore setting for all\nsubmodules in the diff.
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":" version for the struct "},{"type":"uint32_t","name":"flags","comments":" defaults to GIT_DIFF_NORMAL "},{"type":"git_submodule_ignore_t","name":"ignore_submodules","comments":" submodule ignore rule "},{"type":"git_strarray","name":"pathspec","comments":" defaults to include all paths "},{"type":"git_diff_notify_cb","name":"notify_cb","comments":""},{"type":"void *","name":"notify_payload","comments":""},{"type":"uint32_t","name":"context_lines","comments":" defaults to 3 "},{"type":"uint32_t","name":"interhunk_lines","comments":" defaults to 0 "},{"type":"uint16_t","name":"id_abbrev","comments":" default 'core.abbrev' or 7 if unset "},{"type":"git_off_t","name":"max_size","comments":" defaults to 512MB "},{"type":"const char *","name":"old_prefix","comments":" defaults to \"a\" "},{"type":"const char *","name":"new_prefix","comments":" defaults to \"b\" "}],"used":{"returns":[],"needs":["git_diff_blob_to_buffer","git_diff_blobs","git_diff_buffers","git_diff_commit_as_email","git_diff_index_to_workdir","git_diff_init_options","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers"]}}],["git_diff_perfdata",{"decl":["unsigned int version","size_t stat_calls","size_t oid_calculations"],"type":"struct","value":"git_diff_perfdata","file":"sys/diff.h","line":67,"lineto":71,"block":"unsigned int version\nsize_t stat_calls\nsize_t oid_calculations","tdef":"typedef","description":" Performance data from diffing","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"size_t","name":"stat_calls","comments":" Number of stat() calls performed "},{"type":"size_t","name":"oid_calculations","comments":" Number of ID calculations "}],"used":{"returns":[],"needs":["git_diff_get_perfdata","git_status_list_get_perfdata"]}}],["git_diff_similarity_metric",{"decl":["int (*)(void **, const git_diff_file *, const char *, void *) file_signature","int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature","void (*)(void *, void *) free_signature","int (*)(int *, void *, void *, void *) similarity","void * payload"],"type":"struct","value":"git_diff_similarity_metric","file":"diff.h","line":626,"lineto":636,"block":"int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload","tdef":"typedef","description":" Pluggable similarity metric","comments":"","fields":[{"type":"int (*)(void **, const git_diff_file *, const char *, void *)","name":"file_signature","comments":""},{"type":"int (*)(void **, const git_diff_file *, const char *, size_t, void *)","name":"buffer_signature","comments":""},{"type":"void (*)(void *, void *)","name":"free_signature","comments":""},{"type":"int (*)(int *, void *, void *, void *)","name":"similarity","comments":""},{"type":"void *","name":"payload","comments":""}],"used":{"returns":[],"needs":[]}}],["git_diff_stats",{"decl":"git_diff_stats","type":"struct","value":"git_diff_stats","file":"diff.h","line":1132,"lineto":1132,"tdef":"typedef","description":" This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.","comments":"","used":{"returns":[],"needs":["git_diff_get_stats","git_diff_stats_deletions","git_diff_stats_files_changed","git_diff_stats_free","git_diff_stats_insertions","git_diff_stats_to_buf"]}}],["git_diff_stats_format_t",{"decl":["GIT_DIFF_STATS_NONE","GIT_DIFF_STATS_FULL","GIT_DIFF_STATS_SHORT","GIT_DIFF_STATS_NUMBER","GIT_DIFF_STATS_INCLUDE_SUMMARY"],"type":"enum","file":"diff.h","line":1137,"lineto":1152,"block":"GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY","tdef":"typedef","description":" Formatting options for diff stats","comments":"","fields":[{"type":"int","name":"GIT_DIFF_STATS_NONE","comments":"

No stats

\n","value":0},{"type":"int","name":"GIT_DIFF_STATS_FULL","comments":"

Full statistics, equivalent of --stat

\n","value":1},{"type":"int","name":"GIT_DIFF_STATS_SHORT","comments":"

Short statistics, equivalent of --shortstat

\n","value":2},{"type":"int","name":"GIT_DIFF_STATS_NUMBER","comments":"

Number statistics, equivalent of --numstat

\n","value":4},{"type":"int","name":"GIT_DIFF_STATS_INCLUDE_SUMMARY","comments":"

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n","value":8}],"used":{"returns":[],"needs":["git_diff_stats_to_buf"]}}],["git_direction",{"decl":["GIT_DIRECTION_FETCH","GIT_DIRECTION_PUSH"],"type":"enum","file":"net.h","line":31,"lineto":34,"block":"GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH","tdef":"typedef","description":" Direction of the connection.","comments":"

We need this because we need to know whether we should call\n git-upload-pack or git-receive-pack on the remote end when get_refs\n gets called.

\n","fields":[{"type":"int","name":"GIT_DIRECTION_FETCH","comments":"","value":0},{"type":"int","name":"GIT_DIRECTION_PUSH","comments":"","value":1}],"used":{"returns":[],"needs":["git_remote_connect"]}}],["git_error",{"decl":["char * message","int klass"],"type":"struct","value":"git_error","file":"errors.h","line":63,"lineto":66,"block":"char * message\nint klass","tdef":"typedef","description":" Structure to store extra details of the last error that occurred.","comments":"

This is kept on a per-thread basis if GIT_THREADS was defined when the\n library was build, otherwise one is kept globally for the library

\n","fields":[{"type":"char *","name":"message","comments":""},{"type":"int","name":"klass","comments":""}],"used":{"returns":["giterr_last"],"needs":["giterr_detach"]}}],["git_error_code",{"decl":["GIT_OK","GIT_ERROR","GIT_ENOTFOUND","GIT_EEXISTS","GIT_EAMBIGUOUS","GIT_EBUFS","GIT_EUSER","GIT_EBAREREPO","GIT_EUNBORNBRANCH","GIT_EUNMERGED","GIT_ENONFASTFORWARD","GIT_EINVALIDSPEC","GIT_ECONFLICT","GIT_ELOCKED","GIT_EMODIFIED","GIT_EAUTH","GIT_ECERTIFICATE","GIT_EAPPLIED","GIT_EPEEL","GIT_EEOF","GIT_EINVALID","GIT_EUNCOMMITTED","GIT_EDIRECTORY","GIT_PASSTHROUGH","GIT_ITEROVER"],"type":"enum","file":"errors.h","line":21,"lineto":55,"block":"GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_PASSTHROUGH\nGIT_ITEROVER","tdef":"typedef","description":" Generic return codes ","comments":"","fields":[{"type":"int","name":"GIT_OK","comments":"

No error

\n","value":0},{"type":"int","name":"GIT_ERROR","comments":"

Generic error

\n","value":-1},{"type":"int","name":"GIT_ENOTFOUND","comments":"

Requested object could not be found

\n","value":-3},{"type":"int","name":"GIT_EEXISTS","comments":"

Object exists preventing operation

\n","value":-4},{"type":"int","name":"GIT_EAMBIGUOUS","comments":"

More than one object matches

\n","value":-5},{"type":"int","name":"GIT_EBUFS","comments":"

Output buffer too short to hold data

\n","value":-6},{"type":"int","name":"GIT_EUSER","comments":"","value":-7},{"type":"int","name":"GIT_EBAREREPO","comments":"

Operation not allowed on bare repository

\n","value":-8},{"type":"int","name":"GIT_EUNBORNBRANCH","comments":"

HEAD refers to branch with no commits

\n","value":-9},{"type":"int","name":"GIT_EUNMERGED","comments":"

Merge in progress prevented operation

\n","value":-10},{"type":"int","name":"GIT_ENONFASTFORWARD","comments":"

Reference was not fast-forwardable

\n","value":-11},{"type":"int","name":"GIT_EINVALIDSPEC","comments":"

Name/ref spec was not in a valid format

\n","value":-12},{"type":"int","name":"GIT_ECONFLICT","comments":"

Checkout conflicts prevented operation

\n","value":-13},{"type":"int","name":"GIT_ELOCKED","comments":"

Lock file prevented operation

\n","value":-14},{"type":"int","name":"GIT_EMODIFIED","comments":"

Reference value does not match expected

\n","value":-15},{"type":"int","name":"GIT_EAUTH","comments":"

Authentication error

\n","value":-16},{"type":"int","name":"GIT_ECERTIFICATE","comments":"

Server certificate is invalid

\n","value":-17},{"type":"int","name":"GIT_EAPPLIED","comments":"

Patch/merge has already been applied

\n","value":-18},{"type":"int","name":"GIT_EPEEL","comments":"

The requested peel operation is not possible

\n","value":-19},{"type":"int","name":"GIT_EEOF","comments":"

Unexpected EOF

\n","value":-20},{"type":"int","name":"GIT_EINVALID","comments":"

Invalid operation or input

\n","value":-21},{"type":"int","name":"GIT_EUNCOMMITTED","comments":"

Uncommitted changes in index prevented operation

\n","value":-22},{"type":"int","name":"GIT_EDIRECTORY","comments":"

The operation is not valid for a directory

\n","value":-23},{"type":"int","name":"GIT_PASSTHROUGH","comments":"

Internal only

\n","value":-30},{"type":"int","name":"GIT_ITEROVER","comments":"

Signals end of iteration with iterator

\n","value":-31}],"used":{"returns":[],"needs":[]}}],["git_error_t",{"decl":["GITERR_NONE","GITERR_NOMEMORY","GITERR_OS","GITERR_INVALID","GITERR_REFERENCE","GITERR_ZLIB","GITERR_REPOSITORY","GITERR_CONFIG","GITERR_REGEX","GITERR_ODB","GITERR_INDEX","GITERR_OBJECT","GITERR_NET","GITERR_TAG","GITERR_TREE","GITERR_INDEXER","GITERR_SSL","GITERR_SUBMODULE","GITERR_THREAD","GITERR_STASH","GITERR_CHECKOUT","GITERR_FETCHHEAD","GITERR_MERGE","GITERR_SSH","GITERR_FILTER","GITERR_REVERT","GITERR_CALLBACK","GITERR_CHERRYPICK","GITERR_DESCRIBE","GITERR_REBASE","GITERR_FILESYSTEM"],"type":"enum","file":"errors.h","line":69,"lineto":101,"block":"GITERR_NONE\nGITERR_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\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM","tdef":"typedef","description":" Error classes ","comments":"","fields":[{"type":"int","name":"GITERR_NONE","comments":"","value":0},{"type":"int","name":"GITERR_NOMEMORY","comments":"","value":1},{"type":"int","name":"GITERR_OS","comments":"","value":2},{"type":"int","name":"GITERR_INVALID","comments":"","value":3},{"type":"int","name":"GITERR_REFERENCE","comments":"","value":4},{"type":"int","name":"GITERR_ZLIB","comments":"","value":5},{"type":"int","name":"GITERR_REPOSITORY","comments":"","value":6},{"type":"int","name":"GITERR_CONFIG","comments":"","value":7},{"type":"int","name":"GITERR_REGEX","comments":"","value":8},{"type":"int","name":"GITERR_ODB","comments":"","value":9},{"type":"int","name":"GITERR_INDEX","comments":"","value":10},{"type":"int","name":"GITERR_OBJECT","comments":"","value":11},{"type":"int","name":"GITERR_NET","comments":"","value":12},{"type":"int","name":"GITERR_TAG","comments":"","value":13},{"type":"int","name":"GITERR_TREE","comments":"","value":14},{"type":"int","name":"GITERR_INDEXER","comments":"","value":15},{"type":"int","name":"GITERR_SSL","comments":"","value":16},{"type":"int","name":"GITERR_SUBMODULE","comments":"","value":17},{"type":"int","name":"GITERR_THREAD","comments":"","value":18},{"type":"int","name":"GITERR_STASH","comments":"","value":19},{"type":"int","name":"GITERR_CHECKOUT","comments":"","value":20},{"type":"int","name":"GITERR_FETCHHEAD","comments":"","value":21},{"type":"int","name":"GITERR_MERGE","comments":"","value":22},{"type":"int","name":"GITERR_SSH","comments":"","value":23},{"type":"int","name":"GITERR_FILTER","comments":"","value":24},{"type":"int","name":"GITERR_REVERT","comments":"","value":25},{"type":"int","name":"GITERR_CALLBACK","comments":"","value":26},{"type":"int","name":"GITERR_CHERRYPICK","comments":"","value":27},{"type":"int","name":"GITERR_DESCRIBE","comments":"","value":28},{"type":"int","name":"GITERR_REBASE","comments":"","value":29},{"type":"int","name":"GITERR_FILESYSTEM","comments":"","value":30}],"used":{"returns":[],"needs":[]}}],["git_feature_t",{"decl":["GIT_FEATURE_THREADS","GIT_FEATURE_HTTPS","GIT_FEATURE_SSH"],"type":"enum","file":"common.h","line":100,"lineto":104,"block":"GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH","tdef":"typedef","description":" Combinations of these values describe the features with which libgit2\n was compiled","comments":"","fields":[{"type":"int","name":"GIT_FEATURE_THREADS","comments":"","value":1},{"type":"int","name":"GIT_FEATURE_HTTPS","comments":"","value":2},{"type":"int","name":"GIT_FEATURE_SSH","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_fetch_options",{"decl":["int version","git_remote_callbacks callbacks","git_fetch_prune_t prune","int update_fetchhead","git_remote_autotag_option_t download_tags"],"type":"struct","value":"git_fetch_options","file":"remote.h","line":522,"lineto":549,"block":"int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags","tdef":"typedef","description":" Fetch options structure.","comments":"

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n","fields":[{"type":"int","name":"version","comments":""},{"type":"git_remote_callbacks","name":"callbacks","comments":" Callbacks to use for this fetch operation"},{"type":"git_fetch_prune_t","name":"prune","comments":" Whether to perform a prune after the fetch"},{"type":"int","name":"update_fetchhead","comments":" Whether to write the results to FETCH_HEAD. Defaults to\n on. Leave this default in order to behave like git."},{"type":"git_remote_autotag_option_t","name":"download_tags","comments":" Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags."}],"used":{"returns":[],"needs":["git_fetch_init_options","git_remote_download","git_remote_fetch"]}}],["git_filemode_t",{"decl":["GIT_FILEMODE_UNREADABLE","GIT_FILEMODE_TREE","GIT_FILEMODE_BLOB","GIT_FILEMODE_BLOB_EXECUTABLE","GIT_FILEMODE_LINK","GIT_FILEMODE_COMMIT"],"type":"enum","file":"types.h","line":205,"lineto":212,"block":"GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT","tdef":"typedef","description":" Valid modes for index and tree entries. ","comments":"","fields":[{"type":"int","name":"GIT_FILEMODE_UNREADABLE","comments":"","value":0},{"type":"int","name":"GIT_FILEMODE_TREE","comments":"","value":16384},{"type":"int","name":"GIT_FILEMODE_BLOB","comments":"","value":33188},{"type":"int","name":"GIT_FILEMODE_BLOB_EXECUTABLE","comments":"","value":33261},{"type":"int","name":"GIT_FILEMODE_LINK","comments":"","value":40960},{"type":"int","name":"GIT_FILEMODE_COMMIT","comments":"","value":57344}],"used":{"returns":[],"needs":["git_treebuilder_insert"]}}],["git_filter",{"decl":["unsigned int version","const char * attributes","git_filter_init_fn initialize","git_filter_shutdown_fn shutdown","git_filter_check_fn check","git_filter_apply_fn apply","git_filter_stream_fn stream","git_filter_cleanup_fn cleanup"],"type":"struct","value":"git_filter","file":"sys/filter.h","line":248,"lineto":259,"tdef":null,"description":" Filter structure used to register custom filters.","comments":"

To associate extra data with a filter, allocate extra data and put the\n git_filter struct at the start of your data buffer, then cast the\n self pointer to your larger structure when your callback is invoked.

\n\n

version should be set to GIT_FILTER_VERSION

\n\n

attributes is a whitespace-separated list of attribute names to check\n for this filter (e.g. "eol crlf text"). If the attribute name is bare,\n it will be simply loaded and passed to the check callback. If it has\n a value (i.e. "name=value"), the attribute must match that value for\n the filter to be applied.

\n\n

The initialize, shutdown, check, apply, and cleanup callbacks\n are all documented above with the respective function pointer typedefs.

\n","block":"unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_stream_fn stream\ngit_filter_cleanup_fn cleanup","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"attributes","comments":""},{"type":"git_filter_init_fn","name":"initialize","comments":""},{"type":"git_filter_shutdown_fn","name":"shutdown","comments":""},{"type":"git_filter_check_fn","name":"check","comments":""},{"type":"git_filter_apply_fn","name":"apply","comments":""},{"type":"git_filter_stream_fn","name":"stream","comments":""},{"type":"git_filter_cleanup_fn","name":"cleanup","comments":""}],"used":{"returns":["git_filter_lookup"],"needs":["git_filter_list_push","git_filter_register"]}}],["git_filter_flag_t",{"decl":["GIT_FILTER_DEFAULT","GIT_FILTER_ALLOW_UNSAFE"],"type":"enum","file":"filter.h","line":41,"lineto":44,"block":"GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE","tdef":"typedef","description":" Filter option flags.","comments":"","fields":[{"type":"int","name":"GIT_FILTER_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_FILTER_ALLOW_UNSAFE","comments":"","value":1}],"used":{"returns":[],"needs":[]}}],["git_filter_list",{"decl":"git_filter_list","type":"struct","value":"git_filter_list","file":"filter.h","line":73,"lineto":73,"tdef":"typedef","description":" List of filters to be applied","comments":"

This represents a list of filters to be applied to a file / blob. You\n can build the list with one call, apply it with another, and dispose it\n with a third. In typical usage, there are not many occasions where a\n git_filter_list is needed directly since the library will generally\n handle conversions for you, but it can be convenient to be able to\n build and apply the list sometimes.

\n","used":{"returns":[],"needs":["git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_contains","git_filter_list_free","git_filter_list_length","git_filter_list_load","git_filter_list_new","git_filter_list_push","git_filter_list_stream_blob","git_filter_list_stream_data","git_filter_list_stream_file"]}}],["git_filter_mode_t",{"decl":["GIT_FILTER_TO_WORKTREE","GIT_FILTER_SMUDGE","GIT_FILTER_TO_ODB","GIT_FILTER_CLEAN"],"type":"enum","file":"filter.h","line":31,"lineto":36,"block":"GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN","tdef":"typedef","description":" Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.","comments":"","fields":[{"type":"int","name":"GIT_FILTER_TO_WORKTREE","comments":"","value":0},{"type":"int","name":"GIT_FILTER_SMUDGE","comments":"","value":0},{"type":"int","name":"GIT_FILTER_TO_ODB","comments":"","value":1},{"type":"int","name":"GIT_FILTER_CLEAN","comments":"","value":1}],"used":{"returns":[],"needs":["git_filter_list_load","git_filter_list_new"]}}],["git_filter_source",{"decl":"git_filter_source","type":"struct","value":"git_filter_source","file":"sys/filter.h","line":95,"lineto":95,"tdef":"typedef","description":" A filter source represents a file/blob to be processed","comments":"","used":{"returns":[],"needs":["git_filter_source_filemode","git_filter_source_flags","git_filter_source_id","git_filter_source_mode","git_filter_source_path","git_filter_source_repo"]}}],["git_hashsig",{"decl":"git_hashsig","type":"struct","value":"git_hashsig","file":"sys/hashsig.h","line":17,"lineto":17,"tdef":"typedef","description":" Similarity signature of arbitrary text content based on line hashes","comments":"","used":{"returns":[],"needs":["git_hashsig_compare","git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free"]}}],["git_hashsig_option_t",{"decl":["GIT_HASHSIG_NORMAL","GIT_HASHSIG_IGNORE_WHITESPACE","GIT_HASHSIG_SMART_WHITESPACE","GIT_HASHSIG_ALLOW_SMALL_FILES"],"type":"enum","file":"sys/hashsig.h","line":25,"lineto":45,"block":"GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES","tdef":"typedef","description":" Options for hashsig computation","comments":"

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE,\n GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n","fields":[{"type":"int","name":"GIT_HASHSIG_NORMAL","comments":"

Use all data

\n","value":0},{"type":"int","name":"GIT_HASHSIG_IGNORE_WHITESPACE","comments":"

Ignore whitespace

\n","value":1},{"type":"int","name":"GIT_HASHSIG_SMART_WHITESPACE","comments":"

Ignore

\n\n

and all space after

\n","value":2},{"type":"int","name":"GIT_HASHSIG_ALLOW_SMALL_FILES","comments":"

Allow hashing of small files

\n","value":4}],"used":{"returns":[],"needs":["git_hashsig_create","git_hashsig_create_fromfile"]}}],["git_idxentry_extended_flag_t",{"decl":["GIT_IDXENTRY_INTENT_TO_ADD","GIT_IDXENTRY_SKIP_WORKTREE","GIT_IDXENTRY_EXTENDED2","GIT_IDXENTRY_EXTENDED_FLAGS","GIT_IDXENTRY_UPDATE","GIT_IDXENTRY_REMOVE","GIT_IDXENTRY_UPTODATE","GIT_IDXENTRY_ADDED","GIT_IDXENTRY_HASHED","GIT_IDXENTRY_UNHASHED","GIT_IDXENTRY_WT_REMOVE","GIT_IDXENTRY_CONFLICTED","GIT_IDXENTRY_UNPACKED","GIT_IDXENTRY_NEW_SKIP_WORKTREE"],"type":"enum","file":"index.h","line":115,"lineto":135,"block":"GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE","tdef":"typedef","description":" Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`","comments":"

In memory, the flags_extended fields are divided into two parts: the\n fields that are read from and written to disk, and other fields that\n in-memory only and used by libgit2. Only the flags in\n GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the\n git_index_entry flags_extended value that belong on disk. You\n can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry\n flags_extended value that are only used in-memory by libgit2.\n You can use them to interpret the data in the flags_extended.

\n","fields":[{"type":"int","name":"GIT_IDXENTRY_INTENT_TO_ADD","comments":"","value":8192},{"type":"int","name":"GIT_IDXENTRY_SKIP_WORKTREE","comments":"","value":16384},{"type":"int","name":"GIT_IDXENTRY_EXTENDED2","comments":"

Reserved for future extension

\n","value":32768},{"type":"int","name":"GIT_IDXENTRY_EXTENDED_FLAGS","comments":"

Reserved for future extension

\n","value":24576},{"type":"int","name":"GIT_IDXENTRY_UPDATE","comments":"

Reserved for future extension

\n","value":1},{"type":"int","name":"GIT_IDXENTRY_REMOVE","comments":"

Reserved for future extension

\n","value":2},{"type":"int","name":"GIT_IDXENTRY_UPTODATE","comments":"

Reserved for future extension

\n","value":4},{"type":"int","name":"GIT_IDXENTRY_ADDED","comments":"

Reserved for future extension

\n","value":8},{"type":"int","name":"GIT_IDXENTRY_HASHED","comments":"

Reserved for future extension

\n","value":16},{"type":"int","name":"GIT_IDXENTRY_UNHASHED","comments":"

Reserved for future extension

\n","value":32},{"type":"int","name":"GIT_IDXENTRY_WT_REMOVE","comments":"

remove in work directory

\n","value":64},{"type":"int","name":"GIT_IDXENTRY_CONFLICTED","comments":"","value":128},{"type":"int","name":"GIT_IDXENTRY_UNPACKED","comments":"","value":256},{"type":"int","name":"GIT_IDXENTRY_NEW_SKIP_WORKTREE","comments":"","value":512}],"used":{"returns":[],"needs":[]}}],["git_index",{"decl":"git_index","type":"struct","value":"git_index","file":"types.h","line":132,"lineto":132,"tdef":"typedef","description":" Memory representation of an index file. ","comments":"","used":{"returns":[],"needs":["git_checkout_index","git_cherrypick_commit","git_diff_index_to_workdir","git_diff_tree_to_index","git_index_add","git_index_add_all","git_index_add_bypath","git_index_add_frombuffer","git_index_caps","git_index_checksum","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_iterator_new","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_path","git_index_read","git_index_read_tree","git_index_remove","git_index_remove_all","git_index_remove_bypath","git_index_remove_directory","git_index_set_caps","git_index_update_all","git_index_write","git_index_write_tree","git_index_write_tree_to","git_merge_commits","git_merge_trees","git_pathspec_match_index","git_repository_index","git_repository_set_index","git_revert_commit"]}}],["git_index_add_option_t",{"decl":["GIT_INDEX_ADD_DEFAULT","GIT_INDEX_ADD_FORCE","GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH","GIT_INDEX_ADD_CHECK_PATHSPEC"],"type":"enum","file":"index.h","line":150,"lineto":155,"block":"GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC","tdef":"typedef","description":" Flags for APIs that add files matching pathspec ","comments":"","fields":[{"type":"int","name":"GIT_INDEX_ADD_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_INDEX_ADD_FORCE","comments":"","value":1},{"type":"int","name":"GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH","comments":"","value":2},{"type":"int","name":"GIT_INDEX_ADD_CHECK_PATHSPEC","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_index_conflict_iterator",{"decl":"git_index_conflict_iterator","type":"struct","value":"git_index_conflict_iterator","file":"types.h","line":135,"lineto":135,"tdef":"typedef","description":" An iterator for conflicts in the index. ","comments":"","used":{"returns":[],"needs":["git_index_conflict_iterator_free","git_index_conflict_iterator_new","git_index_conflict_next"]}}],["git_index_entry",{"decl":["git_index_time ctime","git_index_time mtime","uint32_t dev","uint32_t ino","uint32_t mode","uint32_t uid","uint32_t gid","uint32_t file_size","git_oid id","uint16_t flags","uint16_t flags_extended","const char * path"],"type":"struct","value":"git_index_entry","file":"index.h","line":53,"lineto":70,"block":"git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path","tdef":"typedef","description":" In-memory representation of a file entry in the index.","comments":"

This is a public structure that represents a file entry in the index.\n The meaning of the fields corresponds to core Git's documentation (in\n "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be\n accessed via the first set of GIT_IDXENTRY_... bitmasks below. These\n flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be\n accessed via the later GIT_IDXENTRY_... bitmasks below. Some of\n these flags are read from and written to disk, but some are set aside\n for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This\n is enough to detect changes, which is enough for the index to\n function as a cache, but it should not be taken as an authoritative\n source for that data.

\n","fields":[{"type":"git_index_time","name":"ctime","comments":""},{"type":"git_index_time","name":"mtime","comments":""},{"type":"uint32_t","name":"dev","comments":""},{"type":"uint32_t","name":"ino","comments":""},{"type":"uint32_t","name":"mode","comments":""},{"type":"uint32_t","name":"uid","comments":""},{"type":"uint32_t","name":"gid","comments":""},{"type":"uint32_t","name":"file_size","comments":""},{"type":"git_oid","name":"id","comments":""},{"type":"uint16_t","name":"flags","comments":""},{"type":"uint16_t","name":"flags_extended","comments":""},{"type":"const char *","name":"path","comments":""}],"used":{"returns":["git_index_get_byindex","git_index_get_bypath"],"needs":["git_index_add","git_index_add_frombuffer","git_index_conflict_add","git_index_conflict_get","git_index_conflict_next","git_index_entry_is_conflict","git_index_entry_stage","git_merge_file_from_index"]}}],["git_index_time",{"decl":["int32_t seconds","uint32_t nanoseconds"],"type":"struct","value":"git_index_time","file":"index.h","line":26,"lineto":30,"block":"int32_t seconds\nuint32_t nanoseconds","tdef":"typedef","description":" Time structure used in a git index entry ","comments":"","fields":[{"type":"int32_t","name":"seconds","comments":""},{"type":"uint32_t","name":"nanoseconds","comments":""}],"used":{"returns":[],"needs":[]}}],["git_indexcap_t",{"decl":["GIT_INDEXCAP_IGNORE_CASE","GIT_INDEXCAP_NO_FILEMODE","GIT_INDEXCAP_NO_SYMLINKS","GIT_INDEXCAP_FROM_OWNER"],"type":"enum","file":"index.h","line":138,"lineto":143,"block":"GIT_INDEXCAP_IGNORE_CASE\nGIT_INDEXCAP_NO_FILEMODE\nGIT_INDEXCAP_NO_SYMLINKS\nGIT_INDEXCAP_FROM_OWNER","tdef":"typedef","description":" Capabilities of system that affect index actions. ","comments":"","fields":[{"type":"int","name":"GIT_INDEXCAP_IGNORE_CASE","comments":"","value":1},{"type":"int","name":"GIT_INDEXCAP_NO_FILEMODE","comments":"","value":2},{"type":"int","name":"GIT_INDEXCAP_NO_SYMLINKS","comments":"","value":4},{"type":"int","name":"GIT_INDEXCAP_FROM_OWNER","comments":"","value":-1}],"used":{"returns":[],"needs":[]}}],["git_indxentry_flag_t",{"decl":["GIT_IDXENTRY_EXTENDED","GIT_IDXENTRY_VALID"],"type":"enum","file":"index.h","line":86,"lineto":89,"block":"GIT_IDXENTRY_EXTENDED\nGIT_IDXENTRY_VALID","tdef":"typedef","description":" Flags for index entries","comments":"","fields":[{"type":"int","name":"GIT_IDXENTRY_EXTENDED","comments":"","value":16384},{"type":"int","name":"GIT_IDXENTRY_VALID","comments":"","value":32768}],"used":{"returns":[],"needs":[]}}],["git_libgit2_opt_t",{"decl":["GIT_OPT_GET_MWINDOW_SIZE","GIT_OPT_SET_MWINDOW_SIZE","GIT_OPT_GET_MWINDOW_MAPPED_LIMIT","GIT_OPT_SET_MWINDOW_MAPPED_LIMIT","GIT_OPT_GET_SEARCH_PATH","GIT_OPT_SET_SEARCH_PATH","GIT_OPT_SET_CACHE_OBJECT_LIMIT","GIT_OPT_SET_CACHE_MAX_SIZE","GIT_OPT_ENABLE_CACHING","GIT_OPT_GET_CACHED_MEMORY","GIT_OPT_GET_TEMPLATE_PATH","GIT_OPT_SET_TEMPLATE_PATH","GIT_OPT_SET_SSL_CERT_LOCATIONS"],"type":"enum","file":"common.h","line":132,"lineto":146,"block":"GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS","tdef":"typedef","description":" Global library options","comments":"

These are used to select which global option to set or get and are\n used in git_libgit2_opts().

\n","fields":[{"type":"int","name":"GIT_OPT_GET_MWINDOW_SIZE","comments":"","value":0},{"type":"int","name":"GIT_OPT_SET_MWINDOW_SIZE","comments":"","value":1},{"type":"int","name":"GIT_OPT_GET_MWINDOW_MAPPED_LIMIT","comments":"","value":2},{"type":"int","name":"GIT_OPT_SET_MWINDOW_MAPPED_LIMIT","comments":"","value":3},{"type":"int","name":"GIT_OPT_GET_SEARCH_PATH","comments":"","value":4},{"type":"int","name":"GIT_OPT_SET_SEARCH_PATH","comments":"","value":5},{"type":"int","name":"GIT_OPT_SET_CACHE_OBJECT_LIMIT","comments":"","value":6},{"type":"int","name":"GIT_OPT_SET_CACHE_MAX_SIZE","comments":"","value":7},{"type":"int","name":"GIT_OPT_ENABLE_CACHING","comments":"","value":8},{"type":"int","name":"GIT_OPT_GET_CACHED_MEMORY","comments":"","value":9},{"type":"int","name":"GIT_OPT_GET_TEMPLATE_PATH","comments":"","value":10},{"type":"int","name":"GIT_OPT_SET_TEMPLATE_PATH","comments":"","value":11},{"type":"int","name":"GIT_OPT_SET_SSL_CERT_LOCATIONS","comments":"","value":12}],"used":{"returns":[],"needs":[]}}],["git_merge_analysis_t",{"decl":["GIT_MERGE_ANALYSIS_NONE","GIT_MERGE_ANALYSIS_NORMAL","GIT_MERGE_ANALYSIS_UP_TO_DATE","GIT_MERGE_ANALYSIS_FASTFORWARD","GIT_MERGE_ANALYSIS_UNBORN"],"type":"enum","file":"merge.h","line":272,"lineto":301,"block":"GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN","tdef":"typedef","description":" The results of `git_merge_analysis` indicate the merge opportunities.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_ANALYSIS_NONE","comments":"

No merge is possible. (Unused.)

\n","value":0},{"type":"int","name":"GIT_MERGE_ANALYSIS_NORMAL","comments":"

A "normal" merge; both HEAD and the given merge input have diverged\n from their common ancestor. The divergent commits must be merged.

\n","value":1},{"type":"int","name":"GIT_MERGE_ANALYSIS_UP_TO_DATE","comments":"

All given merge inputs are reachable from HEAD, meaning the\n repository is up-to-date and no merge needs to be performed.

\n","value":2},{"type":"int","name":"GIT_MERGE_ANALYSIS_FASTFORWARD","comments":"

The given merge input is a fast-forward from HEAD and no merge\n needs to be performed. Instead, the client can check out the\n given merge input.

\n","value":4},{"type":"int","name":"GIT_MERGE_ANALYSIS_UNBORN","comments":"

The HEAD of the current repository is "unborn" and does not point to\n a valid commit. No merge can be performed, but the caller may wish\n to simply set HEAD to the target commit(s).

\n","value":8}],"used":{"returns":[],"needs":["git_merge_analysis"]}}],["git_merge_file_favor_t",{"decl":["GIT_MERGE_FILE_FAVOR_NORMAL","GIT_MERGE_FILE_FAVOR_OURS","GIT_MERGE_FILE_FAVOR_THEIRS","GIT_MERGE_FILE_FAVOR_UNION"],"type":"enum","file":"merge.h","line":81,"lineto":111,"block":"GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION","tdef":"typedef","description":" Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_FILE_FAVOR_NORMAL","comments":"

When a region of a file is changed in both branches, a conflict\n will be recorded in the index so that git_checkout can produce\n a merge file with conflict markers in the working directory.\n This is the default.

\n","value":0},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_OURS","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain the "ours" side of any conflicting\n region. The index will not record a conflict.

\n","value":1},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_THEIRS","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain the "theirs" side of any conflicting\n region. The index will not record a conflict.

\n","value":2},{"type":"int","name":"GIT_MERGE_FILE_FAVOR_UNION","comments":"

When a region of a file is changed in both branches, the file\n created in the index will contain each unique line from each side,\n which has the result of combining both files. The index will not\n record a conflict.

\n","value":3}],"used":{"returns":[],"needs":[]}}],["git_merge_file_flags_t",{"decl":["GIT_MERGE_FILE_DEFAULT","GIT_MERGE_FILE_STYLE_MERGE","GIT_MERGE_FILE_STYLE_DIFF3","GIT_MERGE_FILE_SIMPLIFY_ALNUM","GIT_MERGE_FILE_IGNORE_WHITESPACE","GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE","GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL","GIT_MERGE_FILE_DIFF_PATIENCE","GIT_MERGE_FILE_DIFF_MINIMAL"],"type":"enum","file":"merge.h","line":116,"lineto":143,"block":"GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL","tdef":"typedef","description":" File merging flags","comments":"","fields":[{"type":"int","name":"GIT_MERGE_FILE_DEFAULT","comments":"

Defaults

\n","value":0},{"type":"int","name":"GIT_MERGE_FILE_STYLE_MERGE","comments":"

Create standard conflicted merge files

\n","value":1},{"type":"int","name":"GIT_MERGE_FILE_STYLE_DIFF3","comments":"

Create diff3-style files

\n","value":2},{"type":"int","name":"GIT_MERGE_FILE_SIMPLIFY_ALNUM","comments":"

Condense non-alphanumeric regions for simplified diff file

\n","value":4},{"type":"int","name":"GIT_MERGE_FILE_IGNORE_WHITESPACE","comments":"

Ignore all whitespace

\n","value":8},{"type":"int","name":"GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE","comments":"

Ignore changes in amount of whitespace

\n","value":16},{"type":"int","name":"GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL","comments":"

Ignore whitespace at end of line

\n","value":32},{"type":"int","name":"GIT_MERGE_FILE_DIFF_PATIENCE","comments":"

Use the "patience diff" algorithm

\n","value":64},{"type":"int","name":"GIT_MERGE_FILE_DIFF_MINIMAL","comments":"

Take extra time to find minimal diff

\n","value":128}],"used":{"returns":[],"needs":[]}}],["git_merge_file_input",{"decl":["unsigned int version","const char * ptr","size_t size","const char * path","unsigned int mode"],"type":"struct","value":"git_merge_file_input","file":"merge.h","line":32,"lineto":46,"block":"unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode","tdef":"typedef","description":" The file inputs to `git_merge_file`. Callers should populate the\n `git_merge_file_input` structure with descriptions of the files in\n each side of the conflict for use in producing the merge file.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"ptr","comments":" Pointer to the contents of the file. "},{"type":"size_t","name":"size","comments":" Size of the contents pointed to in `ptr`. "},{"type":"const char *","name":"path","comments":" File name of the conflicted file, or `NULL` to not merge the path. "},{"type":"unsigned int","name":"mode","comments":" File mode of the conflicted file, or `0` to not merge the mode. "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_init_input"]}}],["git_merge_file_options",{"decl":["unsigned int version","const char * ancestor_label","const char * our_label","const char * their_label","git_merge_file_favor_t favor","unsigned int flags"],"type":"struct","value":"git_merge_file_options","file":"merge.h","line":148,"lineto":174,"block":"unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\nunsigned int flags","tdef":"typedef","description":" Options for merging a file","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"const char *","name":"ancestor_label","comments":" Label for the ancestor file side of the conflict which will be prepended\n to labels in diff3-format merge files."},{"type":"const char *","name":"our_label","comments":" Label for our file side of the conflict which will be prepended\n to labels in merge files."},{"type":"const char *","name":"their_label","comments":" Label for their file side of the conflict which will be prepended\n to labels in merge files."},{"type":"git_merge_file_favor_t","name":"favor","comments":" The file to favor in region conflicts. "},{"type":"unsigned int","name":"flags","comments":" see `git_merge_file_flags_t` above "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_from_index","git_merge_file_init_options"]}}],["git_merge_file_result",{"decl":["unsigned int automergeable","const char * path","unsigned int mode","const char * ptr","size_t len"],"type":"struct","value":"git_merge_file_result","file":"merge.h","line":195,"lineto":216,"block":"unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len","tdef":"typedef","description":" Information about file-level merging","comments":"","fields":[{"type":"unsigned int","name":"automergeable","comments":" True if the output was automerged, false if the output contains\n conflict markers."},{"type":"const char *","name":"path","comments":" The path that the resultant merge file should use, or NULL if a\n filename conflict would occur."},{"type":"unsigned int","name":"mode","comments":" The mode that the resultant merge file should use. "},{"type":"const char *","name":"ptr","comments":" The contents of the merge. "},{"type":"size_t","name":"len","comments":" The length of the merge contents. "}],"used":{"returns":[],"needs":["git_merge_file","git_merge_file_from_index","git_merge_file_result_free"]}}],["git_merge_options",{"decl":["unsigned int version","git_merge_tree_flag_t tree_flags","unsigned int rename_threshold","unsigned int target_limit","git_diff_similarity_metric * metric","git_merge_file_favor_t file_favor","unsigned int file_flags"],"type":"struct","value":"git_merge_options","file":"merge.h","line":221,"lineto":251,"block":"unsigned int version\ngit_merge_tree_flag_t tree_flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\ngit_merge_file_favor_t file_favor\nunsigned int file_flags","tdef":"typedef","description":" Merging options","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_merge_tree_flag_t","name":"tree_flags","comments":""},{"type":"unsigned int","name":"rename_threshold","comments":" Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename."},{"type":"unsigned int","name":"target_limit","comments":" Maximum similarity sources to examine for renames (default 200).\n If the number of rename candidates (add / delete pairs) is greater\n than this value, inexact rename detection is aborted.\n\n This setting overrides the `merge.renameLimit` configuration value."},{"type":"git_diff_similarity_metric *","name":"metric","comments":" Pluggable similarity metric; pass NULL to use internal metric "},{"type":"git_merge_file_favor_t","name":"file_favor","comments":" Flags for handling conflicting content. "},{"type":"unsigned int","name":"file_flags","comments":" see `git_merge_file_flags_t` above "}],"used":{"returns":[],"needs":["git_cherrypick_commit","git_merge","git_merge_commits","git_merge_init_options","git_merge_trees","git_revert_commit"]}}],["git_merge_preference_t",{"decl":["GIT_MERGE_PREFERENCE_NONE","GIT_MERGE_PREFERENCE_NO_FASTFORWARD","GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY"],"type":"enum","file":"merge.h","line":306,"lineto":324,"block":"GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY","tdef":"typedef","description":" The user's stated preference for merges.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_PREFERENCE_NONE","comments":"

No configuration was found that suggests a preferred behavior for\n merge.

\n","value":0},{"type":"int","name":"GIT_MERGE_PREFERENCE_NO_FASTFORWARD","comments":"

There is a merge.ff=false configuration setting, suggesting that\n the user does not want to allow a fast-forward merge.

\n","value":1},{"type":"int","name":"GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY","comments":"

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n","value":2}],"used":{"returns":[],"needs":["git_merge_analysis"]}}],["git_merge_result",{"decl":"git_merge_result","type":"struct","value":"git_merge_result","file":"types.h","line":181,"lineto":181,"tdef":"typedef","description":" Merge result ","comments":"","used":{"returns":[],"needs":[]}}],["git_merge_tree_flag_t",{"decl":["GIT_MERGE_TREE_FIND_RENAMES"],"type":"enum","file":"merge.h","line":68,"lineto":75,"block":"GIT_MERGE_TREE_FIND_RENAMES","tdef":"typedef","description":" Flags for `git_merge_tree` options. A combination of these flags can be\n passed in via the `tree_flags` value in the `git_merge_options`.","comments":"","fields":[{"type":"int","name":"GIT_MERGE_TREE_FIND_RENAMES","comments":"

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n","value":1}],"used":{"returns":[],"needs":[]}}],["git_note",{"decl":"git_note","type":"struct","value":"git_note","file":"types.h","line":150,"lineto":150,"tdef":"typedef","description":" Representation of a git note ","comments":"","used":{"returns":[],"needs":["git_note_author","git_note_committer","git_note_free","git_note_id","git_note_message","git_note_read"]}}],["git_note_iterator",{"decl":"git_note_iterator","type":"struct","value":"git_note_iterator","file":"notes.h","line":35,"lineto":35,"tdef":"typedef","description":" note iterator","comments":"","used":{"returns":[],"needs":["git_note_iterator_free","git_note_iterator_new","git_note_next"]}}],["git_object",{"decl":"git_object","type":"struct","value":"git_object","file":"types.h","line":108,"lineto":108,"tdef":"typedef","description":" Representation of a generic object in a repository ","comments":"","used":{"returns":[],"needs":["git_checkout_tree","git_describe_commit","git_object_dup","git_object_free","git_object_id","git_object_lookup","git_object_lookup_bypath","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_short_id","git_object_type","git_reference_peel","git_reset","git_reset_default","git_revparse_ext","git_revparse_single","git_tag_annotation_create","git_tag_create","git_tag_create_lightweight","git_tag_peel","git_tag_target","git_tree_entry_to_object"]}}],["git_odb",{"decl":"git_odb","type":"struct","value":"git_odb","file":"types.h","line":81,"lineto":81,"tdef":"typedef","description":" An open object database handle. ","comments":"","used":{"returns":[],"needs":["git_indexer_new","git_odb_add_alternate","git_odb_add_backend","git_odb_add_disk_alternate","git_odb_exists","git_odb_exists_prefix","git_odb_foreach","git_odb_free","git_odb_get_backend","git_odb_new","git_odb_num_backends","git_odb_open","git_odb_open_rstream","git_odb_open_wstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_refresh","git_odb_write","git_odb_write_pack","git_repository_odb","git_repository_set_odb","git_repository_wrap_odb"]}}],["git_odb_backend",{"decl":"git_odb_backend","type":"struct","value":"git_odb_backend","file":"types.h","line":84,"lineto":84,"block":"unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free","tdef":"typedef","description":" A custom backend in an ODB ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_odb *","name":"odb","comments":""},{"type":"int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)","name":"read","comments":""},{"type":"int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)","name":"read_prefix","comments":""},{"type":"int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)","name":"read_header","comments":""},{"type":"int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)","name":"write","comments":" Write an object into the backend. The id of the object has\n already been calculated and is passed in."},{"type":"int (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype)","name":"writestream","comments":""},{"type":"int (*)(git_odb_stream **, git_odb_backend *, const git_oid *)","name":"readstream","comments":""},{"type":"int (*)(git_odb_backend *, const git_oid *)","name":"exists","comments":""},{"type":"int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)","name":"exists_prefix","comments":""},{"type":"int (*)(git_odb_backend *)","name":"refresh","comments":" If the backend implements a refreshing mechanism, it should be exposed\n through this endpoint. Each call to `git_odb_refresh()` will invoke it.\n\n However, the backend implementation should try to stay up-to-date as much\n as possible by itself as libgit2 will not automatically invoke\n `git_odb_refresh()`. For instance, a potential strategy for the backend\n implementation to achieve this could be to internally invoke this\n endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`)."},{"type":"int (*)(git_odb_backend *, git_odb_foreach_cb, void *)","name":"foreach","comments":""},{"type":"int (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *)","name":"writepack","comments":""},{"type":"void (*)(git_odb_backend *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_mempack_new","git_mempack_reset","git_odb_add_alternate","git_odb_add_backend","git_odb_backend_loose","git_odb_backend_one_pack","git_odb_backend_pack","git_odb_get_backend","git_odb_init_backend"]}}],["git_odb_object",{"decl":"git_odb_object","type":"struct","value":"git_odb_object","file":"types.h","line":87,"lineto":87,"tdef":"typedef","description":" An object read from the ODB ","comments":"","used":{"returns":[],"needs":["git_odb_object_data","git_odb_object_dup","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",{"decl":"git_odb_stream","type":"struct","value":"git_odb_stream","file":"types.h","line":90,"lineto":90,"block":"git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_off_t declared_size\ngit_off_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const int *) finalize_write\nvoid (*)(git_odb_stream *) free","tdef":"typedef","description":" A stream to read/write from the ODB ","comments":"","fields":[{"type":"git_odb_backend *","name":"backend","comments":""},{"type":"unsigned int","name":"mode","comments":""},{"type":"void *","name":"hash_ctx","comments":""},{"type":"git_off_t","name":"declared_size","comments":""},{"type":"git_off_t","name":"received_bytes","comments":""},{"type":"int (*)(git_odb_stream *, char *, size_t)","name":"read","comments":" Write at most `len` bytes into `buffer` and advance the stream."},{"type":"int (*)(git_odb_stream *, const char *, size_t)","name":"write","comments":" Write `len` bytes from `buffer` into the stream."},{"type":"int (*)(git_odb_stream *, const int *)","name":"finalize_write","comments":" Store the contents of the stream as an object with the id\n specified in `oid`.\n\n This method might not be invoked if:\n - an error occurs earlier with the `write` callback,\n - the object referred to by `oid` already exists in any backend, or\n - the final number of received bytes differs from the size declared\n with `git_odb_open_wstream()`"},{"type":"void (*)(git_odb_stream *)","name":"free","comments":" Free the stream's memory.\n\n This method might be called without a call to `finalize_write` if\n an error occurs or if the object is already present in the ODB."}],"used":{"returns":[],"needs":["git_odb_open_rstream","git_odb_open_wstream","git_odb_stream_finalize_write","git_odb_stream_free","git_odb_stream_read","git_odb_stream_write"]}}],["git_odb_stream_t",{"decl":["GIT_STREAM_RDONLY","GIT_STREAM_WRONLY","GIT_STREAM_RW"],"type":"enum","file":"odb_backend.h","line":70,"lineto":74,"block":"GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW","tdef":"typedef","description":" Streaming mode ","comments":"","fields":[{"type":"int","name":"GIT_STREAM_RDONLY","comments":"","value":2},{"type":"int","name":"GIT_STREAM_WRONLY","comments":"","value":4},{"type":"int","name":"GIT_STREAM_RW","comments":"","value":6}],"used":{"returns":[],"needs":[]}}],["git_odb_writepack",{"decl":"git_odb_writepack","type":"struct","value":"git_odb_writepack","file":"types.h","line":93,"lineto":93,"block":"git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *) append\nint (*)(git_odb_writepack *, git_transfer_progress *) commit\nvoid (*)(git_odb_writepack *) free","tdef":"typedef","description":" A stream to write a packfile to the ODB ","comments":"","fields":[{"type":"git_odb_backend *","name":"backend","comments":""},{"type":"int (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *)","name":"append","comments":""},{"type":"int (*)(git_odb_writepack *, git_transfer_progress *)","name":"commit","comments":""},{"type":"void (*)(git_odb_writepack *)","name":"free","comments":""}],"used":{"returns":[],"needs":["git_odb_write_pack"]}}],["git_oid",{"decl":["unsigned char [20] id"],"type":"struct","value":"git_oid","file":"oid.h","line":33,"lineto":36,"block":"unsigned char [20] id","tdef":"typedef","description":" Unique identity of any object (commit, tree, blob, tag). ","comments":"","fields":[{"type":"unsigned char [20]","name":"id","comments":" raw binary formatted id "}],"used":{"returns":["git_annotated_commit_id","git_blob_id","git_commit_id","git_commit_parent_id","git_commit_tree_id","git_filter_source_id","git_index_checksum","git_indexer_hash","git_note_id","git_object_id","git_odb_object_id","git_packbuilder_hash","git_reference_target","git_reference_target_peel","git_reflog_entry_id_new","git_reflog_entry_id_old","git_submodule_head_id","git_submodule_index_id","git_submodule_wd_id","git_tag_id","git_tag_target_id","git_tree_entry_id","git_tree_id"],"needs":["git_annotated_commit_from_fetchhead","git_annotated_commit_lookup","git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_lookup","git_blob_lookup_prefix","git_commit_amend","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_graph_ahead_behind","git_graph_descendant_of","git_index_write_tree","git_index_write_tree_to","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_note_create","git_note_next","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_odb_exists","git_odb_exists_prefix","git_odb_hash","git_odb_hashfile","git_odb_open_rstream","git_odb_read","git_odb_read_header","git_odb_read_prefix","git_odb_stream_finalize_write","git_odb_write","git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_fromstrp","git_oid_iszero","git_oid_ncmp","git_oid_nfmt","git_oid_pathfmt","git_oid_strcmp","git_oid_streq","git_oid_tostr","git_oid_tostr_s","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_recur","git_packbuilder_insert_tree","git_rebase_commit","git_reference__alloc","git_reference_create","git_reference_create_matching","git_reference_name_to_id","git_reference_set_target","git_reflog_append","git_repository_hashfile","git_repository_set_head_detached","git_revwalk_hide","git_revwalk_next","git_revwalk_push","git_tag_annotation_create","git_tag_create","git_tag_create_frombuffer","git_tag_create_lightweight","git_tag_lookup","git_tag_lookup_prefix","git_tree_entry_byid","git_tree_lookup","git_tree_lookup_prefix","git_treebuilder_insert","git_treebuilder_write"]}}],["git_oid_shorten",{"decl":"git_oid_shorten","type":"struct","value":"git_oid_shorten","file":"oid.h","line":216,"lineto":216,"tdef":"typedef","description":" OID Shortener object","comments":"","used":{"returns":["git_oid_shorten_new"],"needs":["git_oid_shorten_add","git_oid_shorten_free"]}}],["git_oidarray",{"decl":["git_oid * ids","size_t count"],"type":"struct","value":"git_oidarray","file":"oidarray.h","line":16,"lineto":19,"block":"git_oid * ids\nsize_t count","tdef":"typedef","description":" Array of object ids ","comments":"","fields":[{"type":"git_oid *","name":"ids","comments":""},{"type":"size_t","name":"count","comments":""}],"used":{"returns":[],"needs":["git_merge_bases","git_merge_bases_many","git_oidarray_free"]}}],["git_otype",{"decl":["GIT_OBJ_ANY","GIT_OBJ_BAD","GIT_OBJ__EXT1","GIT_OBJ_COMMIT","GIT_OBJ_TREE","GIT_OBJ_BLOB","GIT_OBJ_TAG","GIT_OBJ__EXT2","GIT_OBJ_OFS_DELTA","GIT_OBJ_REF_DELTA"],"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","description":" Basic type (loose or packed) of any Git object. ","comments":"","fields":[{"type":"int","name":"GIT_OBJ_ANY","comments":"

Object can be any of the following

\n","value":-2},{"type":"int","name":"GIT_OBJ_BAD","comments":"

Object is invalid.

\n","value":-1},{"type":"int","name":"GIT_OBJ__EXT1","comments":"

Reserved for future use.

\n","value":0},{"type":"int","name":"GIT_OBJ_COMMIT","comments":"

A commit object.

\n","value":1},{"type":"int","name":"GIT_OBJ_TREE","comments":"

A tree (directory listing) object.

\n","value":2},{"type":"int","name":"GIT_OBJ_BLOB","comments":"

A file revision object.

\n","value":3},{"type":"int","name":"GIT_OBJ_TAG","comments":"

An annotated tag object.

\n","value":4},{"type":"int","name":"GIT_OBJ__EXT2","comments":"

Reserved for future use.

\n","value":5},{"type":"int","name":"GIT_OBJ_OFS_DELTA","comments":"

A delta, base is given by an offset.

\n","value":6},{"type":"int","name":"GIT_OBJ_REF_DELTA","comments":"

A delta, base is given by object id.

\n","value":7}],"used":{"returns":[],"needs":["git_object__size","git_object_lookup","git_object_lookup_bypath","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",{"decl":"git_packbuilder","type":"struct","value":"git_packbuilder","file":"types.h","line":153,"lineto":153,"tdef":"typedef","description":" Representation of a git packbuilder ","comments":"","used":{"returns":[],"needs":["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_hash","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_recur","git_packbuilder_insert_tree","git_packbuilder_insert_walk","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_callbacks","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]}}],["git_packbuilder_stage_t",{"decl":["GIT_PACKBUILDER_ADDING_OBJECTS","GIT_PACKBUILDER_DELTAFICATION"],"type":"enum","file":"pack.h","line":51,"lineto":54,"block":"GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION","tdef":"typedef","description":" Stages that are reported by the packbuilder progress callback.","comments":"","fields":[{"type":"int","name":"GIT_PACKBUILDER_ADDING_OBJECTS","comments":"","value":0},{"type":"int","name":"GIT_PACKBUILDER_DELTAFICATION","comments":"","value":1}],"used":{"returns":[],"needs":[]}}],["git_patch",{"decl":"git_patch","type":"struct","value":"git_patch","file":"patch.h","line":29,"lineto":29,"tdef":"typedef","description":" The diff patch is used to store all the text diffs for a delta.","comments":"

You can easily loop over the content of patches and get information about\n them.

\n","used":{"returns":[],"needs":["git_patch_free","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers","git_patch_from_diff","git_patch_get_delta","git_patch_get_hunk","git_patch_get_line_in_hunk","git_patch_line_stats","git_patch_num_hunks","git_patch_num_lines_in_hunk","git_patch_print","git_patch_size","git_patch_to_buf"]}}],["git_pathspec",{"decl":"git_pathspec","type":"struct","value":"git_pathspec","file":"pathspec.h","line":20,"lineto":20,"tdef":"typedef","description":" Compiled pathspec","comments":"","used":{"returns":[],"needs":["git_pathspec_free","git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_tree","git_pathspec_match_workdir","git_pathspec_matches_path","git_pathspec_new"]}}],["git_pathspec_flag_t",{"decl":["GIT_PATHSPEC_DEFAULT","GIT_PATHSPEC_IGNORE_CASE","GIT_PATHSPEC_USE_CASE","GIT_PATHSPEC_NO_GLOB","GIT_PATHSPEC_NO_MATCH_ERROR","GIT_PATHSPEC_FIND_FAILURES","GIT_PATHSPEC_FAILURES_ONLY"],"type":"enum","file":"pathspec.h","line":48,"lineto":56,"block":"GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY","tdef":"typedef","description":" Options controlling how pathspec match should be executed","comments":"
    \n
  • GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\nstring comparison for matching
  • \n
  • GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\ncode GIT_ENOTFOUND if no matches are found; otherwise no matches is\nstill success (return 0) but git_pathspec_match_list_entrycount\nwill indicate 0 matches.
  • \n
  • GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\nshould track which patterns matched which files so that at the end of\nthe match we can identify patterns that did not match any files.
  • \n
  • GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\ndoes not need to keep the actual matching filenames. Use this to\njust test if there were any matches at all or in combination with\nGIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
  • \n
\n","fields":[{"type":"int","name":"GIT_PATHSPEC_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_PATHSPEC_IGNORE_CASE","comments":"","value":1},{"type":"int","name":"GIT_PATHSPEC_USE_CASE","comments":"","value":2},{"type":"int","name":"GIT_PATHSPEC_NO_GLOB","comments":"","value":4},{"type":"int","name":"GIT_PATHSPEC_NO_MATCH_ERROR","comments":"","value":8},{"type":"int","name":"GIT_PATHSPEC_FIND_FAILURES","comments":"","value":16},{"type":"int","name":"GIT_PATHSPEC_FAILURES_ONLY","comments":"","value":32}],"used":{"returns":[],"needs":[]}}],["git_pathspec_match_list",{"decl":"git_pathspec_match_list","type":"struct","value":"git_pathspec_match_list","file":"pathspec.h","line":25,"lineto":25,"tdef":"typedef","description":" List of filenames matching a pathspec","comments":"","used":{"returns":[],"needs":["git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_list_diff_entry","git_pathspec_match_list_entry","git_pathspec_match_list_entrycount","git_pathspec_match_list_failed_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_free","git_pathspec_match_tree","git_pathspec_match_workdir"]}}],["git_push",{"decl":"git_push","type":"struct","value":"git_push","file":"types.h","line":236,"lineto":236,"tdef":"typedef","description":" Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.","comments":"","used":{"returns":[],"needs":[]}}],["git_push_options",{"decl":["unsigned int version","unsigned int pb_parallelism","git_remote_callbacks callbacks"],"type":"struct","value":"git_push_options","file":"remote.h","line":571,"lineto":588,"block":"unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks","tdef":"typedef","description":" Controls the behavior of a git_push object.","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"pb_parallelism","comments":" If the transport being used to push to the remote requires the creation\n of a pack file, this controls the number of worker threads used by\n the packbuilder when creating that pack file to be sent to the remote.\n\n If set to 0, the packbuilder will auto-detect the number of threads\n to create. The default value is 1."},{"type":"git_remote_callbacks","name":"callbacks","comments":" Callbacks to use for this push operation"}],"used":{"returns":[],"needs":["git_push_init_options","git_remote_push","git_remote_upload"]}}],["git_push_update",{"decl":["char * src_refname","char * dst_refname","git_oid src","git_oid dst"],"type":"struct","value":"git_push_update","file":"remote.h","line":340,"lineto":357,"block":"char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst","tdef":"typedef","description":" Represents an update which will be performed on the remote during push","comments":"","fields":[{"type":"char *","name":"src_refname","comments":" The source name of the reference"},{"type":"char *","name":"dst_refname","comments":" The name of the reference to update on the server"},{"type":"git_oid","name":"src","comments":" The current target of the reference"},{"type":"git_oid","name":"dst","comments":" The new target for the reference"}],"used":{"returns":[],"needs":[]}}],["git_rebase",{"decl":"git_rebase","type":"struct","value":"git_rebase","file":"types.h","line":187,"lineto":187,"tdef":"typedef","description":" Representation of a rebase ","comments":"","used":{"returns":[],"needs":["git_rebase_abort","git_rebase_commit","git_rebase_finish","git_rebase_free","git_rebase_init","git_rebase_next","git_rebase_open","git_rebase_operation_byindex","git_rebase_operation_current","git_rebase_operation_entrycount"]}}],["git_rebase_operation",{"decl":["git_rebase_operation_t type","const git_oid id","const char * exec"],"type":"struct","value":"git_rebase_operation","file":"rebase.h","line":115,"lineto":130,"block":"git_rebase_operation_t type\nconst git_oid id\nconst char * exec","tdef":"typedef","description":" A rebase operation","comments":"

Describes a single instruction/operation to be performed during the\n rebase.

\n","fields":[{"type":"git_rebase_operation_t","name":"type","comments":" The type of rebase operation. "},{"type":"const git_oid","name":"id","comments":" The commit ID being cherry-picked. This will be populated for\n all operations except those of type `GIT_REBASE_OPERATION_EXEC`."},{"type":"const char *","name":"exec","comments":" The executable the user has requested be run. This will only\n be populated for operations of type `GIT_REBASE_OPERATION_EXEC`."}],"used":{"returns":["git_rebase_operation_byindex"],"needs":["git_rebase_next"]}}],["git_rebase_operation_t",{"decl":["GIT_REBASE_OPERATION_PICK","GIT_REBASE_OPERATION_REWORD","GIT_REBASE_OPERATION_EDIT","GIT_REBASE_OPERATION_SQUASH","GIT_REBASE_OPERATION_FIXUP","GIT_REBASE_OPERATION_EXEC"],"type":"enum","file":"rebase.h","line":64,"lineto":100,"block":"GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC","tdef":"typedef","description":" Type of rebase operation in-progress after calling `git_rebase_next`.","comments":"","fields":[{"type":"int","name":"GIT_REBASE_OPERATION_PICK","comments":"

The given commit is to be cherry-picked. The client should commit\n the changes and continue if there are no conflicts.

\n","value":0},{"type":"int","name":"GIT_REBASE_OPERATION_REWORD","comments":"

The given commit is to be cherry-picked, but the client should prompt\n the user to provide an updated commit message.

\n","value":1},{"type":"int","name":"GIT_REBASE_OPERATION_EDIT","comments":"

The given commit is to be cherry-picked, but the client should stop\n to allow the user to edit the changes before committing them.

\n","value":2},{"type":"int","name":"GIT_REBASE_OPERATION_SQUASH","comments":"

The given commit is to be squashed into the previous commit. The\n commit message will be merged with the previous message.

\n","value":3},{"type":"int","name":"GIT_REBASE_OPERATION_FIXUP","comments":"

The given commit is to be squashed into the previous commit. The\n commit message from this commit will be discarded.

\n","value":4},{"type":"int","name":"GIT_REBASE_OPERATION_EXEC","comments":"

No commit will be cherry-picked. The client should run the given\n command and (if successful) continue.

\n","value":5}],"used":{"returns":[],"needs":[]}}],["git_ref_t",{"decl":["GIT_REF_INVALID","GIT_REF_OID","GIT_REF_SYMBOLIC","GIT_REF_LISTALL"],"type":"enum","file":"types.h","line":190,"lineto":195,"block":"GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_LISTALL","tdef":"typedef","description":" Basic type of any Git reference. ","comments":"","fields":[{"type":"int","name":"GIT_REF_INVALID","comments":"

Invalid reference

\n","value":0},{"type":"int","name":"GIT_REF_OID","comments":"

A reference which points at an object id

\n","value":1},{"type":"int","name":"GIT_REF_SYMBOLIC","comments":"

A reference which points at another reference

\n","value":2},{"type":"int","name":"GIT_REF_LISTALL","comments":"","value":3}],"used":{"returns":[],"needs":[]}}],["git_refdb",{"decl":"git_refdb","type":"struct","value":"git_refdb","file":"types.h","line":96,"lineto":96,"tdef":"typedef","description":" An open refs database handle. ","comments":"","used":{"returns":[],"needs":["git_refdb_compress","git_refdb_free","git_refdb_new","git_refdb_open","git_refdb_set_backend","git_repository_refdb","git_repository_set_refdb"]}}],["git_refdb_backend",{"decl":"git_refdb_backend","type":"struct","value":"git_refdb_backend","file":"types.h","line":99,"lineto":99,"block":"unsigned int version\nint (*)(int *, git_refdb_backend *, const char *) exists\nint (*)(git_reference **, git_refdb_backend *, const char *) lookup\nint (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator\nint (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write\nint (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename\nint (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del\nint (*)(git_refdb_backend *) compress\nint (*)(git_refdb_backend *, const char *) has_log\nint (*)(git_refdb_backend *, const char *) ensure_log\nvoid (*)(git_refdb_backend *) free\nint (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read\nint (*)(git_refdb_backend *, git_reflog *) reflog_write\nint (*)(git_refdb_backend *, const char *, const char *) reflog_rename\nint (*)(git_refdb_backend *, const char *) reflog_delete\nint (*)(void **, git_refdb_backend *, const char *) lock\nint (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock","tdef":"typedef","description":" A custom backend for refs ","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"int (*)(int *, git_refdb_backend *, const char *)","name":"exists","comments":" Queries the refdb backend to determine if the given ref_name\n exists. A refdb implementation must provide this function."},{"type":"int (*)(git_reference **, git_refdb_backend *, const char *)","name":"lookup","comments":" Queries the refdb backend for a given reference. A refdb\n implementation must provide this function."},{"type":"int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)","name":"iterator","comments":" Allocate an iterator object for the backend.\n\n A refdb implementation must provide this function."},{"type":"int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)","name":"write","comments":""},{"type":"int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)","name":"rename","comments":""},{"type":"int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)","name":"del","comments":" Deletes the given reference from the refdb. A refdb implementation\n must provide this function."},{"type":"int (*)(git_refdb_backend *)","name":"compress","comments":" Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. (For on-disk reference\n databases, this may pack all loose references.) A refdb\n implementation may provide this function; if it is not provided,\n nothing will be done."},{"type":"int (*)(git_refdb_backend *, const char *)","name":"has_log","comments":" Query whether a particular reference has a log (may be empty)"},{"type":"int (*)(git_refdb_backend *, const char *)","name":"ensure_log","comments":" Make sure a particular reference will have a reflog which\n will be appended to on writes."},{"type":"void (*)(git_refdb_backend *)","name":"free","comments":" Frees any resources held by the refdb. A refdb implementation may\n provide this function; if it is not provided, nothing will be done."},{"type":"int (*)(git_reflog **, git_refdb_backend *, const char *)","name":"reflog_read","comments":" Read the reflog for the given reference name."},{"type":"int (*)(git_refdb_backend *, git_reflog *)","name":"reflog_write","comments":" Write a reflog to disk."},{"type":"int (*)(git_refdb_backend *, const char *, const char *)","name":"reflog_rename","comments":" Rename a reflog"},{"type":"int (*)(git_refdb_backend *, const char *)","name":"reflog_delete","comments":" Remove a reflog."},{"type":"int (*)(void **, git_refdb_backend *, const char *)","name":"lock","comments":" Lock a reference. The opaque parameter will be passed to the unlock function"},{"type":"int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)","name":"unlock","comments":" Unlock a reference. Only one of target or symbolic_target\n will be set. success indicates whether to update the\n reference or discard the lock (if it's false)"}],"used":{"returns":[],"needs":["git_refdb_backend_fs","git_refdb_init_backend","git_refdb_set_backend"]}}],["git_reference",{"decl":"git_reference","type":"struct","value":"git_reference","file":"types.h","line":169,"lineto":169,"tdef":"typedef","description":" In-memory representation of a reference. ","comments":"","used":{"returns":["git_reference__alloc","git_reference__alloc_symbolic"],"needs":["git_annotated_commit_from_ref","git_branch_create","git_branch_create_from_annotated","git_branch_delete","git_branch_is_head","git_branch_lookup","git_branch_move","git_branch_name","git_branch_next","git_branch_set_upstream","git_branch_upstream","git_reference_cmp","git_reference_create","git_reference_create_matching","git_reference_delete","git_reference_dwim","git_reference_free","git_reference_is_branch","git_reference_is_note","git_reference_is_remote","git_reference_is_tag","git_reference_lookup","git_reference_name","git_reference_next","git_reference_owner","git_reference_peel","git_reference_rename","git_reference_resolve","git_reference_set_target","git_reference_shorthand","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reference_symbolic_set_target","git_reference_symbolic_target","git_reference_target","git_reference_target_peel","git_reference_type","git_repository_head","git_revparse_ext"]}}],["git_reference_iterator",{"decl":"git_reference_iterator","type":"struct","value":"git_reference_iterator","file":"types.h","line":172,"lineto":172,"block":"git_refdb * db\nint (*)(git_reference **, git_reference_iterator *) next\nint (*)(const char **, git_reference_iterator *) next_name\nvoid (*)(git_reference_iterator *) free","tdef":"typedef","description":" Iterator for references ","comments":"","fields":[{"type":"git_refdb *","name":"db","comments":""},{"type":"int (*)(git_reference **, git_reference_iterator *)","name":"next","comments":" Return the current reference and advance the iterator."},{"type":"int (*)(const char **, git_reference_iterator *)","name":"next_name","comments":" Return the name of the current reference and advance the iterator"},{"type":"void (*)(git_reference_iterator *)","name":"free","comments":" Free the iterator"}],"used":{"returns":[],"needs":["git_reference_iterator_free","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_next","git_reference_next_name"]}}],["git_reference_normalize_t",{"decl":["GIT_REF_FORMAT_NORMAL","GIT_REF_FORMAT_ALLOW_ONELEVEL","GIT_REF_FORMAT_REFSPEC_PATTERN","GIT_REF_FORMAT_REFSPEC_SHORTHAND"],"type":"enum","file":"refs.h","line":625,"lineto":654,"block":"GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND","tdef":"typedef","description":" Normalization options for reference lookup","comments":"","fields":[{"type":"int","name":"GIT_REF_FORMAT_NORMAL","comments":"

No particular normalization.

\n","value":0},{"type":"int","name":"GIT_REF_FORMAT_ALLOW_ONELEVEL","comments":"

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n","value":1},{"type":"int","name":"GIT_REF_FORMAT_REFSPEC_PATTERN","comments":"

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n","value":2},{"type":"int","name":"GIT_REF_FORMAT_REFSPEC_SHORTHAND","comments":"

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_reflog",{"decl":"git_reflog","type":"struct","value":"git_reflog","file":"types.h","line":147,"lineto":147,"tdef":"typedef","description":" Representation of a reference log ","comments":"","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",{"decl":"git_reflog_entry","type":"struct","value":"git_reflog_entry","file":"types.h","line":144,"lineto":144,"tdef":"typedef","description":" Representation of a reference log entry ","comments":"","used":{"returns":["git_reflog_entry_byindex"],"needs":["git_reflog_entry_committer","git_reflog_entry_id_new","git_reflog_entry_id_old","git_reflog_entry_message"]}}],["git_remote",{"decl":"git_remote","type":"struct","value":"git_remote","file":"types.h","line":224,"lineto":224,"tdef":"typedef","description":" Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).","comments":"","used":{"returns":[],"needs":["git_remote_autotag","git_remote_connect","git_remote_connected","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_default_branch","git_remote_disconnect","git_remote_download","git_remote_dup","git_remote_fetch","git_remote_free","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_get_refspec","git_remote_lookup","git_remote_ls","git_remote_name","git_remote_owner","git_remote_prune","git_remote_prune_refs","git_remote_push","git_remote_pushurl","git_remote_refspec_count","git_remote_stats","git_remote_stop","git_remote_update_tips","git_remote_upload","git_remote_url","git_transport_dummy","git_transport_local","git_transport_new","git_transport_smart","git_transport_ssh_with_paths"]}}],["git_remote_autotag_option_t",{"decl":["GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED","GIT_REMOTE_DOWNLOAD_TAGS_AUTO","GIT_REMOTE_DOWNLOAD_TAGS_NONE","GIT_REMOTE_DOWNLOAD_TAGS_ALL"],"type":"enum","file":"remote.h","line":494,"lineto":512,"block":"GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL","tdef":"typedef","description":" Automatic tag following option","comments":"

Lets us select the --tags option to use.

\n","fields":[{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED","comments":"

Use the setting from the configuration.

\n","value":0},{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_AUTO","comments":"

Ask the server for tags pointing to objects we're already\n downloading.

\n","value":1},{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_NONE","comments":"

Don't ask for any tags beyond the refspecs.

\n","value":2},{"type":"int","name":"GIT_REMOTE_DOWNLOAD_TAGS_ALL","comments":"

Ask for the all the tags.

\n","value":3}],"used":{"returns":[],"needs":["git_remote_set_autotag","git_remote_update_tips"]}}],["git_remote_callbacks",{"decl":["unsigned int version","git_transport_message_cb sideband_progress","int (*)(git_remote_completion_type, void *) completion","git_cred_acquire_cb credentials","git_transport_certificate_check_cb certificate_check","git_transfer_progress_cb transfer_progress","int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips","git_packbuilder_progress pack_progress","git_push_transfer_progress push_transfer_progress","int (*)(const char *, const char *, void *) push_update_reference","git_push_negotiation push_negotiation","git_transport_cb transport","void * payload"],"type":"struct","value":"git_remote_callbacks","file":"remote.h","line":373,"lineto":457,"block":"unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\nint (*)(const char *, const char *, void *) push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload","tdef":null,"description":" The callback settings structure","comments":"

Set the callbacks to be called by the remote when informing the user\n about the progress of the network operations.

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_transport_message_cb","name":"sideband_progress","comments":" Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output."},{"type":"int (*)(git_remote_completion_type, void *)","name":"completion","comments":" Completion is called when different parts of the download\n process are done (currently unused)."},{"type":"git_cred_acquire_cb","name":"credentials","comments":" This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set."},{"type":"git_transport_certificate_check_cb","name":"certificate_check","comments":" If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error."},{"type":"git_transfer_progress_cb","name":"transfer_progress","comments":" During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer."},{"type":"int (*)(const char *, const git_oid *, const git_oid *, void *)","name":"update_tips","comments":" Each time a reference is updated locally, this function\n will be called with information about it."},{"type":"git_packbuilder_progress","name":"pack_progress","comments":" Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected."},{"type":"git_push_transfer_progress","name":"push_transfer_progress","comments":" Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected."},{"type":"int (*)(const char *, const char *, void *)","name":"push_update_reference","comments":" Called for each updated reference on push. If `status` is\n not `NULL`, the update was rejected by the remote server\n and `status` contains the reason given."},{"type":"git_push_negotiation","name":"push_negotiation","comments":" Called once between the negotiation step and the upload. It\n provides information about what updates will be performed."},{"type":"git_transport_cb","name":"transport","comments":" Create the transport to use for this operation. Leave NULL\n to auto-detect."},{"type":"void *","name":"payload","comments":" This will be passed to each of the callbacks in this struct\n as the last parameter."}],"used":{"returns":[],"needs":["git_remote_connect","git_remote_init_callbacks","git_remote_prune","git_remote_update_tips"]}}],["git_remote_completion_type",{"decl":["GIT_REMOTE_COMPLETION_DOWNLOAD","GIT_REMOTE_COMPLETION_INDEXING","GIT_REMOTE_COMPLETION_ERROR"],"type":"enum","file":"remote.h","line":325,"lineto":329,"block":"GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR","tdef":"typedef","description":" Argument to the completion callback which tells it which operation\n finished.","comments":"","fields":[{"type":"int","name":"GIT_REMOTE_COMPLETION_DOWNLOAD","comments":"","value":0},{"type":"int","name":"GIT_REMOTE_COMPLETION_INDEXING","comments":"","value":1},{"type":"int","name":"GIT_REMOTE_COMPLETION_ERROR","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_remote_head",{"decl":["int local","git_oid oid","git_oid loid","char * name","char * symref_target"],"type":"struct","value":"git_remote_head","file":"net.h","line":40,"lineto":50,"block":"int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target","tdef":null,"description":" Description of a reference advertised by a remote server, given out\n on `ls` calls.","comments":"","fields":[{"type":"int","name":"local","comments":""},{"type":"git_oid","name":"oid","comments":""},{"type":"git_oid","name":"loid","comments":""},{"type":"char *","name":"name","comments":""},{"type":"char *","name":"symref_target","comments":" If the server send a symref mapping for this ref, this will\n point to the target."}],"used":{"returns":[],"needs":["git_remote_ls"]}}],["git_repository",{"decl":"git_repository","type":"struct","value":"git_repository","file":"types.h","line":105,"lineto":105,"tdef":"typedef","description":" Representation of an existing git repository,\n including all its object contents","comments":"","used":{"returns":["git_blob_owner","git_commit_owner","git_filter_source_repo","git_index_owner","git_object_owner","git_reference_owner","git_remote_owner","git_revwalk_repository","git_submodule_owner","git_tag_owner","git_tree_owner"],"needs":["git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_from_revspec","git_annotated_commit_lookup","git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many","git_blame_file","git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_lookup","git_blob_lookup_prefix","git_branch_create","git_branch_create_from_annotated","git_branch_iterator_new","git_branch_lookup","git_checkout_head","git_checkout_index","git_checkout_tree","git_cherrypick","git_cherrypick_commit","git_clone","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_lookup","git_commit_lookup_prefix","git_describe_workdir","git_diff_commit_as_email","git_diff_index_to_workdir","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_filter_list_apply_to_file","git_filter_list_load","git_filter_list_new","git_filter_list_stream_file","git_graph_ahead_behind","git_graph_descendant_of","git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored","git_index_write_tree_to","git_merge","git_merge_analysis","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_merge_commits","git_merge_file_from_index","git_merge_trees","git_note_create","git_note_foreach","git_note_iterator_new","git_note_read","git_note_remove","git_object_lookup","git_object_lookup_prefix","git_packbuilder_new","git_pathspec_match_workdir","git_rebase_init","git_rebase_open","git_refdb_backend_fs","git_refdb_new","git_refdb_open","git_reference_create","git_reference_create_matching","git_reference_dwim","git_reference_ensure_log","git_reference_foreach","git_reference_foreach_glob","git_reference_foreach_name","git_reference_has_log","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_list","git_reference_lookup","git_reference_name_to_id","git_reference_remove","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reflog_delete","git_reflog_read","git_reflog_rename","git_remote_add_fetch","git_remote_add_push","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_delete","git_remote_list","git_remote_lookup","git_remote_rename","git_remote_set_autotag","git_remote_set_pushurl","git_remote_set_url","git_repository__cleanup","git_repository_config","git_repository_config_snapshot","git_repository_detach_head","git_repository_fetchhead_foreach","git_repository_free","git_repository_get_namespace","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_ident","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_is_bare","git_repository_is_empty","git_repository_is_shallow","git_repository_mergehead_foreach","git_repository_message","git_repository_message_remove","git_repository_new","git_repository_odb","git_repository_open","git_repository_open_bare","git_repository_open_ext","git_repository_path","git_repository_refdb","git_repository_reinit_filesystem","git_repository_set_bare","git_repository_set_config","git_repository_set_head","git_repository_set_head_detached","git_repository_set_head_detached_from_annotated","git_repository_set_ident","git_repository_set_index","git_repository_set_namespace","git_repository_set_odb","git_repository_set_refdb","git_repository_set_workdir","git_repository_state","git_repository_state_cleanup","git_repository_workdir","git_repository_wrap_odb","git_reset","git_reset_default","git_reset_from_annotated","git_revert","git_revert_commit","git_revparse","git_revparse_ext","git_revparse_single","git_revwalk_new","git_signature_default","git_stash_apply","git_stash_drop","git_stash_foreach","git_stash_pop","git_status_file","git_status_foreach","git_status_foreach_ext","git_status_list_new","git_status_should_ignore","git_submodule_add_setup","git_submodule_foreach","git_submodule_lookup","git_submodule_open","git_submodule_repo_init","git_submodule_resolve_url","git_submodule_set_branch","git_submodule_set_fetch_recurse_submodules","git_submodule_set_ignore","git_submodule_set_update","git_submodule_set_url","git_submodule_status","git_tag_annotation_create","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_new"]}}],["git_repository_init_flag_t",{"decl":["GIT_REPOSITORY_INIT_BARE","GIT_REPOSITORY_INIT_NO_REINIT","GIT_REPOSITORY_INIT_NO_DOTGIT_DIR","GIT_REPOSITORY_INIT_MKDIR","GIT_REPOSITORY_INIT_MKPATH","GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE","GIT_REPOSITORY_INIT_RELATIVE_GITLINK"],"type":"enum","file":"repository.h","line":202,"lineto":210,"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\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK","tdef":"typedef","description":" Option flags for `git_repository_init_ext`.","comments":"

These flags configure extra behaviors to git_repository_init_ext.\n In every case, the default behavior is the zero value (i.e. flag is\n not set). Just OR the flag values together for the flags parameter\n when initializing a new repo. Details of individual values are:

\n\n
    \n
  • BARE - Create a bare repository with no working directory.
  • \n
  • NO_REINIT - Return an GIT_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.
  • \n
  • GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is\n specified, use relative paths for the gitdir and core.worktree.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_INIT_BARE","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_INIT_NO_REINIT","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_INIT_NO_DOTGIT_DIR","comments":"","value":4},{"type":"int","name":"GIT_REPOSITORY_INIT_MKDIR","comments":"","value":8},{"type":"int","name":"GIT_REPOSITORY_INIT_MKPATH","comments":"","value":16},{"type":"int","name":"GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE","comments":"","value":32},{"type":"int","name":"GIT_REPOSITORY_INIT_RELATIVE_GITLINK","comments":"","value":64}],"used":{"returns":[],"needs":[]}}],["git_repository_init_mode_t",{"decl":["GIT_REPOSITORY_INIT_SHARED_UMASK","GIT_REPOSITORY_INIT_SHARED_GROUP","GIT_REPOSITORY_INIT_SHARED_ALL"],"type":"enum","file":"repository.h","line":225,"lineto":229,"block":"GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL","tdef":"typedef","description":" Mode options for `git_repository_init_ext`.","comments":"

Set the mode field of the git_repository_init_options structure\n either to the custom mode that you would like, or to one of the\n following modes:

\n\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.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_UMASK","comments":"","value":0},{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_GROUP","comments":"","value":1533},{"type":"int","name":"GIT_REPOSITORY_INIT_SHARED_ALL","comments":"","value":1535}],"used":{"returns":[],"needs":[]}}],["git_repository_init_options",{"decl":["unsigned int version","uint32_t flags","uint32_t mode","const char * workdir_path","const char * description","const char * template_path","const char * initial_head","const char * origin_url"],"type":"struct","value":"git_repository_init_options","file":"repository.h","line":259,"lineto":268,"block":"unsigned int version\nuint32_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","description":" Extended options structure for `git_repository_init_ext`.","comments":"

This contains extra options for git_repository_init_ext that enable\n additional initialization features. The fields are:

\n\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.
  • \n
\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"uint32_t","name":"flags","comments":""},{"type":"uint32_t","name":"mode","comments":""},{"type":"const char *","name":"workdir_path","comments":""},{"type":"const char *","name":"description","comments":""},{"type":"const char *","name":"template_path","comments":""},{"type":"const char *","name":"initial_head","comments":""},{"type":"const char *","name":"origin_url","comments":""}],"used":{"returns":[],"needs":["git_repository_init_ext","git_repository_init_init_options"]}}],["git_repository_open_flag_t",{"decl":["GIT_REPOSITORY_OPEN_NO_SEARCH","GIT_REPOSITORY_OPEN_CROSS_FS","GIT_REPOSITORY_OPEN_BARE"],"type":"enum","file":"repository.h","line":99,"lineto":103,"block":"GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE","tdef":"typedef","description":" Option flags for `git_repository_open_ext`.","comments":"
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be\nimmediately found in the start_path. Do not walk up from the\nstart_path looking at parent directories.
  • \n
  • GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not\ncontinue searching across filesystem boundaries (i.e. when st_dev\nchanges from the stat system call). (E.g. Searching in a user's home\ndirectory "/home/user/source/" will not return "/.git/" as the found\nrepo if "/" is a different filesystem than "/home".)
  • \n
  • GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless\nof core.bare config, and defer loading config file for faster setup.\nUnlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n","fields":[{"type":"int","name":"GIT_REPOSITORY_OPEN_NO_SEARCH","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_OPEN_CROSS_FS","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_OPEN_BARE","comments":"","value":4}],"used":{"returns":[],"needs":[]}}],["git_repository_state_t",{"decl":["GIT_REPOSITORY_STATE_NONE","GIT_REPOSITORY_STATE_MERGE","GIT_REPOSITORY_STATE_REVERT","GIT_REPOSITORY_STATE_CHERRYPICK","GIT_REPOSITORY_STATE_BISECT","GIT_REPOSITORY_STATE_REBASE","GIT_REPOSITORY_STATE_REBASE_INTERACTIVE","GIT_REPOSITORY_STATE_REBASE_MERGE","GIT_REPOSITORY_STATE_APPLY_MAILBOX","GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE"],"type":"enum","file":"repository.h","line":674,"lineto":685,"block":"GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE","tdef":"typedef","description":" Repository state","comments":"

These values represent possible states for the repository to be in,\n based on the current operation which is ongoing.

\n","fields":[{"type":"int","name":"GIT_REPOSITORY_STATE_NONE","comments":"","value":0},{"type":"int","name":"GIT_REPOSITORY_STATE_MERGE","comments":"","value":1},{"type":"int","name":"GIT_REPOSITORY_STATE_REVERT","comments":"","value":2},{"type":"int","name":"GIT_REPOSITORY_STATE_CHERRYPICK","comments":"","value":3},{"type":"int","name":"GIT_REPOSITORY_STATE_BISECT","comments":"","value":4},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE","comments":"","value":5},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE_INTERACTIVE","comments":"","value":6},{"type":"int","name":"GIT_REPOSITORY_STATE_REBASE_MERGE","comments":"","value":7},{"type":"int","name":"GIT_REPOSITORY_STATE_APPLY_MAILBOX","comments":"","value":8},{"type":"int","name":"GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE","comments":"","value":9}],"used":{"returns":[],"needs":[]}}],["git_reset_t",{"decl":["GIT_RESET_SOFT","GIT_RESET_MIXED","GIT_RESET_HARD"],"type":"enum","file":"reset.h","line":26,"lineto":30,"block":"GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD","tdef":"typedef","description":" Kinds of reset operation","comments":"","fields":[{"type":"int","name":"GIT_RESET_SOFT","comments":"

Move the head to the given commit

\n","value":1},{"type":"int","name":"GIT_RESET_MIXED","comments":"

SOFT plus reset index to the commit

\n","value":2},{"type":"int","name":"GIT_RESET_HARD","comments":"

MIXED plus changes in working tree discarded

\n","value":3}],"used":{"returns":[],"needs":["git_reset","git_reset_from_annotated"]}}],["git_revert_options",{"decl":["unsigned int version","unsigned int mainline","git_merge_options merge_opts","git_checkout_options checkout_opts"],"type":"struct","value":"git_revert_options","file":"revert.h","line":26,"lineto":34,"block":"unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts","tdef":"typedef","description":" Options for revert","comments":"","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"unsigned int","name":"mainline","comments":" For merge commits, the \"mainline\" is treated as the parent. "},{"type":"git_merge_options","name":"merge_opts","comments":" Options for the merging "},{"type":"git_checkout_options","name":"checkout_opts","comments":" Options for the checkout "}],"used":{"returns":[],"needs":["git_revert","git_revert_init_options"]}}],["git_revparse_mode_t",{"decl":["GIT_REVPARSE_SINGLE","GIT_REVPARSE_RANGE","GIT_REVPARSE_MERGE_BASE"],"type":"enum","file":"revparse.h","line":71,"lineto":78,"block":"GIT_REVPARSE_SINGLE\nGIT_REVPARSE_RANGE\nGIT_REVPARSE_MERGE_BASE","tdef":"typedef","description":" Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.","comments":"","fields":[{"type":"int","name":"GIT_REVPARSE_SINGLE","comments":"

The spec targeted a single object.

\n","value":1},{"type":"int","name":"GIT_REVPARSE_RANGE","comments":"

The spec targeted a range of commits.

\n","value":2},{"type":"int","name":"GIT_REVPARSE_MERGE_BASE","comments":"

The spec used the '...' operator, which invokes special semantics.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_revspec",{"decl":["git_object * from","git_object * to","unsigned int flags"],"type":"struct","value":"git_revspec","file":"revparse.h","line":83,"lineto":90,"block":"git_object * from\ngit_object * to\nunsigned int flags","tdef":"typedef","description":" Git Revision Spec: output of a `git_revparse` operation","comments":"","fields":[{"type":"git_object *","name":"from","comments":" The left element of the revspec; must be freed by the user "},{"type":"git_object *","name":"to","comments":" The right element of the revspec; must be freed by the user "},{"type":"unsigned int","name":"flags","comments":" The intent of the revspec (i.e. `git_revparse_mode_t` flags) "}],"used":{"returns":[],"needs":["git_revparse"]}}],["git_revwalk",{"decl":"git_revwalk","type":"struct","value":"git_revwalk","file":"types.h","line":111,"lineto":111,"tdef":"typedef","description":" Representation of an in-progress walk through the commits in a repo ","comments":"","used":{"returns":[],"needs":["git_packbuilder_insert_walk","git_revwalk_add_hide_cb","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_range","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_simplify_first_parent","git_revwalk_sorting"]}}],["git_signature",{"decl":["char * name","char * email","git_time when"],"type":"struct","value":"git_signature","file":"types.h","line":162,"lineto":166,"block":"char * name\nchar * email\ngit_time when","tdef":"typedef","description":" An action signature (e.g. for committers, taggers, etc) ","comments":"","fields":[{"type":"char *","name":"name","comments":" full name of the author "},{"type":"char *","name":"email","comments":" email of the author "},{"type":"git_time","name":"when","comments":" time when the action happened "}],"used":{"returns":["git_commit_author","git_commit_committer","git_note_author","git_note_committer","git_reflog_entry_committer","git_tag_tagger"],"needs":["git_commit_amend","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_note_create","git_note_remove","git_rebase_commit","git_rebase_finish","git_reflog_append","git_signature_default","git_signature_dup","git_signature_free","git_signature_new","git_signature_now","git_tag_annotation_create","git_tag_create"]}}],["git_smart_subtransport_definition",{"decl":["git_smart_subtransport_cb callback","unsigned int rpc","void * param"],"type":"struct","value":"git_smart_subtransport_definition","file":"sys/transport.h","line":296,"lineto":309,"block":"git_smart_subtransport_cb callback\nunsigned int rpc\nvoid * param","tdef":"typedef","description":" Definition for a \"subtransport\"","comments":"

This is used to let the smart protocol code know about the protocol\n which you are implementing.

\n","fields":[{"type":"git_smart_subtransport_cb","name":"callback","comments":" The function to use to create the git_smart_subtransport "},{"type":"unsigned int","name":"rpc","comments":" True if the protocol is stateless; false otherwise. For example,\n http:// is stateless, but git:// is not."},{"type":"void *","name":"param","comments":" Param of the callback"}],"used":{"returns":[],"needs":[]}}],["git_sort_t",{"decl":["GIT_SORT_NONE","GIT_SORT_TOPOLOGICAL","GIT_SORT_TIME","GIT_SORT_REVERSE"],"type":"enum","file":"revwalk.h","line":26,"lineto":55,"block":"GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE","tdef":"typedef","description":" Flags to specify the sorting which a revwalk should perform.","comments":"","fields":[{"type":"int","name":"GIT_SORT_NONE","comments":"

Sort the repository contents in no particular ordering;\n this sorting is arbitrary, implementation-specific\n and subject to change at any time.\n This is the default sorting for new walkers.

\n","value":0},{"type":"int","name":"GIT_SORT_TOPOLOGICAL","comments":"

Sort the repository contents in topological order\n (parents before children); this sorting mode\n can be combined with time sorting.

\n","value":1},{"type":"int","name":"GIT_SORT_TIME","comments":"

Sort the repository contents by commit time;\n this sorting mode can be combined with\n topological sorting.

\n","value":2},{"type":"int","name":"GIT_SORT_REVERSE","comments":"

Iterate through the repository contents in reverse\n order; this sorting mode can be combined with\n any of the above.

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_stash_apply_flags",{"decl":["GIT_STASH_APPLY_DEFAULT","GIT_STASH_APPLY_REINSTATE_INDEX"],"type":"enum","file":"stash.h","line":74,"lineto":81,"block":"GIT_STASH_APPLY_DEFAULT\nGIT_STASH_APPLY_REINSTATE_INDEX","tdef":"typedef","description":" Stash application flags. ","comments":"","fields":[{"type":"int","name":"GIT_STASH_APPLY_DEFAULT","comments":"","value":0},{"type":"int","name":"GIT_STASH_APPLY_REINSTATE_INDEX","comments":"","value":1}],"used":{"returns":[],"needs":[]}}],["git_stash_flags",{"decl":["GIT_STASH_DEFAULT","GIT_STASH_KEEP_INDEX","GIT_STASH_INCLUDE_UNTRACKED","GIT_STASH_INCLUDE_IGNORED"],"type":"enum","file":"stash.h","line":24,"lineto":47,"block":"GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED","tdef":"typedef","description":" Stash flags","comments":"","fields":[{"type":"int","name":"GIT_STASH_DEFAULT","comments":"

No option, default

\n","value":0},{"type":"int","name":"GIT_STASH_KEEP_INDEX","comments":"

All changes already added to the index are left intact in\n the working directory

\n","value":1},{"type":"int","name":"GIT_STASH_INCLUDE_UNTRACKED","comments":"

All untracked files are also stashed and then cleaned up\n from the working directory

\n","value":2},{"type":"int","name":"GIT_STASH_INCLUDE_IGNORED","comments":"

All ignored files are also stashed and then cleaned up from\n the working directory

\n","value":4}],"used":{"returns":[],"needs":[]}}],["git_status_list",{"decl":"git_status_list","type":"struct","value":"git_status_list","file":"types.h","line":184,"lineto":184,"tdef":"typedef","description":" Representation of a status collection ","comments":"","used":{"returns":[],"needs":["git_status_byindex","git_status_list_entrycount","git_status_list_free","git_status_list_get_perfdata","git_status_list_new"]}}],["git_status_opt_t",{"decl":["GIT_STATUS_OPT_INCLUDE_UNTRACKED","GIT_STATUS_OPT_INCLUDE_IGNORED","GIT_STATUS_OPT_INCLUDE_UNMODIFIED","GIT_STATUS_OPT_EXCLUDE_SUBMODULES","GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS","GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH","GIT_STATUS_OPT_RECURSE_IGNORED_DIRS","GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX","GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR","GIT_STATUS_OPT_SORT_CASE_SENSITIVELY","GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY","GIT_STATUS_OPT_RENAMES_FROM_REWRITES","GIT_STATUS_OPT_NO_REFRESH","GIT_STATUS_OPT_UPDATE_INDEX","GIT_STATUS_OPT_INCLUDE_UNREADABLE","GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED"],"type":"enum","file":"status.h","line":137,"lineto":154,"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\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED","tdef":"typedef","description":" Flags to control status callbacks","comments":"
    \n
  • GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made\non untracked files. These will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files get callbacks.\nAgain, these callbacks will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be\nmade even on unmodified files.
  • \n
  • GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that submodules should be\nskipped. This only applies if there are no pending typechanges to\nthe submodule (either from or to another type).
  • \n
  • GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that all files in\nuntracked directories should be included. Normally if an entire\ndirectory is new, then just the top-level directory is included (with\na trailing slash on the entry name). This flag says to include all\nof the individual files in the directory instead.
  • \n
  • GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path\nshould be treated as a literal path, and not as a pathspec pattern.
  • \n
  • GIT_STATUS_OPT_RECURSE_IGNORED_DIRS indicates that the contents of\nignored directories should be included in the status. This is like\ndoing git ls-files -o -i --exclude-standard with core git.
  • \n
  • GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX indicates that rename detection\nshould be processed between the head and the index and enables\nthe GIT_STATUS_INDEX_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates that rename\ndetection should be run between the index and the working directory\nand enabled GIT_STATUS_WT_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-sensitive order
  • \n
  • GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-insensitive order
  • \n
  • GIT_STATUS_OPT_RENAMES_FROM_REWRITES indicates that rename detection\nshould include rewritten files
  • \n
  • GIT_STATUS_OPT_NO_REFRESH bypasses the default status behavior of\ndoing a "soft" index reload (i.e. reloading the index data if the\nfile on disk has been modified outside libgit2).
  • \n
  • GIT_STATUS_OPT_UPDATE_INDEX tells libgit2 to refresh the stat cache\nin the index for files that are unchanged but have out of date stat\ninformation in the index. It will result in less work being done on\nsubsequent calls to get status. This is mutually exclusive with the\nNO_REFRESH option.
  • \n
\n\n

Calling git_status_foreach() is like calling the extended version\n with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED,\n and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled\n together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n","fields":[{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNTRACKED","comments":"","value":1},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_IGNORED","comments":"","value":2},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNMODIFIED","comments":"","value":4},{"type":"int","name":"GIT_STATUS_OPT_EXCLUDE_SUBMODULES","comments":"","value":8},{"type":"int","name":"GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS","comments":"","value":16},{"type":"int","name":"GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH","comments":"","value":32},{"type":"int","name":"GIT_STATUS_OPT_RECURSE_IGNORED_DIRS","comments":"","value":64},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX","comments":"","value":128},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR","comments":"","value":256},{"type":"int","name":"GIT_STATUS_OPT_SORT_CASE_SENSITIVELY","comments":"","value":512},{"type":"int","name":"GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY","comments":"","value":1024},{"type":"int","name":"GIT_STATUS_OPT_RENAMES_FROM_REWRITES","comments":"","value":2048},{"type":"int","name":"GIT_STATUS_OPT_NO_REFRESH","comments":"","value":4096},{"type":"int","name":"GIT_STATUS_OPT_UPDATE_INDEX","comments":"","value":8192},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNREADABLE","comments":"","value":16384},{"type":"int","name":"GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED","comments":"","value":32768}],"used":{"returns":[],"needs":[]}}],["git_status_show_t",{"decl":["GIT_STATUS_SHOW_INDEX_AND_WORKDIR","GIT_STATUS_SHOW_INDEX_ONLY","GIT_STATUS_SHOW_WORKDIR_ONLY"],"type":"enum","file":"status.h","line":79,"lineto":83,"block":"GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY","tdef":"typedef","description":" Select the files on which to report status.","comments":"

With git_status_foreach_ext, this will control which changes get\n callbacks. With git_status_list_new, these will control which\n changes are included in the list.

\n\n
    \n
  • GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This roughly\nmatches git status --porcelain regarding which files are\nincluded and in what order.
  • \n
  • GIT_STATUS_SHOW_INDEX_ONLY only gives status based on HEAD to index\ncomparison, not looking at working directory changes.
  • \n
  • GIT_STATUS_SHOW_WORKDIR_ONLY only gives status based on index to\nworking directory comparison, not comparing the index to the HEAD.
  • \n
\n","fields":[{"type":"int","name":"GIT_STATUS_SHOW_INDEX_AND_WORKDIR","comments":"","value":0},{"type":"int","name":"GIT_STATUS_SHOW_INDEX_ONLY","comments":"","value":1},{"type":"int","name":"GIT_STATUS_SHOW_WORKDIR_ONLY","comments":"","value":2}],"used":{"returns":[],"needs":[]}}],["git_status_t",{"decl":["GIT_STATUS_CURRENT","GIT_STATUS_INDEX_NEW","GIT_STATUS_INDEX_MODIFIED","GIT_STATUS_INDEX_DELETED","GIT_STATUS_INDEX_RENAMED","GIT_STATUS_INDEX_TYPECHANGE","GIT_STATUS_WT_NEW","GIT_STATUS_WT_MODIFIED","GIT_STATUS_WT_DELETED","GIT_STATUS_WT_TYPECHANGE","GIT_STATUS_WT_RENAMED","GIT_STATUS_WT_UNREADABLE","GIT_STATUS_IGNORED","GIT_STATUS_CONFLICTED"],"type":"enum","file":"status.h","line":32,"lineto":50,"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_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED","tdef":"typedef","description":" Status flags for a single file.","comments":"

A combination of these values will be returned to indicate the status of\n a file. Status compares the working directory, the index, and the\n current HEAD of the repository. The GIT_STATUS_INDEX set of flags\n represents 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\n working directory relative to the index.

\n","fields":[{"type":"int","name":"GIT_STATUS_CURRENT","comments":"","value":0},{"type":"int","name":"GIT_STATUS_INDEX_NEW","comments":"","value":1},{"type":"int","name":"GIT_STATUS_INDEX_MODIFIED","comments":"","value":2},{"type":"int","name":"GIT_STATUS_INDEX_DELETED","comments":"","value":4},{"type":"int","name":"GIT_STATUS_INDEX_RENAMED","comments":"","value":8},{"type":"int","name":"GIT_STATUS_INDEX_TYPECHANGE","comments":"","value":16},{"type":"int","name":"GIT_STATUS_WT_NEW","comments":"","value":128},{"type":"int","name":"GIT_STATUS_WT_MODIFIED","comments":"","value":256},{"type":"int","name":"GIT_STATUS_WT_DELETED","comments":"","value":512},{"type":"int","name":"GIT_STATUS_WT_TYPECHANGE","comments":"","value":1024},{"type":"int","name":"GIT_STATUS_WT_RENAMED","comments":"","value":2048},{"type":"int","name":"GIT_STATUS_WT_UNREADABLE","comments":"","value":4096},{"type":"int","name":"GIT_STATUS_IGNORED","comments":"","value":16384},{"type":"int","name":"GIT_STATUS_CONFLICTED","comments":"","value":32768}],"used":{"returns":[],"needs":[]}}],["git_strarray",{"decl":["char ** strings","size_t count"],"type":"struct","value":"git_strarray","file":"strarray.h","line":22,"lineto":25,"block":"char ** strings\nsize_t count","tdef":"typedef","description":" Array of strings ","comments":"","fields":[{"type":"char **","name":"strings","comments":""},{"type":"size_t","name":"count","comments":""}],"used":{"returns":[],"needs":["git_index_add_all","git_index_remove_all","git_index_update_all","git_pathspec_new","git_reference_list","git_remote_download","git_remote_fetch","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_list","git_remote_push","git_remote_rename","git_remote_upload","git_reset_default","git_strarray_copy","git_strarray_free","git_tag_list","git_tag_list_match"]}}],["git_stream",{"decl":["int version","int encrypted","int proxy_support","int (*)(struct git_stream *) connect","int (*)(git_cert **, struct git_stream *) certificate","int (*)(struct git_stream *, const char *) set_proxy","ssize_t (*)(struct git_stream *, void *, size_t) read","ssize_t (*)(struct git_stream *, const char *, size_t, int) write","int (*)(struct git_stream *) close","void (*)(struct git_stream *) free"],"type":"struct","value":"git_stream","file":"sys/stream.h","line":28,"lineto":40,"block":"int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const char *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free","tdef":"typedef","description":" Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as","comments":"
 struct my_stream {\n         git_stream parent;\n         ...\n }\n
\n\n

and fill the functions

\n","fields":[{"type":"int","name":"version","comments":""},{"type":"int","name":"encrypted","comments":""},{"type":"int","name":"proxy_support","comments":""},{"type":"int (*)(struct git_stream *)","name":"connect","comments":""},{"type":"int (*)(git_cert **, struct git_stream *)","name":"certificate","comments":""},{"type":"int (*)(struct git_stream *, const char *)","name":"set_proxy","comments":""},{"type":"ssize_t (*)(struct git_stream *, void *, size_t)","name":"read","comments":""},{"type":"ssize_t (*)(struct git_stream *, const char *, size_t, int)","name":"write","comments":""},{"type":"int (*)(struct git_stream *)","name":"close","comments":""},{"type":"void (*)(struct git_stream *)","name":"free","comments":""}],"used":{"returns":[],"needs":[]}}],["git_submodule",{"decl":"git_submodule","type":"struct","value":"git_submodule","file":"types.h","line":335,"lineto":335,"tdef":"typedef","description":" Opaque structure representing a submodule.","comments":"","used":{"returns":[],"needs":["git_submodule_add_finalize","git_submodule_add_setup","git_submodule_add_to_index","git_submodule_branch","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_free","git_submodule_head_id","git_submodule_ignore","git_submodule_index_id","git_submodule_init","git_submodule_location","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_repo_init","git_submodule_sync","git_submodule_update","git_submodule_update_strategy","git_submodule_url","git_submodule_wd_id"]}}],["git_submodule_ignore_t",{"decl":["GIT_SUBMODULE_IGNORE_UNSPECIFIED","GIT_SUBMODULE_IGNORE_NONE","GIT_SUBMODULE_IGNORE_UNTRACKED","GIT_SUBMODULE_IGNORE_DIRTY","GIT_SUBMODULE_IGNORE_ALL"],"type":"enum","file":"types.h","line":399,"lineto":406,"block":"GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL","tdef":"typedef","description":" Submodule ignore values","comments":"

These values represent settings for the submodule.$name.ignore\n configuration value which says how deeply to look at the working\n directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with\n git_submodule_set_ignore() and can write the changed value to disk\n with git_submodule_save(). If you have overwritten the value, you\n can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration
  • \n
  • GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an\nuntracked file, will mark the submodule as dirty. Ignored files are\nstill ignored, of course.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files; only changes\nto tracked files, or the index or the HEAD commit will matter.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory,\nonly considering changes if the HEAD of submodule has moved from the\nvalue in the superproject.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty
  • \n
  • GIT_SUBMODULE_IGNORE_DEFAULT: not used except as static initializer\nwhen we don't want any particular ignore rule to be specified.
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_IGNORE_UNSPECIFIED","comments":"

use the submodule's configuration

\n","value":-1},{"type":"int","name":"GIT_SUBMODULE_IGNORE_NONE","comments":"

any change or untracked == dirty

\n","value":1},{"type":"int","name":"GIT_SUBMODULE_IGNORE_UNTRACKED","comments":"

dirty if tracked files change

\n","value":2},{"type":"int","name":"GIT_SUBMODULE_IGNORE_DIRTY","comments":"

only dirty if HEAD moved

\n","value":3},{"type":"int","name":"GIT_SUBMODULE_IGNORE_ALL","comments":"

never dirty

\n","value":4}],"used":{"returns":[],"needs":["git_submodule_set_ignore","git_submodule_status"]}}],["git_submodule_recurse_t",{"decl":["GIT_SUBMODULE_RECURSE_NO","GIT_SUBMODULE_RECURSE_YES","GIT_SUBMODULE_RECURSE_ONDEMAND"],"type":"enum","file":"types.h","line":418,"lineto":422,"block":"GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND","tdef":"typedef","description":" Options for submodule recurse.","comments":"

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n
    \n
  • GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_YES - recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when\n commit not already in local clone
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_RECURSE_NO","comments":"","value":0},{"type":"int","name":"GIT_SUBMODULE_RECURSE_YES","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_RECURSE_ONDEMAND","comments":"","value":2}],"used":{"returns":[],"needs":["git_submodule_set_fetch_recurse_submodules"]}}],["git_submodule_status_t",{"decl":["GIT_SUBMODULE_STATUS_IN_HEAD","GIT_SUBMODULE_STATUS_IN_INDEX","GIT_SUBMODULE_STATUS_IN_CONFIG","GIT_SUBMODULE_STATUS_IN_WD","GIT_SUBMODULE_STATUS_INDEX_ADDED","GIT_SUBMODULE_STATUS_INDEX_DELETED","GIT_SUBMODULE_STATUS_INDEX_MODIFIED","GIT_SUBMODULE_STATUS_WD_UNINITIALIZED","GIT_SUBMODULE_STATUS_WD_ADDED","GIT_SUBMODULE_STATUS_WD_DELETED","GIT_SUBMODULE_STATUS_WD_MODIFIED","GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED","GIT_SUBMODULE_STATUS_WD_WD_MODIFIED","GIT_SUBMODULE_STATUS_WD_UNTRACKED"],"type":"enum","file":"submodule.h","line":74,"lineto":89,"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","description":" Return codes for submodule status.","comments":"

A combination of these flags will be returned to describe the status of a\n submodule. Depending on the "ignore" property of the submodule, some of\n the flags may never be returned because they indicate changes that are\n supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config\n files (both .git/config and .gitmodules), and the working directory. Any\n or all of those places might be missing information about the submodule\n depending on what state the repo is in. We consider all four places to\n build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info\n about what sources of submodule data are available. These will be\n returned even if ignore is set to "ALL".

\n\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
\n\n

The following values will be returned so long as ignore is not "ALL".

\n\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
\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n
    \n
  • WD_INDEX_MODIFIED - submodule workdir index is dirty
  • \n
  • WD_WD_MODIFIED - submodule workdir has modified files
  • \n
\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n
    \n
  • WD_UNTRACKED - wd contains untracked files
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_HEAD","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_INDEX","comments":"","value":2},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_CONFIG","comments":"","value":4},{"type":"int","name":"GIT_SUBMODULE_STATUS_IN_WD","comments":"","value":8},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_ADDED","comments":"","value":16},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_DELETED","comments":"","value":32},{"type":"int","name":"GIT_SUBMODULE_STATUS_INDEX_MODIFIED","comments":"","value":64},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_UNINITIALIZED","comments":"","value":128},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_ADDED","comments":"","value":256},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_DELETED","comments":"","value":512},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_MODIFIED","comments":"","value":1024},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED","comments":"","value":2048},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_WD_MODIFIED","comments":"","value":4096},{"type":"int","name":"GIT_SUBMODULE_STATUS_WD_UNTRACKED","comments":"","value":8192}],"used":{"returns":[],"needs":[]}}],["git_submodule_update_options",{"decl":["unsigned int version","git_checkout_options checkout_opts","git_fetch_options fetch_opts","unsigned int clone_checkout_strategy"],"type":"struct","value":"git_submodule_update_options","file":"submodule.h","line":118,"lineto":146,"block":"unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nunsigned int clone_checkout_strategy","tdef":"typedef","description":" Submodule update options structure","comments":"

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings,\n like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n","fields":[{"type":"unsigned int","name":"version","comments":""},{"type":"git_checkout_options","name":"checkout_opts","comments":" These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory. Use the `clone_checkout_strategy` field\n to set the checkout strategy that will be used in\n the case where update needs to clone the repository."},{"type":"git_fetch_options","name":"fetch_opts","comments":" Options which control the fetch, including callbacks.\n\n The callbacks to use for reporting fetch progress, and for acquiring\n credentials in the event they are needed."},{"type":"unsigned int","name":"clone_checkout_strategy","comments":" The checkout strategy to use when the sub repository needs to\n be cloned. Use GIT_CHECKOUT_SAFE to create all files\n in the working directory for the newly cloned repository."}],"used":{"returns":[],"needs":["git_submodule_update","git_submodule_update_init_options"]}}],["git_submodule_update_t",{"decl":["GIT_SUBMODULE_UPDATE_CHECKOUT","GIT_SUBMODULE_UPDATE_REBASE","GIT_SUBMODULE_UPDATE_MERGE","GIT_SUBMODULE_UPDATE_NONE","GIT_SUBMODULE_UPDATE_DEFAULT"],"type":"enum","file":"types.h","line":363,"lineto":370,"block":"GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT","tdef":"typedef","description":" Submodule update values","comments":"

These values represent settings for the submodule.$name.update\n configuration value which says how to handle git submodule update for\n this submodule. The value is usually set in the ".gitmodules" file and\n copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with\n git_submodule_set_update() and write the changed value to disk using\n git_submodule_save(). If you have overwritten the value, you can\n revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is\nupdated, checkout the new detached HEAD to the submodule directory.
  • \n
  • GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked\nout branch onto the commit from the superproject.
  • \n
  • GIT_SUBMODULE_UPDATE_MERGE: update by merging the commit in the\nsuperproject into the current checkout out branch of the submodule.
  • \n
  • GIT_SUBMODULE_UPDATE_NONE: do not update this submodule even when\nthe commit in the superproject is updated.
  • \n
  • GIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer\nwhen we don't want any particular update rule to be specified.
  • \n
\n","fields":[{"type":"int","name":"GIT_SUBMODULE_UPDATE_CHECKOUT","comments":"","value":1},{"type":"int","name":"GIT_SUBMODULE_UPDATE_REBASE","comments":"","value":2},{"type":"int","name":"GIT_SUBMODULE_UPDATE_MERGE","comments":"","value":3},{"type":"int","name":"GIT_SUBMODULE_UPDATE_NONE","comments":"","value":4},{"type":"int","name":"GIT_SUBMODULE_UPDATE_DEFAULT","comments":"","value":0}],"used":{"returns":[],"needs":["git_submodule_set_update"]}}],["git_tag",{"decl":"git_tag","type":"struct","value":"git_tag","file":"types.h","line":114,"lineto":114,"tdef":"typedef","description":" Parsed representation of a tag object. ","comments":"","used":{"returns":[],"needs":["git_tag_free","git_tag_id","git_tag_lookup","git_tag_lookup_prefix","git_tag_message","git_tag_name","git_tag_owner","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_id","git_tag_target_type"]}}],["git_time",{"decl":["git_time_t time","int offset"],"type":"struct","value":"git_time","file":"types.h","line":156,"lineto":159,"block":"git_time_t time\nint offset","tdef":"typedef","description":" Time in a signature ","comments":"","fields":[{"type":"git_time_t","name":"time","comments":" time in seconds from epoch "},{"type":"int","name":"offset","comments":" timezone offset, in minutes "}],"used":{"returns":[],"needs":[]}}],["git_trace_level_t",{"decl":["GIT_TRACE_NONE","GIT_TRACE_FATAL","GIT_TRACE_ERROR","GIT_TRACE_WARN","GIT_TRACE_INFO","GIT_TRACE_DEBUG","GIT_TRACE_TRACE"],"type":"enum","file":"trace.h","line":26,"lineto":47,"block":"GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE","tdef":"typedef","description":" Available tracing levels. When tracing is set to a particular level,\n callers will be provided tracing at the given level and all lower levels.","comments":"","fields":[{"type":"int","name":"GIT_TRACE_NONE","comments":"

No tracing will be performed.

\n","value":0},{"type":"int","name":"GIT_TRACE_FATAL","comments":"

Severe errors that may impact the program's execution

\n","value":1},{"type":"int","name":"GIT_TRACE_ERROR","comments":"

Errors that do not impact the program's execution

\n","value":2},{"type":"int","name":"GIT_TRACE_WARN","comments":"

Warnings that suggest abnormal data

\n","value":3},{"type":"int","name":"GIT_TRACE_INFO","comments":"

Informational messages about program execution

\n","value":4},{"type":"int","name":"GIT_TRACE_DEBUG","comments":"

Detailed data that allows for debugging

\n","value":5},{"type":"int","name":"GIT_TRACE_TRACE","comments":"

Exceptionally detailed debugging data

\n","value":6}],"used":{"returns":[],"needs":["git_trace_set"]}}],["git_transaction",{"decl":"git_transaction","type":"struct","value":"git_transaction","file":"types.h","line":175,"lineto":175,"tdef":"typedef","description":" Transactional interface to references ","comments":"","used":{"returns":[],"needs":[]}}],["git_transfer_progress",{"decl":["unsigned int total_objects","unsigned int indexed_objects","unsigned int received_objects","unsigned int local_objects","unsigned int total_deltas","unsigned int indexed_deltas","size_t received_bytes"],"type":"struct","value":"git_transfer_progress","file":"types.h","line":253,"lineto":261,"block":"unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes","tdef":"typedef","description":" This is passed as the first argument to the callback to allow the\n user to see the progress.","comments":"
    \n
  • total_objects: number of objects in the packfile being downloaded
  • \n
  • indexed_objects: received objects that have been hashed
  • \n
  • received_objects: objects which have been downloaded
  • \n
  • local_objects: locally-available objects that have been injected\nin order to fix a thin pack.
  • \n
  • received-bytes: size of the packfile received up to now
  • \n
\n","fields":[{"type":"unsigned int","name":"total_objects","comments":""},{"type":"unsigned int","name":"indexed_objects","comments":""},{"type":"unsigned int","name":"received_objects","comments":""},{"type":"unsigned int","name":"local_objects","comments":""},{"type":"unsigned int","name":"total_deltas","comments":""},{"type":"unsigned int","name":"indexed_deltas","comments":""},{"type":"size_t","name":"received_bytes","comments":""}],"used":{"returns":["git_remote_stats"],"needs":["git_indexer_append","git_indexer_commit"]}}],["git_transport",{"decl":"git_transport","type":"struct","value":"git_transport","file":"types.h","line":230,"lineto":230,"tdef":"typedef","description":" Interface which represents a transport to communicate with a\n remote.","comments":"","used":{"returns":[],"needs":["git_smart_subtransport_git","git_smart_subtransport_http","git_smart_subtransport_ssh","git_transport_dummy","git_transport_init","git_transport_local","git_transport_new","git_transport_smart","git_transport_ssh_with_paths"]}}],["git_transport_flags_t",{"decl":["GIT_TRANSPORTFLAGS_NONE"],"type":"enum","file":"sys/transport.h","line":29,"lineto":31,"block":"GIT_TRANSPORTFLAGS_NONE","tdef":"typedef","description":" Flags to pass to transport","comments":"

Currently unused.

\n","fields":[{"type":"int","name":"GIT_TRANSPORTFLAGS_NONE","comments":"","value":0}],"used":{"returns":[],"needs":[]}}],["git_tree",{"decl":"git_tree","type":"struct","value":"git_tree","file":"types.h","line":126,"lineto":126,"tdef":"typedef","description":" Representation of a tree object. ","comments":"","used":{"returns":[],"needs":["git_commit_amend","git_commit_create","git_commit_create_v","git_commit_tree","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index","git_index_read_tree","git_merge_trees","git_pathspec_match_tree","git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_bypath","git_tree_entrycount","git_tree_free","git_tree_id","git_tree_lookup","git_tree_lookup_prefix","git_tree_owner","git_tree_walk","git_treebuilder_new"]}}],["git_tree_entry",{"decl":"git_tree_entry","type":"struct","value":"git_tree_entry","file":"types.h","line":123,"lineto":123,"tdef":"typedef","description":" Representation of each one of the entries in a tree object. ","comments":"","used":{"returns":["git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_treebuilder_get"],"needs":["git_tree_entry_bypath","git_tree_entry_cmp","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_filemode_raw","git_tree_entry_free","git_tree_entry_id","git_tree_entry_name","git_tree_entry_to_object","git_tree_entry_type","git_treebuilder_insert"]}}],["git_treebuilder",{"decl":"git_treebuilder","type":"struct","value":"git_treebuilder","file":"types.h","line":129,"lineto":129,"tdef":"typedef","description":" Constructor for in-memory trees ","comments":"","used":{"returns":[],"needs":["git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_new","git_treebuilder_remove","git_treebuilder_write"]}}],["git_treewalk_mode",{"decl":["GIT_TREEWALK_PRE","GIT_TREEWALK_POST"],"type":"enum","file":"tree.h","line":384,"lineto":387,"block":"GIT_TREEWALK_PRE\nGIT_TREEWALK_POST","tdef":"typedef","description":" Tree traversal modes ","comments":"","fields":[{"type":"int","name":"GIT_TREEWALK_PRE","comments":"","value":0},{"type":"int","name":"GIT_TREEWALK_POST","comments":"","value":1}],"used":{"returns":[],"needs":["git_tree_walk"]}}],["git_writestream",{"decl":"git_writestream","type":"struct","value":"git_writestream","file":"types.h","line":425,"lineto":425,"tdef":"typedef","description":" A type to write in a streaming fashion, for example, for filters. ","comments":"","used":{"returns":[],"needs":["git_filter_list_stream_blob","git_filter_list_stream_data","git_filter_list_stream_file"]}}]],"prefix":"include/git2","groups":[["annotated",["git_annotated_commit_free","git_annotated_commit_from_fetchhead","git_annotated_commit_from_ref","git_annotated_commit_from_revspec","git_annotated_commit_id","git_annotated_commit_lookup"]],["attr",["git_attr_add_macro","git_attr_cache_flush","git_attr_foreach","git_attr_get","git_attr_get_many","git_attr_value"]],["blame",["git_blame_buffer","git_blame_file","git_blame_free","git_blame_get_hunk_byindex","git_blame_get_hunk_byline","git_blame_get_hunk_count","git_blame_init_options"]],["blob",["git_blob_create_frombuffer","git_blob_create_fromchunks","git_blob_create_fromdisk","git_blob_create_fromworkdir","git_blob_filtered_content","git_blob_free","git_blob_id","git_blob_is_binary","git_blob_lookup","git_blob_lookup_prefix","git_blob_owner","git_blob_rawcontent","git_blob_rawsize"]],["branch",["git_branch_create","git_branch_create_from_annotated","git_branch_delete","git_branch_is_head","git_branch_iterator_free","git_branch_iterator_new","git_branch_lookup","git_branch_move","git_branch_name","git_branch_next","git_branch_set_upstream","git_branch_upstream"]],["buf",["git_buf_contains_nul","git_buf_free","git_buf_grow","git_buf_is_binary","git_buf_set"]],["checkout",["git_checkout_head","git_checkout_index","git_checkout_init_options","git_checkout_tree"]],["cherrypick",["git_cherrypick","git_cherrypick_commit","git_cherrypick_init_options"]],["clone",["git_clone","git_clone_init_options"]],["commit",["git_commit_amend","git_commit_author","git_commit_committer","git_commit_create","git_commit_create_from_callback","git_commit_create_from_ids","git_commit_create_v","git_commit_free","git_commit_header_field","git_commit_id","git_commit_lookup","git_commit_lookup_prefix","git_commit_message","git_commit_message_encoding","git_commit_message_raw","git_commit_nth_gen_ancestor","git_commit_owner","git_commit_parent","git_commit_parent_id","git_commit_parentcount","git_commit_raw_header","git_commit_summary","git_commit_time","git_commit_time_offset","git_commit_tree","git_commit_tree_id"]],["config",["git_config_add_backend","git_config_add_file_ondisk","git_config_backend_foreach_match","git_config_delete_entry","git_config_delete_multivar","git_config_entry_free","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_entry","git_config_get_int32","git_config_get_int64","git_config_get_mapped","git_config_get_multivar_foreach","git_config_get_path","git_config_get_string","git_config_get_string_buf","git_config_init_backend","git_config_iterator_free","git_config_iterator_glob_new","git_config_iterator_new","git_config_lookup_map_value","git_config_multivar_iterator_new","git_config_new","git_config_next","git_config_open_default","git_config_open_global","git_config_open_level","git_config_open_ondisk","git_config_parse_bool","git_config_parse_int32","git_config_parse_int64","git_config_parse_path","git_config_set_bool","git_config_set_int32","git_config_set_int64","git_config_set_multivar","git_config_set_string","git_config_snapshot"]],["cred",["git_cred_default_new","git_cred_has_username","git_cred_ssh_custom_new","git_cred_ssh_interactive_new","git_cred_ssh_key_from_agent","git_cred_ssh_key_memory_new","git_cred_ssh_key_new","git_cred_username_new","git_cred_userpass","git_cred_userpass_plaintext_new"]],["describe",["git_describe_commit","git_describe_format","git_describe_result_free","git_describe_workdir"]],["diff",["git_diff_blob_to_buffer","git_diff_blobs","git_diff_buffers","git_diff_commit_as_email","git_diff_find_init_options","git_diff_find_similar","git_diff_foreach","git_diff_format_email","git_diff_format_email_init_options","git_diff_free","git_diff_get_delta","git_diff_get_perfdata","git_diff_get_stats","git_diff_index_to_workdir","git_diff_init_options","git_diff_is_sorted_icase","git_diff_merge","git_diff_num_deltas","git_diff_num_deltas_of_type","git_diff_print","git_diff_print_callback__to_buf","git_diff_print_callback__to_file_handle","git_diff_stats_deletions","git_diff_stats_files_changed","git_diff_stats_free","git_diff_stats_insertions","git_diff_stats_to_buf","git_diff_status_char","git_diff_tree_to_index","git_diff_tree_to_tree","git_diff_tree_to_workdir","git_diff_tree_to_workdir_with_index"]],["fetch",["git_fetch_init_options"]],["filter",["git_filter_list_apply_to_blob","git_filter_list_apply_to_data","git_filter_list_apply_to_file","git_filter_list_contains","git_filter_list_free","git_filter_list_length","git_filter_list_load","git_filter_list_new","git_filter_list_push","git_filter_list_stream_blob","git_filter_list_stream_data","git_filter_list_stream_file","git_filter_lookup","git_filter_register","git_filter_source_filemode","git_filter_source_flags","git_filter_source_id","git_filter_source_mode","git_filter_source_path","git_filter_source_repo","git_filter_unregister"]],["giterr",["giterr_clear","giterr_detach","giterr_last","giterr_set_oom","giterr_set_str"]],["graph",["git_graph_ahead_behind","git_graph_descendant_of"]],["hashsig",["git_hashsig_compare","git_hashsig_create","git_hashsig_create_fromfile","git_hashsig_free"]],["ignore",["git_ignore_add_rule","git_ignore_clear_internal_rules","git_ignore_path_is_ignored"]],["index",["git_index_add","git_index_add_all","git_index_add_bypath","git_index_add_frombuffer","git_index_caps","git_index_checksum","git_index_clear","git_index_conflict_add","git_index_conflict_cleanup","git_index_conflict_get","git_index_conflict_iterator_free","git_index_conflict_iterator_new","git_index_conflict_next","git_index_conflict_remove","git_index_entry_is_conflict","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_path","git_index_read","git_index_read_tree","git_index_remove","git_index_remove_all","git_index_remove_bypath","git_index_remove_directory","git_index_set_caps","git_index_update_all","git_index_write","git_index_write_tree","git_index_write_tree_to"]],["indexer",["git_indexer_append","git_indexer_commit","git_indexer_free","git_indexer_hash","git_indexer_new"]],["libgit2",["git_libgit2_features","git_libgit2_init","git_libgit2_opts","git_libgit2_shutdown","git_libgit2_version"]],["mempack",["git_mempack_new","git_mempack_reset"]],["merge",["git_merge","git_merge_analysis","git_merge_base","git_merge_base_many","git_merge_base_octopus","git_merge_bases","git_merge_bases_many","git_merge_commits","git_merge_file","git_merge_file_from_index","git_merge_file_init_input","git_merge_file_init_options","git_merge_file_result_free","git_merge_init_options","git_merge_trees"]],["message",["git_message_prettify"]],["note",["git_note_author","git_note_committer","git_note_create","git_note_foreach","git_note_free","git_note_id","git_note_iterator_free","git_note_iterator_new","git_note_message","git_note_next","git_note_read","git_note_remove"]],["object",["git_object__size","git_object_dup","git_object_free","git_object_id","git_object_lookup","git_object_lookup_bypath","git_object_lookup_prefix","git_object_owner","git_object_peel","git_object_short_id","git_object_string2type","git_object_type","git_object_type2string","git_object_typeisloose"]],["odb",["git_odb_add_alternate","git_odb_add_backend","git_odb_add_disk_alternate","git_odb_backend_loose","git_odb_backend_one_pack","git_odb_backend_pack","git_odb_exists","git_odb_exists_prefix","git_odb_foreach","git_odb_free","git_odb_get_backend","git_odb_hash","git_odb_hashfile","git_odb_init_backend","git_odb_new","git_odb_num_backends","git_odb_object_data","git_odb_object_dup","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_refresh","git_odb_stream_finalize_write","git_odb_stream_free","git_odb_stream_read","git_odb_stream_write","git_odb_write","git_odb_write_pack"]],["oid",["git_oid_cmp","git_oid_cpy","git_oid_equal","git_oid_fmt","git_oid_fromraw","git_oid_fromstr","git_oid_fromstrn","git_oid_fromstrp","git_oid_iszero","git_oid_ncmp","git_oid_nfmt","git_oid_pathfmt","git_oid_shorten_add","git_oid_shorten_free","git_oid_shorten_new","git_oid_strcmp","git_oid_streq","git_oid_tostr","git_oid_tostr_s"]],["oidarray",["git_oidarray_free"]],["openssl",["git_openssl_set_locking"]],["packbuilder",["git_packbuilder_foreach","git_packbuilder_free","git_packbuilder_hash","git_packbuilder_insert","git_packbuilder_insert_commit","git_packbuilder_insert_recur","git_packbuilder_insert_tree","git_packbuilder_insert_walk","git_packbuilder_new","git_packbuilder_object_count","git_packbuilder_set_callbacks","git_packbuilder_set_threads","git_packbuilder_write","git_packbuilder_written"]],["patch",["git_patch_free","git_patch_from_blob_and_buffer","git_patch_from_blobs","git_patch_from_buffers","git_patch_from_diff","git_patch_get_delta","git_patch_get_hunk","git_patch_get_line_in_hunk","git_patch_line_stats","git_patch_num_hunks","git_patch_num_lines_in_hunk","git_patch_print","git_patch_size","git_patch_to_buf"]],["pathspec",["git_pathspec_free","git_pathspec_match_diff","git_pathspec_match_index","git_pathspec_match_list_diff_entry","git_pathspec_match_list_entry","git_pathspec_match_list_entrycount","git_pathspec_match_list_failed_entry","git_pathspec_match_list_failed_entrycount","git_pathspec_match_list_free","git_pathspec_match_tree","git_pathspec_match_workdir","git_pathspec_matches_path","git_pathspec_new"]],["push",["git_push_init_options"]],["rebase",["git_rebase_abort","git_rebase_commit","git_rebase_finish","git_rebase_free","git_rebase_init","git_rebase_init_options","git_rebase_next","git_rebase_open","git_rebase_operation_byindex","git_rebase_operation_current","git_rebase_operation_entrycount"]],["refdb",["git_refdb_backend_fs","git_refdb_compress","git_refdb_free","git_refdb_init_backend","git_refdb_new","git_refdb_open","git_refdb_set_backend"]],["reference",["git_reference__alloc","git_reference__alloc_symbolic","git_reference_cmp","git_reference_create","git_reference_create_matching","git_reference_delete","git_reference_dwim","git_reference_ensure_log","git_reference_foreach","git_reference_foreach_glob","git_reference_foreach_name","git_reference_free","git_reference_has_log","git_reference_is_branch","git_reference_is_note","git_reference_is_remote","git_reference_is_tag","git_reference_is_valid_name","git_reference_iterator_free","git_reference_iterator_glob_new","git_reference_iterator_new","git_reference_list","git_reference_lookup","git_reference_name","git_reference_name_to_id","git_reference_next","git_reference_next_name","git_reference_normalize_name","git_reference_owner","git_reference_peel","git_reference_remove","git_reference_rename","git_reference_resolve","git_reference_set_target","git_reference_shorthand","git_reference_symbolic_create","git_reference_symbolic_create_matching","git_reference_symbolic_set_target","git_reference_symbolic_target","git_reference_target","git_reference_target_peel","git_reference_type"]],["reflog",["git_reflog_append","git_reflog_delete","git_reflog_drop","git_reflog_entry_byindex","git_reflog_entry_committer","git_reflog_entry_id_new","git_reflog_entry_id_old","git_reflog_entry_message","git_reflog_entrycount","git_reflog_free","git_reflog_read","git_reflog_rename","git_reflog_write"]],["refspec",["git_refspec_direction","git_refspec_dst","git_refspec_dst_matches","git_refspec_force","git_refspec_rtransform","git_refspec_src","git_refspec_src_matches","git_refspec_string","git_refspec_transform"]],["remote",["git_remote_add_fetch","git_remote_add_push","git_remote_autotag","git_remote_connect","git_remote_connected","git_remote_create","git_remote_create_anonymous","git_remote_create_with_fetchspec","git_remote_default_branch","git_remote_delete","git_remote_disconnect","git_remote_download","git_remote_dup","git_remote_fetch","git_remote_free","git_remote_get_fetch_refspecs","git_remote_get_push_refspecs","git_remote_get_refspec","git_remote_init_callbacks","git_remote_is_valid_name","git_remote_list","git_remote_lookup","git_remote_ls","git_remote_name","git_remote_owner","git_remote_prune","git_remote_prune_refs","git_remote_push","git_remote_pushurl","git_remote_refspec_count","git_remote_rename","git_remote_set_autotag","git_remote_set_pushurl","git_remote_set_url","git_remote_stats","git_remote_stop","git_remote_update_tips","git_remote_upload","git_remote_url"]],["repository",["git_repository__cleanup","git_repository_config","git_repository_config_snapshot","git_repository_detach_head","git_repository_discover","git_repository_fetchhead_foreach","git_repository_free","git_repository_get_namespace","git_repository_hashfile","git_repository_head","git_repository_head_detached","git_repository_head_unborn","git_repository_ident","git_repository_index","git_repository_init","git_repository_init_ext","git_repository_init_init_options","git_repository_is_bare","git_repository_is_empty","git_repository_is_shallow","git_repository_mergehead_foreach","git_repository_message","git_repository_message_remove","git_repository_new","git_repository_odb","git_repository_open","git_repository_open_bare","git_repository_open_ext","git_repository_path","git_repository_refdb","git_repository_reinit_filesystem","git_repository_set_bare","git_repository_set_config","git_repository_set_head","git_repository_set_head_detached","git_repository_set_head_detached_from_annotated","git_repository_set_ident","git_repository_set_index","git_repository_set_namespace","git_repository_set_odb","git_repository_set_refdb","git_repository_set_workdir","git_repository_state","git_repository_state_cleanup","git_repository_workdir","git_repository_wrap_odb"]],["reset",["git_reset","git_reset_default","git_reset_from_annotated"]],["revert",["git_revert","git_revert_commit","git_revert_init_options"]],["revparse",["git_revparse","git_revparse_ext","git_revparse_single"]],["revwalk",["git_revwalk_add_hide_cb","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_range","git_revwalk_push_ref","git_revwalk_repository","git_revwalk_reset","git_revwalk_simplify_first_parent","git_revwalk_sorting"]],["signature",["git_signature_default","git_signature_dup","git_signature_free","git_signature_new","git_signature_now"]],["smart",["git_smart_subtransport_git","git_smart_subtransport_http","git_smart_subtransport_ssh"]],["stash",["git_stash_apply","git_stash_apply_init_options","git_stash_drop","git_stash_foreach","git_stash_pop"]],["status",["git_status_byindex","git_status_file","git_status_foreach","git_status_foreach_ext","git_status_init_options","git_status_list_entrycount","git_status_list_free","git_status_list_get_perfdata","git_status_list_new","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_branch","git_submodule_fetch_recurse_submodules","git_submodule_foreach","git_submodule_free","git_submodule_head_id","git_submodule_ignore","git_submodule_index_id","git_submodule_init","git_submodule_location","git_submodule_lookup","git_submodule_name","git_submodule_open","git_submodule_owner","git_submodule_path","git_submodule_reload","git_submodule_repo_init","git_submodule_resolve_url","git_submodule_set_branch","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_update_init_options","git_submodule_update_strategy","git_submodule_url","git_submodule_wd_id"]],["tag",["git_tag_annotation_create","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_owner","git_tag_peel","git_tag_tagger","git_tag_target","git_tag_target_id","git_tag_target_type"]],["trace",["git_trace_set"]],["transport",["git_transport_dummy","git_transport_init","git_transport_local","git_transport_new","git_transport_smart","git_transport_ssh_with_paths","git_transport_unregister"]],["tree",["git_tree_entry_byid","git_tree_entry_byindex","git_tree_entry_byname","git_tree_entry_bypath","git_tree_entry_cmp","git_tree_entry_dup","git_tree_entry_filemode","git_tree_entry_filemode_raw","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_owner","git_tree_walk"]],["treebuilder",["git_treebuilder_clear","git_treebuilder_entrycount","git_treebuilder_filter","git_treebuilder_free","git_treebuilder_get","git_treebuilder_insert","git_treebuilder_new","git_treebuilder_remove","git_treebuilder_write"]]],"examples":[["add.c","ex/v0.23.2/add.html"],["blame.c","ex/v0.23.2/blame.html"],["cat-file.c","ex/v0.23.2/cat-file.html"],["common.c","ex/v0.23.2/common.html"],["describe.c","ex/v0.23.2/describe.html"],["diff.c","ex/v0.23.2/diff.html"],["for-each-ref.c","ex/v0.23.2/for-each-ref.html"],["general.c","ex/v0.23.2/general.html"],["init.c","ex/v0.23.2/init.html"],["log.c","ex/v0.23.2/log.html"],["network/clone.c","ex/v0.23.2/network/clone.html"],["network/common.c","ex/v0.23.2/network/common.html"],["network/fetch.c","ex/v0.23.2/network/fetch.html"],["network/git2.c","ex/v0.23.2/network/git2.html"],["network/index-pack.c","ex/v0.23.2/network/index-pack.html"],["network/ls-remote.c","ex/v0.23.2/network/ls-remote.html"],["remote.c","ex/v0.23.2/remote.html"],["rev-list.c","ex/v0.23.2/rev-list.html"],["rev-parse.c","ex/v0.23.2/rev-parse.html"],["showindex.c","ex/v0.23.2/showindex.html"],["status.c","ex/v0.23.2/status.html"],["tag.c","ex/v0.23.2/tag.html"]]} +{ + "files": [ + { + "file": "annotated_commit.h", + "functions": [ + "git_annotated_commit_from_ref", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_lookup", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_free" + ], + "meta": {}, + "lines": 112 + }, + { + "file": "attr.h", + "functions": [ + "git_attr_value", + "git_attr_get", + "git_attr_get_many", + "git_attr_foreach", + "git_attr_cache_flush", + "git_attr_add_macro" + ], + "meta": {}, + "lines": 240 + }, + { + "file": "blame.h", + "functions": [ + "git_blame_init_options", + "git_blame_get_hunk_count", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_file", + "git_blame_buffer", + "git_blame_free" + ], + "meta": {}, + "lines": 207 + }, + { + "file": "blob.h", + "functions": [ + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_free", + "git_blob_id", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize", + "git_blob_filtered_content", + "git_blob_create_fromworkdir", + "git_blob_create_fromdisk", + "git_blob_create_fromchunks", + "git_blob_create_frombuffer", + "git_blob_is_binary" + ], + "meta": {}, + "lines": 217 + }, + { + "file": "branch.h", + "functions": [ + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_iterator_new", + "git_branch_next", + "git_branch_iterator_free", + "git_branch_move", + "git_branch_lookup", + "git_branch_name", + "git_branch_upstream", + "git_branch_set_upstream", + "git_branch_is_head" + ], + "meta": {}, + "lines": 246 + }, + { + "file": "buffer.h", + "functions": [ + "git_buf_free", + "git_buf_grow", + "git_buf_set", + "git_buf_is_binary", + "git_buf_contains_nul" + ], + "meta": {}, + "lines": 122 + }, + { + "file": "checkout.h", + "functions": [ + "git_checkout_notify_cb", + "git_checkout_progress_cb", + "git_checkout_perfdata_cb", + "git_checkout_init_options", + "git_checkout_head", + "git_checkout_index", + "git_checkout_tree" + ], + "meta": {}, + "lines": 354 + }, + { + "file": "cherrypick.h", + "functions": [ + "git_cherrypick_init_options", + "git_cherrypick_commit", + "git_cherrypick" + ], + "meta": {}, + "lines": 84 + }, + { + "file": "clone.h", + "functions": [ + "git_remote_create_cb", + "git_repository_create_cb", + "git_clone_init_options", + "git_clone" + ], + "meta": {}, + "lines": 203 + }, + { + "file": "commit.h", + "functions": [ + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_free", + "git_commit_id", + "git_commit_owner", + "git_commit_message_encoding", + "git_commit_message", + "git_commit_message_raw", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_committer", + "git_commit_author", + "git_commit_raw_header", + "git_commit_tree", + "git_commit_tree_id", + "git_commit_parentcount", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_nth_gen_ancestor", + "git_commit_header_field", + "git_commit_create", + "git_commit_create_v", + "git_commit_amend" + ], + "meta": {}, + "lines": 364 + }, + { + "file": "common.h", + "functions": [ + "git_libgit2_version", + "git_libgit2_features", + "git_libgit2_opts" + ], + "meta": {}, + "lines": 245 + }, + { + "file": "config.h", + "functions": [ + "git_config_entry_free", + "git_config_find_global", + "git_config_find_xdg", + "git_config_find_system", + "git_config_open_default", + "git_config_new", + "git_config_add_file_ondisk", + "git_config_open_ondisk", + "git_config_open_level", + "git_config_open_global", + "git_config_snapshot", + "git_config_free", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_bool", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_get_multivar_foreach", + "git_config_multivar_iterator_new", + "git_config_next", + "git_config_iterator_free", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_bool", + "git_config_set_string", + "git_config_set_multivar", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_foreach", + "git_config_iterator_new", + "git_config_iterator_glob_new", + "git_config_foreach_match", + "git_config_get_mapped", + "git_config_lookup_map_value", + "git_config_parse_bool", + "git_config_parse_int32", + "git_config_parse_int64", + "git_config_parse_path", + "git_config_backend_foreach_match" + ], + "meta": {}, + "lines": 691 + }, + { + "file": "cred_helpers.h", + "functions": [ + "git_cred_userpass" + ], + "meta": {}, + "lines": 48 + }, + { + "file": "describe.h", + "functions": [ + "git_describe_commit", + "git_describe_workdir", + "git_describe_format", + "git_describe_result_free" + ], + "meta": {}, + "lines": 158 + }, + { + "file": "diff.h", + "functions": [ + "git_diff_notify_cb", + "git_diff_init_options", + "git_diff_file_cb", + "git_diff_binary_cb", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_diff_find_init_options", + "git_diff_free", + "git_diff_tree_to_tree", + "git_diff_tree_to_index", + "git_diff_index_to_workdir", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_diff_merge", + "git_diff_find_similar", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_get_delta", + "git_diff_is_sorted_icase", + "git_diff_foreach", + "git_diff_status_char", + "git_diff_print", + "git_diff_blobs", + "git_diff_blob_to_buffer", + "git_diff_buffers", + "git_diff_get_stats", + "git_diff_stats_files_changed", + "git_diff_stats_insertions", + "git_diff_stats_deletions", + "git_diff_stats_to_buf", + "git_diff_stats_free", + "git_diff_format_email", + "git_diff_commit_as_email", + "git_diff_format_email_init_options" + ], + "meta": {}, + "lines": 1301 + }, + { + "file": "errors.h", + "functions": [ + "giterr_last", + "giterr_clear", + "giterr_detach", + "giterr_set_str", + "giterr_set_oom" + ], + "meta": {}, + "lines": 160 + }, + { + "file": "filter.h", + "functions": [ + "git_filter_list_load", + "git_filter_list_contains", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_apply_to_blob", + "git_filter_list_stream_data", + "git_filter_list_stream_file", + "git_filter_list_stream_blob", + "git_filter_list_free" + ], + "meta": {}, + "lines": 210 + }, + { + "file": "global.h", + "functions": [ + "git_libgit2_init", + "git_libgit2_shutdown" + ], + "meta": {}, + "lines": 39 + }, + { + "file": "graph.h", + "functions": [ + "git_graph_ahead_behind", + "git_graph_descendant_of" + ], + "meta": {}, + "lines": 51 + }, + { + "file": "ignore.h", + "functions": [ + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored" + ], + "meta": {}, + "lines": 74 + }, + { + "file": "index.h", + "functions": [ + "git_index_matched_path_cb", + "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_path", + "git_index_checksum", + "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_remove_directory", + "git_index_add", + "git_index_entry_stage", + "git_index_entry_is_conflict", + "git_index_add_bypath", + "git_index_add_frombuffer", + "git_index_remove_bypath", + "git_index_add_all", + "git_index_remove_all", + "git_index_update_all", + "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_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_iterator_free" + ], + "meta": {}, + "lines": 755 + }, + { + "file": "indexer.h", + "functions": [ + "git_indexer_new", + "git_indexer_append", + "git_indexer_commit", + "git_indexer_hash", + "git_indexer_free" + ], + "meta": {}, + "lines": 72 + }, + { + "file": "merge.h", + "functions": [ + "git_merge_file_init_input", + "git_merge_file_init_options", + "git_merge_init_options", + "git_merge_analysis", + "git_merge_base", + "git_merge_bases", + "git_merge_base_many", + "git_merge_bases_many", + "git_merge_base_octopus", + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_result_free", + "git_merge_trees", + "git_merge_commits", + "git_merge" + ], + "meta": {}, + "lines": 547 + }, + { + "file": "message.h", + "functions": [ + "git_message_prettify" + ], + "meta": {}, + "lines": 39 + }, + { + "file": "net.h", + "functions": [ + "git_headlist_cb" + ], + "meta": {}, + "lines": 55 + }, + { + "file": "notes.h", + "functions": [ + "git_note_foreach_cb", + "git_note_iterator_new", + "git_note_iterator_free", + "git_note_next", + "git_note_read", + "git_note_author", + "git_note_committer", + "git_note_message", + "git_note_id", + "git_note_create", + "git_note_remove", + "git_note_free", + "git_note_foreach" + ], + "meta": {}, + "lines": 213 + }, + { + "file": "object.h", + "functions": [ + "git_object_lookup", + "git_object_lookup_prefix", + "git_object_lookup_bypath", + "git_object_id", + "git_object_short_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", + "git_object_dup" + ], + "meta": {}, + "lines": 237 + }, + { + "file": "odb.h", + "functions": [ + "git_odb_foreach_cb", + "git_odb_new", + "git_odb_open", + "git_odb_add_disk_alternate", + "git_odb_free", + "git_odb_read", + "git_odb_read_prefix", + "git_odb_read_header", + "git_odb_exists", + "git_odb_exists_prefix", + "git_odb_refresh", + "git_odb_foreach", + "git_odb_write", + "git_odb_open_wstream", + "git_odb_stream_write", + "git_odb_stream_finalize_write", + "git_odb_stream_read", + "git_odb_stream_free", + "git_odb_open_rstream", + "git_odb_write_pack", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_object_dup", + "git_odb_object_free", + "git_odb_object_id", + "git_odb_object_data", + "git_odb_object_size", + "git_odb_object_type", + "git_odb_add_backend", + "git_odb_add_alternate", + "git_odb_num_backends", + "git_odb_get_backend" + ], + "meta": {}, + "lines": 491 + }, + { + "file": "odb_backend.h", + "functions": [ + "git_odb_backend_pack", + "git_odb_backend_loose", + "git_odb_backend_one_pack" + ], + "meta": {}, + "lines": 130 + }, + { + "file": "oid.h", + "functions": [ + "git_oid_fromstr", + "git_oid_fromstrp", + "git_oid_fromstrn", + "git_oid_fromraw", + "git_oid_fmt", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_tostr_s", + "git_oid_tostr", + "git_oid_cpy", + "git_oid_cmp", + "git_oid_equal", + "git_oid_ncmp", + "git_oid_streq", + "git_oid_strcmp", + "git_oid_iszero", + "git_oid_shorten_new", + "git_oid_shorten_add", + "git_oid_shorten_free" + ], + "meta": {}, + "lines": 265 + }, + { + "file": "oidarray.h", + "functions": [ + "git_oidarray_free" + ], + "meta": {}, + "lines": 34 + }, + { + "file": "pack.h", + "functions": [ + "git_packbuilder_new", + "git_packbuilder_set_threads", + "git_packbuilder_insert", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_walk", + "git_packbuilder_insert_recur", + "git_packbuilder_write", + "git_packbuilder_hash", + "git_packbuilder_foreach", + "git_packbuilder_object_count", + "git_packbuilder_written", + "git_packbuilder_progress", + "git_packbuilder_set_callbacks", + "git_packbuilder_free" + ], + "meta": {}, + "lines": 236 + }, + { + "file": "patch.h", + "functions": [ + "git_patch_from_diff", + "git_patch_from_blobs", + "git_patch_from_blob_and_buffer", + "git_patch_from_buffers", + "git_patch_free", + "git_patch_get_delta", + "git_patch_num_hunks", + "git_patch_line_stats", + "git_patch_get_hunk", + "git_patch_num_lines_in_hunk", + "git_patch_get_line_in_hunk", + "git_patch_size", + "git_patch_print", + "git_patch_to_buf" + ], + "meta": {}, + "lines": 268 + }, + { + "file": "pathspec.h", + "functions": [ + "git_pathspec_new", + "git_pathspec_free", + "git_pathspec_matches_path", + "git_pathspec_match_workdir", + "git_pathspec_match_index", + "git_pathspec_match_tree", + "git_pathspec_match_diff", + "git_pathspec_match_list_free", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_failed_entry" + ], + "meta": {}, + "lines": 260 + }, + { + "file": "rebase.h", + "functions": [ + "git_rebase_init_options", + "git_rebase_init", + "git_rebase_open", + "git_rebase_operation_entrycount", + "git_rebase_operation_current", + "git_rebase_operation_byindex", + "git_rebase_next", + "git_rebase_commit", + "git_rebase_abort", + "git_rebase_finish", + "git_rebase_free" + ], + "meta": {}, + "lines": 286 + }, + { + "file": "refdb.h", + "functions": [ + "git_refdb_new", + "git_refdb_open", + "git_refdb_compress", + "git_refdb_free" + ], + "meta": {}, + "lines": 63 + }, + { + "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_id_old", + "git_reflog_entry_id_new", + "git_reflog_entry_committer", + "git_reflog_entry_message", + "git_reflog_free" + ], + "meta": {}, + "lines": 166 + }, + { + "file": "refs.h", + "functions": [ + "git_reference_lookup", + "git_reference_name_to_id", + "git_reference_dwim", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_create", + "git_reference_create", + "git_reference_create_matching", + "git_reference_target", + "git_reference_target_peel", + "git_reference_symbolic_target", + "git_reference_type", + "git_reference_name", + "git_reference_resolve", + "git_reference_owner", + "git_reference_symbolic_set_target", + "git_reference_set_target", + "git_reference_rename", + "git_reference_delete", + "git_reference_remove", + "git_reference_list", + "git_reference_foreach", + "git_reference_foreach_name", + "git_reference_free", + "git_reference_cmp", + "git_reference_iterator_new", + "git_reference_iterator_glob_new", + "git_reference_next", + "git_reference_next_name", + "git_reference_iterator_free", + "git_reference_foreach_glob", + "git_reference_has_log", + "git_reference_ensure_log", + "git_reference_is_branch", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_is_note", + "git_reference_normalize_name", + "git_reference_peel", + "git_reference_is_valid_name", + "git_reference_shorthand" + ], + "meta": {}, + "lines": 730 + }, + { + "file": "refspec.h", + "functions": [ + "git_refspec_src", + "git_refspec_dst", + "git_refspec_string", + "git_refspec_force", + "git_refspec_direction", + "git_refspec_src_matches", + "git_refspec_dst_matches", + "git_refspec_transform", + "git_refspec_rtransform" + ], + "meta": {}, + "lines": 100 + }, + { + "file": "remote.h", + "functions": [ + "git_remote_rename_problem_cb", + "git_remote_create", + "git_remote_create_with_fetchspec", + "git_remote_create_anonymous", + "git_remote_lookup", + "git_remote_dup", + "git_remote_owner", + "git_remote_name", + "git_remote_url", + "git_remote_pushurl", + "git_remote_set_url", + "git_remote_set_pushurl", + "git_remote_add_fetch", + "git_remote_get_fetch_refspecs", + "git_remote_add_push", + "git_remote_get_push_refspecs", + "git_remote_refspec_count", + "git_remote_get_refspec", + "git_remote_connect", + "git_remote_ls", + "git_remote_connected", + "git_remote_stop", + "git_remote_disconnect", + "git_remote_free", + "git_remote_list", + "git_push_transfer_progress", + "git_push_negotiation", + "git_remote_init_callbacks", + "git_fetch_init_options", + "git_push_init_options", + "git_remote_download", + "git_remote_upload", + "git_remote_update_tips", + "git_remote_fetch", + "git_remote_prune", + "git_remote_push", + "git_remote_stats", + "git_remote_autotag", + "git_remote_set_autotag", + "git_remote_prune_refs", + "git_remote_rename", + "git_remote_is_valid_name", + "git_remote_delete", + "git_remote_default_branch" + ], + "meta": {}, + "lines": 796 + }, + { + "file": "repository.h", + "functions": [ + "git_repository_open", + "git_repository_wrap_odb", + "git_repository_discover", + "git_repository_open_ext", + "git_repository_open_bare", + "git_repository_free", + "git_repository_init", + "git_repository_init_init_options", + "git_repository_init_ext", + "git_repository_head", + "git_repository_head_detached", + "git_repository_head_unborn", + "git_repository_is_empty", + "git_repository_path", + "git_repository_workdir", + "git_repository_set_workdir", + "git_repository_is_bare", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_odb", + "git_repository_refdb", + "git_repository_index", + "git_repository_message", + "git_repository_message_remove", + "git_repository_state_cleanup", + "git_repository_fetchhead_foreach", + "git_repository_mergehead_foreach", + "git_repository_hashfile", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_detach_head", + "git_repository_state", + "git_repository_set_namespace", + "git_repository_get_namespace", + "git_repository_is_shallow", + "git_repository_ident", + "git_repository_set_ident" + ], + "meta": {}, + "lines": 750 + }, + { + "file": "reset.h", + "functions": [ + "git_reset", + "git_reset_from_annotated", + "git_reset_default" + ], + "meta": {}, + "lines": 107 + }, + { + "file": "revert.h", + "functions": [ + "git_revert_init_options", + "git_revert_commit", + "git_revert" + ], + "meta": {}, + "lines": 84 + }, + { + "file": "revparse.h", + "functions": [ + "git_revparse_single", + "git_revparse_ext", + "git_revparse" + ], + "meta": {}, + "lines": 108 + }, + { + "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_push_range", + "git_revwalk_simplify_first_parent", + "git_revwalk_free", + "git_revwalk_repository", + "git_revwalk_hide_cb", + "git_revwalk_add_hide_cb" + ], + "meta": {}, + "lines": 293 + }, + { + "file": "signature.h", + "functions": [ + "git_signature_new", + "git_signature_now", + "git_signature_default", + "git_signature_dup", + "git_signature_free" + ], + "meta": {}, + "lines": 86 + }, + { + "file": "stash.h", + "functions": [ + "git_stash_apply_progress_cb", + "git_stash_apply_init_options", + "git_stash_apply", + "git_stash_cb", + "git_stash_foreach", + "git_stash_drop", + "git_stash_pop" + ], + "meta": {}, + "lines": 253 + }, + { + "file": "status.h", + "functions": [ + "git_status_cb", + "git_status_init_options", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_file", + "git_status_list_new", + "git_status_list_entrycount", + "git_status_byindex", + "git_status_list_free", + "git_status_should_ignore" + ], + "meta": {}, + "lines": 366 + }, + { + "file": "strarray.h", + "functions": [ + "git_strarray_free", + "git_strarray_copy" + ], + "meta": {}, + "lines": 53 + }, + { + "file": "submodule.h", + "functions": [ + "git_submodule_update_init_options", + "git_submodule_update", + "git_submodule_lookup", + "git_submodule_free", + "git_submodule_foreach", + "git_submodule_add_setup", + "git_submodule_add_finalize", + "git_submodule_add_to_index", + "git_submodule_owner", + "git_submodule_name", + "git_submodule_path", + "git_submodule_url", + "git_submodule_resolve_url", + "git_submodule_branch", + "git_submodule_set_branch", + "git_submodule_set_url", + "git_submodule_index_id", + "git_submodule_head_id", + "git_submodule_wd_id", + "git_submodule_ignore", + "git_submodule_set_ignore", + "git_submodule_update_strategy", + "git_submodule_set_update", + "git_submodule_fetch_recurse_submodules", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_init", + "git_submodule_repo_init", + "git_submodule_sync", + "git_submodule_open", + "git_submodule_reload", + "git_submodule_status", + "git_submodule_location" + ], + "meta": {}, + "lines": 622 + }, + { + "file": "sys/commit.h", + "functions": [ + "git_commit_create_from_ids", + "git_commit_create_from_callback" + ], + "meta": {}, + "lines": 76 + }, + { + "file": "sys/config.h", + "functions": [ + "git_config_init_backend", + "git_config_add_backend" + ], + "meta": {}, + "lines": 109 + }, + { + "file": "sys/diff.h", + "functions": [ + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle", + "git_diff_get_perfdata", + "git_status_list_get_perfdata" + ], + "meta": {}, + "lines": 90 + }, + { + "file": "sys/filter.h", + "functions": [ + "git_filter_lookup", + "git_filter_list_new", + "git_filter_list_push", + "git_filter_list_length", + "git_filter_source_repo", + "git_filter_source_path", + "git_filter_source_filemode", + "git_filter_source_id", + "git_filter_source_mode", + "git_filter_source_flags", + "git_filter_init_fn", + "git_filter_shutdown_fn", + "git_filter_check_fn", + "git_filter_apply_fn", + "git_filter_cleanup_fn", + "git_filter_register", + "git_filter_unregister" + ], + "meta": {}, + "lines": 305 + }, + { + "file": "sys/hashsig.h", + "functions": [ + "git_hashsig_create", + "git_hashsig_create_fromfile", + "git_hashsig_free", + "git_hashsig_compare" + ], + "meta": {}, + "lines": 102 + }, + { + "file": "sys/mempack.h", + "functions": [ + "git_mempack_new", + "git_mempack_reset" + ], + "meta": {}, + "lines": 81 + }, + { + "file": "sys/odb_backend.h", + "functions": [ + "git_odb_init_backend" + ], + "meta": {}, + "lines": 102 + }, + { + "file": "sys/openssl.h", + "functions": [ + "git_openssl_set_locking" + ], + "meta": {}, + "lines": 34 + }, + { + "file": "sys/refdb_backend.h", + "functions": [ + "git_refdb_init_backend", + "git_refdb_backend_fs", + "git_refdb_set_backend" + ], + "meta": {}, + "lines": 213 + }, + { + "file": "sys/refs.h", + "functions": [ + "git_reference__alloc", + "git_reference__alloc_symbolic" + ], + "meta": {}, + "lines": 45 + }, + { + "file": "sys/repository.h", + "functions": [ + "git_repository_new", + "git_repository__cleanup", + "git_repository_reinit_filesystem", + "git_repository_set_config", + "git_repository_set_odb", + "git_repository_set_refdb", + "git_repository_set_index", + "git_repository_set_bare" + ], + "meta": {}, + "lines": 136 + }, + { + "file": "sys/stream.h", + "functions": [], + "meta": {}, + "lines": 40 + }, + { + "file": "sys/transport.h", + "functions": [ + "git_transport_init", + "git_transport_new", + "git_transport_ssh_with_paths", + "git_transport_unregister", + "git_transport_dummy", + "git_transport_local", + "git_transport_smart", + "git_smart_subtransport_http", + "git_smart_subtransport_git", + "git_smart_subtransport_ssh" + ], + "meta": {}, + "lines": 349 + }, + { + "file": "tag.h", + "functions": [ + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tag_free", + "git_tag_id", + "git_tag_owner", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type", + "git_tag_name", + "git_tag_tagger", + "git_tag_message", + "git_tag_create", + "git_tag_annotation_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": {}, + "lines": 348 + }, + { + "file": "trace.h", + "functions": [ + "git_trace_callback", + "git_trace_set" + ], + "meta": {}, + "lines": 63 + }, + { + "file": "transport.h", + "functions": [ + "git_transport_cb", + "git_cred_has_username", + "git_cred_userpass_plaintext_new", + "git_cred_ssh_key_new", + "git_cred_ssh_interactive_new", + "git_cred_ssh_key_from_agent", + "git_cred_ssh_custom_new", + "git_cred_default_new", + "git_cred_username_new", + "git_cred_ssh_key_memory_new", + "git_cred_acquire_cb" + ], + "meta": {}, + "lines": 334 + }, + { + "file": "tree.h", + "functions": [ + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_tree_free", + "git_tree_id", + "git_tree_owner", + "git_tree_entrycount", + "git_tree_entry_byname", + "git_tree_entry_byindex", + "git_tree_entry_byid", + "git_tree_entry_bypath", + "git_tree_entry_dup", + "git_tree_entry_free", + "git_tree_entry_name", + "git_tree_entry_id", + "git_tree_entry_type", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_cmp", + "git_tree_entry_to_object", + "git_treebuilder_new", + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_remove", + "git_treebuilder_filter_cb", + "git_treebuilder_filter", + "git_treebuilder_write", + "git_treewalk_cb", + "git_tree_walk" + ], + "meta": {}, + "lines": 410 + }, + { + "file": "types.h", + "functions": [ + "git_transfer_progress_cb", + "git_transport_message_cb", + "git_transport_certificate_check_cb" + ], + "meta": {}, + "lines": 425 + } + ], + "functions": { + "git_annotated_commit_from_ref": { + "type": "function", + "file": "annotated_commit.h", + "line": 33, + "lineto": 36, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given reference" + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "reference to use to lookup the git_annotated_commit" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const git_reference *ref", + "sig": "git_annotated_commit **::git_repository *::const git_reference *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Creates a git_annotated_commit from the given reference.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "", + "group": "annotated" + }, + "git_annotated_commit_from_fetchhead": { + "type": "function", + "file": "annotated_commit.h", + "line": 50, + "lineto": 55, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "name of the (remote) branch" + }, + { + "name": "remote_url", + "type": "const char *", + "comment": "url of the remote" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the commit object id of the remote branch" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const char *branch_name, const char *remote_url, const git_oid *id", + "sig": "git_annotated_commit **::git_repository *::const char *::const char *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Creates a git_annotated_commit from the given fetch head data.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "", + "group": "annotated" + }, + "git_annotated_commit_lookup": { + "type": "function", + "file": "annotated_commit.h", + "line": 75, + "lineto": 78, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the commit object id to lookup" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const git_oid *id", + "sig": "git_annotated_commit **::git_repository *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", + "comments": "

An annotated commit contains information about how it was\n looked up, which may be useful for functions like merge or\n rebase to provide context to the operation. For example,\n conflict files will include the name of the source or target\n branches being merged. It is therefore preferable to use the\n most specific function (eg git_annotated_commit_from_ref)\n instead of this one when that data is known.

\n", + "group": "annotated" + }, + "git_annotated_commit_from_revspec": { + "type": "function", + "file": "annotated_commit.h", + "line": 92, + "lineto": 95, + "args": [ + { + "name": "out", + "type": "git_annotated_commit **", + "comment": "pointer to store the git_annotated_commit result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given commit" + }, + { + "name": "revspec", + "type": "const char *", + "comment": "the extended sha syntax string to use to lookup the commit" + } + ], + "argline": "git_annotated_commit **out, git_repository *repo, const char *revspec", + "sig": "git_annotated_commit **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Creates a git_annotated_comit from a revision string.

\n", + "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n", + "group": "annotated" + }, + "git_annotated_commit_id": { + "type": "function", + "file": "annotated_commit.h", + "line": 103, + "lineto": 104, + "args": [ + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": "the given annotated commit" + } + ], + "argline": "const git_annotated_commit *commit", + "sig": "const git_annotated_commit *", + "return": { + "type": "const git_oid *", + "comment": " commit id" + }, + "description": "

Gets the commit ID that the given git_annotated_commit refers to.

\n", + "comments": "", + "group": "annotated" + }, + "git_annotated_commit_free": { + "type": "function", + "file": "annotated_commit.h", + "line": 111, + "lineto": 112, + "args": [ + { + "name": "commit", + "type": "git_annotated_commit *", + "comment": "annotated commit to free" + } + ], + "argline": "git_annotated_commit *commit", + "sig": "git_annotated_commit *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Frees a git_annotated_commit.

\n", + "comments": "", + "group": "annotated" + }, + "git_attr_value": { + "type": "function", + "file": "attr.h", + "line": 102, + "lineto": 102, + "args": [ + { + "name": "attr", + "type": "const char *", + "comment": "The attribute" + } + ], + "argline": "const char *attr", + "sig": "const char *", + "return": { + "type": "git_attr_t", + "comment": " the value type for the attribute" + }, + "description": "

Return the value type for a given attribute.

\n", + "comments": "

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute\n was not set at all), or VALUE, if the attribute was set to an\n actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally\n as a NULL-terminated C string.

\n", + "group": "attr" + }, + "git_attr_get": { + "type": "function", + "file": "attr.h", + "line": 145, + "lineto": 150, + "args": [ + { + "name": "value_out", + "type": "const char **", + "comment": "Output of the value of the attribute. Use the GIT_ATTR_...\n macros to test for TRUE, FALSE, UNSPECIFIED, etc. or just\n use the string value for attributes set to a value. You\n 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\n interpreted relative to the repo root. The file does\n not have to exist, but if it does not, then it will be\n 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, git_repository *repo, uint32_t flags, const char *path, const char *name", + "sig": "const char **::git_repository *::uint32_t::const char *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Look up the value of one git attribute for path.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_get_many": { + "type": "function", + "file": "attr.h", + "line": 181, + "lineto": 187, + "args": [ + { + "name": "values_out", + "type": "const char **", + "comment": "An array of num_attr entries that will have string\n pointers written into it for the values of the attributes.\n You should not modify or free the values that are written\n into this array (although of course, you should free the\n array itself if you allocated it)." + }, + { + "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\n does not have to exist, but if it does not, then\n 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, git_repository *repo, uint32_t flags, const char *path, size_t num_attr, const char **names", + "sig": "const char **::git_repository *::uint32_t::const char *::size_t::const char **", + "return": { + "type": "int", + "comment": null + }, + "description": "

Look up a list of git attributes for path.

\n", + "comments": "

Use this if you have a known list of attributes that you want to\n look up in a single call. This is somewhat more efficient than\n calling git_attr_get() multiple times.

\n\n

For 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
\n\n

Then you could loop through the 3 values to get the settings for\n the three attributes you asked about.

\n", + "group": "attr" + }, + "git_attr_foreach": { + "type": "function", + "file": "attr.h", + "line": 209, + "lineto": 214, + "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\n to exist, but if it does not, then it will be treated as a\n plain file (i.e. not a directory)." + }, + { + "name": "callback", + "type": "git_attr_foreach_cb", + "comment": "Function to invoke on each attribute name and value. The\n value may be NULL is the attribute is explicitly set to\n UNSPECIFIED using the '!' sign. Callback will be invoked\n only once per attribute name, even if there are multiple\n rules for a given file. The highest priority rule will be\n used. Return a non-zero value from this to stop looping.\n The value will be returned from `git_attr_foreach`." + }, + { + "name": "payload", + "type": "void *", + "comment": "Passed on as extra parameter to callback function." + } + ], + "argline": "git_repository *repo, uint32_t flags, const char *path, git_attr_foreach_cb callback, void *payload", + "sig": "git_repository *::uint32_t::const char *::git_attr_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all the git attributes for a path.

\n", + "comments": "", + "group": "attr" + }, + "git_attr_cache_flush": { + "type": "function", + "file": "attr.h", + "line": 224, + "lineto": 225, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Flush the gitattributes cache.

\n", + "comments": "

Call this if you have reason to believe that the attributes files on\n disk no longer match the cached contents of memory. This will cause\n the attributes files to be reloaded the next time that an attribute\n access function is called.

\n", + "group": "attr" + }, + "git_attr_add_macro": { + "type": "function", + "file": "attr.h", + "line": 237, + "lineto": 240, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "name", + "type": "const char *", + "comment": null + }, + { + "name": "values", + "type": "const char *", + "comment": null + } + ], + "argline": "git_repository *repo, const char *name, const char *values", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Add a macro definition.

\n", + "comments": "

Macros will automatically be loaded from the top level .gitattributes\n file of the repository (plus the build-in "binary" macro). This\n function allows you to add others. For example, to add the default\n macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", + "group": "attr" + }, + "git_blame_init_options": { + "type": "function", + "file": "blame.h", + "line": 92, + "lineto": 94, + "args": [ + { + "name": "opts", + "type": "git_blame_options *", + "comment": "The `git_blame_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`" + } + ], + "argline": "git_blame_options *opts, unsigned int version", + "sig": "git_blame_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_blame_options with default values. Equivalent to\n creating an instance with GIT_BLAME_OPTIONS_INIT.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_count": { + "type": "function", + "file": "blame.h", + "line": 137, + "lineto": 137, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": null + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { + "type": "uint32_t", + "comment": null + }, + "description": "

Gets the number of hunks that exist in the blame structure.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byindex": { + "type": "function", + "file": "blame.h", + "line": 146, + "lineto": 148, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "index", + "type": "uint32_t", + "comment": "index of the hunk to retrieve" + } + ], + "argline": "git_blame *blame, uint32_t index", + "sig": "git_blame *::uint32_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk at the given index, or NULL on error" + }, + "description": "

Gets the blame hunk at the given index.

\n", + "comments": "", + "group": "blame" + }, + "git_blame_get_hunk_byline": { + "type": "function", + "file": "blame.h", + "line": 157, + "lineto": 159, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to query" + }, + { + "name": "lineno", + "type": "uint32_t", + "comment": "the (1-based) line number to find a hunk for" + } + ], + "argline": "git_blame *blame, uint32_t lineno", + "sig": "git_blame *::uint32_t", + "return": { + "type": "const git_blame_hunk *", + "comment": " the hunk that contains the given line, or NULL on error" + }, + "description": "

Gets the hunk that relates to the given line number in the newest commit.

\n", + "comments": "", + "group": "blame", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blame_get_hunk_byline-1" + ] + } + }, + "git_blame_file": { + "type": "function", + "file": "blame.h", + "line": 172, + "lineto": 176, + "args": [ + { + "name": "out", + "type": "git_blame **", + "comment": "pointer that will receive the blame object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository whose history is to be walked" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to file to consider" + }, + { + "name": "options", + "type": "git_blame_options *", + "comment": "options for the blame operation. If NULL, this is treated as\n though GIT_BLAME_OPTIONS_INIT were passed." + } + ], + "argline": "git_blame **out, git_repository *repo, const char *path, git_blame_options *options", + "sig": "git_blame **::git_repository *::const char *::git_blame_options *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error.)" + }, + "description": "

Get the blame for a single file.

\n", + "comments": "", + "group": "blame", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blame_file-2" + ] + } + }, + "git_blame_buffer": { + "type": "function", + "file": "blame.h", + "line": 196, + "lineto": 200, + "args": [ + { + "name": "out", + "type": "git_blame **", + "comment": "pointer that will receive the resulting blame data" + }, + { + "name": "reference", + "type": "git_blame *", + "comment": "cached blame from the history of the file (usually the output\n from git_blame_file)" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the (possibly) modified contents of the file" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "number of valid bytes in the buffer" + } + ], + "argline": "git_blame **out, git_blame *reference, const char *buffer, size_t buffer_len", + "sig": "git_blame **::git_blame *::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error)" + }, + "description": "

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n", + "comments": "

Lines that differ between the buffer and the committed version are marked as\n having a zero OID for their final_commit_id.

\n", + "group": "blame" + }, + "git_blame_free": { + "type": "function", + "file": "blame.h", + "line": 207, + "lineto": 207, + "args": [ + { + "name": "blame", + "type": "git_blame *", + "comment": "the blame structure to free" + } + ], + "argline": "git_blame *blame", + "sig": "git_blame *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free memory allocated by git_blame_file or git_blame_buffer.

\n", + "comments": "", + "group": "blame", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blame_free-3" + ] + } + }, + "git_blob_lookup": { + "type": "function", + "file": "blob.h", + "line": 33, + "lineto": 33, + "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.

\n", + "comments": "", + "group": "blob", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blob_lookup-4" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_blob_lookup-1" + ] + } + }, + "git_blob_lookup_prefix": { + "type": "function", + "file": "blob.h", + "line": 47, + "lineto": 47, + "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,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "blob" + }, + "git_blob_free": { + "type": "function", + "file": "blob.h", + "line": 60, + "lineto": 60, + "args": [ + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to close" + } + ], + "argline": "git_blob *blob", + "sig": "git_blob *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open blob

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a blob. Failure to do so will cause a memory leak.

\n", + "group": "blob", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blob_free-5" + ] + } + }, + "git_blob_id": { + "type": "function", + "file": "blob.h", + "line": 68, + "lineto": 68, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "a previously loaded blob." + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "const git_oid *", + "comment": " SHA1 hash for this blob." + }, + "description": "

Get the id of a blob.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_owner": { + "type": "function", + "file": "blob.h", + "line": 76, + "lineto": 76, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "A previously loaded blob." + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this blob." + }, + "description": "

Get the repository that contains the blob.

\n", + "comments": "", + "group": "blob" + }, + "git_blob_rawcontent": { + "type": "function", + "file": "blob.h", + "line": 89, + "lineto": 89, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "pointer to the blob" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "const void *", + "comment": " the pointer" + }, + "description": "

Get a read-only buffer with the raw content of a blob.

\n", + "comments": "

A pointer to the raw content of a blob is returned;\n this pointer is owned internally by the object and shall\n not be free'd. The pointer may be invalidated at a later\n time.

\n", + "group": "blob", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blob_rawcontent-6" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_blob_rawcontent-1" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_blob_rawcontent-2" + ] + } + }, + "git_blob_rawsize": { + "type": "function", + "file": "blob.h", + "line": 97, + "lineto": 97, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "pointer to the blob" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "git_off_t", + "comment": " size on bytes" + }, + "description": "

Get the size in bytes of the contents of a blob

\n", + "comments": "", + "group": "blob", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_blob_rawsize-7" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_blob_rawsize-2" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_blob_rawsize-3", + "ex/v0.23.2/general.html#git_blob_rawsize-4" + ] + } + }, + "git_blob_filtered_content": { + "type": "function", + "file": "blob.h", + "line": 122, + "lineto": 126, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The git_buf to be filled in" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "Pointer to the blob" + }, + { + "name": "as_path", + "type": "const char *", + "comment": "Path used for file attribute lookups, etc." + }, + { + "name": "check_for_binary_data", + "type": "int", + "comment": "Should this test if blob content contains\n NUL bytes / looks like binary data before applying filters?" + } + ], + "argline": "git_buf *out, git_blob *blob, const char *as_path, int check_for_binary_data", + "sig": "git_buf *::git_blob *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success or an error code" + }, + "description": "

Get a buffer with the filtered content of a blob.

\n", + "comments": "

This applies filters as if the blob was being checked out to the\n working directory under the specified filename. This may apply\n CRLF filtering or other types of changes depending on the file\n attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free\n when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just\n be populated with a pointer to the raw content of the blob. In\n that case, be careful to not free the blob until done with the\n buffer or copy it into memory you own.

\n", + "group": "blob" + }, + "git_blob_create_fromworkdir": { + "type": "function", + "file": "blob.h", + "line": 139, + "lineto": 139, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where the blob will be written.\n\tthis repository cannot be bare" + }, + { + "name": "relative_path", + "type": "const char *", + "comment": "file from which the blob will be created,\n\trelative to the repository's working dir" + } + ], + "argline": "git_oid *id, git_repository *repo, const char *relative_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\n and write it to the Object Database as a loose blob

\n", + "comments": "", + "group": "blob" + }, + "git_blob_create_fromdisk": { + "type": "function", + "file": "blob.h", + "line": 151, + "lineto": 151, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository where the blob will be written.\n\tthis repository can be bare or not" + }, + { + "name": "path", + "type": "const char *", + "comment": "file from which the blob will be created" + } + ], + "argline": "git_oid *id, 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\n to the Object Database as a loose blob

\n", + "comments": "", + "group": "blob" + }, + "git_blob_create_fromchunks": { + "type": "function", + "file": "blob.h", + "line": 187, + "lineto": 192, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Return the id of the written blob" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where the blob will be written.\n This repository can be bare or not." + }, + { + "name": "hintpath", + "type": "const char *", + "comment": "If not NULL, will be used to select data filters\n to apply onto the content of the blob to be created." + }, + { + "name": "callback", + "type": "git_blob_chunk_cb", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *hintpath, git_blob_chunk_cb callback, void *payload", + "sig": "git_oid *::git_repository *::const char *::git_blob_chunk_cb::void *", + "return": { + "type": "int", + "comment": " 0 or error code (from either libgit2 or callback function)" + }, + "description": "

Write a loose blob to the Object Database from a\n provider of chunks of data.

\n", + "comments": "

If the hintpath parameter is filled, it will be used to determine\n what git filters should be applied to the object before it is written\n to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n
    \n
  • content must be filled by the callback. The maximum number of\nbytes that the buffer can accept per call is defined by the\nmax_length parameter. Allocation and freeing of the buffer will\nbe taken care of by libgit2.

  • \n
  • The callback must return the number of bytes that have been\nwritten to the content buffer.

  • \n
  • When there is no more data to stream, callback should return

    \n\n
      \n
    1. This will prevent it from being invoked anymore.
    2. \n
  • \n
  • If an error occurs, the callback should return a negative value.\nThis value will be returned to the caller.

  • \n
\n", + "group": "blob" + }, + "git_blob_create_frombuffer": { + "type": "function", + "file": "blob.h", + "line": 203, + "lineto": 204, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "return the id 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 *id, 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

\n", + "comments": "", + "group": "blob" + }, + "git_blob_is_binary": { + "type": "function", + "file": "blob.h", + "line": 217, + "lineto": 217, + "args": [ + { + "name": "blob", + "type": "const git_blob *", + "comment": "The blob which content should be analyzed" + } + ], + "argline": "const git_blob *blob", + "sig": "const git_blob *", + "return": { + "type": "int", + "comment": " 1 if the content of the blob is detected\n as binary; 0 otherwise." + }, + "description": "

Determine if the blob content is most certainly binary or not.

\n", + "comments": "

The heuristic used to guess if a file is binary is taken from core git:\n Searching for NUL bytes and looking for a reasonable ratio of printable\n to non-printable characters among the first 8000 bytes.

\n", + "group": "blob" + }, + "git_branch_create": { + "type": "function", + "file": "branch.h", + "line": 50, + "lineto": 55, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer where to store the underlying reference." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "branch_name", + "type": "const char *", + "comment": "Name for the branch; this name is\n validated for consistency. It should also not conflict with\n an already existing branch name." + }, + { + "name": "target", + "type": "const git_commit *", + "comment": "Commit to which this branch should point. This object\n must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing branch." + } + ], + "argline": "git_reference **out, git_repository *repo, const char *branch_name, const git_commit *target, int force", + "sig": "git_reference **::git_repository *::const char *::const git_commit *::int", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC or an error code.\n A proper reference is written in the refs/heads namespace\n pointing to the provided target commit." + }, + "description": "

Create a new branch pointing at a target commit

\n", + "comments": "

A new direct reference will be created pointing to\n this target commit. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "branch" + }, + "git_branch_create_from_annotated": { + "type": "function", + "file": "branch.h", + "line": 68, + "lineto": 73, + "args": [ + { + "name": "ref_out", + "type": "git_reference **", + "comment": null + }, + { + "name": "repository", + "type": "git_repository *", + "comment": null + }, + { + "name": "branch_name", + "type": "const char *", + "comment": null + }, + { + "name": "commit", + "type": "const git_annotated_commit *", + "comment": null + }, + { + "name": "force", + "type": "int", + "comment": null + } + ], + "argline": "git_reference **ref_out, git_repository *repository, const char *branch_name, const git_annotated_commit *commit, int force", + "sig": "git_reference **::git_repository *::const char *::const git_annotated_commit *::int", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a new branch pointing at a target commit

\n", + "comments": "

This behaves like git_branch_create() but takes an annotated\n commit, which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_branch_create().

\n", + "group": "branch" + }, + "git_branch_delete": { + "type": "function", + "file": "branch.h", + "line": 85, + "lineto": 85, + "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.

\n", + "comments": "

If the branch is successfully deleted, the passed reference\n object will be invalidated. The reference must be freed manually\n by the user.

\n", + "group": "branch" + }, + "git_branch_iterator_new": { + "type": "function", + "file": "branch.h", + "line": 101, + "lineto": 104, + "args": [ + { + "name": "out", + "type": "git_branch_iterator **", + "comment": "the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the branches." + }, + { + "name": "list_flags", + "type": "git_branch_t", + "comment": "Filtering flags for the branch\n listing. Valid values are GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE\n or GIT_BRANCH_ALL." + } + ], + "argline": "git_branch_iterator **out, git_repository *repo, git_branch_t list_flags", + "sig": "git_branch_iterator **::git_repository *::git_branch_t", + "return": { + "type": "int", + "comment": " 0 on success or an error code" + }, + "description": "

Create an iterator which loops over the requested branches.

\n", + "comments": "", + "group": "branch" + }, + "git_branch_next": { + "type": "function", + "file": "branch.h", + "line": 114, + "lineto": 114, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "the reference" + }, + { + "name": "out_type", + "type": "git_branch_t *", + "comment": "the type of branch (local or remote-tracking)" + }, + { + "name": "iter", + "type": "git_branch_iterator *", + "comment": "the branch iterator" + } + ], + "argline": "git_reference **out, git_branch_t *out_type, git_branch_iterator *iter", + "sig": "git_reference **::git_branch_t *::git_branch_iterator *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ITEROVER if there are no more branches or an error code." + }, + "description": "

Retrieve the next branch from the iterator

\n", + "comments": "", + "group": "branch" + }, + "git_branch_iterator_free": { + "type": "function", + "file": "branch.h", + "line": 121, + "lineto": 121, + "args": [ + { + "name": "iter", + "type": "git_branch_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_branch_iterator *iter", + "sig": "git_branch_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a branch iterator

\n", + "comments": "", + "group": "branch" + }, + "git_branch_move": { + "type": "function", + "file": "branch.h", + "line": 138, + "lineto": 142, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": null + }, + { + "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\n is performed; this name is validated for consistency." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing branch." + } + ], + "argline": "git_reference **out, git_reference *branch, const char *new_branch_name, int force", + "sig": "git_reference **::git_reference *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Move/rename an existing local branch reference.

\n", + "comments": "

The new branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "branch" + }, + "git_branch_lookup": { + "type": "function", + "file": "branch.h", + "line": 165, + "lineto": 169, + "args": [ + { + "name": "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;\n this name is validated for consistency." + }, + { + "name": "branch_type", + "type": "git_branch_t", + "comment": "Type of the considered branch. This should\n be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE." + } + ], + "argline": "git_reference **out, git_repository *repo, const char *branch_name, git_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\n exists, GIT_EINVALIDSPEC, otherwise an error code." + }, + "description": "

Lookup a branch by its name in a repository.

\n", + "comments": "

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "branch" + }, + "git_branch_name": { + "type": "function", + "file": "branch.h", + "line": 186, + "lineto": 188, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "where the pointer of branch name is stored;\n this is valid as long as the ref is not freed." + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "the reference ideally pointing to a branch" + } + ], + "argline": "const char **out, const git_reference *ref", + "sig": "const char **::const git_reference *", + "return": { + "type": "int", + "comment": " 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)." + }, + "description": "

Return the name of the given local or remote branch.

\n", + "comments": "

The name of the branch matches the definition of the name\n for git_branch_lookup. That is, if the returned name is given\n to git_branch_lookup() then the reference is returned that\n was given to this function.

\n", + "group": "branch" + }, + "git_branch_upstream": { + "type": "function", + "file": "branch.h", + "line": 202, + "lineto": 204, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer where to store the retrieved\n reference." + }, + { + "name": "branch", + "type": "const git_reference *", + "comment": "Current underlying reference of the branch." + } + ], + "argline": "git_reference **out, const git_reference *branch", + "sig": "git_reference **::const git_reference *", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND when no remote tracking\n reference exists, otherwise an error code." + }, + "description": "

Return the reference supporting the remote tracking branch,\n given a local branch reference.

\n", + "comments": "", + "group": "branch" + }, + "git_branch_set_upstream": { + "type": "function", + "file": "branch.h", + "line": 216, + "lineto": 216, + "args": [ + { + "name": "branch", + "type": "git_reference *", + "comment": "the branch to configure" + }, + { + "name": "upstream_name", + "type": "const char *", + "comment": "remote-tracking or local branch to set as\n upstream. Pass NULL to unset." + } + ], + "argline": "git_reference *branch, const char *upstream_name", + "sig": "git_reference *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Set the upstream configuration for a given local branch

\n", + "comments": "", + "group": "branch" + }, + "git_branch_is_head": { + "type": "function", + "file": "branch.h", + "line": 245, + "lineto": 246, + "args": [ + { + "name": "branch", + "type": "const git_reference *", + "comment": "Current underlying reference of the branch." + } + ], + "argline": "const git_reference *branch", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 if HEAD points at the branch, 0 if it isn't,\n error code otherwise." + }, + "description": "

Determine if the current local branch is pointed at by HEAD.

\n", + "comments": "", + "group": "branch" + }, + "git_buf_free": { + "type": "function", + "file": "buffer.h", + "line": 72, + "lineto": 72, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to deallocate" + } + ], + "argline": "git_buf *buffer", + "sig": "git_buf *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the memory referred to by the git_buf.

\n", + "comments": "

Note that this does not free the git_buf itself, just the memory\n pointed to by buffer->ptr. This will not free the memory if it looks\n like it was not allocated internally, but it will clear the buffer back\n to the empty state.

\n", + "group": "buf", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_buf_free-1" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_buf_free-1" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_buf_free-1" + ] + } + }, + "git_buf_grow": { + "type": "function", + "file": "buffer.h", + "line": 95, + "lineto": 95, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to be resized; may or may not be allocated yet" + }, + { + "name": "target_size", + "type": "size_t", + "comment": "The desired available size" + } + ], + "argline": "git_buf *buffer, size_t target_size", + "sig": "git_buf *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, -1 on allocation failure" + }, + "description": "

Resize the buffer allocation to make more space.

\n", + "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e.\n the asize field is zero), then ptr will be replaced with a newly\n allocated block of data. Be careful so that memory allocated by the\n caller is not lost. As a special variant, if you pass target_size as\n 0 and the memory is not allocated by libgit2, this will allocate a new\n buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be\n marked as invalid for future operations, invaliding the contents.

\n", + "group": "buf" + }, + "git_buf_set": { + "type": "function", + "file": "buffer.h", + "line": 105, + "lineto": 106, + "args": [ + { + "name": "buffer", + "type": "git_buf *", + "comment": "The buffer to set" + }, + { + "name": "data", + "type": "const void *", + "comment": "The data to copy into the buffer" + }, + { + "name": "datalen", + "type": "size_t", + "comment": "The length of the data to copy into the buffer" + } + ], + "argline": "git_buf *buffer, const void *data, size_t datalen", + "sig": "git_buf *::const void *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, -1 on allocation failure" + }, + "description": "

Set buffer to a copy of some raw data.

\n", + "comments": "", + "group": "buf" + }, + "git_buf_is_binary": { + "type": "function", + "file": "buffer.h", + "line": 114, + "lineto": 114, + "args": [ + { + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" + } + ], + "argline": "const git_buf *buf", + "sig": "const git_buf *", + "return": { + "type": "int", + "comment": " 1 if buffer looks like non-text data" + }, + "description": "

Check quickly if buffer looks like it contains binary data

\n", + "comments": "", + "group": "buf" + }, + "git_buf_contains_nul": { + "type": "function", + "file": "buffer.h", + "line": 122, + "lineto": 122, + "args": [ + { + "name": "buf", + "type": "const git_buf *", + "comment": "Buffer to check" + } + ], + "argline": "const git_buf *buf", + "sig": "const git_buf *", + "return": { + "type": "int", + "comment": " 1 if buffer contains a NUL byte" + }, + "description": "

Check quickly if buffer contains a NUL byte

\n", + "comments": "", + "group": "buf" + }, + "git_checkout_init_options": { + "type": "function", + "file": "checkout.h", + "line": 308, + "lineto": 310, + "args": [ + { + "name": "opts", + "type": "git_checkout_options *", + "comment": "the `git_checkout_options` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`" + } + ], + "argline": "git_checkout_options *opts, unsigned int version", + "sig": "git_checkout_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_checkout_options with default values. Equivalent to\n creating an instance with GIT_CHECKOUT_OPTIONS_INIT.

\n", + "comments": "", + "group": "checkout" + }, + "git_checkout_head": { + "type": "function", + "file": "checkout.h", + "line": 322, + "lineto": 324, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to check out (must be non-bare)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, const git_checkout_options *opts", + "sig": "git_repository *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH if HEAD points to a non\n existing branch, non-zero value returned by `notify_cb`, or\n other error code \n<\n 0 (use giterr_last for error details)" + }, + "description": "

Updates files in the index and the working tree to match the content of\n the commit pointed at by HEAD.

\n", + "comments": "", + "group": "checkout" + }, + "git_checkout_index": { + "type": "function", + "file": "checkout.h", + "line": 335, + "lineto": 338, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository into which to check out (must be non-bare)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "index to be checked out (or NULL to use repository index)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, git_index *index, const git_checkout_options *opts", + "sig": "git_repository *::git_index *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + }, + "description": "

Updates files in the working tree to match the content of the index.

\n", + "comments": "", + "group": "checkout" + }, + "git_checkout_tree": { + "type": "function", + "file": "checkout.h", + "line": 351, + "lineto": 354, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "repository to check out (must be non-bare)" + }, + { + "name": "treeish", + "type": "const git_object *", + "comment": "a commit, tag or tree which content will be used to update\n the working directory (or NULL to use HEAD)" + }, + { + "name": "opts", + "type": "const git_checkout_options *", + "comment": "specifies checkout options (may be NULL)" + } + ], + "argline": "git_repository *repo, const git_object *treeish, const git_checkout_options *opts", + "sig": "git_repository *::const git_object *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero return value from `notify_cb`, or error\n code \n<\n 0 (use giterr_last for error details)" + }, + "description": "

Updates files in the index and working tree to match the content of the\n tree pointed at by the treeish.

\n", + "comments": "", + "group": "checkout" + }, + "git_cherrypick_init_options": { + "type": "function", + "file": "cherrypick.h", + "line": 47, + "lineto": 49, + "args": [ + { + "name": "opts", + "type": "git_cherrypick_options *", + "comment": "the `git_cherrypick_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`" + } + ], + "argline": "git_cherrypick_options *opts, unsigned int version", + "sig": "git_cherrypick_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_cherrypick_options with default values. Equivalent to\n creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.

\n", + "comments": "", + "group": "cherrypick" + }, + "git_cherrypick_commit": { + "type": "function", + "file": "cherrypick.h", + "line": 65, + "lineto": 71, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository that contains the given commits" + }, + { + "name": "cherrypick_commit", + "type": "git_commit *", + "comment": "the commit to cherry-pick" + }, + { + "name": "our_commit", + "type": "git_commit *", + "comment": "the commit to revert against (eg, HEAD)" + }, + { + "name": "mainline", + "type": "unsigned int", + "comment": "the parent of the revert commit, if it is a merge" + }, + { + "name": "merge_options", + "type": "const git_merge_options *", + "comment": "the merge options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_commit *cherrypick_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options", + "sig": "git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Cherry-picks the given commit against the given "our" commit, producing an\n index that reflects the result of the cherry-pick.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "cherrypick" + }, + "git_cherrypick": { + "type": "function", + "file": "cherrypick.h", + "line": 81, + "lineto": 84, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to cherry-pick" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to cherry-pick" + }, + { + "name": "cherrypick_options", + "type": "const git_cherrypick_options *", + "comment": "the cherry-pick options (or null for defaults)" + } + ], + "argline": "git_repository *repo, git_commit *commit, const git_cherrypick_options *cherrypick_options", + "sig": "git_repository *::git_commit *::const git_cherrypick_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Cherry-pick the given commit, producing changes in the index and working directory.

\n", + "comments": "", + "group": "cherrypick" + }, + "git_clone_init_options": { + "type": "function", + "file": "clone.h", + "line": 179, + "lineto": 181, + "args": [ + { + "name": "opts", + "type": "git_clone_options *", + "comment": "The `git_clone_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`" + } + ], + "argline": "git_clone_options *opts, unsigned int version", + "sig": "git_clone_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_clone_options with default values. Equivalent to\n creating an instance with GIT_CLONE_OPTIONS_INIT.

\n", + "comments": "", + "group": "clone" + }, + "git_clone": { + "type": "function", + "file": "clone.h", + "line": 199, + "lineto": 203, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer that will receive the resulting repository object" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository to clone" + }, + { + "name": "local_path", + "type": "const char *", + "comment": "local directory to clone to" + }, + { + "name": "options", + "type": "const git_clone_options *", + "comment": "configuration options for the clone. If NULL, the\n function works as though GIT_OPTIONS_INIT were passed." + } + ], + "argline": "git_repository **out, const char *url, const char *local_path, const git_clone_options *options", + "sig": "git_repository **::const char *::const char *::const git_clone_options *", + "return": { + "type": "int", + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)" + }, + "description": "

Clone a remote repository.

\n", + "comments": "

By default this creates its repository and initial remote to match\n git's defaults. You can use the options in the callback to\n customize how these are created.

\n", + "group": "clone", + "examples": { + "network/clone.c": [ + "ex/v0.23.2/network/clone.html#git_clone-1" + ] + } + }, + "git_commit_lookup": { + "type": "function", + "file": "commit.h", + "line": 36, + "lineto": 37, + "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\n\t\tan 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.

\n", + "comments": "

The returned object should be released with git_commit_free when no\n longer needed.

\n", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_lookup-5", + "ex/v0.23.2/general.html#git_commit_lookup-6", + "ex/v0.23.2/general.html#git_commit_lookup-7" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_lookup-1" + ] + } + }, + "git_commit_lookup_prefix": { + "type": "function", + "file": "commit.h", + "line": 55, + "lineto": 56, + "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\n\t\tan 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, given a prefix of its\n identifier (short id).

\n", + "comments": "

The returned object should be released with git_commit_free when no\n longer needed.

\n", + "group": "commit" + }, + "git_commit_free": { + "type": "function", + "file": "commit.h", + "line": 70, + "lineto": 70, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to close" + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open commit

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a commit. Failure to do so will cause a memory leak.

\n", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_free-8", + "ex/v0.23.2/general.html#git_commit_free-9", + "ex/v0.23.2/general.html#git_commit_free-10", + "ex/v0.23.2/general.html#git_commit_free-11" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_free-2", + "ex/v0.23.2/log.html#git_commit_free-3", + "ex/v0.23.2/log.html#git_commit_free-4", + "ex/v0.23.2/log.html#git_commit_free-5" + ] + } + }, + "git_commit_id": { + "type": "function", + "file": "commit.h", + "line": 78, + "lineto": 78, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_oid *", + "comment": " object identity for the commit." + }, + "description": "

Get the id of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_id-12" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_id-6" + ] + } + }, + "git_commit_owner": { + "type": "function", + "file": "commit.h", + "line": 86, + "lineto": 86, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "A previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this commit." + }, + "description": "

Get the repository that contains the commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_commit_owner-7", + "ex/v0.23.2/log.html#git_commit_owner-8" + ] + } + }, + "git_commit_message_encoding": { + "type": "function", + "file": "commit.h", + "line": 98, + "lineto": 98, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " NULL, or the encoding" + }, + "description": "

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n", + "comments": "

The encoding may be NULL if the encoding header\n in the commit is missing; in that case UTF-8 is assumed.

\n", + "group": "commit" + }, + "git_commit_message": { + "type": "function", + "file": "commit.h", + "line": 109, + "lineto": 109, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the message of a commit" + }, + "description": "

Get the full message of a commit.

\n", + "comments": "

The returned message will be slightly prettified by removing any\n potential leading newlines.

\n", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_message-3", + "ex/v0.23.2/cat-file.html#git_commit_message-4" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_commit_message-13", + "ex/v0.23.2/general.html#git_commit_message-14", + "ex/v0.23.2/general.html#git_commit_message-15" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_message-9", + "ex/v0.23.2/log.html#git_commit_message-10" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_commit_message-2" + ] + } + }, + "git_commit_message_raw": { + "type": "function", + "file": "commit.h", + "line": 117, + "lineto": 117, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the raw message of a commit" + }, + "description": "

Get the full raw message of a commit.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_summary": { + "type": "function", + "file": "commit.h", + "line": 128, + "lineto": 128, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { + "type": "const char *", + "comment": " the summary of a commit or NULL on error" + }, + "description": "

Get the short "summary" of the git commit message.

\n", + "comments": "

The returned message is the summary of the commit, comprising the\n first paragraph of the message with whitespace trimmed and squashed.

\n", + "group": "commit" + }, + "git_commit_time": { + "type": "function", + "file": "commit.h", + "line": 136, + "lineto": 136, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const 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.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_time-16", + "ex/v0.23.2/general.html#git_commit_time-17" + ] + } + }, + "git_commit_time_offset": { + "type": "function", + "file": "commit.h", + "line": 144, + "lineto": 144, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const 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.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_committer": { + "type": "function", + "file": "commit.h", + "line": 152, + "lineto": 152, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_signature *", + "comment": " the committer of a commit" + }, + "description": "

Get the committer of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_committer-5" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_commit_committer-18" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_committer-11" + ] + } + }, + "git_commit_author": { + "type": "function", + "file": "commit.h", + "line": 160, + "lineto": 160, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const git_signature *", + "comment": " the author of a commit" + }, + "description": "

Get the author of a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_author-6" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_commit_author-19", + "ex/v0.23.2/general.html#git_commit_author-20" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_author-12", + "ex/v0.23.2/log.html#git_commit_author-13" + ] + } + }, + "git_commit_raw_header": { + "type": "function", + "file": "commit.h", + "line": 168, + "lineto": 168, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit" + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "const char *", + "comment": " the header text of the commit" + }, + "description": "

Get the full raw text of the commit header.

\n", + "comments": "", + "group": "commit" + }, + "git_commit_tree": { + "type": "function", + "file": "commit.h", + "line": 177, + "lineto": 177, + "args": [ + { + "name": "tree_out", + "type": "git_tree **", + "comment": "pointer where to store the tree object" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_tree **tree_out, const git_commit *commit", + "sig": "git_tree **::const git_commit *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the tree pointed to by a commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_commit_tree-14", + "ex/v0.23.2/log.html#git_commit_tree-15", + "ex/v0.23.2/log.html#git_commit_tree-16", + "ex/v0.23.2/log.html#git_commit_tree-17", + "ex/v0.23.2/log.html#git_commit_tree-18" + ] + } + }, + "git_commit_tree_id": { + "type": "function", + "file": "commit.h", + "line": 187, + "lineto": 187, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const 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\n from the ODB.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_tree_id-7" + ] + } + }, + "git_commit_parentcount": { + "type": "function", + "file": "commit.h", + "line": 195, + "lineto": 195, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "const git_commit *commit", + "sig": "const git_commit *", + "return": { + "type": "unsigned int", + "comment": " integer of count of parents" + }, + "description": "

Get the number of parents of this commit

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_parentcount-8" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_commit_parentcount-21" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_parentcount-19", + "ex/v0.23.2/log.html#git_commit_parentcount-20" + ] + } + }, + "git_commit_parent": { + "type": "function", + "file": "commit.h", + "line": 205, + "lineto": 208, + "args": [ + { + "name": "out", + "type": "git_commit **", + "comment": "Pointer where to store the parent commit" + }, + { + "name": "commit", + "type": "const 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 **out, const git_commit *commit, unsigned int n", + "sig": "git_commit **::const git_commit *::unsigned int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the specified parent of the commit.

\n", + "comments": "", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_parent-22" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_parent-21", + "ex/v0.23.2/log.html#git_commit_parent-22" + ] + } + }, + "git_commit_parent_id": { + "type": "function", + "file": "commit.h", + "line": 219, + "lineto": 221, + "args": [ + { + "name": "commit", + "type": "const git_commit *", + "comment": "a previously loaded commit." + }, + { + "name": "n", + "type": "unsigned int", + "comment": "the position of the parent (from 0 to `parentcount`)" + } + ], + "argline": "const git_commit *commit, unsigned int n", + "sig": "const 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\n the ODB.

\n", + "comments": "", + "group": "commit", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_commit_parent_id-9" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_commit_parent_id-23" + ] + } + }, + "git_commit_nth_gen_ancestor": { + "type": "function", + "file": "commit.h", + "line": 237, + "lineto": 240, + "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, const git_commit *commit, unsigned int n", + "sig": "git_commit **::const git_commit *::unsigned int", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND if no matching ancestor exists\n or an error code" + }, + "description": "

Get the commit object that is the \n<n

\n\n
\n

th generation ancestor\n of the named commit object, following only the first parents.\n The returned commit has to be freed by the caller.

\n
\n", + "comments": "

Passing 0 as the generation number returns another instance of the\n base commit itself.

\n", + "group": "commit" + }, + "git_commit_header_field": { + "type": "function", + "file": "commit.h", + "line": 251, + "lineto": 251, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer to fill" + }, + { + "name": "commit", + "type": "const git_commit *", + "comment": "the commit to look in" + }, + { + "name": "field", + "type": "const char *", + "comment": "the header field to return" + } + ], + "argline": "git_buf *out, const git_commit *commit, const char *field", + "sig": "git_buf *::const git_commit *::const char *", + "return": { + "type": "int", + "comment": " 0 on succeess, GIT_ENOTFOUND if the field does not exist,\n or an error code" + }, + "description": "

Get an arbitrary header field

\n", + "comments": "", + "group": "commit" + }, + "git_commit_create": { + "type": "function", + "file": "commit.h", + "line": 297, + "lineto": 307, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which 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\n\twill be updated to point to this commit. If the reference\n\tis not direct, it will be resolved to a direct reference.\n\tUse \"HEAD\" to update the HEAD of the current branch and\n\tmake it point to this commit. If the reference doesn't\n\texist yet, it will be created. If it does exist, the first\n\tparent must be the tip of this branch." + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "Signature with author and author time of commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "Signature with committer and * commit time of commit" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the\n commit, represented with a standard encoding name.\n E.g. \"UTF-8\". If NULL, no encoding header is written and\n UTF-8 is assumed." + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this commit" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "An instance of a `git_tree` object that will\n be used as the tree for the commit. This tree object must\n also be owned by the given `repo`." + }, + { + "name": "parent_count", + "type": "size_t", + "comment": "Number of parents for this commit" + }, + { + "name": "parents", + "type": "const git_commit *[]", + "comment": "Array of `parent_count` pointers to `git_commit`\n objects that will be used as the parents for this commit. This\n array may be NULL if `parent_count` is 0 (root commit). All the\n given commits must be owned by the `repo`." + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count, const git_commit *[] parents", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t::const git_commit *[]", + "return": { + "type": "int", + "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" + }, + "description": "

Create new commit in the repository from a list of git_object pointers

\n", + "comments": "

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n", + "group": "commit" + }, + "git_commit_create_v": { + "type": "function", + "file": "commit.h", + "line": 323, + "lineto": 333, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "update_ref", + "type": "const char *", + "comment": null + }, + { + "name": "author", + "type": "const git_signature *", + "comment": null + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": null + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": null + }, + { + "name": "message", + "type": "const char *", + "comment": null + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": null + }, + { + "name": "parent_count", + "type": "size_t", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree, size_t parent_count", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *::size_t", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create new commit in the repository using a variable argument list.

\n", + "comments": "

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers\n to const git_commit *. Note that this is a convenience method which may\n not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n", + "group": "commit", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_commit_create_v-23" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_commit_create_v-1" + ] + } + }, + "git_commit_amend": { + "type": "function", + "file": "commit.h", + "line": 356, + "lineto": 364, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "commit_to_amend", + "type": "const git_commit *", + "comment": null + }, + { + "name": "update_ref", + "type": "const char *", + "comment": null + }, + { + "name": "author", + "type": "const git_signature *", + "comment": null + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": null + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": null + }, + { + "name": "message", + "type": "const char *", + "comment": null + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": null + } + ], + "argline": "git_oid *id, const git_commit *commit_to_amend, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_tree *tree", + "sig": "git_oid *::const git_commit *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_tree *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Amend an existing commit by replacing only non-NULL values.

\n", + "comments": "

This creates a new commit that is exactly the same as the old commit,\n except that any non-NULL values will be updated. The new commit has\n the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(),\n updating the ref to point to the newly rewritten commit. If you want\n to amend a commit that is not currently the tip of the branch and then\n rewrite the following commits to reach a ref, pass this as NULL and\n update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message,\n message_encoding, and tree parameters can be NULL in which case this\n will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n", + "group": "commit" + }, + "git_libgit2_version": { + "type": "function", + "file": "common.h", + "line": 94, + "lineto": 94, + "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", + "comment": null + }, + "description": "

Return the version of the libgit2 library\n being currently used.

\n", + "comments": "", + "group": "libgit2" + }, + "git_libgit2_features": { + "type": "function", + "file": "common.h", + "line": 124, + "lineto": 124, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " A combination of GIT_FEATURE_* values." + }, + "description": "

Query compile time options for libgit2.

\n", + "comments": "
    \n
  • GIT_FEATURE_THREADS\nLibgit2 was compiled with thread support. Note that thread support is\nstill to be seen as a 'work in progress' - basic object lookups are\nbelieved to be threadsafe, but other operations may not be.

  • \n
  • GIT_FEATURE_HTTPS\nLibgit2 supports the https:// protocol. This requires the openssl\nlibrary to be found when compiling libgit2.

  • \n
  • GIT_FEATURE_SSH\nLibgit2 supports the SSH protocol for network operations. This requires\nthe libssh2 library to be found when compiling libgit2

  • \n
\n", + "group": "libgit2" + }, + "git_libgit2_opts": { + "type": "function", + "file": "common.h", + "line": 245, + "lineto": 245, + "args": [ + { + "name": "option", + "type": "int", + "comment": "Option key" + } + ], + "argline": "int option", + "sig": "int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set or query a library global option

\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time\n    by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must\n    > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, or\n    > `GIT_CONFIG_LEVEL_XDG`.  The search path is written to the `out`\n    > buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path\n    > applied to shared attributes and ignore files, too.\n    >\n    > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.\n    >   Pass NULL to reset to the default (generally based on environment\n    >   variables).  Use magic path `$PATH` to include the old value\n    >   of the path (if you want to prepend or append, for instance).\n    >\n    > - `level` must be GIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_GLOBAL,\n    >   or GIT_CONFIG_LEVEL_XDG.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be\n    > considered eligible for caching in memory.  Setting to value to\n    > zero means that that type of object will not be cached.\n    > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k\n    > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory\n    > across all repositories before libgit2 starts evicting objects\n    > from the cache.  This is a soft limit, in that the library might\n    > briefly exceed it, but will start aggressively evicting objects\n    > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.\n    >\n    > Because caches are repository-specific, disabling the cache\n    > cannot immediately clear all cached objects, but each cache will\n    > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be\n    > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.\n    > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.\n    >\n    > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.\n    >\n    > - `file` is the location of a file containing several\n    >   certificates concatenated together.\n    > - `path` is the location of a directory holding several\n    >   certificates, one per file.\n    >\n    > Either parameter may be `NULL`, but not both.\n
\n", + "group": "libgit2" + }, + "git_config_entry_free": { + "type": "function", + "file": "config.h", + "line": 72, + "lineto": 72, + "args": [ + { + "name": "", + "type": "git_config_entry *", + "comment": null + } + ], + "argline": "git_config_entry *", + "sig": "git_config_entry *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a config entry

\n", + "comments": "", + "group": "config" + }, + "git_config_find_global": { + "type": "function", + "file": "config.h", + "line": 113, + "lineto": 113, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a global configuration file has been found. Its path will be stored in `out`." + }, + "description": "

Locate the path to the global configuration file

\n", + "comments": "

The user or global configuration file is usually\n located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n global configuration file.

\n\n

This method will not guess the path to the xdg compatible\n config file (.config/git/config).

\n", + "group": "config" + }, + "git_config_find_xdg": { + "type": "function", + "file": "config.h", + "line": 130, + "lineto": 130, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a xdg compatible configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the global xdg compatible configuration file

\n", + "comments": "

The xdg compatible configuration file is usually\n located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n xdg compatible configuration file.

\n", + "group": "config" + }, + "git_config_find_system": { + "type": "function", + "file": "config.h", + "line": 142, + "lineto": 142, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the system configuration file

\n", + "comments": "

If /etc/gitconfig doesn't exist, it will look for\n %PROGRAMFILES%

\n\n

.

\n", + "group": "config" + }, + "git_config_open_default": { + "type": "function", + "file": "config.h", + "line": 154, + "lineto": 154, + "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

\n", + "comments": "

Utility wrapper that finds the global, XDG and system configuration files\n and opens them into a single prioritized config object that can be\n used when accessing default config data outside a repository.

\n", + "group": "config" + }, + "git_config_new": { + "type": "function", + "file": "config.h", + "line": 165, + "lineto": 165, + "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

\n", + "comments": "

This object is empty, so you have to add a file to it before you\n can do anything with it.

\n", + "group": "config" + }, + "git_config_add_file_ondisk": { + "type": "function", + "file": "config.h", + "line": 192, + "lineto": 196, + "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 to add" + }, + { + "name": "level", + "type": "git_config_level_t", + "comment": "the priority level of the backend" + }, + { + "name": "force", + "type": "int", + "comment": "replace config file at the given priority level" + } + ], + "argline": "git_config *cfg, const char *path, git_config_level_t level, int force", + "sig": "git_config *::const char *::git_config_level_t::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code" + }, + "description": "

Add an on-disk config file instance to an existing config

\n", + "comments": "

The on-disk file pointed at by path will be opened and\n parsed; it's expected to be a native Git config file following\n the default Git config syntax (see man git-config).

\n\n

If the file does not exist, the file will still be added and it\n will be created the first time we write to it.

\n\n

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n", + "group": "config" + }, + "git_config_open_ondisk": { + "type": "function", + "file": "config.h", + "line": 210, + "lineto": 210, + "args": [ + { + "name": "out", + "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 **out, const char *path", + "sig": "git_config **::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Create a new config instance containing a single on-disk file

\n", + "comments": "

This method is a simple utility wrapper for the following sequence\n of calls:\n - git_config_new\n - git_config_add_file_ondisk

\n", + "group": "config", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_config_open_ondisk-24" + ] + } + }, + "git_config_open_level": { + "type": "function", + "file": "config.h", + "line": 228, + "lineto": 231, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "The configuration instance to create" + }, + { + "name": "parent", + "type": "const git_config *", + "comment": "Multi-level config to search for the given level" + }, + { + "name": "level", + "type": "git_config_level_t", + "comment": "Configuration level to search for" + } + ], + "argline": "git_config **out, const git_config *parent, git_config_level_t level", + "sig": "git_config **::const git_config *::git_config_level_t", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the passed level cannot be found in the\n multi-level parent config, or an error code" + }, + "description": "

Build a single-level focused config object from a multi-level one.

\n", + "comments": "

The returned config object can be used to perform get/set/delete operations\n on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config\n will return different config instances, but containing the same config_file\n instance.

\n", + "group": "config" + }, + "git_config_open_global": { + "type": "function", + "file": "config.h", + "line": 245, + "lineto": 245, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "pointer in which to store the config object" + }, + { + "name": "config", + "type": "git_config *", + "comment": "the config object in which to look" + } + ], + "argline": "git_config **out, git_config *config", + "sig": "git_config **::git_config *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Open the global/XDG configuration file according to git's rules

\n", + "comments": "

Git allows you to store your global configuration at\n $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards\n compatability, the XDG file shouldn't be used unless the use has\n created it explicitly. With this function you'll open the correct\n one to write to.

\n", + "group": "config" + }, + "git_config_snapshot": { + "type": "function", + "file": "config.h", + "line": 261, + "lineto": 261, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "pointer in which to store the snapshot config object" + }, + { + "name": "config", + "type": "git_config *", + "comment": "configuration to snapshot" + } + ], + "argline": "git_config **out, git_config *config", + "sig": "git_config **::git_config *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a snapshot of the configuration

\n", + "comments": "

Create a snapshot of the current state of a configuration, which\n allows you to look into a consistent view of the configuration for\n looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid\n until it is freed.

\n", + "group": "config" + }, + "git_config_free": { + "type": "function", + "file": "config.h", + "line": 268, + "lineto": 268, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to free" + } + ], + "argline": "git_config *cfg", + "sig": "git_config *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the configuration and its associated memory and files

\n", + "comments": "", + "group": "config" + }, + "git_config_get_entry": { + "type": "function", + "file": "config.h", + "line": 280, + "lineto": 283, + "args": [ + { + "name": "out", + "type": "git_config_entry **", + "comment": "pointer to the variable git_config_entry" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_config_entry **out, const git_config *cfg, const char *name", + "sig": "git_config_entry **::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the git_config_entry of a config variable.

\n", + "comments": "

Free the git_config_entry after use with git_config_entry_free().

\n", + "group": "config" + }, + "git_config_get_int32": { + "type": "function", + "file": "config.h", + "line": 297, + "lineto": 297, + "args": [ + { + "name": "out", + "type": "int32_t *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int32_t *out, const git_config *cfg, const char *name", + "sig": "int32_t *::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of an integer config variable.

\n", + "comments": "

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_config_get_int32-25" + ] + } + }, + "git_config_get_int64": { + "type": "function", + "file": "config.h", + "line": 311, + "lineto": 311, + "args": [ + { + "name": "out", + "type": "int64_t *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int64_t *out, const git_config *cfg, const char *name", + "sig": "int64_t *::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of a long integer config variable.

\n", + "comments": "

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_bool": { + "type": "function", + "file": "config.h", + "line": 328, + "lineto": 328, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "pointer to the variable where the value should be stored" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "int *out, const git_config *cfg, const char *name", + "sig": "int *::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of a boolean config variable.

\n", + "comments": "

This function uses the usual C convention of 0 being false and\n anything else true.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_path": { + "type": "function", + "file": "config.h", + "line": 346, + "lineto": 346, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffer in which to store the result" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_buf *out, const git_config *cfg, const char *name", + "sig": "git_buf *::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of a path config variable.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_string": { + "type": "function", + "file": "config.h", + "line": 364, + "lineto": 364, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "pointer to the string" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "const char **out, const git_config *cfg, const char *name", + "sig": "const char **::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of a string config variable.

\n", + "comments": "

This function can only be used on snapshot config objects. The\n string is owned by the config and should not be freed by the\n user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_config_get_string-26" + ] + } + }, + "git_config_get_string_buf": { + "type": "function", + "file": "config.h", + "line": 380, + "lineto": 380, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer in which to store the string" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to look for the variable" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + } + ], + "argline": "git_buf *out, const git_config *cfg, const char *name", + "sig": "git_buf *::const git_config *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the value of a string config variable.

\n", + "comments": "

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "group": "config" + }, + "git_config_get_multivar_foreach": { + "type": "function", + "file": "config.h", + "line": 394, + "lineto": 394, + "args": [ + { + "name": "cfg", + "type": "const 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\n interested in. Use NULL to indicate all" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to be called on each value of the variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "opaque pointer to pass to the callback" + } + ], + "argline": "const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::const char *::const char *::git_config_foreach_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get each value of a multivar in a foreach callback

\n", + "comments": "

The callback will be called on each variable found

\n", + "group": "config" + }, + "git_config_multivar_iterator_new": { + "type": "function", + "file": "config.h", + "line": 405, + "lineto": 405, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const 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\n interested in. Use NULL to indicate all" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp", + "sig": "git_config_iterator **::const git_config *::const char *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get each value of a multivar

\n", + "comments": "", + "group": "config" + }, + "git_config_next": { + "type": "function", + "file": "config.h", + "line": 417, + "lineto": 417, + "args": [ + { + "name": "entry", + "type": "git_config_entry **", + "comment": "pointer to store the entry" + }, + { + "name": "iter", + "type": "git_config_iterator *", + "comment": "the iterator" + } + ], + "argline": "git_config_entry **entry, git_config_iterator *iter", + "sig": "git_config_entry **::git_config_iterator *", + "return": { + "type": "int", + "comment": " 0 or an error code. GIT_ITEROVER if the iteration has completed" + }, + "description": "

Return the current entry and advance the iterator

\n", + "comments": "

The pointers returned by this function are valid until the iterator\n is freed.

\n", + "group": "config" + }, + "git_config_iterator_free": { + "type": "function", + "file": "config.h", + "line": 424, + "lineto": 424, + "args": [ + { + "name": "iter", + "type": "git_config_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_config_iterator *iter", + "sig": "git_config_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a config iterator

\n", + "comments": "", + "group": "config" + }, + "git_config_set_int32": { + "type": "function", + "file": "config.h", + "line": 435, + "lineto": 435, + "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\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_int64": { + "type": "function", + "file": "config.h", + "line": 446, + "lineto": 446, + "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\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_bool": { + "type": "function", + "file": "config.h", + "line": 457, + "lineto": 457, + "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\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_set_string": { + "type": "function", + "file": "config.h", + "line": 471, + "lineto": 471, + "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\n with the highest level (usually the local one).

\n", + "comments": "

A copy of the string is made and the user is free to use it\n afterwards.

\n", + "group": "config" + }, + "git_config_set_multivar": { + "type": "function", + "file": "config.h", + "line": 481, + "lineto": 481, + "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", + "comment": null + }, + "description": "

Set a multivar in the local config file.

\n", + "comments": "", + "group": "config" + }, + "git_config_delete_entry": { + "type": "function", + "file": "config.h", + "line": 490, + "lineto": 490, + "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", + "comment": null + }, + "description": "

Delete a config variable from the config file\n with the highest level (usually the local one).

\n", + "comments": "", + "group": "config" + }, + "git_config_delete_multivar": { + "type": "function", + "file": "config.h", + "line": 501, + "lineto": 501, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "where to look for the variables" + }, + { + "name": "name", + "type": "const char *", + "comment": "the variable's name" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "a regular expression to indicate which values to delete" + } + ], + "argline": "git_config *cfg, const char *name, const char *regexp", + "sig": "git_config *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Deletes one or several entries from a multivar in the local config file.

\n", + "comments": "", + "group": "config" + }, + "git_config_foreach": { + "type": "function", + "file": "config.h", + "line": 519, + "lineto": 522, + "args": [ + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to get the variables from" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "const git_config *cfg, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::git_config_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform an operation on each config variable.

\n", + "comments": "

The callback receives the normalized name and value of each variable\n in the config backend, and the data pointer passed to this function.\n If the callback returns a non-zero value, the function stops iterating\n and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n", + "group": "config" + }, + "git_config_iterator_new": { + "type": "function", + "file": "config.h", + "line": 533, + "lineto": 533, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to ge the variables from" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg", + "sig": "git_config_iterator **::const git_config *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Iterate over all the config variables

\n", + "comments": "

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n", + "group": "config" + }, + "git_config_iterator_glob_new": { + "type": "function", + "file": "config.h", + "line": 545, + "lineto": 545, + "args": [ + { + "name": "out", + "type": "git_config_iterator **", + "comment": "pointer to store the iterator" + }, + { + "name": "cfg", + "type": "const git_config *", + "comment": "where to ge the variables from" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to match the names" + } + ], + "argline": "git_config_iterator **out, const git_config *cfg, const char *regexp", + "sig": "git_config_iterator **::const git_config *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Iterate over all the config variables whose name matches a pattern

\n", + "comments": "

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n", + "group": "config" + }, + "git_config_foreach_match": { + "type": "function", + "file": "config.h", + "line": 563, + "lineto": 567, + "args": [ + { + "name": "cfg", + "type": "const 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": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "const git_config *cfg, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "const git_config *::const char *::git_config_foreach_cb::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.

\n", + "comments": "

This behaviors like git_config_foreach with an additional filter of a\n regular expression that filters which config keys are passed to the\n callback.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n", + "group": "config" + }, + "git_config_get_mapped": { + "type": "function", + "file": "config.h", + "line": 603, + "lineto": 608, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "place to store the result of the mapping" + }, + { + "name": "cfg", + "type": "const 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": "const 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, const git_config *cfg, const char *name, const git_cvar_map *maps, size_t map_n", + "sig": "int *::const git_config *::const char *::const 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\n an integer constant.

\n", + "comments": "

This is a helper method to easily map different possible values\n to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {\n    {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},\n    {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},\n    {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},\n    {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the\n mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing\n the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison),\n the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be\n returned.

\n", + "group": "config" + }, + "git_config_lookup_map_value": { + "type": "function", + "file": "config.h", + "line": 618, + "lineto": 622, + "args": [ + { + "name": "out", + "type": "int *", + "comment": "place to store the result of the parsing" + }, + { + "name": "maps", + "type": "const 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, const git_cvar_map *maps, size_t map_n, const char *value", + "sig": "int *::const git_cvar_map *::size_t::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Maps a string value to an integer constant

\n", + "comments": "", + "group": "config" + }, + "git_config_parse_bool": { + "type": "function", + "file": "config.h", + "line": 634, + "lineto": 634, + "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", + "comment": null + }, + "description": "

Parse a string value as a bool.

\n", + "comments": "

Valid values for true are: 'true', 'yes', 'on', 1 or any\n number different from 0\n Valid values for false are: 'false', 'no', 'off', 0

\n", + "group": "config" + }, + "git_config_parse_int32": { + "type": "function", + "file": "config.h", + "line": 646, + "lineto": 646, + "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", + "comment": null + }, + "description": "

Parse a string value as an int32.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n", + "group": "config" + }, + "git_config_parse_int64": { + "type": "function", + "file": "config.h", + "line": 658, + "lineto": 658, + "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", + "comment": null + }, + "description": "

Parse a string value as an int64.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n", + "group": "config" + }, + "git_config_parse_path": { + "type": "function", + "file": "config.h", + "line": 673, + "lineto": 673, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "placae to store the result of parsing" + }, + { + "name": "value", + "type": "const char *", + "comment": "the path to evaluate" + } + ], + "argline": "git_buf *out, const char *value", + "sig": "git_buf *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Parse a string value as a path.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be\n returned.

\n", + "group": "config" + }, + "git_config_backend_foreach_match": { + "type": "function", + "file": "config.h", + "line": 687, + "lineto": 691, + "args": [ + { + "name": "backend", + "type": "git_config_backend *", + "comment": "where to get the variables from" + }, + { + "name": "regexp", + "type": "const char *", + "comment": "regular expression to match against config names (can be NULL)" + }, + { + "name": "callback", + "type": "git_config_foreach_cb", + "comment": "the function to call on each variable" + }, + { + "name": "payload", + "type": "void *", + "comment": "the data to pass to the callback" + } + ], + "argline": "git_config_backend *backend, const char *regexp, git_config_foreach_cb callback, void *payload", + "sig": "git_config_backend *::const char *::git_config_foreach_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n", + "comments": "

This behaviors like git_config_foreach_match except instead of all config\n entries it just enumerates through the given backend entry.

\n", + "group": "config" + }, + "git_cred_userpass": { + "type": "function", + "file": "cred_helpers.h", + "line": 43, + "lineto": 48, + "args": [ + { + "name": "cred", + "type": "git_cred **", + "comment": "The newly created credential object." + }, + { + "name": "url", + "type": "const char *", + "comment": "The resource for which we are demanding a credential." + }, + { + "name": "user_from_url", + "type": "const char *", + "comment": "The username that was embedded in a \"user\n@\nhost\"\n remote url, or NULL if not included." + }, + { + "name": "allowed_types", + "type": "unsigned int", + "comment": "A bitmask stating which cred types are OK to return." + }, + { + "name": "payload", + "type": "void *", + "comment": "The payload provided when specifying this callback. (This is\n interpreted as a `git_cred_userpass_payload*`.)" + } + ], + "argline": "git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload", + "sig": "git_cred **::const char *::const char *::unsigned int::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Stock callback usable as a git_cred_acquire_cb. This calls\n git_cred_userpass_plaintext_new unless the protocol has not specified\n GIT_CREDTYPE_USERPASS_PLAINTEXT as an allowed type.

\n", + "comments": "", + "group": "cred" + }, + "git_describe_commit": { + "type": "function", + "file": "describe.h", + "line": 120, + "lineto": 123, + "args": [ + { + "name": "result", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." + }, + { + "name": "committish", + "type": "git_object *", + "comment": "a committish to describe" + }, + { + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options" + } + ], + "argline": "git_describe_result **result, git_object *committish, git_describe_options *opts", + "sig": "git_describe_result **::git_object *::git_describe_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the given committish object.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/v0.23.2/describe.html#git_describe_commit-1" + ] + } + }, + "git_describe_workdir": { + "type": "function", + "file": "describe.h", + "line": 137, + "lineto": 140, + "args": [ + { + "name": "out", + "type": "git_describe_result **", + "comment": "pointer to store the result. You must free this once\n you're done with it." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the describe" + }, + { + "name": "opts", + "type": "git_describe_options *", + "comment": "the lookup options" + } + ], + "argline": "git_describe_result **out, git_repository *repo, git_describe_options *opts", + "sig": "git_describe_result **::git_repository *::git_describe_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Describe a commit

\n", + "comments": "

Perform the describe operation on the current commit and the\n worktree. After peforming describe on HEAD, a status is run and the\n description is considered to be dirty if there are.

\n", + "group": "describe", + "examples": { + "describe.c": [ + "ex/v0.23.2/describe.html#git_describe_workdir-2" + ] + } + }, + "git_describe_format": { + "type": "function", + "file": "describe.h", + "line": 150, + "lineto": 153, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The buffer to store the result" + }, + { + "name": "result", + "type": "const git_describe_result *", + "comment": "the result from `git_describe_commit()` or\n `git_describe_workdir()`." + }, + { + "name": "opts", + "type": "const git_describe_format_options *", + "comment": "the formatting options" + } + ], + "argline": "git_buf *out, const git_describe_result *result, const git_describe_format_options *opts", + "sig": "git_buf *::const git_describe_result *::const git_describe_format_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Print the describe result to a buffer

\n", + "comments": "", + "group": "describe", + "examples": { + "describe.c": [ + "ex/v0.23.2/describe.html#git_describe_format-3" + ] + } + }, + "git_describe_result_free": { + "type": "function", + "file": "describe.h", + "line": 158, + "lineto": 158, + "args": [ + { + "name": "result", + "type": "git_describe_result *", + "comment": null + } + ], + "argline": "git_describe_result *result", + "sig": "git_describe_result *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the describe result.

\n", + "comments": "", + "group": "describe" + }, + "git_diff_init_options": { + "type": "function", + "file": "diff.h", + "line": 412, + "lineto": 414, + "args": [ + { + "name": "opts", + "type": "git_diff_options *", + "comment": "The `git_diff_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`" + } + ], + "argline": "git_diff_options *opts, unsigned int version", + "sig": "git_diff_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_diff_options with default values. Equivalent to\n creating an instance with GIT_DIFF_OPTIONS_INIT.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_find_init_options": { + "type": "function", + "file": "diff.h", + "line": 697, + "lineto": 699, + "args": [ + { + "name": "opts", + "type": "git_diff_find_options *", + "comment": "The `git_diff_find_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`" + } + ], + "argline": "git_diff_find_options *opts, unsigned int version", + "sig": "git_diff_find_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_diff_find_options with default values. Equivalent to\n creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_free": { + "type": "function", + "file": "diff.h", + "line": 713, + "lineto": 713, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "The previously created diff; cannot be used after free." + } + ], + "argline": "git_diff *diff", + "sig": "git_diff *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Deallocate a diff.

\n", + "comments": "", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_free-2" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_diff_free-24", + "ex/v0.23.2/log.html#git_diff_free-25" + ] + } + }, + "git_diff_tree_to_tree": { + "type": "function", + "file": "diff.h", + "line": 731, + "lineto": 736, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the trees." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "new_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff to, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_tree *new_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_tree *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff with the difference between two tree objects.

\n", + "comments": "

This is equivalent to git diff \n<old\n-tree> \n<new\n-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the\n second tree will be used for the "new_file" side of the delta. You can\n pass NULL to indicate an empty tree, although it is an error to pass\n NULL for both the old_tree and new_tree.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_tree_to_tree-3" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_diff_tree_to_tree-26", + "ex/v0.23.2/log.html#git_diff_tree_to_tree-27" + ] + } + }, + "git_diff_tree_to_index": { + "type": "function", + "file": "diff.h", + "line": 757, + "lineto": 762, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree and index." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to diff with; repo index used if NULL." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::git_index *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff between a tree and repository index.

\n", + "comments": "

This is equivalent to `git diff --cached \n<treeish

\n\n
\n

or if you pass\n the HEAD tree, then likegit diff --cached`.

\n
\n\n

The tree you pass will be used for the "old_file" side of the delta, and\n the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_tree_to_index-4" + ] + } + }, + "git_diff_index_to_workdir": { + "type": "function", + "file": "diff.h", + "line": 784, + "lineto": 788, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository." + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to diff from; repo index used if NULL." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_index *index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff between the repository index and the workdir directory.

\n", + "comments": "

This matches the git diff command. See the note below on\n git_diff_tree_to_workdir for a discussion of the difference between\n git diff and git diff HEAD and how to emulate a `git diff \n<treeish

\n\n
\n

`\n using libgit2.

\n
\n\n

The index will be used for the "old_file" side of the delta, and the\n working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_index_to_workdir-5" + ] + } + }, + "git_diff_tree_to_workdir": { + "type": "function", + "file": "diff.h", + "line": 813, + "lineto": 817, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff between a tree and the working directory.

\n", + "comments": "

The tree you provide will be used for the "old_file" side of the delta,\n and the working directory will be used for the "new_file" side.

\n\n

This is not the same as `git diff \n<treeish

\n\n
\n

orgit diff-index

\n
\n\n

<treeish

\n\n
\n

. Those commands use information from the index, whereas this\n function strictly returns the differences between the tree and the files\n in the working directory, regardless of the state of the index. Use\ngit_diff_tree_to_workdir_with_index` to emulate those commands.

\n
\n\n

To see difference between this and git_diff_tree_to_workdir_with_index,\n consider the example of a staged file deletion where the file has then\n been put back into the working dir and further modified. The\n tree-to-workdir diff for that file is 'modified', but git diff would\n show status 'deleted' since there is a staged delete.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_tree_to_workdir-6" + ] + } + }, + "git_diff_tree_to_workdir_with_index": { + "type": "function", + "file": "diff.h", + "line": 832, + "lineto": 836, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "A pointer to a git_diff pointer that will be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the tree." + }, + { + "name": "old_tree", + "type": "git_tree *", + "comment": "A git_tree object to diff from, or NULL for empty tree." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_tree *old_tree, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_tree *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n", + "comments": "

This emulates `git diff \n<tree

\n\n
\n

` by diffing the tree to the index and\n the index to the working directory and blending the results into a\n single diff that includes staged deleted, etc.

\n
\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_tree_to_workdir_with_index-7" + ] + } + }, + "git_diff_merge": { + "type": "function", + "file": "diff.h", + "line": 851, + "lineto": 853, + "args": [ + { + "name": "onto", + "type": "git_diff *", + "comment": "Diff to merge into." + }, + { + "name": "from", + "type": "const git_diff *", + "comment": "Diff to merge." + } + ], + "argline": "git_diff *onto, const git_diff *from", + "sig": "git_diff *::const git_diff *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Merge one diff into another.

\n", + "comments": "

This merges items from the "from" list into the "onto" list. The\n resulting diff will have all items that appear in either list.\n If an item appears in both lists, then it will be "merged" to appear\n as if the old version was from the "onto" list and the new version\n is from the "from" list (with the exception that if the item has a\n pending DELETE in the middle, then it will show as deleted).

\n", + "group": "diff" + }, + "git_diff_find_similar": { + "type": "function", + "file": "diff.h", + "line": 867, + "lineto": 869, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "diff to run detection algorithms on" + }, + { + "name": "options", + "type": "const git_diff_find_options *", + "comment": "Control how detection should be run, NULL for defaults" + } + ], + "argline": "git_diff *diff, const git_diff_find_options *options", + "sig": "git_diff *::const git_diff_find_options *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on failure" + }, + "description": "

Transform a diff marking file renames, copies, etc.

\n", + "comments": "

This modifies a diff in place, replacing old entries that look\n like renames or copies with new entries reflecting those changes.\n This also will, if requested, break modified files into add/remove\n pairs if the amount of change is above a threshold.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_find_similar-8" + ] + } + }, + "git_diff_num_deltas": { + "type": "function", + "file": "diff.h", + "line": 887, + "lineto": 887, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" + } + ], + "argline": "const git_diff *diff", + "sig": "const git_diff *", + "return": { + "type": "size_t", + "comment": " Count of number of deltas in the list" + }, + "description": "

Query how many diff records are there in a diff.

\n", + "comments": "", + "group": "diff", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_diff_num_deltas-28" + ] + } + }, + "git_diff_num_deltas_of_type": { + "type": "function", + "file": "diff.h", + "line": 900, + "lineto": 901, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "A git_diff generated by one of the above functions" + }, + { + "name": "type", + "type": "git_delta_t", + "comment": "A git_delta_t value to filter the count" + } + ], + "argline": "const git_diff *diff, git_delta_t type", + "sig": "const git_diff *::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 filtered by type.

\n", + "comments": "

This works just like git_diff_entrycount() with an extra parameter\n that is a git_delta_t and returns just the count of how many deltas\n match that particular type.

\n", + "group": "diff" + }, + "git_diff_get_delta": { + "type": "function", + "file": "diff.h", + "line": 920, + "lineto": 921, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "Diff list object" + }, + { + "name": "idx", + "type": "size_t", + "comment": "Index into diff list" + } + ], + "argline": "const git_diff *diff, size_t idx", + "sig": "const git_diff *::size_t", + "return": { + "type": "const git_diff_delta *", + "comment": " Pointer to git_diff_delta (or NULL if `idx` out of range)" + }, + "description": "

Return the diff delta for an entry in the diff list.

\n", + "comments": "

The git_diff_delta pointer points to internal data and you do not\n have to release it when you are done with it. It will go away when\n the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary\n content or not may not be set if there are no attributes set for the\n file and there has been no reason to load the file data at this point.\n For now, if you need those flags to be up to date, your only option is\n to either use git_diff_foreach or create a git_patch.

\n", + "group": "diff" + }, + "git_diff_is_sorted_icase": { + "type": "function", + "file": "diff.h", + "line": 929, + "lineto": 929, + "args": [ + { + "name": "diff", + "type": "const git_diff *", + "comment": "diff to check" + } + ], + "argline": "const git_diff *diff", + "sig": "const git_diff *", + "return": { + "type": "int", + "comment": " 0 if case sensitive, 1 if case is ignored" + }, + "description": "

Check if deltas are sorted case sensitively or insensitively.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_foreach": { + "type": "function", + "file": "diff.h", + "line": 957, + "lineto": 963, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback function to make per file in the diff." + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Optional callback to make for binary files." + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Optional callback to make per hunk of text diff. This\n callback is called to describe a range of lines in the\n diff. It will not be issued for binary files." + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Optional callback to make per line of diff text. This\n same callback will be made for context lines, added, and\n removed lines, and even for a deleted trailing newline." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." + } + ], + "argline": "git_diff *diff, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "git_diff *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all deltas in a diff issuing callbacks.

\n", + "comments": "

This will iterate through all of the files described in a diff. You\n should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the\n files will only be calculated if they are not NULL. Of course, these\n callbacks will not be invoked for binary files on the diff or for\n files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate\n the iteration and return the value to the user.

\n", + "group": "diff" + }, + "git_diff_status_char": { + "type": "function", + "file": "diff.h", + "line": 976, + "lineto": 976, + "args": [ + { + "name": "status", + "type": "git_delta_t", + "comment": "The git_delta_t value to look up" + } + ], + "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.

\n", + "comments": "

When you run git diff --name-status it uses single letter codes in\n the output such as 'A' for added, 'D' for deleted, 'M' for modified,\n etc. This function converts a git_delta_t value into these letters for\n your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", + "group": "diff" + }, + "git_diff_print": { + "type": "function", + "file": "diff.h", + "line": 1001, + "lineto": 1005, + "args": [ + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_format_t", + "comment": "A git_diff_format_t value to pick the text format." + }, + { + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback to make per line of diff text." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callback." + } + ], + "argline": "git_diff *diff, git_diff_format_t format, git_diff_line_cb print_cb, void *payload", + "sig": "git_diff *::git_diff_format_t::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Iterate over a diff generating formatted text output.

\n", + "comments": "

Returning a non-zero value from the callbacks will terminate the\n iteration and return the non-zero value to the caller.

\n", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_print-9" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_diff_print-29" + ] + } + }, + "git_diff_blobs": { + "type": "function", + "file": "diff.h", + "line": 1042, + "lineto": 1052, + "args": [ + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff on two blobs.

\n", + "comments": "

Compared to a file, a blob lacks some contextual information. As such,\n the git_diff_file given to the callback will have some fake data; i.e.\n mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated\n as an empty blob, with the oid set to NULL in the git_diff_file data.\n Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob\n looks like binary data, the git_diff_delta binary attribute will be set\n to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass\n GIT_DIFF_FORCE_TEXT of course).

\n", + "group": "diff" + }, + "git_diff_blob_to_buffer": { + "type": "function", + "file": "diff.h", + "line": 1079, + "lineto": 1090, + "args": [ + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff between a blob and a buffer.

\n", + "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context,\n so the git_diff_file parameters to the callbacks will be faked a la the\n rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the\n file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the\n entire content of the buffer added). Passing NULL to the buffer will do\n the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", + "group": "diff" + }, + "git_diff_buffers": { + "type": "function", + "file": "diff.h", + "line": 1113, + "lineto": 1125, + "args": [ + { + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" + }, + { + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, + { + "name": "new_buffer", + "type": "const void *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "options", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + }, + { + "name": "file_cb", + "type": "git_diff_file_cb", + "comment": "Callback for \"file\"; made once if there is a diff; can be NULL" + }, + { + "name": "binary_cb", + "type": "git_diff_binary_cb", + "comment": "Callback for binary files; can be NULL" + }, + { + "name": "hunk_cb", + "type": "git_diff_hunk_cb", + "comment": "Callback for each hunk in diff; can be NULL" + }, + { + "name": "line_cb", + "type": "git_diff_line_cb", + "comment": "Callback for each line in diff; can be NULL" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload passed to each callback function" + } + ], + "argline": "const void *old_buffer, size_t old_len, const char *old_as_path, const void *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload", + "sig": "const void *::size_t::const char *::const void *::size_t::const char *::const git_diff_options *::git_diff_file_cb::git_diff_binary_cb::git_diff_hunk_cb::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Directly run a diff between two buffers.

\n", + "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks\n context, so the git_diff_file parameters to the callbacks will be\n faked a la the rules for git_diff_blobs().

\n", + "group": "diff" + }, + "git_diff_get_stats": { + "type": "function", + "file": "diff.h", + "line": 1161, + "lineto": 1163, + "args": [ + { + "name": "out", + "type": "git_diff_stats **", + "comment": "Structure containg the diff statistics." + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A git_diff generated by one of the above functions." + } + ], + "argline": "git_diff_stats **out, git_diff *diff", + "sig": "git_diff_stats **::git_diff *", + "return": { + "type": "int", + "comment": " 0 on success; non-zero on error" + }, + "description": "

Accumlate diff statistics for all patches.

\n", + "comments": "", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_get_stats-10" + ] + } + }, + "git_diff_stats_files_changed": { + "type": "function", + "file": "diff.h", + "line": 1171, + "lineto": 1172, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of files changed in the diff" + }, + "description": "

Get the total number of files changed in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_insertions": { + "type": "function", + "file": "diff.h", + "line": 1180, + "lineto": 1181, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of insertions in the diff" + }, + "description": "

Get the total number of insertions in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_deletions": { + "type": "function", + "file": "diff.h", + "line": 1189, + "lineto": 1190, + "args": [ + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + } + ], + "argline": "const git_diff_stats *stats", + "sig": "const git_diff_stats *", + "return": { + "type": "size_t", + "comment": " total number of deletions in the diff" + }, + "description": "

Get the total number of deletions in a diff

\n", + "comments": "", + "group": "diff" + }, + "git_diff_stats_to_buf": { + "type": "function", + "file": "diff.h", + "line": 1201, + "lineto": 1205, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the formatted diff statistics in." + }, + { + "name": "stats", + "type": "const git_diff_stats *", + "comment": "A `git_diff_stats` generated by one of the above functions." + }, + { + "name": "format", + "type": "git_diff_stats_format_t", + "comment": "Formatting option." + }, + { + "name": "width", + "type": "size_t", + "comment": "Target width for output (only affects GIT_DIFF_STATS_FULL)" + } + ], + "argline": "git_buf *out, const git_diff_stats *stats, git_diff_stats_format_t format, size_t width", + "sig": "git_buf *::const git_diff_stats *::git_diff_stats_format_t::size_t", + "return": { + "type": "int", + "comment": " 0 on success; non-zero on error" + }, + "description": "

Print diff statistics to a git_buf.

\n", + "comments": "", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_stats_to_buf-11" + ] + } + }, + "git_diff_stats_free": { + "type": "function", + "file": "diff.h", + "line": 1213, + "lineto": 1213, + "args": [ + { + "name": "stats", + "type": "git_diff_stats *", + "comment": "The previously created statistics object;\n cannot be used after free." + } + ], + "argline": "git_diff_stats *stats", + "sig": "git_diff_stats *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Deallocate a git_diff_stats.

\n", + "comments": "", + "group": "diff", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_diff_stats_free-12" + ] + } + }, + "git_diff_format_email": { + "type": "function", + "file": "diff.h", + "line": 1262, + "lineto": 1265, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the e-mail patch in" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "containing the commit" + }, + { + "name": "opts", + "type": "const git_diff_format_email_options *", + "comment": "structure with options to influence content and formatting." + } + ], + "argline": "git_buf *out, git_diff *diff, const git_diff_format_email_options *opts", + "sig": "git_buf *::git_diff *::const git_diff_format_email_options *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an e-mail ready patch from a diff.

\n", + "comments": "", + "group": "diff" + }, + "git_diff_commit_as_email": { + "type": "function", + "file": "diff.h", + "line": 1281, + "lineto": 1288, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the e-mail patch in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "containing the commit" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "pointer to up commit" + }, + { + "name": "patch_no", + "type": "size_t", + "comment": "patch number of the commit" + }, + { + "name": "total_patches", + "type": "size_t", + "comment": "total number of patches in the patch set" + }, + { + "name": "flags", + "type": "git_diff_format_email_flags_t", + "comment": "determines the formatting of the e-mail" + }, + { + "name": "diff_opts", + "type": "const git_diff_options *", + "comment": "structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_buf *out, git_repository *repo, git_commit *commit, size_t patch_no, size_t total_patches, git_diff_format_email_flags_t flags, const git_diff_options *diff_opts", + "sig": "git_buf *::git_repository *::git_commit *::size_t::size_t::git_diff_format_email_flags_t::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an e-mail ready patch for a commit.

\n", + "comments": "

Does not support creating patches for merge commits (yet).

\n", + "group": "diff" + }, + "git_diff_format_email_init_options": { + "type": "function", + "file": "diff.h", + "line": 1299, + "lineto": 1301, + "args": [ + { + "name": "opts", + "type": "git_diff_format_email_options *", + "comment": "The `git_diff_format_email_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`" + } + ], + "argline": "git_diff_format_email_options *opts, unsigned int version", + "sig": "git_diff_format_email_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_diff_format_email_options with default values.

\n", + "comments": "

Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.

\n", + "group": "diff" + }, + "giterr_last": { + "type": "function", + "file": "errors.h", + "line": 109, + "lineto": 109, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "const git_error *", + "comment": " A git_error object." + }, + "description": "

Return the last git_error object that was generated for the\n current thread or NULL if no error has occurred.

\n", + "comments": "", + "group": "giterr", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#giterr_last-27" + ], + "network/clone.c": [ + "ex/v0.23.2/network/clone.html#giterr_last-2" + ], + "network/git2.c": [ + "ex/v0.23.2/network/git2.html#giterr_last-1", + "ex/v0.23.2/network/git2.html#giterr_last-2" + ] + } + }, + "giterr_clear": { + "type": "function", + "file": "errors.h", + "line": 114, + "lineto": 114, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "void", + "comment": null + }, + "description": "

Clear the last library error that occurred for this thread.

\n", + "comments": "", + "group": "giterr" + }, + "giterr_detach": { + "type": "function", + "file": "errors.h", + "line": 126, + "lineto": 126, + "args": [ + { + "name": "cpy", + "type": "git_error *", + "comment": null + } + ], + "argline": "git_error *cpy", + "sig": "git_error *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get the last error data and clear it.

\n", + "comments": "

This copies the last error into the given git_error struct\n and returns 0 if the copy was successful, leaving the error\n cleared as if giterr_clear had been called.

\n\n

If there was no existing error in the library, -1 will be returned\n and the contents of cpy will be left unmodified.

\n", + "group": "giterr" + }, + "giterr_set_str": { + "type": "function", + "file": "errors.h", + "line": 149, + "lineto": 149, + "args": [ + { + "name": "error_class", + "type": "int", + "comment": "One of the `git_error_t` enum above describing the\n general subsystem that is responsible for the error." + }, + { + "name": "string", + "type": "const char *", + "comment": "The formatted error message to keep" + } + ], + "argline": "int error_class, const char *string", + "sig": "int::const char *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Set the error message string for this thread.

\n", + "comments": "

This function is public so that custom ODB backends and the like can\n relay an error message through libgit2. Most regular users of libgit2\n will never need to call this function -- actually, calling it in most\n circumstances (for example, calling from within a callback function)\n will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies\n to the particular thread that this libgit2 call is made from.

\n\n

NOTE: Passing the error_class as GITERR_OS has a special behavior: we\n attempt to append the system default error message for the last OS error\n that occurred and then clear the last error. The specific implementation\n of looking up and clearing this last OS error will vary by platform.

\n", + "group": "giterr" + }, + "giterr_set_oom": { + "type": "function", + "file": "errors.h", + "line": 160, + "lineto": 160, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "void", + "comment": null + }, + "description": "

Set the error message to a special value for memory allocation failure.

\n", + "comments": "

The normal giterr_set_str() function attempts to strdup() the string\n that is passed in. This is not a good idea when the error in question\n is a memory allocation failure. That circumstance has a special setter\n function that sets the error string to a known and statically allocated\n internal value.

\n", + "group": "giterr" + }, + "git_filter_list_load": { + "type": "function", + "file": "filter.h", + "line": 90, + "lineto": 96, + "args": [ + { + "name": "filters", + "type": "git_filter_list **", + "comment": "Output newly created git_filter_list (or NULL)" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object that contains `path`" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "The blob to which the filter will be applied (if known)" + }, + { + "name": "path", + "type": "const char *", + "comment": "Relative path of the file to be filtered" + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": "Filtering direction (WT->ODB or ODB->WT)" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of `git_filter_flag_t` flags" + } + ], + "argline": "git_filter_list **filters, git_repository *repo, git_blob *blob, const char *path, git_filter_mode_t mode, uint32_t flags", + "sig": "git_filter_list **::git_repository *::git_blob *::const char *::git_filter_mode_t::uint32_t", + "return": { + "type": "int", + "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" + }, + "description": "

Load the filter list for a given path.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL\n if no filters are requested for the given file.

\n", + "group": "filter" + }, + "git_filter_list_contains": { + "type": "function", + "file": "filter.h", + "line": 110, + "lineto": 112, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of the filter to query" + } + ], + "argline": "git_filter_list *filters, const char *name", + "sig": "git_filter_list *::const char *", + "return": { + "type": "int", + "comment": " 1 if the filter is in the list, 0 otherwise" + }, + "description": "

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n", + "comments": "

This will return 0 if the given filter is not in the list, or 1 if\n the filter will be applied.

\n", + "group": "filter" + }, + "git_filter_list_apply_to_data": { + "type": "function", + "file": "filter.h", + "line": 134, + "lineto": 137, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to store the result of the filtering" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A loaded git_filter_list (or NULL)" + }, + { + "name": "in", + "type": "git_buf *", + "comment": "Buffer containing the data to filter" + } + ], + "argline": "git_buf *out, git_filter_list *filters, git_buf *in", + "sig": "git_buf *::git_filter_list *::git_buf *", + "return": { + "type": "int", + "comment": " 0 on success, an error code otherwise" + }, + "description": "

Apply filter list to a data buffer.

\n", + "comments": "

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is\n not zero), then it will be overwritten when applying the filters. If\n not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out\n buffer will reference the in buffer data (with asize set to zero)\n instead of allocating data. This keeps allocations to a minimum, but\n it means you have to be careful about freeing the in data since out\n may be pointing to it!

\n", + "group": "filter" + }, + "git_filter_list_apply_to_file": { + "type": "function", + "file": "filter.h", + "line": 148, + "lineto": 152, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + } + ], + "argline": "git_buf *out, git_filter_list *filters, git_repository *repo, const char *path", + "sig": "git_buf *::git_filter_list *::git_repository *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a filter list to the contents of a file on disk

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_apply_to_blob": { + "type": "function", + "file": "filter.h", + "line": 161, + "lineto": 164, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer into which to store the filtered file" + }, + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" + } + ], + "argline": "git_buf *out, git_filter_list *filters, git_blob *blob", + "sig": "git_buf *::git_filter_list *::git_blob *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a filter list to the contents of a blob

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_data": { + "type": "function", + "file": "filter.h", + "line": 173, + "lineto": 176, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "data", + "type": "git_buf *", + "comment": "the buffer to filter" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, git_buf *data, git_writestream *target", + "sig": "git_filter_list *::git_buf *::git_writestream *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a filter list to an arbitrary buffer as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_file": { + "type": "function", + "file": "filter.h", + "line": 187, + "lineto": 191, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the filtering" + }, + { + "name": "path", + "type": "const char *", + "comment": "the path of the file to filter, a relative path will be\n taken as relative to the workdir" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, git_repository *repo, const char *path, git_writestream *target", + "sig": "git_filter_list *::git_repository *::const char *::git_writestream *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a filter list to a file as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_stream_blob": { + "type": "function", + "file": "filter.h", + "line": 200, + "lineto": 203, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "the list of filters to apply" + }, + { + "name": "blob", + "type": "git_blob *", + "comment": "the blob to filter" + }, + { + "name": "target", + "type": "git_writestream *", + "comment": "the stream into which the data will be written" + } + ], + "argline": "git_filter_list *filters, git_blob *blob, git_writestream *target", + "sig": "git_filter_list *::git_blob *::git_writestream *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Apply a filter list to a blob as a stream

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_free": { + "type": "function", + "file": "filter.h", + "line": 210, + "lineto": 210, + "args": [ + { + "name": "filters", + "type": "git_filter_list *", + "comment": "A git_filter_list created by `git_filter_list_load`" + } + ], + "argline": "git_filter_list *filters", + "sig": "git_filter_list *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a git_filter_list

\n", + "comments": "", + "group": "filter" + }, + "git_libgit2_init": { + "type": "function", + "file": "global.h", + "line": 26, + "lineto": 26, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " the number of initializations of the library, or an error code." + }, + "description": "

Init the global state

\n", + "comments": "

This function must the called before any other libgit2 function in\n order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number\n of times the initialization has been called (including this one) that have\n not subsequently been shutdown.

\n", + "group": "libgit2", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_libgit2_init-8" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_libgit2_init-10" + ], + "describe.c": [ + "ex/v0.23.2/describe.html#git_libgit2_init-4" + ], + "diff.c": [ + "ex/v0.23.2/diff.html#git_libgit2_init-13" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_libgit2_init-28" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_libgit2_init-2" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_libgit2_init-30" + ], + "network/git2.c": [ + "ex/v0.23.2/network/git2.html#git_libgit2_init-3" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_libgit2_init-2" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_libgit2_init-1" + ], + "status.c": [ + "ex/v0.23.2/status.html#git_libgit2_init-1" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_libgit2_init-3" + ] + } + }, + "git_libgit2_shutdown": { + "type": "function", + "file": "global.h", + "line": 39, + "lineto": 39, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " the number of remaining initializations of the library, or an\n error code." + }, + "description": "

Shutdown the global state

\n", + "comments": "

Clean up the global state and threading context after calling it as\n many times as git_libgit2_init() was called - it will return the\n number of remainining initializations that have not been shutdown\n (after this one).

\n", + "group": "libgit2", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_libgit2_shutdown-9" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_libgit2_shutdown-11" + ], + "describe.c": [ + "ex/v0.23.2/describe.html#git_libgit2_shutdown-5" + ], + "diff.c": [ + "ex/v0.23.2/diff.html#git_libgit2_shutdown-14" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_libgit2_shutdown-3" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_libgit2_shutdown-31" + ], + "network/git2.c": [ + "ex/v0.23.2/network/git2.html#git_libgit2_shutdown-4" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_libgit2_shutdown-3" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_libgit2_shutdown-2" + ], + "status.c": [ + "ex/v0.23.2/status.html#git_libgit2_shutdown-2" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_libgit2_shutdown-4" + ] + } + }, + "git_graph_ahead_behind": { + "type": "function", + "file": "graph.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "ahead", + "type": "size_t *", + "comment": "number of unique from commits in `upstream`" + }, + { + "name": "behind", + "type": "size_t *", + "comment": "number of unique from commits in `local`" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository where the commits exist" + }, + { + "name": "local", + "type": "const git_oid *", + "comment": "the commit for local" + }, + { + "name": "upstream", + "type": "const git_oid *", + "comment": "the commit for upstream" + } + ], + "argline": "size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream", + "sig": "size_t *::size_t *::git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Count the number of unique commits between two commit objects

\n", + "comments": "

There is no need for branches containing the commits to have any\n upstream relationship, but it helps to think of one as a branch and\n the other as its upstream, the ahead and behind values will be\n what git would report for the branches.

\n", + "group": "graph" + }, + "git_graph_descendant_of": { + "type": "function", + "file": "graph.h", + "line": 48, + "lineto": 51, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "commit", + "type": "const git_oid *", + "comment": "a previously loaded commit." + }, + { + "name": "ancestor", + "type": "const git_oid *", + "comment": "a potential ancestor commit." + } + ], + "argline": "git_repository *repo, const git_oid *commit, const git_oid *ancestor", + "sig": "git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " 1 if the given commit is a descendant of the potential ancestor,\n 0 if not, error code otherwise." + }, + "description": "

Determine if a commit is the descendant of another commit.

\n", + "comments": "", + "group": "graph" + }, + "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.\n It is okay to have multiple rules in the text; if so,\n each rule should be terminated with a newline." + } + ], + "argline": "git_repository *repo, const char *rules", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success" + }, + "description": "

Add ignore rules for a repository.

\n", + "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from\n .gitignore files in the repository tree or from a shared system file\n only if a "core.excludesfile" config value is set. The library also\n keeps a set of per-repository internal ignores that can be configured\n in-memory and will not persist. This function allows you to add to\n that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c\n
\n\n

/

\n\n

with space

\n\n

");

\n\n

This would add three rules to the ignores.

\n", + "group": "ignore" + }, + "git_ignore_clear_internal_rules": { + "type": "function", + "file": "ignore.h", + "line": 52, + "lineto": 53, + "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.

\n", + "comments": "

Resets to the default internal ignore rules. This will not turn off\n rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", + "group": "ignore" + }, + "git_ignore_path_is_ignored": { + "type": "function", + "file": "ignore.h", + "line": 71, + "lineto": 74, + "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, git_repository *repo, const char *path", + "sig": "int *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." + }, + "description": "

Test if the ignore rules apply to a given path.

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n", + "group": "ignore" + }, + "git_index_open": { + "type": "function", + "file": "index.h", + "line": 189, + "lineto": 189, + "args": [ + { + "name": "out", + "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 **out, 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\n of the Git index file in 'index_path', without a repository\n to back it.

\n", + "comments": "

Since there is no ODB or working directory behind this index,\n any Index methods which rely on these (e.g. index_add_bypath)\n will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository,\n use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", + "group": "index" + }, + "git_index_new": { + "type": "function", + "file": "index.h", + "line": 202, + "lineto": 202, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "the pointer for the new index" + } + ], + "argline": "git_index **out", + "sig": "git_index **", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an in-memory index object.

\n", + "comments": "

This index object cannot be read/written to the filesystem,\n but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", + "group": "index" + }, + "git_index_free": { + "type": "function", + "file": "index.h", + "line": 209, + "lineto": 209, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free an existing index object.

\n", + "comments": "", + "group": "index", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_index_free-29" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_index_free-4" + ] + } + }, + "git_index_owner": { + "type": "function", + "file": "index.h", + "line": 217, + "lineto": 217, + "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

\n", + "comments": "", + "group": "index" + }, + "git_index_caps": { + "type": "function", + "file": "index.h", + "line": 225, + "lineto": 225, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "An existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "int", + "comment": " A combination of GIT_INDEXCAP values" + }, + "description": "

Read index capabilities flags.

\n", + "comments": "", + "group": "index" + }, + "git_index_set_caps": { + "type": "function", + "file": "index.h", + "line": 238, + "lineto": 238, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "caps", + "type": "int", + "comment": "A combination of GIT_INDEXCAP values" + } + ], + "argline": "git_index *index, int caps", + "sig": "git_index *::int", + "return": { + "type": "int", + "comment": " 0 on success, -1 on failure" + }, + "description": "

Set index capabilities flags.

\n", + "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the\n capabilities will be read from the config of the owner object,\n looking at core.ignorecase, core.filemode, core.symlinks.

\n", + "group": "index" + }, + "git_index_read": { + "type": "function", + "file": "index.h", + "line": 257, + "lineto": 257, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "force", + "type": "int", + "comment": "if true, always reload, vs. only read if file has changed" + } + ], + "argline": "git_index *index, int force", + "sig": "git_index *::int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n", + "comments": "

If force is true, this performs a "hard" read that discards in-memory\n changes and always reloads the on-disk index data. If there is no\n on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index\n data from disk only if it has changed since the last time it was\n loaded. Purely in-memory index data will be untouched. Be aware: if\n there are changes on disk, unwritten in-memory changes are discarded.

\n", + "group": "index" + }, + "git_index_write": { + "type": "function", + "file": "index.h", + "line": 266, + "lineto": 266, + "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\n using an atomic file lock.

\n", + "comments": "", + "group": "index" + }, + "git_index_path": { + "type": "function", + "file": "index.h", + "line": 274, + "lineto": 274, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "an existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "const char *", + "comment": " path to index file or NULL for in-memory index" + }, + "description": "

Get the full path to the index file on disk.

\n", + "comments": "", + "group": "index" + }, + "git_index_checksum": { + "type": "function", + "file": "index.h", + "line": 286, + "lineto": 286, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the checksum of the index" + }, + "description": "

Get the checksum of the index

\n", + "comments": "

This checksum is the SHA-1 hash over the index file (except the\n last 20 bytes which are the checksum itself). In cases where the\n index does not exist on-disk, it will be zeroed out.

\n", + "group": "index" + }, + "git_index_read_tree": { + "type": "function", + "file": "index.h", + "line": 297, + "lineto": 297, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "tree", + "type": "const git_tree *", + "comment": "tree to read" + } + ], + "argline": "git_index *index, const git_tree *tree", + "sig": "git_index *::const git_tree *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Read a tree into the index file with stats

\n", + "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": 318, + "lineto": 318, + "args": [ + { + "name": "out", + "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 *out, git_index *index", + "sig": "git_oid *::git_index *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" + }, + "description": "

Write the index as a tree

\n", + "comments": "

This method will scan the index and write a representation\n of its current state back to disk; it recursively creates\n tree objects for each of the subtrees stored in the index,\n but only returns the OID of the root tree. This is the OID\n that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated\n to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", + "group": "index", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_index_write_tree-5" + ] + } + }, + "git_index_write_tree_to": { + "type": "function", + "file": "index.h", + "line": 335, + "lineto": 335, + "args": [ + { + "name": "out", + "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 *out, 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\n or an error code" + }, + "description": "

Write the index as a tree to the given repository

\n", + "comments": "

This method will do the same as git_index_write_tree, but\n letting the user choose the repository where the tree will\n be written.

\n\n

The index must not contain any file in conflict.

\n", + "group": "index" + }, + "git_index_entrycount": { + "type": "function", + "file": "index.h", + "line": 354, + "lineto": 354, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": "an existing index object" + } + ], + "argline": "const git_index *index", + "sig": "const git_index *", + "return": { + "type": "size_t", + "comment": " integer of count of current entries" + }, + "description": "

Get the count of entries currently in the index

\n", + "comments": "", + "group": "index", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_index_entrycount-30" + ] + } + }, + "git_index_clear": { + "type": "function", + "file": "index.h", + "line": 365, + "lineto": 365, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + } + ], + "argline": "git_index *index", + "sig": "git_index *", + "return": { + "type": "int", + "comment": " 0 on success, error code \n<\n 0 on failure" + }, + "description": "

Clear the contents (all the entries) of an index object.

\n", + "comments": "

This clears the index object in memory; changes must be explicitly\n written to disk for them to take effect persistently.

\n", + "group": "index" + }, + "git_index_get_byindex": { + "type": "function", + "file": "index.h", + "line": 378, + "lineto": 379, + "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_entry *", + "comment": " a pointer to the entry; NULL if out of bounds" + }, + "description": "

Get a pointer to one of the entries in the index

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "group": "index", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_index_get_byindex-31" + ] + } + }, + "git_index_get_bypath": { + "type": "function", + "file": "index.h", + "line": 393, + "lineto": 394, + "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": "const 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

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "group": "index" + }, + "git_index_remove": { + "type": "function", + "file": "index.h", + "line": 404, + "lineto": 404, + "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

\n", + "comments": "", + "group": "index" + }, + "git_index_remove_directory": { + "type": "function", + "file": "index.h", + "line": 414, + "lineto": 415, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "dir", + "type": "const char *", + "comment": "container directory path" + }, + { + "name": "stage", + "type": "int", + "comment": "stage to search" + } + ], + "argline": "git_index *index, const char *dir, int stage", + "sig": "git_index *::const char *::int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Remove all entries from the index under a given directory

\n", + "comments": "", + "group": "index" + }, + "git_index_add": { + "type": "function", + "file": "index.h", + "line": 431, + "lineto": 431, + "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

\n", + "comments": "

If a previous index entry exists that has the same path and stage\n as the given 'source_entry', it will be replaced. Otherwise, the\n 'source_entry' will be added.

\n\n

A 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": 443, + "lineto": 443, + "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", + "comment": " the stage number" + }, + "description": "

Return the stage number from a git index entry

\n", + "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags \n
\n\n

&\n GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT

\n", + "group": "index" + }, + "git_index_entry_is_conflict": { + "type": "function", + "file": "index.h", + "line": 452, + "lineto": 452, + "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", + "comment": " 1 if the entry is a conflict entry, 0 otherwise" + }, + "description": "

Return whether the given index entry is a conflict (has a high stage\n entry). This is simply shorthand for git_index_entry_stage > 0.

\n", + "comments": "", + "group": "index" + }, + "git_index_add_bypath": { + "type": "function", + "file": "index.h", + "line": 483, + "lineto": 483, + "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 on disk

\n", + "comments": "

The file path must be relative to the repository's\n working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_add_frombuffer": { + "type": "function", + "file": "index.h", + "line": 512, + "lineto": 515, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "entry", + "type": "const git_index_entry *", + "comment": "filename to add" + }, + { + "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_index *index, const git_index_entry *entry, const void *buffer, size_t len", + "sig": "git_index *::const git_index_entry *::const void *::size_t", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Add or update an index entry from a buffer in memory

\n", + "comments": "

This method will create a blob in the repository that owns the\n index and then add the index entry to the index. The path of the\n entry represents the position of the blob relative to the\n repository's root folder.

\n\n

If a previous index entry exists that has the same path as the\n given 'entry', it will be replaced. Otherwise, the 'entry' will be\n added. The id and the file_size of the 'entry' are updated with the\n real value of the blob.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_remove_bypath": { + "type": "function", + "file": "index.h", + "line": 531, + "lineto": 531, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "path", + "type": "const char *", + "comment": "filename to remove" + } + ], + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Remove an index entry corresponding to a file on disk

\n", + "comments": "

The file path must be relative to the repository's\n working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "group": "index" + }, + "git_index_add_all": { + "type": "function", + "file": "index.h", + "line": 578, + "lineto": 583, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "flags", + "type": "unsigned int", + "comment": "combination of git_index_add_option_t flags" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each added/updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, unsigned int flags, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::unsigned int::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Add or update index entries matching files in the working directory.

\n", + "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will\n matched against files in the repository's working directory. Each file\n that matches will be added to the index (either updating an existing\n entry or adding a new entry). You can disable glob expansion and force\n exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath).\n If a file is already tracked in the index, then it will be updated\n even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to\n skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains\n the exact path of an ignored file (when not using FORCE), add the\n GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry\n in the pathspec that is an exact match to a filename on disk is\n either not ignored or already in the index. If this check fails, the\n function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback\n function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files\n will no longer be marked as conflicting. The data about the conflicts\n will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the working directory immediately before it is added to /\n updated in the index. Returning zero will add the item to the index,\n greater than zero will skip the item, and less than zero will abort the\n scan and return that value to the caller.

\n", + "group": "index" + }, + "git_index_remove_all": { + "type": "function", + "file": "index.h", + "line": 600, + "lineto": 604, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each removed path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Remove all matching index entries.

\n", + "comments": "

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is removed. Return 0 to\n remove the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n", + "group": "index" + }, + "git_index_update_all": { + "type": "function", + "file": "index.h", + "line": 629, + "lineto": 633, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "An existing index object" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "array of path patterns" + }, + { + "name": "callback", + "type": "git_index_matched_path_cb", + "comment": "notification callback for each updated path (also\n gets index of matching pathspec entry); can be NULL;\n return 0 to add, >0 to skip, \n<\n0 to abort scan." + }, + { + "name": "payload", + "type": "void *", + "comment": "payload passed through to callback function" + } + ], + "argline": "git_index *index, const git_strarray *pathspec, git_index_matched_path_cb callback, void *payload", + "sig": "git_index *::const git_strarray *::git_index_matched_path_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, negative callback return value, or error code" + }, + "description": "

Update all index entries to match the working directory

\n", + "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the\n working directory, deleting them if the corresponding working directory\n file no longer exists otherwise updating the information (including\n adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is updated (either refreshed\n or removed depending on working directory state). Return 0 to proceed\n with updating the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n", + "group": "index" + }, + "git_index_find": { + "type": "function", + "file": "index.h", + "line": 644, + "lineto": 644, + "args": [ + { + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to search" + } + ], + "argline": "size_t *at_pos, git_index *index, const char *path", + "sig": "size_t *::git_index *::const char *", + "return": { + "type": "int", + "comment": " a zero-based position in the index if found; GIT_ENOTFOUND otherwise" + }, + "description": "

Find the first position of any entries which point to given\n path in the Git index.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_add": { + "type": "function", + "file": "index.h", + "line": 669, + "lineto": 673, + "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, const git_index_entry *ancestor_entry, const git_index_entry *our_entry, const 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. Any staged\n entries that exist at the given paths will be removed.

\n", + "comments": "

The entries are the entries from the tree included in the merge. Any\n entry may be null to indicate that that file was not present in the\n trees during the merge. For example, ancestor_entry may be NULL to\n indicate 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": 689, + "lineto": 694, + "args": [ + { + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor entry" + }, + { + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the our entry" + }, + { + "name": "their_out", + "type": "const 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": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index *index, const char *path", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the index entries that represent a conflict of a single file.

\n", + "comments": "

The entries are not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "group": "index" + }, + "git_index_conflict_remove": { + "type": "function", + "file": "index.h", + "line": 703, + "lineto": 703, + "args": [ + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to remove conflicts for" + } + ], + "argline": "git_index *index, const char *path", + "sig": "git_index *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Removes the index entries that represent a conflict of a single file.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_cleanup": { + "type": "function", + "file": "index.h", + "line": 711, + "lineto": 711, + "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": "

Remove all conflicts in the index (entries with a stage greater than 0).

\n", + "comments": "", + "group": "index" + }, + "git_index_has_conflicts": { + "type": "function", + "file": "index.h", + "line": 718, + "lineto": 718, + "args": [ + { + "name": "index", + "type": "const git_index *", + "comment": null + } + ], + "argline": "const git_index *index", + "sig": "const 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.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_iterator_new": { + "type": "function", + "file": "index.h", + "line": 729, + "lineto": 731, + "args": [ + { + "name": "iterator_out", + "type": "git_index_conflict_iterator **", + "comment": "The newly created conflict iterator" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to scan" + } + ], + "argline": "git_index_conflict_iterator **iterator_out, git_index *index", + "sig": "git_index_conflict_iterator **::git_index *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an iterator for the conflicts in the index.

\n", + "comments": "

The index must not be modified while iterating; the results are undefined.

\n", + "group": "index" + }, + "git_index_conflict_next": { + "type": "function", + "file": "index.h", + "line": 743, + "lineto": 747, + "args": [ + { + "name": "ancestor_out", + "type": "const git_index_entry **", + "comment": "Pointer to store the ancestor side of the conflict" + }, + { + "name": "our_out", + "type": "const git_index_entry **", + "comment": "Pointer to store our side of the conflict" + }, + { + "name": "their_out", + "type": "const git_index_entry **", + "comment": "Pointer to store their side of the conflict" + }, + { + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": null + } + ], + "argline": "const git_index_entry **ancestor_out, const git_index_entry **our_out, const git_index_entry **their_out, git_index_conflict_iterator *iterator", + "sig": "const git_index_entry **::const git_index_entry **::const git_index_entry **::git_index_conflict_iterator *", + "return": { + "type": "int", + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + }, + "description": "

Returns the current conflict (ancestor, ours and theirs entry) and\n advance the iterator internally to the next value.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_iterator_free": { + "type": "function", + "file": "index.h", + "line": 754, + "lineto": 755, + "args": [ + { + "name": "iterator", + "type": "git_index_conflict_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_index_conflict_iterator *iterator", + "sig": "git_index_conflict_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Frees a git_index_conflict_iterator.

\n", + "comments": "", + "group": "index" + }, + "git_indexer_new": { + "type": "function", + "file": "indexer.h", + "line": 30, + "lineto": 36, + "args": [ + { + "name": "out", + "type": "git_indexer **", + "comment": "where to store the indexer instance" + }, + { + "name": "path", + "type": "const char *", + "comment": "to the directory where the packfile should be stored" + }, + { + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating packfile or 0 for defaults" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "object database from which to read base objects when\n fixing thin packs. Pass NULL if no thin pack is expected (an error\n will be returned if there are bases missing)" + }, + { + "name": "progress_cb", + "type": "git_transfer_progress_cb", + "comment": "function to call with progress information" + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "payload for the progress callback" + } + ], + "argline": "git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_cb_payload", + "sig": "git_indexer **::const char *::unsigned int::git_odb *::git_transfer_progress_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a new indexer instance

\n", + "comments": "", + "group": "indexer", + "examples": { + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_indexer_new-1" + ] + } + }, + "git_indexer_append": { + "type": "function", + "file": "indexer.h", + "line": 46, + "lineto": 46, + "args": [ + { + "name": "idx", + "type": "git_indexer *", + "comment": "the indexer" + }, + { + "name": "data", + "type": "const void *", + "comment": "the data to add" + }, + { + "name": "size", + "type": "size_t", + "comment": "the size of the data in bytes" + }, + { + "name": "stats", + "type": "git_transfer_progress *", + "comment": "stat storage" + } + ], + "argline": "git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats", + "sig": "git_indexer *::const void *::size_t::git_transfer_progress *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Add data to the indexer

\n", + "comments": "", + "group": "indexer", + "examples": { + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_indexer_append-2" + ] + } + }, + "git_indexer_commit": { + "type": "function", + "file": "indexer.h", + "line": 55, + "lineto": 55, + "args": [ + { + "name": "idx", + "type": "git_indexer *", + "comment": "the indexer" + }, + { + "name": "stats", + "type": "git_transfer_progress *", + "comment": null + } + ], + "argline": "git_indexer *idx, git_transfer_progress *stats", + "sig": "git_indexer *::git_transfer_progress *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Finalize the pack and index

\n", + "comments": "

Resolve any pending deltas and write out the index file

\n", + "group": "indexer", + "examples": { + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_indexer_commit-3" + ] + } + }, + "git_indexer_hash": { + "type": "function", + "file": "indexer.h", + "line": 65, + "lineto": 65, + "args": [ + { + "name": "idx", + "type": "const git_indexer *", + "comment": "the indexer instance" + } + ], + "argline": "const git_indexer *idx", + "sig": "const git_indexer *", + "return": { + "type": "const git_oid *", + "comment": null + }, + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the index has been finalized.

\n", + "group": "indexer", + "examples": { + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_indexer_hash-4" + ] + } + }, + "git_indexer_free": { + "type": "function", + "file": "indexer.h", + "line": 72, + "lineto": 72, + "args": [ + { + "name": "idx", + "type": "git_indexer *", + "comment": "the indexer to free" + } + ], + "argline": "git_indexer *idx", + "sig": "git_indexer *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the indexer and its resources

\n", + "comments": "", + "group": "indexer", + "examples": { + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_indexer_free-5" + ] + } + }, + "git_merge_file_init_input": { + "type": "function", + "file": "merge.h", + "line": 60, + "lineto": 62, + "args": [ + { + "name": "opts", + "type": "git_merge_file_input *", + "comment": "the `git_merge_file_input` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_INPUT_VERSION` here." + } + ], + "argline": "git_merge_file_input *opts, unsigned int version", + "sig": "git_merge_file_input *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_merge_file_input with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_INPUT_INIT.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file_init_options": { + "type": "function", + "file": "merge.h", + "line": 188, + "lineto": 190, + "args": [ + { + "name": "opts", + "type": "git_merge_file_options *", + "comment": "the `git_merge_file_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_MERGE_FILE_OPTIONS_VERSION` here." + } + ], + "argline": "git_merge_file_options *opts, unsigned int version", + "sig": "git_merge_file_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_merge_file_options with default values. Equivalent to\n creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_init_options": { + "type": "function", + "file": "merge.h", + "line": 265, + "lineto": 267, + "args": [ + { + "name": "opts", + "type": "git_merge_options *", + "comment": "the `git_merge_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_MERGE_OPTIONS_VERSION` here." + } + ], + "argline": "git_merge_options *opts, unsigned int version", + "sig": "git_merge_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_merge_options with default values. Equivalent to\n creating an instance with GIT_MERGE_OPTIONS_INIT.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_analysis": { + "type": "function", + "file": "merge.h", + "line": 336, + "lineto": 341, + "args": [ + { + "name": "analysis_out", + "type": "git_merge_analysis_t *", + "comment": "analysis enumeration that the result is written into" + }, + { + "name": "preference_out", + "type": "git_merge_preference_t *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + } + ], + "argline": "git_merge_analysis_t *analysis_out, git_merge_preference_t *preference_out, git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len", + "sig": "git_merge_analysis_t *::git_merge_preference_t *::git_repository *::const git_annotated_commit **::size_t", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Analyzes the given branch(es) and determines the opportunities for\n merging them into the HEAD of the repository.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base": { + "type": "function", + "file": "merge.h", + "line": 352, + "lineto": 356, + "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", + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + }, + "description": "

Find a merge base between two commits

\n", + "comments": "", + "group": "merge", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_merge_base-32" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_merge_base-3" + ] + } + }, + "git_merge_bases": { + "type": "function", + "file": "merge.h", + "line": 367, + "lineto": 371, + "args": [ + { + "name": "out", + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" + }, + { + "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_oidarray *out, git_repository *repo, const git_oid *one, const git_oid *two", + "sig": "git_oidarray *::git_repository *::const git_oid *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if not found or error code" + }, + "description": "

Find merge bases between two commits

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base_many": { + "type": "function", + "file": "merge.h", + "line": 382, + "lineto": 386, + "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`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find a merge base given a list of commits

\n", + "comments": "", + "group": "merge" + }, + "git_merge_bases_many": { + "type": "function", + "file": "merge.h", + "line": 397, + "lineto": 401, + "args": [ + { + "name": "out", + "type": "git_oidarray *", + "comment": "array in which to store the resulting ids" + }, + { + "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`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oidarray *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oidarray *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find all merge bases given a list of commits

\n", + "comments": "", + "group": "merge" + }, + "git_merge_base_octopus": { + "type": "function", + "file": "merge.h", + "line": 412, + "lineto": 416, + "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`" + }, + { + "name": "input_array", + "type": "const git_oid []", + "comment": "oids of the commits" + } + ], + "argline": "git_oid *out, git_repository *repo, size_t length, const git_oid [] input_array", + "sig": "git_oid *::git_repository *::size_t::const git_oid []", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND or -1 on failure." + }, + "description": "

Find a merge base in preparation for an octopus merge

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file": { + "type": "function", + "file": "merge.h", + "line": 434, + "lineto": 439, + "args": [ + { + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, + { + "name": "ancestor", + "type": "const git_merge_file_input *", + "comment": "The contents of the ancestor file" + }, + { + "name": "ours", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"our\" side" + }, + { + "name": "theirs", + "type": "const git_merge_file_input *", + "comment": "The contents of the file in \"their\" side" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or `NULL` for defaults" + } + ], + "argline": "git_merge_file_result *out, const git_merge_file_input *ancestor, const git_merge_file_input *ours, const git_merge_file_input *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_input *::const git_merge_file_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n", + "comments": "

Note that this function does not reference a repository and any\n configuration must be passed as git_merge_file_options.

\n", + "group": "merge" + }, + "git_merge_file_from_index": { + "type": "function", + "file": "merge.h", + "line": 455, + "lineto": 461, + "args": [ + { + "name": "out", + "type": "git_merge_file_result *", + "comment": "The git_merge_file_result to be filled in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + }, + { + "name": "ancestor", + "type": "const git_index_entry *", + "comment": "The index entry for the ancestor file (stage level 1)" + }, + { + "name": "ours", + "type": "const git_index_entry *", + "comment": "The index entry for our file (stage level 2)" + }, + { + "name": "theirs", + "type": "const git_index_entry *", + "comment": "The index entry for their file (stage level 3)" + }, + { + "name": "opts", + "type": "const git_merge_file_options *", + "comment": "The merge file options or NULL" + } + ], + "argline": "git_merge_file_result *out, git_repository *repo, const git_index_entry *ancestor, const git_index_entry *ours, const git_index_entry *theirs, const git_merge_file_options *opts", + "sig": "git_merge_file_result *::git_repository *::const git_index_entry *::const git_index_entry *::const git_index_entry *::const git_merge_file_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Merge two files as they exist in the index, using the given common\n ancestor as the baseline, producing a git_merge_file_result that\n reflects the merge result. The git_merge_file_result must be freed with\n git_merge_file_result_free.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_file_result_free": { + "type": "function", + "file": "merge.h", + "line": 468, + "lineto": 468, + "args": [ + { + "name": "result", + "type": "git_merge_file_result *", + "comment": "The result to free or `NULL`" + } + ], + "argline": "git_merge_file_result *result", + "sig": "git_merge_file_result *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Frees a git_merge_file_result.

\n", + "comments": "", + "group": "merge" + }, + "git_merge_trees": { + "type": "function", + "file": "merge.h", + "line": 486, + "lineto": 492, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" + }, + { + "name": "ancestor_tree", + "type": "const git_tree *", + "comment": "the common ancestor between the trees (or null if none)" + }, + { + "name": "our_tree", + "type": "const git_tree *", + "comment": "the tree that reflects the destination tree" + }, + { + "name": "their_tree", + "type": "const git_tree *", + "comment": "the tree to merge in to `our_tree`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, const git_tree *ancestor_tree, const git_tree *our_tree, const git_tree *their_tree, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_tree *::const git_tree *::const git_tree *::const git_merge_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Merge two trees, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" + }, + "git_merge_commits": { + "type": "function", + "file": "merge.h", + "line": 513, + "lineto": 518, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository that contains the given trees" + }, + { + "name": "our_commit", + "type": "const git_commit *", + "comment": "the commit that reflects the destination tree" + }, + { + "name": "their_commit", + "type": "const git_commit *", + "comment": "the commit to merge in to `our_commit`" + }, + { + "name": "opts", + "type": "const git_merge_options *", + "comment": "the merge tree options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, const git_commit *our_commit, const git_commit *their_commit, const git_merge_options *opts", + "sig": "git_index **::git_repository *::const git_commit *::const git_commit *::const git_merge_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", + "comments": "

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

The returned index must be freed explicitly with git_index_free.

\n", + "group": "merge" + }, + "git_merge": { + "type": "function", + "file": "merge.h", + "line": 542, + "lineto": 547, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to merge" + }, + { + "name": "their_heads", + "type": "const git_annotated_commit **", + "comment": "the heads to merge into" + }, + { + "name": "their_heads_len", + "type": "size_t", + "comment": "the number of heads to merge" + }, + { + "name": "merge_opts", + "type": "const git_merge_options *", + "comment": "merge options" + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "checkout options" + } + ], + "argline": "git_repository *repo, const git_annotated_commit **their_heads, size_t their_heads_len, const git_merge_options *merge_opts, const git_checkout_options *checkout_opts", + "sig": "git_repository *::const git_annotated_commit **::size_t::const git_merge_options *::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n", + "comments": "

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

For compatibility with git, the repository is put into a merging\n state. Once the commit is done (or if the uses wishes to abort),\n you should clear this state by calling\n git_repository_state_cleanup().

\n", + "group": "merge" + }, + "git_message_prettify": { + "type": "function", + "file": "message.h", + "line": 39, + "lineto": 39, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The user-allocated git_buf which will be filled with the\n cleaned up message." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message to be prettified." + }, + { + "name": "strip_comments", + "type": "int", + "comment": "Non-zero to remove comment lines, 0 to leave them in." + }, + { + "name": "comment_char", + "type": "char", + "comment": "Comment character. Lines starting with this character\n are considered to be comments and removed if `strip_comments` is non-zero." + } + ], + "argline": "git_buf *out, const char *message, int strip_comments, char comment_char", + "sig": "git_buf *::const char *::int::char", + "return": { + "type": "int", + "comment": " 0 or an error code." + }, + "description": "

Clean up message from excess whitespace and make sure that the last line\n ends with a '

\n\n

'.

\n", + "comments": "

Optionally, can remove lines starting with a "#".

\n", + "group": "message" + }, + "git_note_iterator_new": { + "type": "function", + "file": "notes.h", + "line": 49, + "lineto": 52, + "args": [ + { + "name": "out", + "type": "git_note_iterator **", + "comment": "pointer to the iterator" + }, + { + "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\n \"refs/notes/commits\"" + } + ], + "argline": "git_note_iterator **out, git_repository *repo, const char *notes_ref", + "sig": "git_note_iterator **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Creates a new iterator for notes

\n", + "comments": "

The iterator must be freed manually by the user.

\n", + "group": "note" + }, + "git_note_iterator_free": { + "type": "function", + "file": "notes.h", + "line": 59, + "lineto": 59, + "args": [ + { + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_note_iterator *it", + "sig": "git_note_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Frees an git_note_iterator

\n", + "comments": "", + "group": "note" + }, + "git_note_next": { + "type": "function", + "file": "notes.h", + "line": 72, + "lineto": 75, + "args": [ + { + "name": "note_id", + "type": "git_oid *", + "comment": "id of blob containing the message" + }, + { + "name": "annotated_id", + "type": "git_oid *", + "comment": "id of the git object being annotated" + }, + { + "name": "it", + "type": "git_note_iterator *", + "comment": "pointer to the iterator" + } + ], + "argline": "git_oid *note_id, git_oid *annotated_id, git_note_iterator *it", + "sig": "git_oid *::git_oid *::git_note_iterator *", + "return": { + "type": "int", + "comment": " 0 (no error), GIT_ITEROVER (iteration is done) or an error code\n (negative value)" + }, + "description": "

Return the current item (note_id and annotated_id) and advance the iterator\n internally to the next value

\n", + "comments": "", + "group": "note" + }, + "git_note_read": { + "type": "function", + "file": "notes.h", + "line": 91, + "lineto": 95, + "args": [ + { + "name": "out", + "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\n \"refs/notes/commits\"" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "OID of the git object to read the note from" + } + ], + "argline": "git_note **out, git_repository *repo, 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

\n", + "comments": "

The note must be freed manually by the user.

\n", + "group": "note" + }, + "git_note_author": { + "type": "function", + "file": "notes.h", + "line": 103, + "lineto": 103, + "args": [ + { + "name": "note", + "type": "const git_note *", + "comment": "the note" + } + ], + "argline": "const git_note *note", + "sig": "const git_note *", + "return": { + "type": "const git_signature *", + "comment": " the author" + }, + "description": "

Get the note author

\n", + "comments": "", + "group": "note" + }, + "git_note_committer": { + "type": "function", + "file": "notes.h", + "line": 111, + "lineto": 111, + "args": [ + { + "name": "note", + "type": "const git_note *", + "comment": "the note" + } + ], + "argline": "const git_note *note", + "sig": "const git_note *", + "return": { + "type": "const git_signature *", + "comment": " the committer" + }, + "description": "

Get the note committer

\n", + "comments": "", + "group": "note" + }, + "git_note_message": { + "type": "function", + "file": "notes.h", + "line": 120, + "lineto": 120, + "args": [ + { + "name": "note", + "type": "const git_note *", + "comment": "the note" + } + ], + "argline": "const git_note *note", + "sig": "const git_note *", + "return": { + "type": "const char *", + "comment": " the note message" + }, + "description": "

Get the note message

\n", + "comments": "", + "group": "note" + }, + "git_note_id": { + "type": "function", + "file": "notes.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "note", + "type": "const git_note *", + "comment": "the note" + } + ], + "argline": "const git_note *note", + "sig": "const git_note *", + "return": { + "type": "const git_oid *", + "comment": " the note object's id" + }, + "description": "

Get the note object's id

\n", + "comments": "", + "group": "note" + }, + "git_note_create": { + "type": "function", + "file": "notes.h", + "line": 146, + "lineto": 154, + "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": "notes_ref", + "type": "const char *", + "comment": "canonical name of the reference to use (optional);\n\t\t\t\t\tdefaults to \"refs/notes/commits\"" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "signature of the notes commit author" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "signature of the notes commit committer" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "OID of the git object to decorate" + }, + { + "name": "note", + "type": "const char *", + "comment": "Content of the note to add for object oid" + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing note" + } + ], + "argline": "git_oid *out, git_repository *repo, const char *notes_ref, const git_signature *author, const git_signature *committer, const git_oid *oid, const char *note, int force", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *::const char *::int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Add a note for an object

\n", + "comments": "", + "group": "note" + }, + "git_note_remove": { + "type": "function", + "file": "notes.h", + "line": 169, + "lineto": 174, + "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);\n\t\t\t\t\tdefaults to \"refs/notes/commits\"" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "signature of the notes commit author" + }, + { + "name": "committer", + "type": "const 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, const git_signature *author, const git_signature *committer, const git_oid *oid", + "sig": "git_repository *::const char *::const git_signature *::const git_signature *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Remove the note for an object

\n", + "comments": "", + "group": "note" + }, + "git_note_free": { + "type": "function", + "file": "notes.h", + "line": 181, + "lineto": 181, + "args": [ + { + "name": "note", + "type": "git_note *", + "comment": "git_note object" + } + ], + "argline": "git_note *note", + "sig": "git_note *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a git_note object

\n", + "comments": "", + "group": "note" + }, + "git_note_foreach": { + "type": "function", + "file": "notes.h", + "line": 209, + "lineto": 213, + "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\n \"refs/notes/commits\"." + }, + { + "name": "note_cb", + "type": "git_note_foreach_cb", + "comment": "Callback to invoke per found annotation. Return non-zero\n to stop looping." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." + } + ], + "argline": "git_repository *repo, const char *notes_ref, git_note_foreach_cb note_cb, void *payload", + "sig": "git_repository *::const char *::git_note_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Loop over all the notes within a specified namespace\n and issue a callback for each one.

\n", + "comments": "", + "group": "note" + }, + "git_object_lookup": { + "type": "function", + "file": "object.h", + "line": 42, + "lineto": 46, + "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, git_repository *repo, const git_oid *id, git_otype type", + "sig": "git_object **::git_repository *::const git_oid *::git_otype", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Lookup a reference to one of the objects in a repository.

\n", + "comments": "

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n", + "group": "object", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_object_lookup-33" + ] + } + }, + "git_object_lookup_prefix": { + "type": "function", + "file": "object.h", + "line": 75, + "lineto": 80, + "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, git_repository *repo, const git_oid *id, size_t len, git_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,\n given a prefix of its identifier (short id).

\n", + "comments": "

The object obtained will be so that its identifier\n matches the first 'len' hexadecimal characters\n (packets of 4 bits) of the given 'id'.\n 'len' must be at least GIT_OID_MINPREFIXLEN, and\n long enough to identify a unique object matching\n the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n", + "group": "object" + }, + "git_object_lookup_bypath": { + "type": "function", + "file": "object.h", + "line": 93, + "lineto": 97, + "args": [ + { + "name": "out", + "type": "git_object **", + "comment": "buffer that receives a pointer to the object (which must be freed\n by the caller)" + }, + { + "name": "treeish", + "type": "const git_object *", + "comment": "root object that can be peeled to a tree" + }, + { + "name": "path", + "type": "const char *", + "comment": "relative path from the root object to the desired object" + }, + { + "name": "type", + "type": "git_otype", + "comment": "type of object desired" + } + ], + "argline": "git_object **out, const git_object *treeish, const char *path, git_otype type", + "sig": "git_object **::const git_object *::const char *::git_otype", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Lookup an object that represents a tree entry.

\n", + "comments": "", + "group": "object" + }, + "git_object_id": { + "type": "function", + "file": "object.h", + "line": 105, + "lineto": 105, + "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

\n", + "comments": "", + "group": "object", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_object_id-10", + "ex/v0.23.2/blame.html#git_object_id-11", + "ex/v0.23.2/blame.html#git_object_id-12", + "ex/v0.23.2/blame.html#git_object_id-13" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_object_id-12", + "ex/v0.23.2/cat-file.html#git_object_id-13" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_object_id-34", + "ex/v0.23.2/log.html#git_object_id-35", + "ex/v0.23.2/log.html#git_object_id-36", + "ex/v0.23.2/log.html#git_object_id-37" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_object_id-4", + "ex/v0.23.2/rev-parse.html#git_object_id-5", + "ex/v0.23.2/rev-parse.html#git_object_id-6", + "ex/v0.23.2/rev-parse.html#git_object_id-7", + "ex/v0.23.2/rev-parse.html#git_object_id-8" + ] + } + }, + "git_object_short_id": { + "type": "function", + "file": "object.h", + "line": 119, + "lineto": 119, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Buffer to write string into" + }, + { + "name": "obj", + "type": "const git_object *", + "comment": "The object to get an ID for" + } + ], + "argline": "git_buf *out, const git_object *obj", + "sig": "git_buf *::const git_object *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 for error" + }, + "description": "

Get a short abbreviated OID string for the object

\n", + "comments": "

This starts at the "core.abbrev" length (default 7 characters) and\n iteratively extends to a longer string if that length is ambiguous.\n The result will be unambiguous (at least until new objects are added to\n the repository).

\n", + "group": "object", + "examples": { + "tag.c": [ + "ex/v0.23.2/tag.html#git_object_short_id-5" + ] + } + }, + "git_object_type": { + "type": "function", + "file": "object.h", + "line": 127, + "lineto": 127, + "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

\n", + "comments": "", + "group": "object", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_object_type-14", + "ex/v0.23.2/cat-file.html#git_object_type-15", + "ex/v0.23.2/cat-file.html#git_object_type-16" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_object_type-6" + ] + } + }, + "git_object_owner": { + "type": "function", + "file": "object.h", + "line": 141, + "lineto": 141, + "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

\n", + "comments": "

Freeing or calling git_repository_close on the\n returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without\n affecting the object.

\n", + "group": "object" + }, + "git_object_free": { + "type": "function", + "file": "object.h", + "line": 158, + "lineto": 158, + "args": [ + { + "name": "object", + "type": "git_object *", + "comment": "the object to close" + } + ], + "argline": "git_object *object", + "sig": "git_object *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open object

\n", + "comments": "

This method instructs the library to close an existing\n object; note that git_objects are owned and cached by the repository\n so the object may or may not be freed after this library call,\n depending on how aggressive is the caching mechanism used\n by the repository.

\n\n

IMPORTANT:\n It is necessary to call this method when you stop using\n an object. Failure to do so will cause a memory leak.

\n", + "group": "object", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_object_free-14", + "ex/v0.23.2/blame.html#git_object_free-15", + "ex/v0.23.2/blame.html#git_object_free-16", + "ex/v0.23.2/blame.html#git_object_free-17" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_object_free-17" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_object_free-32" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_object_free-38" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_object_free-9", + "ex/v0.23.2/rev-parse.html#git_object_free-10", + "ex/v0.23.2/rev-parse.html#git_object_free-11" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_object_free-7", + "ex/v0.23.2/tag.html#git_object_free-8", + "ex/v0.23.2/tag.html#git_object_free-9", + "ex/v0.23.2/tag.html#git_object_free-10" + ] + } + }, + "git_object_type2string": { + "type": "function", + "file": "object.h", + "line": 169, + "lineto": 169, + "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 its string representation.

\n", + "comments": "

The result is a pointer to a string in static memory and\n should not be free()'ed.

\n", + "group": "object", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_object_type2string-18", + "ex/v0.23.2/cat-file.html#git_object_type2string-19", + "ex/v0.23.2/cat-file.html#git_object_type2string-20", + "ex/v0.23.2/cat-file.html#git_object_type2string-21" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_object_type2string-33" + ] + } + }, + "git_object_string2type": { + "type": "function", + "file": "object.h", + "line": 177, + "lineto": 177, + "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.

\n", + "comments": "", + "group": "object" + }, + "git_object_typeisloose": { + "type": "function", + "file": "object.h", + "line": 186, + "lineto": 186, + "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,\n false otherwise." + }, + "description": "

Determine if the given git_otype is a valid loose object type.

\n", + "comments": "", + "group": "object" + }, + "git_object__size": { + "type": "function", + "file": "object.h", + "line": 200, + "lineto": 200, + "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\n acts as an in-memory representation of any given\n object type.

\n", + "comments": "

For all the core types, this would the equivalent\n of calling sizeof(git_commit) if the core types\n were not opaque on the external API.

\n", + "group": "object" + }, + "git_object_peel": { + "type": "function", + "file": "object.h", + "line": 225, + "lineto": 228, + "args": [ + { + "name": "peeled", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "object", + "type": "const git_object *", + "comment": "The object to be processed" + }, + { + "name": "target_type", + "type": "git_otype", + "comment": "The type of the requested object (a GIT_OBJ_ value)" + } + ], + "argline": "git_object **peeled, const git_object *object, git_otype target_type", + "sig": "git_object **::const git_object *::git_otype", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" + }, + "description": "

Recursively peel an object until an object of the specified type is met.

\n", + "comments": "

If the query cannot be satisfied due to the object model,\n GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a\n tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will\n be peeled until the type changes. A tag will be peeled until the\n referenced object is no longer a tag, and a commit will be peeled\n to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to\n the target type due to the object model, GIT_EPEEL will be\n returned.

\n\n

You must free the returned object.

\n", + "group": "object" + }, + "git_object_dup": { + "type": "function", + "file": "object.h", + "line": 237, + "lineto": 237, + "args": [ + { + "name": "dest", + "type": "git_object **", + "comment": "Pointer to store the copy of the object" + }, + { + "name": "source", + "type": "git_object *", + "comment": "Original object to copy" + } + ], + "argline": "git_object **dest, git_object *source", + "sig": "git_object **::git_object *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create an in-memory copy of a Git object. The copy must be\n explicitly free'd or it will leak.

\n", + "comments": "", + "group": "object" + }, + "git_odb_new": { + "type": "function", + "file": "odb.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "out", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet 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.

\n", + "comments": "

Before the ODB can be used for read/writing, a custom database\n backend must be manually added using git_odb_add_backend()

\n", + "group": "odb" + }, + "git_odb_open": { + "type": "function", + "file": "odb.h", + "line": 56, + "lineto": 56, + "args": [ + { + "name": "out", + "type": "git_odb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet 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\n the two default backends:

\n", + "comments": "
- git_odb_backend_loose: read and write loose object files\n    from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,\n    assuming `objects_dir` as the Objects folder which\n    contains a 'pack/' folder with the corresponding data\n
\n", + "group": "odb" + }, + "git_odb_add_disk_alternate": { + "type": "function", + "file": "odb.h", + "line": 73, + "lineto": 73, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "database to add the backend to" + }, + { + "name": "path", + "type": "const char *", + "comment": "path to the objects folder for the alternate" + } + ], + "argline": "git_odb *odb, const char *path", + "sig": "git_odb *::const char *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Add an on-disk alternate to an existing Object DB.

\n", + "comments": "

Note that the added path must point to an objects, not\n to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", + "group": "odb" + }, + "git_odb_free": { + "type": "function", + "file": "odb.h", + "line": 80, + "lineto": 80, + "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", + "comment": null + }, + "description": "

Close an open object database.

\n", + "comments": "", + "group": "odb", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_odb_free-22" + ] + } + }, + "git_odb_read": { + "type": "function", + "file": "odb.h", + "line": 99, + "lineto": 99, + "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;\n - GIT_ENOTFOUND if the object is not in the database." + }, + "description": "

Read an object from the database.

\n", + "comments": "

This method queries all available ODB backends\n trying to read the given OID.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n", + "group": "odb", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_odb_read-23" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_odb_read-34" + ] + } + }, + "git_odb_read_prefix": { + "type": "function", + "file": "odb.h", + "line": 128, + "lineto": 128, + "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;\n - GIT_ENOTFOUND if the object is not in the database.\n - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)" + }, + "description": "

Read an object from the database, given a prefix\n of its identifier.

\n", + "comments": "

This method queries all available ODB backends\n trying to match the 'len' first hexadecimal\n characters of the 'short_id'.\n The remaining (GIT_OID_HEXSZ-len)*4 bits of\n 'short_id' must be 0s.\n 'len' must be at least GIT_OID_MINPREFIXLEN,\n and the prefix must be long enough to identify\n a unique object in all the backends; the\n method will fail otherwise.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n", + "group": "odb" + }, + "git_odb_read_header": { + "type": "function", + "file": "odb.h", + "line": 148, + "lineto": 148, + "args": [ + { + "name": "len_out", + "type": "size_t *", + "comment": "pointer where to store the length" + }, + { + "name": "type_out", + "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_out, git_otype *type_out, 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;\n - GIT_ENOTFOUND if the object is not in the database." + }, + "description": "

Read the header of an object from the database, without\n reading its full contents.

\n", + "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header\n of an object, so the whole object will be read and then the\n header will be returned.

\n", + "group": "odb" + }, + "git_odb_exists": { + "type": "function", + "file": "odb.h", + "line": 159, + "lineto": 159, + "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\n - 0, otherwise" + }, + "description": "

Determine if the given object can be found in the object database.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_exists_prefix": { + "type": "function", + "file": "odb.h", + "line": 171, + "lineto": 172, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "The full OID of the found object if just one is found." + }, + { + "name": "db", + "type": "git_odb *", + "comment": "The database to be searched for the given object." + }, + { + "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_oid *out, git_odb *db, const git_oid *short_id, size_t len", + "sig": "git_oid *::git_odb *::const git_oid *::size_t", + "return": { + "type": "int", + "comment": " 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple\n matches were found, other value \n<\n 0 if there was a read error." + }, + "description": "

Determine if objects can be found in the object database from a short OID.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_refresh": { + "type": "function", + "file": "odb.h", + "line": 192, + "lineto": 192, + "args": [ + { + "name": "db", + "type": "struct git_odb *", + "comment": "database to refresh" + } + ], + "argline": "struct git_odb *db", + "sig": "struct git_odb *", + "return": { + "type": "int", + "comment": " 0 on success, error code otherwise" + }, + "description": "

Refresh the object database to load newly added files.

\n", + "comments": "

If the object databases have changed on disk while the library\n is running, this function will force a reload of the underlying\n indexes.

\n\n

Use this function when you're confident that an external\n application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The\n library will automatically attempt to refresh the ODB\n when a lookup fails, to see if the looked up object exists\n on disk but hasn't been loaded yet.

\n", + "group": "odb" + }, + "git_odb_foreach": { + "type": "function", + "file": "odb.h", + "line": 207, + "lineto": 207, + "args": [ + { + "name": "db", + "type": "git_odb *", + "comment": "database to use" + }, + { + "name": "cb", + "type": "git_odb_foreach_cb", + "comment": "the callback to call for each object" + }, + { + "name": "payload", + "type": "void *", + "comment": "data to pass to the callback" + } + ], + "argline": "git_odb *db, git_odb_foreach_cb cb, void *payload", + "sig": "git_odb *::git_odb_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

List all objects available in the database

\n", + "comments": "

The callback will be called for each object available in the\n database. Note that the objects are likely to be returned in the index\n order, which would make accessing the objects in that order inefficient.\n Return a non-zero value from the callback to stop looping.

\n", + "group": "odb" + }, + "git_odb_write": { + "type": "function", + "file": "odb.h", + "line": 227, + "lineto": 227, + "args": [ + { + "name": "out", + "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 *out, 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

\n", + "comments": "

This method writes a full object straight into the ODB.\n For most cases, it is preferred to write objects through a write\n stream, which is both faster and less memory intensive, specially\n for big objects.

\n\n

This method is provided for compatibility with custom backends\n which are not able to support streaming writes

\n", + "group": "odb", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_odb_write-35" + ] + } + }, + "git_odb_open_wstream": { + "type": "function", + "file": "odb.h", + "line": 250, + "lineto": 250, + "args": [ + { + "name": "out", + "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": "git_off_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 **out, git_odb *db, git_off_t size, git_otype type", + "sig": "git_odb_stream **::git_odb *::git_off_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

\n", + "comments": "

The type and final length of the object must be specified\n when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it\n won't be effective until git_odb_stream_finalize_write is called\n and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or\n will leak memory.

\n", + "group": "odb" + }, + "git_odb_stream_write": { + "type": "function", + "file": "odb.h", + "line": 263, + "lineto": 263, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "the data to write" + }, + { + "name": "len", + "type": "size_t", + "comment": "the buffer's length" + } + ], + "argline": "git_odb_stream *stream, const char *buffer, size_t len", + "sig": "git_odb_stream *::const char *::size_t", + "return": { + "type": "int", + "comment": " 0 if the write succeeded; error code otherwise" + }, + "description": "

Write to an odb stream

\n", + "comments": "

This method will fail if the total number of received bytes exceeds the\n size declared with git_odb_open_wstream()

\n", + "group": "odb" + }, + "git_odb_stream_finalize_write": { + "type": "function", + "file": "odb.h", + "line": 278, + "lineto": 278, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "pointer to store the resulting object's id" + }, + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream" + } + ], + "argline": "git_oid *out, git_odb_stream *stream", + "sig": "git_oid *::git_odb_stream *", + "return": { + "type": "int", + "comment": " 0 on success; an error code otherwise" + }, + "description": "

Finish writing to an odb stream

\n", + "comments": "

The object will take its final name and will be available to the\n odb.

\n\n

This method will fail if the total number of received bytes\n differs from the size declared with git_odb_open_wstream()

\n", + "group": "odb" + }, + "git_odb_stream_read": { + "type": "function", + "file": "odb.h", + "line": 285, + "lineto": 285, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": null + }, + { + "name": "buffer", + "type": "char *", + "comment": null + }, + { + "name": "len", + "type": "size_t", + "comment": null + } + ], + "argline": "git_odb_stream *stream, char *buffer, size_t len", + "sig": "git_odb_stream *::char *::size_t", + "return": { + "type": "int", + "comment": null + }, + "description": "

Read from an odb stream

\n", + "comments": "

Most backends don't implement streaming reads

\n", + "group": "odb" + }, + "git_odb_stream_free": { + "type": "function", + "file": "odb.h", + "line": 292, + "lineto": 292, + "args": [ + { + "name": "stream", + "type": "git_odb_stream *", + "comment": "the stream to free" + } + ], + "argline": "git_odb_stream *stream", + "sig": "git_odb_stream *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free an odb stream

\n", + "comments": "", + "group": "odb" + }, + "git_odb_open_rstream": { + "type": "function", + "file": "odb.h", + "line": 318, + "lineto": 318, + "args": [ + { + "name": "out", + "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 **out, 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

\n", + "comments": "

Note that most backends do not support streaming reads\n because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is\n assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and\n will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream\n    - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", + "group": "odb" + }, + "git_odb_write_pack": { + "type": "function", + "file": "odb.h", + "line": 338, + "lineto": 342, + "args": [ + { + "name": "out", + "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_cb", + "comment": "function to call with progress information.\n Be aware that this is called inline with network and indexing operations,\n so performance may be affected." + }, + { + "name": "progress_payload", + "type": "void *", + "comment": "payload for the progress callback" + } + ], + "argline": "git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload", + "sig": "git_odb_writepack **::git_odb *::git_transfer_progress_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Open a stream for writing a pack file to the ODB.

\n", + "comments": "

If the ODB layer understands pack files, then the given\n packfile will likely be streamed directly to disk (and a\n corresponding index created). If the ODB layer does not\n understand pack files, the objects will be stored in whatever\n format the ODB layer uses.

\n", + "group": "odb" + }, + "git_odb_hash": { + "type": "function", + "file": "odb.h", + "line": 356, + "lineto": 356, + "args": [ + { + "name": "out", + "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 *out, 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

\n", + "comments": "

The resulting SHA-1 OID will be the identifier for the data\n buffer as if the data buffer it were to written to the ODB.

\n", + "group": "odb" + }, + "git_odb_hashfile": { + "type": "function", + "file": "odb.h", + "line": 371, + "lineto": 371, + "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\n that the file would have if it were written to the Object\n Database as an object of the given type (w/o applying filters).\n Similar functionality to git.git's git hash-object without\n the -w flag, however, with the --no-filters flag.\n If you need filters, see git_repository_hashfile.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_object_dup": { + "type": "function", + "file": "odb.h", + "line": 385, + "lineto": 385, + "args": [ + { + "name": "dest", + "type": "git_odb_object **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_odb_object *", + "comment": "object to copy" + } + ], + "argline": "git_odb_object **dest, git_odb_object *source", + "sig": "git_odb_object **::git_odb_object *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a copy of an odb_object

\n", + "comments": "

The returned copy must be manually freed with git_odb_object_free.\n Note that because of an implementation detail, the returned copy will be\n the same pointer as source: the object is internally refcounted, so the\n copy still needs to be freed twice.

\n", + "group": "odb" + }, + "git_odb_object_free": { + "type": "function", + "file": "odb.h", + "line": 395, + "lineto": 395, + "args": [ + { + "name": "object", + "type": "git_odb_object *", + "comment": "object to close" + } + ], + "argline": "git_odb_object *object", + "sig": "git_odb_object *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an ODB object

\n", + "comments": "

This method must always be called once a git_odb_object is no\n longer needed, otherwise memory will leak.

\n", + "group": "odb", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_odb_object_free-24" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_odb_object_free-36" + ] + } + }, + "git_odb_object_id": { + "type": "function", + "file": "odb.h", + "line": 405, + "lineto": 405, + "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

\n", + "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": 418, + "lineto": 418, + "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

\n", + "comments": "

This is the uncompressed, raw data as read from the ODB,\n without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", + "group": "odb", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_odb_object_data-37" + ] + } + }, + "git_odb_object_size": { + "type": "function", + "file": "odb.h", + "line": 429, + "lineto": 429, + "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

\n", + "comments": "

This is the real size of the data buffer, not the\n actual size of the object.

\n", + "group": "odb", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_odb_object_size-25" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_odb_object_size-38" + ] + } + }, + "git_odb_object_type": { + "type": "function", + "file": "odb.h", + "line": 437, + "lineto": 437, + "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

\n", + "comments": "", + "group": "odb", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_odb_object_type-39" + ] + } + }, + "git_odb_add_backend": { + "type": "function", + "file": "odb.h", + "line": 452, + "lineto": 452, + "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

\n", + "comments": "

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Read \n for more information.

\n", + "group": "odb" + }, + "git_odb_add_alternate": { + "type": "function", + "file": "odb.h", + "line": 473, + "lineto": 473, + "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\n backend will work as an alternate.

\n", + "comments": "

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read \n for more information.

\n", + "group": "odb" + }, + "git_odb_num_backends": { + "type": "function", + "file": "odb.h", + "line": 481, + "lineto": 481, + "args": [ + { + "name": "odb", + "type": "git_odb *", + "comment": "object database" + } + ], + "argline": "git_odb *odb", + "sig": "git_odb *", + "return": { + "type": "size_t", + "comment": " number of backends in the ODB" + }, + "description": "

Get the number of ODB backend objects

\n", + "comments": "", + "group": "odb" + }, + "git_odb_get_backend": { + "type": "function", + "file": "odb.h", + "line": 491, + "lineto": 491, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "output pointer to ODB backend at pos" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "object database" + }, + { + "name": "pos", + "type": "size_t", + "comment": "index into object database backend list" + } + ], + "argline": "git_odb_backend **out, git_odb *odb, size_t pos", + "sig": "git_odb_backend **::git_odb *::size_t", + "return": { + "type": "int", + "comment": " 0 on success; GIT_ENOTFOUND if pos is invalid; other errors \n<\n 0" + }, + "description": "

Lookup an ODB backend object by index

\n", + "comments": "", + "group": "odb" + }, + "git_odb_backend_pack": { + "type": "function", + "file": "odb_backend.h", + "line": 34, + "lineto": 34, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "the Git repository's objects directory" + } + ], + "argline": "git_odb_backend **out, const char *objects_dir", + "sig": "git_odb_backend **::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a backend for the packfiles.

\n", + "comments": "", + "group": "odb" + }, + "git_odb_backend_loose": { + "type": "function", + "file": "odb_backend.h", + "line": 48, + "lineto": 54, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "objects_dir", + "type": "const char *", + "comment": "the Git repository's objects directory" + }, + { + "name": "compression_level", + "type": "int", + "comment": "zlib compression level to use" + }, + { + "name": "do_fsync", + "type": "int", + "comment": "whether to do an fsync() after writing (currently ignored)" + }, + { + "name": "dir_mode", + "type": "unsigned int", + "comment": "permissions to use creating a directory or 0 for defaults" + }, + { + "name": "file_mode", + "type": "unsigned int", + "comment": "permissions to use creating a file or 0 for defaults" + } + ], + "argline": "git_odb_backend **out, const char *objects_dir, int compression_level, int do_fsync, unsigned int dir_mode, unsigned int file_mode", + "sig": "git_odb_backend **::const char *::int::int::unsigned int::unsigned int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a backend for loose objects

\n", + "comments": "", + "group": "odb" + }, + "git_odb_backend_one_pack": { + "type": "function", + "file": "odb_backend.h", + "line": 67, + "lineto": 67, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "location to store the odb backend pointer" + }, + { + "name": "index_file", + "type": "const char *", + "comment": "path to the packfile's .idx file" + } + ], + "argline": "git_odb_backend **out, const char *index_file", + "sig": "git_odb_backend **::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a backend out of a single packfile

\n", + "comments": "

This can be useful for inspecting the contents of a single\n packfile.

\n", + "group": "odb" + }, + "git_oid_fromstr": { + "type": "function", + "file": "oid.h", + "line": 47, + "lineto": 47, + "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\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded 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.

\n", + "comments": "", + "group": "oid", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_oid_fromstr-40", + "ex/v0.23.2/general.html#git_oid_fromstr-41", + "ex/v0.23.2/general.html#git_oid_fromstr-42", + "ex/v0.23.2/general.html#git_oid_fromstr-43", + "ex/v0.23.2/general.html#git_oid_fromstr-44", + "ex/v0.23.2/general.html#git_oid_fromstr-45", + "ex/v0.23.2/general.html#git_oid_fromstr-46", + "ex/v0.23.2/general.html#git_oid_fromstr-47" + ] + } + }, + "git_oid_fromstrp": { + "type": "function", + "file": "oid.h", + "line": 57, + "lineto": 57, + "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 at least 4 characters\n long and null-terminated." + } + ], + "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 null-terminated string into a git_oid.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_fromstrn": { + "type": "function", + "file": "oid.h", + "line": 70, + "lineto": 70, + "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

\n", + "comments": "

If N is odd, N-1 characters will be parsed instead.\n The remaining space in the git_oid will be set to zero.

\n", + "group": "oid" + }, + "git_oid_fromraw": { + "type": "function", + "file": "oid.h", + "line": 78, + "lineto": 78, + "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", + "comment": null + }, + "description": "

Copy an already raw oid into a git_oid structure.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_fmt": { + "type": "function", + "file": "oid.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (40 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Format a git_oid into a hex string.

\n", + "comments": "", + "group": "oid", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_oid_fmt-48", + "ex/v0.23.2/general.html#git_oid_fmt-49", + "ex/v0.23.2/general.html#git_oid_fmt-50", + "ex/v0.23.2/general.html#git_oid_fmt-51", + "ex/v0.23.2/general.html#git_oid_fmt-52" + ], + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_oid_fmt-1", + "ex/v0.23.2/network/fetch.html#git_oid_fmt-2" + ], + "network/index-pack.c": [ + "ex/v0.23.2/network/index-pack.html#git_oid_fmt-6" + ], + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_oid_fmt-1" + ] + } + }, + "git_oid_nfmt": { + "type": "function", + "file": "oid.h", + "line": 101, + "lineto": 101, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; you say how many bytes to write.\n\t\tIf the number of bytes is > GIT_OID_HEXSZ, extra bytes\n\t\twill be zeroed; if not, a '\n\\\n0' terminator is NOT added." + }, + { + "name": "n", + "type": "size_t", + "comment": "number of characters to write into out string" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Format a git_oid into a partial hex string.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_pathfmt": { + "type": "function", + "file": "oid.h", + "line": 116, + "lineto": 116, + "args": [ + { + "name": "out", + "type": "char *", + "comment": "output hex string; must be pointing at the start of\n\t\tthe hex sequence and have at least the number of bytes\n\t\tneeded for an oid encoded in hex (41 bytes). Only the\n\t\toid digits are written; a '\n\\\n0' terminator must be added\n\t\tby the caller if it is required." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure to format." + } + ], + "argline": "char *out, const git_oid *id", + "sig": "char *::const git_oid *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Format a git_oid into a loose-object path string.

\n", + "comments": "

The resulting string is "aa/...", where "aa" is the first two\n hex digits of the oid and "..." is the remaining 38 digits.

\n", + "group": "oid" + }, + "git_oid_tostr_s": { + "type": "function", + "file": "oid.h", + "line": 129, + "lineto": 129, + "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" + }, + "description": "

Format a git_oid into a statically allocated c-string.

\n", + "comments": "

The c-string is owned by the library and should not be freed\n by the user. If libgit2 is built with thread support, the string\n will be stored in TLS (i.e. one buffer per thread) to allow for\n concurrent calls of the function.

\n", + "group": "oid" + }, + "git_oid_tostr": { + "type": "function", + "file": "oid.h", + "line": 148, + "lineto": 148, + "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": "id", + "type": "const git_oid *", + "comment": "the oid structure to format." + } + ], + "argline": "char *out, size_t n, const git_oid *id", + "sig": "char *::size_t::const git_oid *", + "return": { + "type": "char *", + "comment": " the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string." + }, + "description": "

Format a git_oid into a buffer as a hex format c-string.

\n", + "comments": "

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting\n oid c-string will be truncated to n-1 characters (but will still be\n NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid ==\n NULL), then a pointer to an empty string is returned, so that the\n return value can always be printed.

\n", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_oid_tostr-18", + "ex/v0.23.2/blame.html#git_oid_tostr-19" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_oid_tostr-26", + "ex/v0.23.2/cat-file.html#git_oid_tostr-27", + "ex/v0.23.2/cat-file.html#git_oid_tostr-28", + "ex/v0.23.2/cat-file.html#git_oid_tostr-29", + "ex/v0.23.2/cat-file.html#git_oid_tostr-30" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_oid_tostr-39", + "ex/v0.23.2/log.html#git_oid_tostr-40" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_oid_tostr-12", + "ex/v0.23.2/rev-parse.html#git_oid_tostr-13", + "ex/v0.23.2/rev-parse.html#git_oid_tostr-14", + "ex/v0.23.2/rev-parse.html#git_oid_tostr-15" + ] + } + }, + "git_oid_cpy": { + "type": "function", + "file": "oid.h", + "line": 156, + "lineto": 156, + "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", + "comment": null + }, + "description": "

Copy an oid from one structure to another.

\n", + "comments": "", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_oid_cpy-20", + "ex/v0.23.2/blame.html#git_oid_cpy-21", + "ex/v0.23.2/blame.html#git_oid_cpy-22" + ] + } + }, + "git_oid_cmp": { + "type": "function", + "file": "oid.h", + "line": 165, + "lineto": 165, + "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": " \n<\n0, 0, >0 if a \n<\n b, a == b, a > b." + }, + "description": "

Compare two oid structures.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_equal": { + "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." + } + ], + "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

\n", + "comments": "", + "group": "oid" + }, + "git_oid_ncmp": { + "type": "function", + "file": "oid.h", + "line": 185, + "lineto": 185, + "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)\n of two oid structures.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_streq": { + "type": "function", + "file": "oid.h", + "line": 194, + "lineto": 194, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." + } + ], + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 in case of a match, -1 otherwise." + }, + "description": "

Check if an oid equals an hex formatted object id.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_strcmp": { + "type": "function", + "file": "oid.h", + "line": 204, + "lineto": 204, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": "oid structure." + }, + { + "name": "str", + "type": "const char *", + "comment": "input hex string of an object id." + } + ], + "argline": "const git_oid *id, const char *str", + "sig": "const git_oid *::const char *", + "return": { + "type": "int", + "comment": " -1 if str is not valid, \n<\n0 if id sorts before str,\n 0 if id matches str, >0 if id sorts after str." + }, + "description": "

Compare an oid to an hex formatted object id.

\n", + "comments": "", + "group": "oid" + }, + "git_oid_iszero": { + "type": "function", + "file": "oid.h", + "line": 211, + "lineto": 211, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": null + } + ], + "argline": "const git_oid *id", + "sig": "const git_oid *", + "return": { + "type": "int", + "comment": " 1 if all zeros, 0 otherwise." + }, + "description": "

Check is an oid is all zeros.

\n", + "comments": "", + "group": "oid", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_oid_iszero-23" + ], + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_oid_iszero-3" + ] + } + }, + "git_oid_shorten_new": { + "type": "function", + "file": "oid.h", + "line": 232, + "lineto": 232, + "args": [ + { + "name": "min_length", + "type": "size_t", + "comment": "The minimal length for all identifiers,\n\t\twhich will be used even if shorter OIDs would still\n\t\tbe 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.

\n", + "comments": "

The OID shortener is used to process a list of OIDs\n in text form and return the shortest length that would\n uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", + "group": "oid" + }, + "git_oid_shorten_add": { + "type": "function", + "file": "oid.h", + "line": 258, + "lineto": 258, + "args": [ + { + "name": "os", + "type": "git_oid_shorten *", + "comment": "a `git_oid_shorten` instance" + }, + { + "name": "text_id", + "type": "const char *", + "comment": "an OID in text form" + } + ], + "argline": "git_oid_shorten *os, const char *text_id", + "sig": "git_oid_shorten *::const char *", + "return": { + "type": "int", + "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." + }, + "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", + "comments": "

The OID is expected to be a 40-char hexadecimal string.\n The OID is owned by the user and will not be modified\n or freed.

\n\n

For performance reasons, there is a hard-limit of how many\n OIDs can be added to a single set (around ~32000, assuming\n a mostly randomized distribution), which should be enough\n for any kind of program, and keeps the algorithm fast and\n memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a\n GITERR_INVALID error

\n", + "group": "oid" + }, + "git_oid_shorten_free": { + "type": "function", + "file": "oid.h", + "line": 265, + "lineto": 265, + "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", + "comment": null + }, + "description": "

Free an OID shortener instance

\n", + "comments": "", + "group": "oid" + }, + "git_oidarray_free": { + "type": "function", + "file": "oidarray.h", + "line": 34, + "lineto": 34, + "args": [ + { + "name": "array", + "type": "git_oidarray *", + "comment": "git_oidarray from which to free oid data" + } + ], + "argline": "git_oidarray *array", + "sig": "git_oidarray *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the OID array

\n", + "comments": "

This method must (and must only) be called on git_oidarray\n objects where the array is allocated by the library. Not doing so,\n will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n", + "group": "oidarray" + }, + "git_packbuilder_new": { + "type": "function", + "file": "pack.h", + "line": 64, + "lineto": 64, + "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

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_set_threads": { + "type": "function", + "file": "pack.h", + "line": 77, + "lineto": 77, + "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": "unsigned int", + "comment": " number of actual threads to be used" + }, + "description": "

Set number of threads to spawn

\n", + "comments": "

By default, libgit2 won't spawn any threads at all;\n when set to 0, libgit2 will autodetect the number of\n CPUs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert": { + "type": "function", + "file": "pack.h", + "line": 91, + "lineto": 91, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name; might be NULL" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Insert a single object

\n", + "comments": "

For an optimal pack it's mandatory to insert objects in recency order,\n commits followed by trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_tree": { + "type": "function", + "file": "pack.h", + "line": 103, + "lineto": 103, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the root tree" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Insert a root tree object

\n", + "comments": "

This will add the tree as well as all referenced trees and blobs.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_commit": { + "type": "function", + "file": "pack.h", + "line": 115, + "lineto": 115, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The oid of the commit" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id", + "sig": "git_packbuilder *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Insert a commit object

\n", + "comments": "

This will add a commit as well as the completed referenced tree.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_walk": { + "type": "function", + "file": "pack.h", + "line": 128, + "lineto": 128, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revwalk to use to fill the packbuilder" + } + ], + "argline": "git_packbuilder *pb, git_revwalk *walk", + "sig": "git_packbuilder *::git_revwalk *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Insert objects as given by the walk

\n", + "comments": "

Those commits and all objects they reference will be inserted into\n the packbuilder.

\n", + "group": "packbuilder" + }, + "git_packbuilder_insert_recur": { + "type": "function", + "file": "pack.h", + "line": 140, + "lineto": 140, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the id of the root object to insert" + }, + { + "name": "name", + "type": "const char *", + "comment": "optional name for the object" + } + ], + "argline": "git_packbuilder *pb, const git_oid *id, const char *name", + "sig": "git_packbuilder *::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Recursively insert an object and its referenced objects

\n", + "comments": "

Insert the object as well as any object it references.

\n", + "group": "packbuilder" + }, + "git_packbuilder_write": { + "type": "function", + "file": "pack.h", + "line": 164, + "lineto": 169, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + }, + { + "name": "path", + "type": "const char *", + "comment": "to the directory where the packfile and index should be stored" + }, + { + "name": "mode", + "type": "unsigned int", + "comment": "permissions to use creating a packfile or 0 for defaults" + }, + { + "name": "progress_cb", + "type": "git_transfer_progress_cb", + "comment": "function to call with progress information from the indexer (optional)" + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "payload for the progress callback (optional)" + } + ], + "argline": "git_packbuilder *pb, const char *path, unsigned int mode, git_transfer_progress_cb progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::const char *::unsigned int::git_transfer_progress_cb::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Write the new pack and corresponding index file to path.

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_hash": { + "type": "function", + "file": "pack.h", + "line": 179, + "lineto": 179, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "const git_oid *", + "comment": null + }, + "description": "

Get the packfile's hash

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the packfile has been written.

\n", + "group": "packbuilder" + }, + "git_packbuilder_foreach": { + "type": "function", + "file": "pack.h", + "line": 191, + "lineto": 191, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + }, + { + "name": "cb", + "type": "git_packbuilder_foreach_cb", + "comment": "the callback to call with each packed object's buffer" + }, + { + "name": "payload", + "type": "void *", + "comment": "the callback's data" + } + ], + "argline": "git_packbuilder *pb, git_packbuilder_foreach_cb cb, void *payload", + "sig": "git_packbuilder *::git_packbuilder_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create the new pack and pass each object to the callback

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_object_count": { + "type": "function", + "file": "pack.h", + "line": 199, + "lineto": 199, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "uint32_t", + "comment": " the number of objects in the packfile" + }, + "description": "

Get the total number of objects the packbuilder will write out

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_written": { + "type": "function", + "file": "pack.h", + "line": 207, + "lineto": 207, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "the packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "uint32_t", + "comment": " the number of objects which have already been written" + }, + "description": "

Get the number of objects the packbuilder has already written out

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_set_callbacks": { + "type": "function", + "file": "pack.h", + "line": 226, + "lineto": 229, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder object" + }, + { + "name": "progress_cb", + "type": "git_packbuilder_progress", + "comment": "Function to call with progress information during\n pack building. Be aware that this is called inline with pack building\n operations, so performance may be affected." + }, + { + "name": "progress_cb_payload", + "type": "void *", + "comment": "Payload for progress callback." + } + ], + "argline": "git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload", + "sig": "git_packbuilder *::git_packbuilder_progress::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Set the callbacks for a packbuilder

\n", + "comments": "", + "group": "packbuilder" + }, + "git_packbuilder_free": { + "type": "function", + "file": "pack.h", + "line": 236, + "lineto": 236, + "args": [ + { + "name": "pb", + "type": "git_packbuilder *", + "comment": "The packbuilder" + } + ], + "argline": "git_packbuilder *pb", + "sig": "git_packbuilder *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the packbuilder and all associated data

\n", + "comments": "", + "group": "packbuilder" + }, + "git_patch_from_diff": { + "type": "function", + "file": "patch.h", + "line": 51, + "lineto": 52, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "Output parameter for the delta patch object" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "Diff list object" + }, + { + "name": "idx", + "type": "size_t", + "comment": "Index into diff list" + } + ], + "argline": "git_patch **out, git_diff *diff, size_t idx", + "sig": "git_patch **::git_diff *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, other value \n<\n 0 on error" + }, + "description": "

Return a patch for an entry in the diff list.

\n", + "comments": "

The git_patch is a newly created object contains the text diffs\n for the delta. You have to call git_patch_free() when you are\n done with it. You can use the patch object to loop over all the hunks\n and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be\n created, the output will be set to NULL, and the binary flag will be\n set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass\n NULL for the git_patch, then the text diff will not be calculated.

\n", + "group": "patch" + }, + "git_patch_from_blobs": { + "type": "function", + "file": "patch.h", + "line": 70, + "lineto": 76, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "new_blob", + "type": "const git_blob *", + "comment": "Blob for new side of diff, or NULL for empty blob" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat new blob as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const git_blob *new_blob, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const git_blob *::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between two blobs.

\n", + "comments": "

This is just like git_diff_blobs() except it generates a patch object\n for the difference instead of directly making callbacks. You can use the\n standard git_patch accessor functions to read the patch data, and\n you must call git_patch_free() on the patch when done.

\n", + "group": "patch" + }, + "git_patch_from_blob_and_buffer": { + "type": "function", + "file": "patch.h", + "line": 95, + "lineto": 102, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_blob", + "type": "const git_blob *", + "comment": "Blob for old side of diff, or NULL for empty blob" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old blob as if it had this filename; can be NULL" + }, + { + "name": "buffer", + "type": "const char *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "buffer_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "buffer_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const git_blob *old_blob, const char *old_as_path, const char *buffer, size_t buffer_len, const char *buffer_as_path, const git_diff_options *opts", + "sig": "git_patch **::const git_blob *::const char *::const char *::size_t::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between a blob and a buffer.

\n", + "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" + }, + "git_patch_from_buffers": { + "type": "function", + "file": "patch.h", + "line": 122, + "lineto": 130, + "args": [ + { + "name": "out", + "type": "git_patch **", + "comment": "The generated patch; NULL on error" + }, + { + "name": "old_buffer", + "type": "const void *", + "comment": "Raw data for old side of diff, or NULL for empty" + }, + { + "name": "old_len", + "type": "size_t", + "comment": "Length of the raw data for old side of the diff" + }, + { + "name": "old_as_path", + "type": "const char *", + "comment": "Treat old buffer as if it had this filename; can be NULL" + }, + { + "name": "new_buffer", + "type": "const char *", + "comment": "Raw data for new side of diff, or NULL for empty" + }, + { + "name": "new_len", + "type": "size_t", + "comment": "Length of raw data for new side of diff" + }, + { + "name": "new_as_path", + "type": "const char *", + "comment": "Treat buffer as if it had this filename; can be NULL" + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Options for diff, or NULL for default options" + } + ], + "argline": "git_patch **out, const void *old_buffer, size_t old_len, const char *old_as_path, const char *new_buffer, size_t new_len, const char *new_as_path, const git_diff_options *opts", + "sig": "git_patch **::const void *::size_t::const char *::const char *::size_t::const char *::const git_diff_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code \n<\n 0" + }, + "description": "

Directly generate a patch from the difference between two buffers.

\n", + "comments": "

This is just like git_diff_buffers() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n", + "group": "patch" + }, + "git_patch_free": { + "type": "function", + "file": "patch.h", + "line": 135, + "lineto": 135, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": null + } + ], + "argline": "git_patch *patch", + "sig": "git_patch *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a git_patch object.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_get_delta": { + "type": "function", + "file": "patch.h", + "line": 141, + "lineto": 141, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": null + } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", + "return": { + "type": "const git_diff_delta *", + "comment": null + }, + "description": "

Get the delta associated with a patch. This delta points to internal\n data and you do not have to release it when you are done with it.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_num_hunks": { + "type": "function", + "file": "patch.h", + "line": 146, + "lineto": 146, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": null + } + ], + "argline": "const git_patch *patch", + "sig": "const git_patch *", + "return": { + "type": "size_t", + "comment": null + }, + "description": "

Get the number of hunks in a patch

\n", + "comments": "", + "group": "patch" + }, + "git_patch_line_stats": { + "type": "function", + "file": "patch.h", + "line": 164, + "lineto": 168, + "args": [ + { + "name": "total_context", + "type": "size_t *", + "comment": "Count of context lines in output, can be NULL." + }, + { + "name": "total_additions", + "type": "size_t *", + "comment": "Count of addition lines in output, can be NULL." + }, + { + "name": "total_deletions", + "type": "size_t *", + "comment": "Count of deletion lines in output, can be NULL." + }, + { + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" + } + ], + "argline": "size_t *total_context, size_t *total_additions, size_t *total_deletions, const git_patch *patch", + "sig": "size_t *::size_t *::size_t *::const git_patch *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on error" + }, + "description": "

Get line counts of each type in a patch.

\n", + "comments": "

This helps imitate a diff --numstat type of output. For that purpose,\n you only need the total_additions and total_deletions values, but we\n include the total_context line count in case you want the total number\n of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", + "group": "patch" + }, + "git_patch_get_hunk": { + "type": "function", + "file": "patch.h", + "line": 183, + "lineto": 187, + "args": [ + { + "name": "out", + "type": "const git_diff_hunk **", + "comment": "Output pointer to git_diff_hunk of hunk" + }, + { + "name": "lines_in_hunk", + "type": "size_t *", + "comment": "Output count of total lines in this hunk" + }, + { + "name": "patch", + "type": "git_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_hunk **out, size_t *lines_in_hunk, git_patch *patch, size_t hunk_idx", + "sig": "const git_diff_hunk **::size_t *::git_patch *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error" + }, + "description": "

Get the information about a hunk in a patch

\n", + "comments": "

Given a patch and a hunk index into the patch, this returns detailed\n information about that hunk. Any of the output pointers can be passed\n as NULL if you don't care about that particular piece of information.

\n", + "group": "patch" + }, + "git_patch_num_lines_in_hunk": { + "type": "function", + "file": "patch.h", + "line": 196, + "lineto": 198, + "args": [ + { + "name": "patch", + "type": "const git_patch *", + "comment": "The git_patch object" + }, + { + "name": "hunk_idx", + "type": "size_t", + "comment": "Index of the hunk" + } + ], + "argline": "const git_patch *patch, size_t hunk_idx", + "sig": "const git_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.

\n", + "comments": "", + "group": "patch" + }, + "git_patch_get_line_in_hunk": { + "type": "function", + "file": "patch.h", + "line": 214, + "lineto": 218, + "args": [ + { + "name": "out", + "type": "const git_diff_line **", + "comment": "The git_diff_line data for this line" + }, + { + "name": "patch", + "type": "git_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", + "comment": "The index of the line in the hunk" + } + ], + "argline": "const git_diff_line **out, git_patch *patch, size_t hunk_idx, size_t line_of_hunk", + "sig": "const git_diff_line **::git_patch *::size_t::size_t", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Get data about a line in a hunk of a patch.

\n", + "comments": "

Given a patch, a hunk index, and a line index in the hunk, this\n will return a lot of details about that line. If you pass a hunk\n index larger than the number of hunks or a line index larger than\n the number of lines in the hunk, this will return -1.

\n", + "group": "patch" + }, + "git_patch_size": { + "type": "function", + "file": "patch.h", + "line": 236, + "lineto": 240, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + }, + { + "name": "include_context", + "type": "int", + "comment": "Include context lines in size if non-zero" + }, + { + "name": "include_hunk_headers", + "type": "int", + "comment": "Include hunk header lines if non-zero" + }, + { + "name": "include_file_headers", + "type": "int", + "comment": "Include file header lines if non-zero" + } + ], + "argline": "git_patch *patch, int include_context, int include_hunk_headers, int include_file_headers", + "sig": "git_patch *::int::int::int", + "return": { + "type": "size_t", + "comment": " The number of bytes of data" + }, + "description": "

Look up size of patch diff data in bytes

\n", + "comments": "

This returns the raw size of the patch data. This only includes the\n actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size\n of all of the diff output; if you pass it as false (zero), this will\n only include the actual changed lines (as if context_lines was 0).

\n", + "group": "patch" + }, + "git_patch_print": { + "type": "function", + "file": "patch.h", + "line": 254, + "lineto": 257, + "args": [ + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + }, + { + "name": "print_cb", + "type": "git_diff_line_cb", + "comment": "Callback function to output lines of the patch. Will be\n called for file headers, hunk headers, and diff lines." + }, + { + "name": "payload", + "type": "void *", + "comment": "Reference pointer that will be passed to your callbacks." + } + ], + "argline": "git_patch *patch, git_diff_line_cb print_cb, void *payload", + "sig": "git_patch *::git_diff_line_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Serialize the patch to text via callback.

\n", + "comments": "

Returning a non-zero value from the callback will terminate the iteration\n and return that value to the caller.

\n", + "group": "patch" + }, + "git_patch_to_buf": { + "type": "function", + "file": "patch.h", + "line": 266, + "lineto": 268, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "The git_buf to be filled in" + }, + { + "name": "patch", + "type": "git_patch *", + "comment": "A git_patch representing changes to one file" + } + ], + "argline": "git_buf *out, git_patch *patch", + "sig": "git_buf *::git_patch *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure." + }, + "description": "

Get the content of a patch as a single diff text.

\n", + "comments": "", + "group": "patch" + }, + "git_pathspec_new": { + "type": "function", + "file": "pathspec.h", + "line": 65, + "lineto": 66, + "args": [ + { + "name": "out", + "type": "git_pathspec **", + "comment": "Output of the compiled pathspec" + }, + { + "name": "pathspec", + "type": "const git_strarray *", + "comment": "A git_strarray of the paths to match" + } + ], + "argline": "git_pathspec **out, const git_strarray *pathspec", + "sig": "git_pathspec **::const git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Compile a pathspec

\n", + "comments": "", + "group": "pathspec", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_pathspec_new-41" + ] + } + }, + "git_pathspec_free": { + "type": "function", + "file": "pathspec.h", + "line": 73, + "lineto": 73, + "args": [ + { + "name": "ps", + "type": "git_pathspec *", + "comment": "The compiled pathspec" + } + ], + "argline": "git_pathspec *ps", + "sig": "git_pathspec *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a pathspec

\n", + "comments": "", + "group": "pathspec", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_pathspec_free-42" + ] + } + }, + "git_pathspec_matches_path": { + "type": "function", + "file": "pathspec.h", + "line": 88, + "lineto": 89, + "args": [ + { + "name": "ps", + "type": "const git_pathspec *", + "comment": "The compiled pathspec" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "path", + "type": "const char *", + "comment": "The pathname to attempt to match" + } + ], + "argline": "const git_pathspec *ps, uint32_t flags, const char *path", + "sig": "const git_pathspec *::uint32_t::const char *", + "return": { + "type": "int", + "comment": " 1 is path matches spec, 0 if it does not" + }, + "description": "

Try to match a path against a pathspec

\n", + "comments": "

Unlike most of the other pathspec matching functions, this will not\n fall back on the native case-sensitivity for your platform. You must\n explicitly pass flags to control case sensitivity or else this will\n fall back on being case sensitive.

\n", + "group": "pathspec" + }, + "git_pathspec_match_workdir": { + "type": "function", + "file": "pathspec.h", + "line": 113, + "lineto": 117, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which to match; bare repo is an error" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_repository *repo, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_repository *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given" + }, + "description": "

Match a pathspec against the working directory of a repository.

\n", + "comments": "

This matches the pathspec against the current files in the working\n directory of the repository. It is an error to invoke this on a bare\n repo. This handles git ignores (i.e. ignored files will not be\n considered to match the pathspec unless the file is tracked in the\n index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_index": { + "type": "function", + "file": "pathspec.h", + "line": 142, + "lineto": 146, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "index", + "type": "git_index *", + "comment": "The index to match against" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_index *index, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_index *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against entries in an index.

\n", + "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled\n by the current case-sensitivity of the index object itself and the\n USE_CASE and IGNORE_CASE flags will have no effect. This behavior will\n be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_tree": { + "type": "function", + "file": "pathspec.h", + "line": 166, + "lineto": 170, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "tree", + "type": "git_tree *", + "comment": "The root-level tree to match against" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_tree *tree, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_tree *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against files in a tree.

\n", + "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_pathspec_match_tree-43" + ] + } + }, + "git_pathspec_match_diff": { + "type": "function", + "file": "pathspec.h", + "line": 190, + "lineto": 194, + "args": [ + { + "name": "out", + "type": "git_pathspec_match_list **", + "comment": "Output list of matches; pass NULL to just get return value" + }, + { + "name": "diff", + "type": "git_diff *", + "comment": "A generated diff list" + }, + { + "name": "flags", + "type": "uint32_t", + "comment": "Combination of git_pathspec_flag_t options to control match" + }, + { + "name": "ps", + "type": "git_pathspec *", + "comment": "Pathspec to be matched" + } + ], + "argline": "git_pathspec_match_list **out, git_diff *diff, uint32_t flags, git_pathspec *ps", + "sig": "git_pathspec_match_list **::git_diff *::uint32_t::git_pathspec *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" + }, + "description": "

Match a pathspec against files in a diff list.

\n", + "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_free": { + "type": "function", + "file": "pathspec.h", + "line": 201, + "lineto": 201, + "args": [ + { + "name": "m", + "type": "git_pathspec_match_list *", + "comment": "The git_pathspec_match_list to be freed" + } + ], + "argline": "git_pathspec_match_list *m", + "sig": "git_pathspec_match_list *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free memory associates with a git_pathspec_match_list

\n", + "comments": "", + "group": "pathspec" + }, + "git_pathspec_match_list_entrycount": { + "type": "function", + "file": "pathspec.h", + "line": 209, + "lineto": 210, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + } + ], + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", + "return": { + "type": "size_t", + "comment": " Number of items in match list" + }, + "description": "

Get the number of items in a match list.

\n", + "comments": "", + "group": "pathspec" + }, + "git_pathspec_match_list_entry": { + "type": "function", + "file": "pathspec.h", + "line": 222, + "lineto": 223, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the list" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const char *", + "comment": " The filename of the match" + }, + "description": "

Get a matching filename by position.

\n", + "comments": "

This routine cannot be used if the match list was generated by\n git_pathspec_match_diff. If so, it will always return NULL.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_diff_entry": { + "type": "function", + "file": "pathspec.h", + "line": 235, + "lineto": 236, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the list" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const git_diff_delta *", + "comment": " The filename of the match" + }, + "description": "

Get a matching diff delta by position.

\n", + "comments": "

This routine can only be used if the match list was generated by\n git_pathspec_match_diff. Otherwise it will always return NULL.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_failed_entrycount": { + "type": "function", + "file": "pathspec.h", + "line": 247, + "lineto": 248, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + } + ], + "argline": "const git_pathspec_match_list *m", + "sig": "const git_pathspec_match_list *", + "return": { + "type": "size_t", + "comment": " Number of items in original pathspec that had no matches" + }, + "description": "

Get the number of pathspec items that did not match.

\n", + "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when\n generating the git_pathspec_match_list.

\n", + "group": "pathspec" + }, + "git_pathspec_match_list_failed_entry": { + "type": "function", + "file": "pathspec.h", + "line": 259, + "lineto": 260, + "args": [ + { + "name": "m", + "type": "const git_pathspec_match_list *", + "comment": "The git_pathspec_match_list object" + }, + { + "name": "pos", + "type": "size_t", + "comment": "The index into the failed items" + } + ], + "argline": "const git_pathspec_match_list *m, size_t pos", + "sig": "const git_pathspec_match_list *::size_t", + "return": { + "type": "const char *", + "comment": " The pathspec pattern that didn't match anything" + }, + "description": "

Get an original pathspec string that had no matches.

\n", + "comments": "

This will be return NULL for positions out of range.

\n", + "group": "pathspec" + }, + "git_rebase_init_options": { + "type": "function", + "file": "rebase.h", + "line": 141, + "lineto": 143, + "args": [ + { + "name": "opts", + "type": "git_rebase_options *", + "comment": "the `git_rebase_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_REBASE_OPTIONS_VERSION` here." + } + ], + "argline": "git_rebase_options *opts, unsigned int version", + "sig": "git_rebase_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_rebase_options with default values. Equivalent to\n creating an instance with GIT_REBASE_OPTIONS_INIT.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_init": { + "type": "function", + "file": "rebase.h", + "line": 162, + "lineto": 168, + "args": [ + { + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository to perform the rebase" + }, + { + "name": "branch", + "type": "const git_annotated_commit *", + "comment": "The terminal commit to rebase, or NULL to rebase the\n current branch" + }, + { + "name": "upstream", + "type": "const git_annotated_commit *", + "comment": "The commit to begin rebasing from, or NULL to rebase all\n reachable commits" + }, + { + "name": "onto", + "type": "const git_annotated_commit *", + "comment": "The branch to rebase onto, or NULL to rebase onto the given\n upstream" + }, + { + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed, or NULL" + } + ], + "argline": "git_rebase **out, git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_annotated_commit *::const git_annotated_commit *::const git_annotated_commit *::const git_rebase_options *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a rebase operation to rebase the changes in branch\n relative to upstream onto another branch. To begin the rebase\n process, call git_rebase_next. When you have finished with this\n object, call git_rebase_free.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_open": { + "type": "function", + "file": "rebase.h", + "line": 179, + "lineto": 182, + "args": [ + { + "name": "out", + "type": "git_rebase **", + "comment": "Pointer to store the rebase object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository that has a rebase in-progress" + }, + { + "name": "opts", + "type": "const git_rebase_options *", + "comment": "Options to specify how rebase is performed" + } + ], + "argline": "git_rebase **out, git_repository *repo, const git_rebase_options *opts", + "sig": "git_rebase **::git_repository *::const git_rebase_options *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Opens an existing rebase that was previously started by either an\n invocation of git_rebase_init or by another client.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_entrycount": { + "type": "function", + "file": "rebase.h", + "line": 190, + "lineto": 190, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "size_t", + "comment": " The number of rebase operations in total" + }, + "description": "

Gets the count of rebase operations that are to be applied.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_current": { + "type": "function", + "file": "rebase.h", + "line": 201, + "lineto": 201, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "size_t", + "comment": " The index of the rebase operation currently being applied." + }, + "description": "

Gets the index of the rebase operation that is currently being applied.\n If the first operation has not yet been applied (because you have\n called init but not yet next) then this returns\n GIT_REBASE_NO_OPERATION.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_operation_byindex": { + "type": "function", + "file": "rebase.h", + "line": 210, + "lineto": 212, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The in-progress rebase" + }, + { + "name": "idx", + "type": "size_t", + "comment": "The index of the rebase operation to retrieve" + } + ], + "argline": "git_rebase *rebase, size_t idx", + "sig": "git_rebase *::size_t", + "return": { + "type": "git_rebase_operation *", + "comment": " The rebase operation or NULL if `idx` was out of bounds" + }, + "description": "

Gets the rebase operation specified by the given index.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_next": { + "type": "function", + "file": "rebase.h", + "line": 225, + "lineto": 227, + "args": [ + { + "name": "operation", + "type": "git_rebase_operation **", + "comment": "Pointer to store the rebase operation that is to be performed next" + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase in progress" + } + ], + "argline": "git_rebase_operation **operation, git_rebase *rebase", + "sig": "git_rebase_operation **::git_rebase *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Performs the next rebase operation and returns the information about it.\n If the operation is one that applies a patch (which is any operation except\n GIT_REBASE_OPERATION_EXEC) then the patch will be applied and the index and\n working directory will be updated with the changes. If there are conflicts,\n you will need to address those before committing the changes.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_commit": { + "type": "function", + "file": "rebase.h", + "line": 251, + "lineto": 257, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer in which to store the OID of the newly created commit" + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + }, + { + "name": "author", + "type": "const git_signature *", + "comment": "The author of the updated commit, or NULL to keep the\n author from the original commit" + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": "The committer of the rebase" + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": "The encoding for the message in the commit,\n represented with a standard encoding name. If message is NULL,\n this should also be NULL, and the encoding from the original\n commit will be maintained. If message is specified, this may be\n NULL to indicate that \"UTF-8\" is to be used." + }, + { + "name": "message", + "type": "const char *", + "comment": "The message for this commit, or NULL to use the message\n from the original commit." + } + ], + "argline": "git_oid *id, git_rebase *rebase, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message", + "sig": "git_oid *::git_rebase *::const git_signature *::const git_signature *::const char *::const char *", + "return": { + "type": "int", + "comment": " Zero on success, GIT_EUNMERGED if there are unmerged changes in\n the index, GIT_EAPPLIED if the current commit has already\n been applied to the upstream and there is nothing to commit,\n -1 on failure." + }, + "description": "

Commits the current patch. You must have resolved any conflicts that\n were introduced during the patch application from the git_rebase_next\n invocation.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_abort": { + "type": "function", + "file": "rebase.h", + "line": 267, + "lineto": 267, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "int", + "comment": " Zero on success; GIT_ENOTFOUND if a rebase is not in progress,\n -1 on other errors." + }, + "description": "

Aborts a rebase that is currently in progress, resetting the repository\n and working directory to their state before rebase began.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_finish": { + "type": "function", + "file": "rebase.h", + "line": 277, + "lineto": 279, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase that is in-progress" + }, + { + "name": "signature", + "type": "const git_signature *", + "comment": "The identity that is finishing the rebase (optional)" + } + ], + "argline": "git_rebase *rebase, const git_signature *signature", + "sig": "git_rebase *::const git_signature *", + "return": { + "type": "int", + "comment": " Zero on success; -1 on error" + }, + "description": "

Finishes a rebase that is currently in progress once all patches have\n been applied.

\n", + "comments": "", + "group": "rebase" + }, + "git_rebase_free": { + "type": "function", + "file": "rebase.h", + "line": 286, + "lineto": 286, + "args": [ + { + "name": "rebase", + "type": "git_rebase *", + "comment": "The rebase object" + } + ], + "argline": "git_rebase *rebase", + "sig": "git_rebase *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Frees the git_rebase object.

\n", + "comments": "", + "group": "rebase" + }, + "git_refdb_new": { + "type": "function", + "file": "refdb.h", + "line": 35, + "lineto": 35, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a new reference database with no backends.

\n", + "comments": "

Before the Ref DB can be used for read/writing, a custom database\n backend must be manually set using git_refdb_set_backend()

\n", + "group": "refdb" + }, + "git_refdb_open": { + "type": "function", + "file": "refdb.h", + "line": 49, + "lineto": 49, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "location to store the database pointer, if opened.\n\t\t\tSet to NULL if the open failed." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a new reference database and automatically add\n the default backends:

\n", + "comments": "
    \n
  • git_refdb_dir: read and write loose and packed refs\n from disk, assuming the repository dir as the folder
  • \n
\n", + "group": "refdb" + }, + "git_refdb_compress": { + "type": "function", + "file": "refdb.h", + "line": 56, + "lineto": 56, + "args": [ + { + "name": "refdb", + "type": "git_refdb *", + "comment": null + } + ], + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. For on-disk reference\n databases, for example, this may pack all loose references.

\n", + "comments": "", + "group": "refdb" + }, + "git_refdb_free": { + "type": "function", + "file": "refdb.h", + "line": 63, + "lineto": 63, + "args": [ + { + "name": "refdb", + "type": "git_refdb *", + "comment": "reference database pointer or NULL" + } + ], + "argline": "git_refdb *refdb", + "sig": "git_refdb *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open reference database.

\n", + "comments": "", + "group": "refdb" + }, + "git_reflog_read": { + "type": "function", + "file": "reflog.h", + "line": 38, + "lineto": 38, + "args": [ + { + "name": "out", + "type": "git_reflog **", + "comment": "pointer to reflog" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repostiory" + }, + { + "name": "name", + "type": "const char *", + "comment": "reference to look up" + } + ], + "argline": "git_reflog **out, git_repository *repo, const char *name", + "sig": "git_reflog **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Read the reflog for the given reference

\n", + "comments": "

If there is no reflog file for the given\n reference yet, an empty reflog object will\n be returned.

\n\n

The reflog must be freed manually by using\n git_reflog_free().

\n", + "group": "reflog" + }, + "git_reflog_write": { + "type": "function", + "file": "reflog.h", + "line": 47, + "lineto": 47, + "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\n using an atomic file lock.

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_append": { + "type": "function", + "file": "reflog.h", + "line": 60, + "lineto": 60, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "an existing reflog object" + }, + { + "name": "id", + "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 *id, 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 in-memory reflog.

\n", + "comments": "

msg is optional and can be NULL.

\n", + "group": "reflog" + }, + "git_reflog_rename": { + "type": "function", + "file": "reflog.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "old_name", + "type": "const char *", + "comment": "the old name of the reference" + }, + { + "name": "name", + "type": "const char *", + "comment": "the new name of the reference" + } + ], + "argline": "git_repository *repo, const char *old_name, const char *name", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Rename a reflog

\n", + "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity.\n See git_reference_create_symbolic() for rules about valid names.

\n", + "group": "reflog" + }, + "git_reflog_delete": { + "type": "function", + "file": "reflog.h", + "line": 84, + "lineto": 84, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "the reflog to delete" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Delete the reflog for the given reference

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entrycount": { + "type": "function", + "file": "reflog.h", + "line": 92, + "lineto": 92, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "the previously loaded reflog" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { + "type": "size_t", + "comment": " the number of log entries" + }, + "description": "

Get the number of log entries in a reflog

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_byindex": { + "type": "function", + "file": "reflog.h", + "line": 105, + "lineto": 105, + "args": [ + { + "name": "reflog", + "type": "const git_reflog *", + "comment": "a previously loaded reflog" + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to lookup. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + } + ], + "argline": "const git_reflog *reflog, size_t idx", + "sig": "const git_reflog *::size_t", + "return": { + "type": "const git_reflog_entry *", + "comment": " the entry; NULL if not found" + }, + "description": "

Lookup an entry by its index

\n", + "comments": "

Requesting the reflog entry with an index of 0 (zero) will\n return the most recently created entry.

\n", + "group": "reflog" + }, + "git_reflog_drop": { + "type": "function", + "file": "reflog.h", + "line": 124, + "lineto": 127, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "a previously loaded reflog." + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position of the entry to remove. Should be greater than or\n equal to 0 (zero) and less than `git_reflog_entrycount()`." + }, + { + "name": "rewrite_previous_entry", + "type": "int", + "comment": "1 to rewrite the history; 0 otherwise." + } + ], + "argline": "git_reflog *reflog, size_t idx, int rewrite_previous_entry", + "sig": "git_reflog *::size_t::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code." + }, + "description": "

Remove an entry from the reflog by its index

\n", + "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry\n param 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_id_old": { + "type": "function", + "file": "reflog.h", + "line": 135, + "lineto": 135, + "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

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_id_new": { + "type": "function", + "file": "reflog.h", + "line": 143, + "lineto": 143, + "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

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_committer": { + "type": "function", + "file": "reflog.h", + "line": 151, + "lineto": 151, + "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_signature *", + "comment": " the committer" + }, + "description": "

Get the committer of this entry

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_entry_message": { + "type": "function", + "file": "reflog.h", + "line": 159, + "lineto": 159, + "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 char *", + "comment": " the log msg" + }, + "description": "

Get the log message

\n", + "comments": "", + "group": "reflog" + }, + "git_reflog_free": { + "type": "function", + "file": "reflog.h", + "line": 166, + "lineto": 166, + "args": [ + { + "name": "reflog", + "type": "git_reflog *", + "comment": "reflog to free" + } + ], + "argline": "git_reflog *reflog", + "sig": "git_reflog *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the reflog

\n", + "comments": "", + "group": "reflog" + }, + "git_reference_lookup": { + "type": "function", + "file": "refs.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "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 **out, git_repository *repo, const char *name", + "sig": "git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Lookup a reference by name in a repository.

\n", + "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_reference_lookup-53" + ] + } + }, + "git_reference_name_to_id": { + "type": "function", + "file": "refs.h", + "line": 54, + "lineto": 55, + "args": [ + { + "name": "out", + "type": "git_oid *", + "comment": "Pointer to oid to be filled in" + }, + { + "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 (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)" + } + ], + "argline": "git_oid *out, git_repository *repo, const char *name", + "sig": "git_oid *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." + }, + "description": "

Lookup a reference by name and resolve immediately to OID.

\n", + "comments": "

This function provides a quick way to resolve a reference name straight\n through to the object id that it refers to. This avoids having to\n allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference" + }, + "git_reference_dwim": { + "type": "function", + "file": "refs.h", + "line": 68, + "lineto": 68, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer in which to store the reference" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "shorthand", + "type": "const char *", + "comment": "the short name for the reference" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *shorthand", + "sig": "git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Lookup a reference by DWIMing its short name

\n", + "comments": "

Apply the git precendence rules to the given shorthand to determine\n which reference the user is referring to.

\n", + "group": "reference" + }, + "git_reference_symbolic_create_matching": { + "type": "function", + "file": "refs.h", + "line": 109, + "lineto": 109, + "args": [ + { + "name": "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" + }, + { + "name": "current_value", + "type": "const char *", + "comment": "The expected value of the reference when updating" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code" + }, + "description": "

Conditionally create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_value\n (i.e. if the ref has changed since the user read it).

\n", + "group": "reference" + }, + "git_reference_symbolic_create": { + "type": "function", + "file": "refs.h", + "line": 145, + "lineto": 145, + "args": [ + { + "name": "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" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const char *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new symbolic reference.

\n", + "comments": "

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n", + "group": "reference" + }, + "git_reference_create": { + "type": "function", + "file": "refs.h", + "line": 182, + "lineto": 182, + "args": [ + { + "name": "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" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new direct reference.

\n", + "comments": "

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n", + "group": "reference" + }, + "git_reference_create_matching": { + "type": "function", + "file": "refs.h", + "line": 225, + "lineto": 225, + "args": [ + { + "name": "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" + }, + { + "name": "current_id", + "type": "const git_oid *", + "comment": "The expected value of the reference at the time of update" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message", + "sig": "git_reference **::git_repository *::const char *::const git_oid *::int::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Conditionally create new direct reference

\n", + "comments": "

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_id\n (i.e. if the ref has changed since the user read it).

\n", + "group": "reference" + }, + "git_reference_target": { + "type": "function", + "file": "refs.h", + "line": 240, + "lineto": 240, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const 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.

\n", + "comments": "

Only available if the reference is direct (i.e. an object id reference,\n not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and\n then this function (or maybe use git_reference_name_to_id() to\n directly resolve a reference name all the way through to an OID).

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_reference_target-54" + ] + } + }, + "git_reference_target_peel": { + "type": "function", + "file": "refs.h", + "line": 251, + "lineto": 251, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const git_oid *", + "comment": " a pointer to the oid if available, NULL otherwise" + }, + "description": "

Return the peeled OID target of this reference.

\n", + "comments": "

This peeled OID only applies to direct references that point to\n a hard Tag object: it is the result of peeling such Tag.

\n", + "group": "reference" + }, + "git_reference_symbolic_target": { + "type": "function", + "file": "refs.h", + "line": 261, + "lineto": 261, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const 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.

\n", + "comments": "

Only available if the reference is symbolic.

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_reference_symbolic_target-55" + ] + } + }, + "git_reference_type": { + "type": "function", + "file": "refs.h", + "line": 271, + "lineto": 271, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "git_ref_t", + "comment": " the type" + }, + "description": "

Get the type of a reference.

\n", + "comments": "

Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_reference_type-56" + ] + } + }, + "git_reference_name": { + "type": "function", + "file": "refs.h", + "line": 281, + "lineto": 281, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const char *", + "comment": " the full name for the ref" + }, + "description": "

Get the full name of a reference.

\n", + "comments": "

See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference" + }, + "git_reference_resolve": { + "type": "function", + "file": "refs.h", + "line": 299, + "lineto": 299, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the peeled reference" + }, + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "git_reference **out, const git_reference *ref", + "sig": "git_reference **::const git_reference *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Resolve a symbolic reference to a direct reference.

\n", + "comments": "

This method iteratively peels a symbolic reference until it resolves to\n a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and\n must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that\n reference is returned. This copy must be manually freed too.

\n", + "group": "reference" + }, + "git_reference_owner": { + "type": "function", + "file": "refs.h", + "line": 307, + "lineto": 307, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "The reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "git_repository *", + "comment": " a pointer to the repo" + }, + "description": "

Get the repository where a reference resides.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_symbolic_set_target": { + "type": "function", + "file": "refs.h", + "line": 329, + "lineto": 333, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference" + }, + { + "name": "target", + "type": "const char *", + "comment": "The new target for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_reference *ref, const char *target, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n", + "group": "reference" + }, + "git_reference_set_target": { + "type": "function", + "file": "refs.h", + "line": 349, + "lineto": 353, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "Pointer to the newly created reference" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference" + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "The new target OID for the reference" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **out, git_reference *ref, const git_oid *id, const char *log_message", + "sig": "git_reference **::git_reference *::const git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed since it was read, or an error code" + }, + "description": "

Conditionally create a new reference with the same name as the given reference but a\n different OID target. The reference must be a direct reference, otherwise\n this will fail.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n", + "group": "reference" + }, + "git_reference_rename": { + "type": "function", + "file": "refs.h", + "line": 378, + "lineto": 383, + "args": [ + { + "name": "new_ref", + "type": "git_reference **", + "comment": null + }, + { + "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" + }, + { + "name": "log_message", + "type": "const char *", + "comment": "The one line long message to be appended to the reflog" + } + ], + "argline": "git_reference **new_ref, git_reference *ref, const char *new_name, int force, const char *log_message", + "sig": "git_reference **::git_reference *::const char *::int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Rename an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already\n a reference with the given name, the renaming will fail.

\n\n

IMPORTANT:\n The user needs to write a proper reflog entry if the\n reflog is enabled for the repository. We only rename\n the reflog if it exists.

\n", + "group": "reference" + }, + "git_reference_delete": { + "type": "function", + "file": "refs.h", + "line": 398, + "lineto": 398, + "args": [ + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference to remove" + } + ], + "argline": "git_reference *ref", + "sig": "git_reference *", + "return": { + "type": "int", + "comment": " 0, GIT_EMODIFIED or an error code" + }, + "description": "

Delete an existing reference.

\n", + "comments": "

This method works for both direct and symbolic references. The reference\n will be immediately removed on disk but the memory will not be freed.\n Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed\n from the time it was looked up.

\n", + "group": "reference" + }, + "git_reference_remove": { + "type": "function", + "file": "refs.h", + "line": 409, + "lineto": 409, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "name", + "type": "const char *", + "comment": "The reference to remove" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Delete an existing reference by name

\n", + "comments": "

This method removes the named reference from the repository without\n looking at its old value.

\n", + "group": "reference" + }, + "git_reference_list": { + "type": "function", + "file": "refs.h", + "line": 423, + "lineto": 423, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe reference names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + } + ], + "argline": "git_strarray *array, git_repository *repo", + "sig": "git_strarray *::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Fill a list with all the references that can be found in a repository.

\n", + "comments": "

The string array will be filled with the names of all references; these\n values are owned by the user and should be free'd manually when no\n longer needed, using git_strarray_free().

\n", + "group": "reference", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_reference_list-57" + ] + } + }, + "git_reference_foreach": { + "type": "function", + "file": "refs.h", + "line": 441, + "lineto": 444, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "callback", + "type": "git_reference_foreach_cb", + "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, git_reference_foreach_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform a callback on each reference in the repository.

\n", + "comments": "

The callback function will be called for each reference in the\n repository, receiving the reference object and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n", + "group": "reference" + }, + "git_reference_foreach_name": { + "type": "function", + "file": "refs.h", + "line": 459, + "lineto": 462, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the refs" + }, + { + "name": "callback", + "type": "git_reference_foreach_name_cb", + "comment": "Function which will be called for every listed ref name" + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback" + } + ], + "argline": "git_repository *repo, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::git_reference_foreach_name_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Perform a callback on the fully-qualified name of each reference.

\n", + "comments": "

The callback function will be called for each reference in the\n repository, receiving the name of the reference and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n", + "group": "reference" + }, + "git_reference_free": { + "type": "function", + "file": "refs.h", + "line": 469, + "lineto": 469, + "args": [ + { + "name": "ref", + "type": "git_reference *", + "comment": "git_reference" + } + ], + "argline": "git_reference *ref", + "sig": "git_reference *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the given reference.

\n", + "comments": "", + "group": "reference", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_reference_free-3" + ] + } + }, + "git_reference_cmp": { + "type": "function", + "file": "refs.h", + "line": 478, + "lineto": 480, + "args": [ + { + "name": "ref1", + "type": "const git_reference *", + "comment": "The first git_reference" + }, + { + "name": "ref2", + "type": "const git_reference *", + "comment": "The second git_reference" + } + ], + "argline": "const git_reference *ref1, const git_reference *ref2", + "sig": "const git_reference *::const git_reference *", + "return": { + "type": "int", + "comment": " 0 if the same, else a stable but meaningless ordering." + }, + "description": "

Compare two references.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_iterator_new": { + "type": "function", + "file": "refs.h", + "line": 489, + "lineto": 491, + "args": [ + { + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_reference_iterator **out, git_repository *repo", + "sig": "git_reference_iterator **::git_repository *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an iterator for the repo's references

\n", + "comments": "", + "group": "reference" + }, + "git_reference_iterator_glob_new": { + "type": "function", + "file": "refs.h", + "line": 502, + "lineto": 505, + "args": [ + { + "name": "out", + "type": "git_reference_iterator **", + "comment": "pointer in which to store the iterator" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "glob", + "type": "const char *", + "comment": "the glob to match against the reference names" + } + ], + "argline": "git_reference_iterator **out, git_repository *repo, const char *glob", + "sig": "git_reference_iterator **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an iterator for the repo's references that match the\n specified glob

\n", + "comments": "", + "group": "reference" + }, + "git_reference_next": { + "type": "function", + "file": "refs.h", + "line": 514, + "lineto": 514, + "args": [ + { + "name": "out", + "type": "git_reference **", + "comment": "pointer in which to store the reference" + }, + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" + } + ], + "argline": "git_reference **out, git_reference_iterator *iter", + "sig": "git_reference **::git_reference_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + }, + "description": "

Get the next reference

\n", + "comments": "", + "group": "reference" + }, + "git_reference_next_name": { + "type": "function", + "file": "refs.h", + "line": 527, + "lineto": 527, + "args": [ + { + "name": "out", + "type": "const char **", + "comment": "pointer in which to store the string" + }, + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator" + } + ], + "argline": "const char **out, git_reference_iterator *iter", + "sig": "const char **::git_reference_iterator *", + "return": { + "type": "int", + "comment": " 0, GIT_ITEROVER if there are no more; or an error code" + }, + "description": "

Get the next reference's name

\n", + "comments": "

This function is provided for convenience in case only the names\n are interesting as it avoids the allocation of the git_reference\n object which git_reference_next() needs.

\n", + "group": "reference" + }, + "git_reference_iterator_free": { + "type": "function", + "file": "refs.h", + "line": 534, + "lineto": 534, + "args": [ + { + "name": "iter", + "type": "git_reference_iterator *", + "comment": "the iterator to free" + } + ], + "argline": "git_reference_iterator *iter", + "sig": "git_reference_iterator *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the iterator and its associated resources

\n", + "comments": "", + "group": "reference" + }, + "git_reference_foreach_glob": { + "type": "function", + "file": "refs.h", + "line": 554, + "lineto": 558, + "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": "callback", + "type": "git_reference_foreach_name_cb", + "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, const char *glob, git_reference_foreach_name_cb callback, void *payload", + "sig": "git_repository *::const char *::git_reference_foreach_name_cb::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\n matches the given pattern.

\n", + "comments": "

This function acts like git_reference_foreach() with an additional\n pattern match being applied to the reference name before issuing the\n callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches\n any sequence of letters, a '?' matches any letter, and square brackets\n can 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": 568, + "lineto": 568, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 when no reflog can be found, 1 when it exists;\n otherwise an error code." + }, + "description": "

Check if a reflog exists for the specified reference.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_ensure_log": { + "type": "function", + "file": "refs.h", + "line": 580, + "lineto": 580, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + }, + { + "name": "refname", + "type": "const char *", + "comment": "the reference's name" + } + ], + "argline": "git_repository *repo, const char *refname", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code." + }, + "description": "

Ensure there is a reflog for a particular reference.

\n", + "comments": "

Make sure that successive updates to the reference will append to\n its log.

\n", + "group": "reference" + }, + "git_reference_is_branch": { + "type": "function", + "file": "refs.h", + "line": 590, + "lineto": 590, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/heads\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a local branch.

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_remote": { + "type": "function", + "file": "refs.h", + "line": 600, + "lineto": 600, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/remotes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a remote tracking branch

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_tag": { + "type": "function", + "file": "refs.h", + "line": 610, + "lineto": 610, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/tags\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a tag

\n", + "comments": "", + "group": "reference" + }, + "git_reference_is_note": { + "type": "function", + "file": "refs.h", + "line": 620, + "lineto": 620, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "A git reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "int", + "comment": " 1 when the reference lives in the refs/notes\n namespace; 0 otherwise." + }, + "description": "

Check if a reference is a note

\n", + "comments": "", + "group": "reference" + }, + "git_reference_normalize_name": { + "type": "function", + "file": "refs.h", + "line": 676, + "lineto": 680, + "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\n GIT_REF_FORMAT constants above." + } + ], + "argline": "char *buffer_out, size_t buffer_size, const char *name, unsigned int flags", + "sig": "char *::size_t::const char *::unsigned int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC\n or an error code." + }, + "description": "

Normalize reference name and check validity.

\n", + "comments": "

This will normalize the reference name by removing any leading slash\n '/' characters and collapsing runs of adjacent slashes between name\n components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in\n the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n", + "group": "reference" + }, + "git_reference_peel": { + "type": "function", + "file": "refs.h", + "line": 697, + "lineto": 700, + "args": [ + { + "name": "out", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "ref", + "type": "git_reference *", + "comment": "The reference to be processed" + }, + { + "name": "type", + "type": "git_otype", + "comment": "The type of the requested object (GIT_OBJ_COMMIT,\n GIT_OBJ_TAG, GIT_OBJ_TREE, GIT_OBJ_BLOB or GIT_OBJ_ANY)." + } + ], + "argline": "git_object **out, git_reference *ref, git_otype type", + "sig": "git_object **::git_reference *::git_otype", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code" + }, + "description": "

Recursively peel reference until object of the specified type is found.

\n", + "comments": "

The retrieved peeled object is owned by the repository\n and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object\n will be peeled until a non-tag object is met.

\n", + "group": "reference" + }, + "git_reference_is_valid_name": { + "type": "function", + "file": "refs.h", + "line": 716, + "lineto": 716, + "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.

\n", + "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n", + "group": "reference" + }, + "git_reference_shorthand": { + "type": "function", + "file": "refs.h", + "line": 730, + "lineto": 730, + "args": [ + { + "name": "ref", + "type": "const git_reference *", + "comment": "a reference" + } + ], + "argline": "const git_reference *ref", + "sig": "const git_reference *", + "return": { + "type": "const char *", + "comment": " the human-readable version of the name" + }, + "description": "

Get the reference's short name

\n", + "comments": "

This will transform the reference name into a name "human-readable"\n version. If no shortname is appropriate, it will return the full\n name.

\n\n

The memory is owned by the reference and must not be freed.

\n", + "group": "reference", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_reference_shorthand-4" + ] + } + }, + "git_refspec_src": { + "type": "function", + "file": "refspec.h", + "line": 30, + "lineto": 30, + "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

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_dst": { + "type": "function", + "file": "refspec.h", + "line": 38, + "lineto": 38, + "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

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_string": { + "type": "function", + "file": "refspec.h", + "line": 46, + "lineto": 46, + "args": [ + { + "name": "refspec", + "type": "const git_refspec *", + "comment": "the refspec" + } + ], + "argline": "const git_refspec *refspec", + "sig": "const git_refspec *", + "return": { + "type": "const char *", + "comment": null + }, + "description": "

Get the refspec's string

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_force": { + "type": "function", + "file": "refspec.h", + "line": 54, + "lineto": 54, + "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

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_direction": { + "type": "function", + "file": "refspec.h", + "line": 62, + "lineto": 62, + "args": [ + { + "name": "spec", + "type": "const git_refspec *", + "comment": "refspec" + } + ], + "argline": "const git_refspec *spec", + "sig": "const git_refspec *", + "return": { + "type": "git_direction", + "comment": " GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH" + }, + "description": "

Get the refspec's direction.

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_src_matches": { + "type": "function", + "file": "refspec.h", + "line": 71, + "lineto": 71, + "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

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_dst_matches": { + "type": "function", + "file": "refspec.h", + "line": 80, + "lineto": 80, + "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 destination descriptor matches a reference

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_transform": { + "type": "function", + "file": "refspec.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "where to store the target name" + }, + { + "name": "spec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the reference to transform" + } + ], + "argline": "git_buf *out, const git_refspec *spec, const char *name", + "sig": "git_buf *::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

\n", + "comments": "", + "group": "refspec" + }, + "git_refspec_rtransform": { + "type": "function", + "file": "refspec.h", + "line": 100, + "lineto": 100, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "where to store the source reference name" + }, + { + "name": "spec", + "type": "const git_refspec *", + "comment": "the refspec" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the reference to transform" + } + ], + "argline": "git_buf *out, const git_refspec *spec, const char *name", + "sig": "git_buf *::const git_refspec *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EBUFS or another error" + }, + "description": "

Transform a target reference to its source reference following the refspec's rules

\n", + "comments": "", + "group": "refspec" + }, + "git_remote_create": { + "type": "function", + "file": "remote.h", + "line": 39, + "lineto": 43, + "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, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Add a remote with the default fetch refspec to the repository's configuration.

\n", + "comments": "", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_create-4" + ] + } + }, + "git_remote_create_with_fetchspec": { + "type": "function", + "file": "remote.h", + "line": 56, + "lineto": 61, + "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" + }, + { + "name": "fetch", + "type": "const char *", + "comment": "the remote fetch value" + } + ], + "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, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Add a remote with the provided fetch refspec (or default if NULL) to the repository's\n configuration.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_create_anonymous": { + "type": "function", + "file": "remote.h", + "line": 74, + "lineto": 77, + "args": [ + { + "name": "out", + "type": "git_remote **", + "comment": "pointer to the new remote objects" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the associated repository" + }, + { + "name": "url", + "type": "const char *", + "comment": "the remote repository's URL" + } + ], + "argline": "git_remote **out, git_repository *repo, const char *url", + "sig": "git_remote **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an anonymous remote

\n", + "comments": "

Create a remote with the given url in-memory. You can use this when\n you have a URL instead of a remote's name.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_create_anonymous-4" + ], + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_remote_create_anonymous-2" + ] + } + }, + "git_remote_lookup": { + "type": "function", + "file": "remote.h", + "line": 90, + "lineto": 90, + "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, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Get the information for a particular remote

\n", + "comments": "

The name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_lookup-5" + ], + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_remote_lookup-3" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_lookup-5" + ] + } + }, + "git_remote_dup": { + "type": "function", + "file": "remote.h", + "line": 102, + "lineto": 102, + "args": [ + { + "name": "dest", + "type": "git_remote **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "git_remote *", + "comment": "object to copy" + } + ], + "argline": "git_remote **dest, git_remote *source", + "sig": "git_remote **::git_remote *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a copy of an existing remote. All internal strings are also\n duplicated. Callbacks are not duplicated.

\n", + "comments": "

Call git_remote_free to free the data.

\n", + "group": "remote" + }, + "git_remote_owner": { + "type": "function", + "file": "remote.h", + "line": 110, + "lineto": 110, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "git_repository *", + "comment": " a pointer to the repository" + }, + "description": "

Get the remote's repository

\n", + "comments": "", + "group": "remote" + }, + "git_remote_name": { + "type": "function", + "file": "remote.h", + "line": 118, + "lineto": 118, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "const char *", + "comment": " a pointer to the name or NULL for in-memory remotes" + }, + "description": "

Get the remote's name

\n", + "comments": "", + "group": "remote" + }, + "git_remote_url": { + "type": "function", + "file": "remote.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "const char *", + "comment": " a pointer to the url" + }, + "description": "

Get the remote's url

\n", + "comments": "

If url.*.insteadOf has been configured for this URL, it will\n return the modified URL.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_url-6" + ] + } + }, + "git_remote_pushurl": { + "type": "function", + "file": "remote.h", + "line": 140, + "lineto": 140, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const 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

\n", + "comments": "

If url.*.pushInsteadOf has been configured for this URL, it\n will return the modified URL.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_pushurl-7" + ] + } + }, + "git_remote_set_url": { + "type": "function", + "file": "remote.h", + "line": 153, + "lineto": 153, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the remote's name" + }, + { + "name": "url", + "type": "const char *", + "comment": "the url to set" + } + ], + "argline": "git_repository *repo, const char *remote, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error value" + }, + "description": "

Set the remote's url in the configuration

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_set_url-8" + ] + } + }, + "git_remote_set_pushurl": { + "type": "function", + "file": "remote.h", + "line": 166, + "lineto": 166, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to perform the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the remote's name" + }, + { + "name": "url", + "type": "const char *", + "comment": "the url to set" + } + ], + "argline": "git_repository *repo, const char *remote, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Set the remote's url for pushing in the configuration.

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_set_pushurl-9" + ] + } + }, + "git_remote_add_fetch": { + "type": "function", + "file": "remote.h", + "line": 179, + "lineto": 179, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to change the configuration" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote to change" + }, + { + "name": "refspec", + "type": "const char *", + "comment": "the new fetch refspec" + } + ], + "argline": "git_repository *repo, const char *remote, const char *refspec", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" + }, + "description": "

Add a fetch refspec to the remote's configuration

\n", + "comments": "

Add the given refspec to the fetch list in the configuration. No\n loaded remote instances will be affected.

\n", + "group": "remote" + }, + "git_remote_get_fetch_refspecs": { + "type": "function", + "file": "remote.h", + "line": 190, + "lineto": 190, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "pointer to the array in which to store the strings" + }, + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "git_strarray *array, const git_remote *remote", + "sig": "git_strarray *::const git_remote *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get the remote's list of fetch refspecs

\n", + "comments": "

The memory is owned by the user and should be freed with\n git_strarray_free.

\n", + "group": "remote" + }, + "git_remote_add_push": { + "type": "function", + "file": "remote.h", + "line": 203, + "lineto": 203, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to change the configuration" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote to change" + }, + { + "name": "refspec", + "type": "const char *", + "comment": "the new push refspec" + } + ], + "argline": "git_repository *repo, const char *remote, const char *refspec", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" + }, + "description": "

Add a push refspec to the remote's configuration

\n", + "comments": "

Add the given refspec to the push list in the configuration. No\n loaded remote instances will be affected.

\n", + "group": "remote" + }, + "git_remote_get_push_refspecs": { + "type": "function", + "file": "remote.h", + "line": 214, + "lineto": 214, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "pointer to the array in which to store the strings" + }, + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "git_strarray *array, const git_remote *remote", + "sig": "git_strarray *::const git_remote *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get the remote's list of push refspecs

\n", + "comments": "

The memory is owned by the user and should be freed with\n git_strarray_free.

\n", + "group": "remote" + }, + "git_remote_refspec_count": { + "type": "function", + "file": "remote.h", + "line": 222, + "lineto": 222, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "size_t", + "comment": " the amount of refspecs configured in this remote" + }, + "description": "

Get the number of refspecs for a remote

\n", + "comments": "", + "group": "remote" + }, + "git_remote_get_refspec": { + "type": "function", + "file": "remote.h", + "line": 231, + "lineto": 231, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + }, + { + "name": "n", + "type": "size_t", + "comment": "the refspec to get" + } + ], + "argline": "const git_remote *remote, size_t n", + "sig": "const git_remote *::size_t", + "return": { + "type": "const git_refspec *", + "comment": " the nth refspec" + }, + "description": "

Get a refspec from the remote

\n", + "comments": "", + "group": "remote" + }, + "git_remote_connect": { + "type": "function", + "file": "remote.h", + "line": 246, + "lineto": 246, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to connect to" + }, + { + "name": "direction", + "type": "git_direction", + "comment": "GIT_DIRECTION_FETCH if you want to fetch or\n GIT_DIRECTION_PUSH if you want to push" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "the callbacks to use for this connection" + } + ], + "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks", + "sig": "git_remote *::git_direction::const git_remote_callbacks *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Open a connection to a remote

\n", + "comments": "

The transport is selected based on the URL. The direction argument\n is due to a limitation of the git protocol (over TCP or SSH) which\n starts up a specific binary which can only do the one or the other.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_connect-6" + ], + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_remote_connect-4" + ] + } + }, + "git_remote_ls": { + "type": "function", + "file": "remote.h", + "line": 268, + "lineto": 268, + "args": [ + { + "name": "out", + "type": "const git_remote_head ***", + "comment": "pointer to the array" + }, + { + "name": "size", + "type": "size_t *", + "comment": "the number of remote heads" + }, + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote_head ***out, size_t *size, git_remote *remote", + "sig": "const git_remote_head ***::size_t *::git_remote *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Get the remote repository's reference advertisement list

\n", + "comments": "

Get the list of references with which the server responds to a new\n connection.

\n\n

The remote (or more exactly its transport) must have connected to\n the remote repository. This list is available as soon as the\n connection to the remote is initiated and it remains available\n after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long\n as a new connection is not initiated, but it is recommended that\n you make a copy in order to make use of the data.

\n", + "group": "remote", + "examples": { + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_remote_ls-5" + ] + } + }, + "git_remote_connected": { + "type": "function", + "file": "remote.h", + "line": 279, + "lineto": 279, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "int", + "comment": " 1 if it's connected, 0 otherwise." + }, + "description": "

Check whether the remote is connected

\n", + "comments": "

Check whether the remote's underlying transport is connected to the\n remote host.

\n", + "group": "remote" + }, + "git_remote_stop": { + "type": "function", + "file": "remote.h", + "line": 289, + "lineto": 289, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Cancel the operation

\n", + "comments": "

At certain points in its operation, the network code checks whether\n the operation has been cancelled and if so stops the operation.

\n", + "group": "remote" + }, + "git_remote_disconnect": { + "type": "function", + "file": "remote.h", + "line": 298, + "lineto": 298, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to disconnect from" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Disconnect from the remote

\n", + "comments": "

Close the connection to the remote.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_disconnect-7" + ] + } + }, + "git_remote_free": { + "type": "function", + "file": "remote.h", + "line": 308, + "lineto": 308, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to free" + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free the memory associated with a remote

\n", + "comments": "

This also disconnects from the remote, if the connection\n has not been closed yet (using git_remote_disconnect).

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_free-8", + "ex/v0.23.2/network/fetch.html#git_remote_free-9" + ], + "network/ls-remote.c": [ + "ex/v0.23.2/network/ls-remote.html#git_remote_free-6" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_free-10" + ] + } + }, + "git_remote_list": { + "type": "function", + "file": "remote.h", + "line": 319, + "lineto": 319, + "args": [ + { + "name": "out", + "type": "git_strarray *", + "comment": "a string array which receives the names of the remotes" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to query" + } + ], + "argline": "git_strarray *out, 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

\n", + "comments": "

The string array must be freed by the user.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_list-11" + ] + } + }, + "git_remote_init_callbacks": { + "type": "function", + "file": "remote.h", + "line": 470, + "lineto": 472, + "args": [ + { + "name": "opts", + "type": "git_remote_callbacks *", + "comment": "the `git_remote_callbacks` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_REMOTE_CALLBACKS_VERSION`" + } + ], + "argline": "git_remote_callbacks *opts, unsigned int version", + "sig": "git_remote_callbacks *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_remote_callbacks with default values. Equivalent to\n creating an instance with GIT_REMOTE_CALLBACKS_INIT.

\n", + "comments": "", + "group": "remote" + }, + "git_fetch_init_options": { + "type": "function", + "file": "remote.h", + "line": 563, + "lineto": 565, + "args": [ + { + "name": "opts", + "type": "git_fetch_options *", + "comment": "the `git_push_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_FETCH_OPTIONS_VERSION` here." + } + ], + "argline": "git_fetch_options *opts, unsigned int version", + "sig": "git_fetch_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_fetch_options with default values. Equivalent to\n creating an instance with GIT_FETCH_OPTIONS_INIT.

\n", + "comments": "", + "group": "fetch" + }, + "git_push_init_options": { + "type": "function", + "file": "remote.h", + "line": 602, + "lineto": 604, + "args": [ + { + "name": "opts", + "type": "git_push_options *", + "comment": "the `git_push_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_PUSH_OPTIONS_VERSION` here." + } + ], + "argline": "git_push_options *opts, unsigned int version", + "sig": "git_push_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_push_options with default values. Equivalent to\n creating an instance with GIT_PUSH_OPTIONS_INIT.

\n", + "comments": "", + "group": "push" + }, + "git_remote_download": { + "type": "function", + "file": "remote.h", + "line": 622, + "lineto": 622, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this negotiation and\n download. Use NULL or an empty array to use the base refspecs" + }, + { + "name": "opts", + "type": "const git_fetch_options *", + "comment": "the options to use for this fetch" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts", + "sig": "git_remote *::const git_strarray *::const git_fetch_options *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Download and index the packfile

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, download and index the\n packfile.

\n\n

The .idx file will be created and both it and the packfile with be\n renamed to their final name.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_download-10" + ] + } + }, + "git_remote_upload": { + "type": "function", + "file": "remote.h", + "line": 636, + "lineto": 636, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this negotiation and\n upload. Use NULL or an empty array to use the base refspecs" + }, + { + "name": "opts", + "type": "const git_push_options *", + "comment": "the options to use for this push" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", + "sig": "git_remote *::const git_strarray *::const git_push_options *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a packfile and send it to the server

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, create a packfile with the missing objects and send it.

\n", + "group": "remote" + }, + "git_remote_update_tips": { + "type": "function", + "file": "remote.h", + "line": 652, + "lineto": 657, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to update" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "pointer to the callback structure to use" + }, + { + "name": "update_fetchhead", + "type": "int", + "comment": "whether to write to FETCH_HEAD. Pass 1 to behave like git." + }, + { + "name": "download_tags", + "type": "git_remote_autotag_option_t", + "comment": "what the behaviour for downloading tags is for this fetch. This is\n ignored for push. This must be the same value passed to `git_remote_download()`." + }, + { + "name": "reflog_message", + "type": "const char *", + "comment": "The message to insert into the reflogs. If\n NULL and fetching, the default is \"fetch \n\", where \n is\n the name of the remote (or its url, for in-memory remotes). This\n parameter is ignored when pushing." + } + ], + "argline": "git_remote *remote, const git_remote_callbacks *callbacks, int update_fetchhead, git_remote_autotag_option_t download_tags, const char *reflog_message", + "sig": "git_remote *::const git_remote_callbacks *::int::git_remote_autotag_option_t::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Update the tips to the new state

\n", + "comments": "", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_update_tips-11" + ] + } + }, + "git_remote_fetch": { + "type": "function", + "file": "remote.h", + "line": 673, + "lineto": 677, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to fetch from" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for this fetch. Pass NULL or an\n empty array to use the base refspecs." + }, + { + "name": "opts", + "type": "const git_fetch_options *", + "comment": "options to use for this fetch" + }, + { + "name": "reflog_message", + "type": "const char *", + "comment": "The message to insert into the reflogs. If NULL, the\n\t\t\t\t\t\t\t\t default is \"fetch\"" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts, const char *reflog_message", + "sig": "git_remote *::const git_strarray *::const git_fetch_options *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Download new data and update tips

\n", + "comments": "

Convenience function to connect to a remote, download the data,\n disconnect and update the remote-tracking branches.

\n", + "group": "remote" + }, + "git_remote_prune": { + "type": "function", + "file": "remote.h", + "line": 686, + "lineto": 686, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to prune" + }, + { + "name": "callbacks", + "type": "const git_remote_callbacks *", + "comment": "callbacks to use for this prune" + } + ], + "argline": "git_remote *remote, const git_remote_callbacks *callbacks", + "sig": "git_remote *::const git_remote_callbacks *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Prune tracking refs that are no longer present on remote

\n", + "comments": "", + "group": "remote" + }, + "git_remote_push": { + "type": "function", + "file": "remote.h", + "line": 698, + "lineto": 700, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote to push to" + }, + { + "name": "refspecs", + "type": "const git_strarray *", + "comment": "the refspecs to use for pushing. If none are\n passed, the configured refspecs will be used" + }, + { + "name": "opts", + "type": "const git_push_options *", + "comment": "options to use for this push" + } + ], + "argline": "git_remote *remote, const git_strarray *refspecs, const git_push_options *opts", + "sig": "git_remote *::const git_strarray *::const git_push_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Perform a push

\n", + "comments": "

Peform all the steps from a push.

\n", + "group": "remote" + }, + "git_remote_stats": { + "type": "function", + "file": "remote.h", + "line": 705, + "lineto": 705, + "args": [ + { + "name": "remote", + "type": "git_remote *", + "comment": null + } + ], + "argline": "git_remote *remote", + "sig": "git_remote *", + "return": { + "type": "const git_transfer_progress *", + "comment": null + }, + "description": "

Get the statistics structure that is filled in by the fetch operation.

\n", + "comments": "", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.23.2/network/fetch.html#git_remote_stats-12" + ] + } + }, + "git_remote_autotag": { + "type": "function", + "file": "remote.h", + "line": 713, + "lineto": 713, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "git_remote_autotag_option_t", + "comment": " the auto-follow setting" + }, + "description": "

Retrieve the tag auto-follow setting

\n", + "comments": "", + "group": "remote" + }, + "git_remote_set_autotag": { + "type": "function", + "file": "remote.h", + "line": 725, + "lineto": 725, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to make the change" + }, + { + "name": "remote", + "type": "const char *", + "comment": "the name of the remote" + }, + { + "name": "value", + "type": "git_remote_autotag_option_t", + "comment": "the new value to take." + } + ], + "argline": "git_repository *repo, const char *remote, git_remote_autotag_option_t value", + "sig": "git_repository *::const char *::git_remote_autotag_option_t", + "return": { + "type": "int", + "comment": null + }, + "description": "

Set the remote's tag following setting.

\n", + "comments": "

The change will be made in the configuration. No loaded remotes\n will be affected.

\n", + "group": "remote" + }, + "git_remote_prune_refs": { + "type": "function", + "file": "remote.h", + "line": 732, + "lineto": 732, + "args": [ + { + "name": "remote", + "type": "const git_remote *", + "comment": "the remote to query" + } + ], + "argline": "const git_remote *remote", + "sig": "const git_remote *", + "return": { + "type": "int", + "comment": " the ref-prune setting" + }, + "description": "

Retrieve the ref-prune setting

\n", + "comments": "", + "group": "remote" + }, + "git_remote_rename": { + "type": "function", + "file": "remote.h", + "line": 754, + "lineto": 758, + "args": [ + { + "name": "problems", + "type": "git_strarray *", + "comment": "non-default refspecs cannot be renamed and will be\n stored here for further processing by the caller. Always free this\n strarray on successful return." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to rename" + }, + { + "name": "name", + "type": "const char *", + "comment": "the current name of the remote" + }, + { + "name": "new_name", + "type": "const char *", + "comment": "the new name the remote should bear" + } + ], + "argline": "git_strarray *problems, git_repository *repo, const char *name, const char *new_name", + "sig": "git_strarray *::git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

Give the remote a new name

\n", + "comments": "

All remote-tracking branches and configuration settings\n for the remote are updated.

\n\n

The new name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change\n their name or their list of refspecs.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_rename-12" + ] + } + }, + "git_remote_is_valid_name": { + "type": "function", + "file": "remote.h", + "line": 766, + "lineto": 766, + "args": [ + { + "name": "remote_name", + "type": "const char *", + "comment": "name to be checked." + } + ], + "argline": "const char *remote_name", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 1 if the reference name is acceptable; 0 if it isn't" + }, + "description": "

Ensure the remote name is well-formed.

\n", + "comments": "", + "group": "remote" + }, + "git_remote_delete": { + "type": "function", + "file": "remote.h", + "line": 778, + "lineto": 778, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to act" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the remove to delete" + } + ], + "argline": "git_repository *repo, const char *name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code." + }, + "description": "

Delete an existing persisted remote.

\n", + "comments": "

All remote-tracking branches and configuration settings\n for the remote will be removed.

\n", + "group": "remote", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_remote_delete-13" + ] + } + }, + "git_remote_default_branch": { + "type": "function", + "file": "remote.h", + "line": 796, + "lineto": 796, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "the buffern in which to store the reference name" + }, + { + "name": "remote", + "type": "git_remote *", + "comment": "the remote" + } + ], + "argline": "git_buf *out, git_remote *remote", + "sig": "git_buf *::git_remote *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if the remote does not have any references\n or none of them point to HEAD's commit, or an error message." + }, + "description": "

Retrieve the name of the remote's default branch

\n", + "comments": "

The default branch of a repository is the branch which HEAD points\n to. If the remote does not support reporting this information\n directly, it performs the guess as git does; that is, if there are\n multiple branches which point to the same commit, the first one is\n chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n", + "group": "remote" + }, + "git_repository_open": { + "type": "function", + "file": "repository.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "out", + "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 **out, const char *path", + "sig": "git_repository **::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Open a git repository.

\n", + "comments": "

The 'path' argument must point to either a git repository\n folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal\n or bare repository or fail is 'path' is neither.

\n", + "group": "repository", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_repository_open-58" + ], + "network/git2.c": [ + "ex/v0.23.2/network/git2.html#git_repository_open-5" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_repository_open-14" + ] + } + }, + "git_repository_wrap_odb": { + "type": "function", + "file": "repository.h", + "line": 50, + "lineto": 50, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "pointer to the repo" + }, + { + "name": "odb", + "type": "git_odb *", + "comment": "the object database to wrap" + } + ], + "argline": "git_repository **out, 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

\n", + "comments": "

Create a repository object to wrap an object database to be used\n with the API when all you have is an object database. This doesn't\n have any paths associated with it, so use with care.

\n", + "group": "repository" + }, + "git_repository_discover": { + "type": "function", + "file": "repository.h", + "line": 78, + "lineto": 82, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "A pointer to a user-allocated git_buf which will contain\n the found path." + }, + { + "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\n filesystem device change is detected while exploring parent directories." + }, + { + "name": "ceiling_dirs", + "type": "const char *", + "comment": "A GIT_PATH_LIST_SEPARATOR separated list of\n absolute symbolic link free paths. The lookup will stop when any\n of this paths is reached. Note that the lookup always performs on\n start_path no matter start_path appears in ceiling_dirs ceiling_dirs\n might be NULL (which is equivalent to an empty string)" + } + ], + "argline": "git_buf *out, const char *start_path, int across_fs, const char *ceiling_dirs", + "sig": "git_buf *::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.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n", + "comments": "

The method will automatically detect if the repository is bare\n (if there is a repository).

\n", + "group": "repository", + "examples": { + "remote.c": [ + "ex/v0.23.2/remote.html#git_repository_discover-15" + ] + } + }, + "git_repository_open_ext": { + "type": "function", + "file": "repository.h", + "line": 122, + "lineto": 126, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Pointer to the repo which will be opened. This can\n actually be NULL if you only want to use the error code to\n see if a repo at this path could be opened." + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to open as git repository. If the flags\n permit \"searching\", then this can be a path to a subdirectory\n inside the working directory of the repository." + }, + { + "name": "flags", + "type": "unsigned int", + "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\n prefixes at which the search for a containing repository should\n terminate." + } + ], + "argline": "git_repository **out, const char *path, unsigned int flags, const char *ceiling_dirs", + "sig": "git_repository **::const char *::unsigned int::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if no repository could be found,\n or -1 if there was a repository but open failed for some reason\n (such as repo corruption or system errors)." + }, + "description": "

Find and open a repository with extended controls.

\n", + "comments": "", + "group": "repository", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_repository_open_ext-24" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_repository_open_ext-31" + ], + "describe.c": [ + "ex/v0.23.2/describe.html#git_repository_open_ext-6" + ], + "diff.c": [ + "ex/v0.23.2/diff.html#git_repository_open_ext-15" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_repository_open_ext-44", + "ex/v0.23.2/log.html#git_repository_open_ext-45" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_repository_open_ext-16" + ], + "status.c": [ + "ex/v0.23.2/status.html#git_repository_open_ext-5" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_repository_open_ext-11" + ] + } + }, + "git_repository_open_bare": { + "type": "function", + "file": "repository.h", + "line": 139, + "lineto": 139, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Pointer to the repo which will be opened." + }, + { + "name": "bare_path", + "type": "const char *", + "comment": "Direct path to the bare repository" + } + ], + "argline": "git_repository **out, const char *bare_path", + "sig": "git_repository **::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Open a bare repository on the serverside.

\n", + "comments": "

This is a fast open for bare repositories that will come in handy\n if you're e.g. hosting git repositories and need to access them\n efficiently

\n", + "group": "repository" + }, + "git_repository_free": { + "type": "function", + "file": "repository.h", + "line": 152, + "lineto": 152, + "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", + "comment": null + }, + "description": "

Free a previously allocated repository

\n", + "comments": "

Note that after a repository is free'd, all the objects it has spawned\n will still exist until they are manually closed by the user\n with git_object_free, but accessing any of the attributes of\n an object without a backing repository will result in undefined\n behavior

\n", + "group": "repository", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_repository_free-25" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_repository_free-32" + ], + "describe.c": [ + "ex/v0.23.2/describe.html#git_repository_free-7" + ], + "diff.c": [ + "ex/v0.23.2/diff.html#git_repository_free-16" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_repository_free-59" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_repository_free-6" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_repository_free-46" + ], + "network/clone.c": [ + "ex/v0.23.2/network/clone.html#git_repository_free-3" + ], + "network/git2.c": [ + "ex/v0.23.2/network/git2.html#git_repository_free-6" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_repository_free-17" + ], + "status.c": [ + "ex/v0.23.2/status.html#git_repository_free-6" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_repository_free-12" + ] + } + }, + "git_repository_init": { + "type": "function", + "file": "repository.h", + "line": 169, + "lineto": 172, + "args": [ + { + "name": "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 int", + "comment": "if true, a Git repository without a working directory is\n\t\tcreated at the pointed path. If false, provided path will be\n\t\tconsidered as the working directory into which the .git directory\n\t\twill be created." + } + ], + "argline": "git_repository **out, const char *path, unsigned int is_bare", + "sig": "git_repository **::const char *::unsigned int", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Creates a new Git repository in the given folder.

\n", + "comments": "

TODO:\n - Reinit the repository

\n", + "group": "repository", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_repository_init-7" + ] + } + }, + "git_repository_init_init_options": { + "type": "function", + "file": "repository.h", + "line": 281, + "lineto": 283, + "args": [ + { + "name": "opts", + "type": "git_repository_init_options *", + "comment": "the `git_repository_init_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`" + } + ], + "argline": "git_repository_init_options *opts, unsigned int version", + "sig": "git_repository_init_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_repository_init_options with default values. Equivalent\n to creating an instance with GIT_REPOSITORY_INIT_OPTIONS_INIT.

\n", + "comments": "", + "group": "repository" + }, + "git_repository_init_ext": { + "type": "function", + "file": "repository.h", + "line": 298, + "lineto": 301, + "args": [ + { + "name": "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 **out, const char *repo_path, git_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.

\n", + "comments": "

This will initialize a new git repository (creating the repo_path\n if requested by flags) and working directory as needed. It will\n auto-detect the case sensitivity of the file system and if the\n file system supports file mode bits correctly.

\n", + "group": "repository", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_repository_init_ext-8" + ] + } + }, + "git_repository_head": { + "type": "function", + "file": "repository.h", + "line": 316, + "lineto": 316, + "args": [ + { + "name": "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 **out, git_repository *repo", + "sig": "git_reference **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise" + }, + "description": "

Retrieve and resolve the reference pointed at by HEAD.

\n", + "comments": "

The returned git_reference will be owned by caller and\n git_reference_free() must be called when done with it to release the\n allocated memory and prevent a leak.

\n", + "group": "repository", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_repository_head-7" + ] + } + }, + "git_repository_head_detached": { + "type": "function", + "file": "repository.h", + "line": 328, + "lineto": 328, + "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\n was an error." + }, + "description": "

Check if a repository's HEAD is detached

\n", + "comments": "

A repository's HEAD is detached when it points directly to a commit\n instead of a branch.

\n", + "group": "repository" + }, + "git_repository_head_unborn": { + "type": "function", + "file": "repository.h", + "line": 340, + "lineto": 340, + "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 unborn, 0 if it's not; error\n code if there was an error" + }, + "description": "

Check if the current branch is unborn

\n", + "comments": "

An unborn branch is one named from HEAD but which doesn't exist in\n the 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": 352, + "lineto": 352, + "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\n if the repository is corrupted" + }, + "description": "

Check if a repository is empty

\n", + "comments": "

An empty repository has just been initialized and contains no references\n apart from HEAD, which must be pointing to the unborn master branch.

\n", + "group": "repository" + }, + "git_repository_path": { + "type": "function", + "file": "repository.h", + "line": 363, + "lineto": 363, + "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

\n", + "comments": "

This is the path of the .git folder for normal repositories,\n or of the repository itself for bare repositories.

\n", + "group": "repository", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_repository_path-9" + ], + "status.c": [ + "ex/v0.23.2/status.html#git_repository_path-8" + ] + } + }, + "git_repository_workdir": { + "type": "function", + "file": "repository.h", + "line": 374, + "lineto": 374, + "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

\n", + "comments": "

If the repository is bare, this function will always return\n NULL.

\n", + "group": "repository", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_repository_workdir-10" + ] + } + }, + "git_repository_set_workdir": { + "type": "function", + "file": "repository.h", + "line": 393, + "lineto": 394, + "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\n \"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

\n", + "comments": "

The working directory doesn't need to be the same one\n that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory\n will turn it into a normal repository, capable of performing\n all the common workdir operations (checkout, status, index\n manipulation, etc).

\n", + "group": "repository" + }, + "git_repository_is_bare": { + "type": "function", + "file": "repository.h", + "line": 402, + "lineto": 402, + "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

\n", + "comments": "", + "group": "repository", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_repository_is_bare-9" + ] + } + }, + "git_repository_config": { + "type": "function", + "file": "repository.h", + "line": 418, + "lineto": 418, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the loaded configuration" + }, + { + "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.

\n", + "comments": "

If a configuration file has not been set, the default\n config set for the repository will be returned, including\n global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n", + "group": "repository" + }, + "git_repository_config_snapshot": { + "type": "function", + "file": "repository.h", + "line": 434, + "lineto": 434, + "args": [ + { + "name": "out", + "type": "git_config **", + "comment": "Pointer to store the loaded configuration" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository" + } + ], + "argline": "git_config **out, git_repository *repo", + "sig": "git_config **::git_repository *", + "return": { + "type": "int", + "comment": " 0, or an error code" + }, + "description": "

Get a snapshot of the repository's configuration

\n", + "comments": "

Convenience function to take a snapshot from the repository's\n configuration. The contents of this snapshot will not change,\n even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n", + "group": "repository" + }, + "git_repository_odb": { + "type": "function", + "file": "repository.h", + "line": 450, + "lineto": 450, + "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.

\n", + "comments": "

If a custom ODB has not been set, the default\n database for the repository will be returned (the one\n located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by\n the user.

\n", + "group": "repository", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_repository_odb-33" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_repository_odb-60" + ] + } + }, + "git_repository_refdb": { + "type": "function", + "file": "repository.h", + "line": 466, + "lineto": 466, + "args": [ + { + "name": "out", + "type": "git_refdb **", + "comment": "Pointer to store the loaded refdb" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_refdb **out, git_repository *repo", + "sig": "git_refdb **::git_repository *", + "return": { + "type": "int", + "comment": " 0, or an error code" + }, + "description": "

Get the Reference Database Backend for this repository.

\n", + "comments": "

If a custom refsdb has not been set, the default database for\n the repository will be returned (the one that manipulates loose\n and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by\n the user.

\n", + "group": "repository" + }, + "git_repository_index": { + "type": "function", + "file": "repository.h", + "line": 482, + "lineto": 482, + "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.

\n", + "comments": "

If a custom index has not been set, the default\n index for the repository will be returned (the one\n located in .git/index).

\n\n

The index must be freed once it's no longer being used by\n the user.

\n", + "group": "repository", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_repository_index-61" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_repository_index-11" + ] + } + }, + "git_repository_message": { + "type": "function", + "file": "repository.h", + "line": 500, + "lineto": 500, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "git_buf to write data into" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository to read prepared message from" + } + ], + "argline": "git_buf *out, git_repository *repo", + "sig": "git_buf *::git_repository *", + "return": { + "type": "int", + "comment": " 0, GIT_ENOTFOUND if no message exists or an error code" + }, + "description": "

Retrieve git's prepared message

\n", + "comments": "

Operations such as git revert/cherry-pick/merge with the -n option\n stop just short of creating a commit with the changes and save\n their prepared message in .git/MERGE_MSG so the next git-commit\n execution can present it to the user for them to amend if they\n wish.

\n\n

Use this function to get the contents of this file. Don't forget to\n remove the file after you create the commit.

\n", + "group": "repository" + }, + "git_repository_message_remove": { + "type": "function", + "file": "repository.h", + "line": 507, + "lineto": 507, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Remove git's prepared message.

\n", + "comments": "

Remove the message that git_repository_message retrieves.

\n", + "group": "repository" + }, + "git_repository_state_cleanup": { + "type": "function", + "file": "repository.h", + "line": 516, + "lineto": 516, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, or error" + }, + "description": "

Remove all the metadata associated with an ongoing command like merge,\n revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG, etc.

\n", + "comments": "", + "group": "repository" + }, + "git_repository_fetchhead_foreach": { + "type": "function", + "file": "repository.h", + "line": 535, + "lineto": 538, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_repository_fetchhead_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_repository_fetchhead_foreach_cb callback, void *payload", + "sig": "git_repository *::git_repository_fetchhead_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no FETCH_HEAD file, or other error code." + }, + "description": "

Invoke 'callback' for each entry in the given FETCH_HEAD file.

\n", + "comments": "

Return a non-zero value from the callback to stop the loop.

\n", + "group": "repository" + }, + "git_repository_mergehead_foreach": { + "type": "function", + "file": "repository.h", + "line": 555, + "lineto": 558, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_repository_mergehead_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_repository_mergehead_foreach_cb callback, void *payload", + "sig": "git_repository *::git_repository_mergehead_foreach_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, GIT_ENOTFOUND if\n there is no MERGE_HEAD file, or other error code." + }, + "description": "

If a merge is in progress, invoke 'callback' for each commit ID in the\n MERGE_HEAD file.

\n", + "comments": "

Return a non-zero value from the callback to stop the loop.

\n", + "group": "repository" + }, + "git_repository_hashfile": { + "type": "function", + "file": "repository.h", + "line": 583, + "lineto": 588, + "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\n 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\n NULL, then the `path` parameter will be used instead. If\n this is passed as the empty string, then no filters will be\n applied when calculating the hash." + } + ], + "argline": "git_oid *out, git_repository *repo, const char *path, git_otype type, const char *as_path", + "sig": "git_oid *::git_repository *::const char *::git_otype::const char *", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Calculate hash of file using repository filtering rules.

\n", + "comments": "

If you simply want to calculate the hash of a file on disk with no filters,\n you can just use the git_odb_hashfile() API. However, if you want to\n hash a file in the repository and you want to apply filtering rules (e.g.\n crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the\n filtering triggers that failure, then this function will return an\n error and not calculate the hash of the file.

\n", + "group": "repository" + }, + "git_repository_set_head": { + "type": "function", + "file": "repository.h", + "line": 608, + "lineto": 610, + "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, const 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.

\n", + "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is\n unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point\n to that branch, staying attached, or become attached if it isn't yet.\n If the branch doesn't exist yet, no error will be return. The HEAD\n will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to\n the Commit.

\n", + "group": "repository" + }, + "git_repository_set_head_detached": { + "type": "function", + "file": "repository.h", + "line": 628, + "lineto": 630, + "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, const 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.

\n", + "comments": "

If the provided committish cannot be found in the repository, the HEAD\n is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD\n is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to\n the peeled Commit.

\n", + "group": "repository" + }, + "git_repository_set_head_detached_from_annotated": { + "type": "function", + "file": "repository.h", + "line": 644, + "lineto": 646, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "commitish", + "type": "const git_annotated_commit *", + "comment": null + } + ], + "argline": "git_repository *repo, const git_annotated_commit *commitish", + "sig": "git_repository *::const git_annotated_commit *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Make the repository HEAD directly point to the Commit.

\n", + "comments": "

This behaves like git_repository_set_head_detached() but takes an\n annotated commit, which lets you specify which extended sha syntax\n string was specified by a user, allowing for more exact reflog\n messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", + "group": "repository" + }, + "git_repository_detach_head": { + "type": "function", + "file": "repository.h", + "line": 665, + "lineto": 666, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository pointer" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code" + }, + "description": "

Detach the HEAD.

\n", + "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is\n updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is\n unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", + "group": "repository" + }, + "git_repository_state": { + "type": "function", + "file": "repository.h", + "line": 694, + "lineto": 694, + "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.

\n", + "comments": "", + "group": "repository" + }, + "git_repository_set_namespace": { + "type": "function", + "file": "repository.h", + "line": 708, + "lineto": 708, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repo" + }, + { + "name": "nmspace", + "type": "const char *", + "comment": "The namespace. This should not include the refs\n\tfolder, e.g. to namespace all references under `refs/namespaces/foo/`,\n\tuse `foo` as the namespace." + } + ], + "argline": "git_repository *repo, const char *nmspace", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, -1 on error" + }, + "description": "

Sets the active namespace for this Git Repository

\n", + "comments": "

This namespace affects all reference operations for the repo.\n See man gitnamespaces

\n", + "group": "repository" + }, + "git_repository_get_namespace": { + "type": "function", + "file": "repository.h", + "line": 716, + "lineto": 716, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repo" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "const char *", + "comment": " the active namespace, or NULL if there isn't one" + }, + "description": "

Get the currently active namespace for this repository

\n", + "comments": "", + "group": "repository" + }, + "git_repository_is_shallow": { + "type": "function", + "file": "repository.h", + "line": 725, + "lineto": 725, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 1 if shallow, zero if not" + }, + "description": "

Determine if the repository was a shallow clone

\n", + "comments": "", + "group": "repository" + }, + "git_repository_ident": { + "type": "function", + "file": "repository.h", + "line": 737, + "lineto": 737, + "args": [ + { + "name": "name", + "type": "const char **", + "comment": "where to store the pointer to the name" + }, + { + "name": "email", + "type": "const char **", + "comment": "where to store the pointer to the email" + }, + { + "name": "repo", + "type": "const git_repository *", + "comment": "the repository" + } + ], + "argline": "const char **name, const char **email, const git_repository *repo", + "sig": "const char **::const char **::const git_repository *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Retrieve the configured identity to use for reflogs

\n", + "comments": "

The memory is owned by the repository and must not be freed by the\n user.

\n", + "group": "repository" + }, + "git_repository_set_ident": { + "type": "function", + "file": "repository.h", + "line": 750, + "lineto": 750, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to configure" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name to use for the reflog entries" + }, + { + "name": "email", + "type": "const char *", + "comment": "the email to use for the reflog entries" + } + ], + "argline": "git_repository *repo, const char *name, const char *email", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Set the identity to be used for writing reflogs

\n", + "comments": "

If both are set, this name and email will be used to write to the\n reflog. Pass NULL to unset. When unset, the identity will be taken\n from the repository's configuration.

\n", + "group": "repository" + }, + "git_reset": { + "type": "function", + "file": "reset.h", + "line": 62, + "lineto": 66, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to perform the reset operation." + }, + { + "name": "target", + "type": "git_object *", + "comment": "Committish to which the Head should be moved to. This object\n must belong to the given `repo` and can either be a git_commit or a\n git_tag. When a git_tag is being passed, it should be dereferencable\n to a git_commit which oid will be used as the target of the branch." + }, + { + "name": "reset_type", + "type": "git_reset_t", + "comment": "Kind of reset operation to perform." + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": "Checkout options to be used for a HARD reset.\n The checkout_strategy field will be overridden (based on reset_type).\n This parameter can be used to propagate notify and progress callbacks." + } + ], + "argline": "git_repository *repo, git_object *target, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::git_object *::git_reset_t::const git_checkout_options *", + "return": { + "type": "int", + "comment": " 0 on success or an error code" + }, + "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", + "comments": "

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced\n with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be\n replaced with the content of the index. (Untracked and ignored files\n will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n", + "group": "reset" + }, + "git_reset_from_annotated": { + "type": "function", + "file": "reset.h", + "line": 80, + "lineto": 84, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "commit", + "type": "git_annotated_commit *", + "comment": null + }, + { + "name": "reset_type", + "type": "git_reset_t", + "comment": null + }, + { + "name": "checkout_opts", + "type": "const git_checkout_options *", + "comment": null + } + ], + "argline": "git_repository *repo, git_annotated_commit *commit, git_reset_t reset_type, const git_checkout_options *checkout_opts", + "sig": "git_repository *::git_annotated_commit *::git_reset_t::const git_checkout_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", + "comments": "

This behaves like git_reset() but takes an annotated commit,\n which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n", + "group": "reset" + }, + "git_reset_default": { + "type": "function", + "file": "reset.h", + "line": 104, + "lineto": 107, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to perform the reset operation." + }, + { + "name": "target", + "type": "git_object *", + "comment": "The committish which content will be used to reset the content\n of the index." + }, + { + "name": "pathspecs", + "type": "git_strarray *", + "comment": "List of pathspecs to operate on." + } + ], + "argline": "git_repository *repo, git_object *target, git_strarray *pathspecs", + "sig": "git_repository *::git_object *::git_strarray *", + "return": { + "type": "int", + "comment": " 0 on success or an error code \n<\n 0" + }, + "description": "

Updates some entries in the index from the target commit tree.

\n", + "comments": "

The scope of the updated entries is determined by the paths\n being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing\n entries in the index matching the provided pathspecs.

\n", + "group": "reset" + }, + "git_revert_init_options": { + "type": "function", + "file": "revert.h", + "line": 47, + "lineto": 49, + "args": [ + { + "name": "opts", + "type": "git_revert_options *", + "comment": "the `git_revert_options` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_REVERT_OPTIONS_VERSION`" + } + ], + "argline": "git_revert_options *opts, unsigned int version", + "sig": "git_revert_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_revert_options with default values. Equivalent to\n creating an instance with GIT_REVERT_OPTIONS_INIT.

\n", + "comments": "", + "group": "revert" + }, + "git_revert_commit": { + "type": "function", + "file": "revert.h", + "line": 65, + "lineto": 71, + "args": [ + { + "name": "out", + "type": "git_index **", + "comment": "pointer to store the index result in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository that contains the given commits" + }, + { + "name": "revert_commit", + "type": "git_commit *", + "comment": "the commit to revert" + }, + { + "name": "our_commit", + "type": "git_commit *", + "comment": "the commit to revert against (eg, HEAD)" + }, + { + "name": "mainline", + "type": "unsigned int", + "comment": "the parent of the revert commit, if it is a merge" + }, + { + "name": "merge_options", + "type": "const git_merge_options *", + "comment": "the merge options (or null for defaults)" + } + ], + "argline": "git_index **out, git_repository *repo, git_commit *revert_commit, git_commit *our_commit, unsigned int mainline, const git_merge_options *merge_options", + "sig": "git_index **::git_repository *::git_commit *::git_commit *::unsigned int::const git_merge_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Reverts the given commit against the given "our" commit, producing an\n index that reflects the result of the revert.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", + "group": "revert" + }, + "git_revert": { + "type": "function", + "file": "revert.h", + "line": 81, + "lineto": 84, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to revert" + }, + { + "name": "commit", + "type": "git_commit *", + "comment": "the commit to revert" + }, + { + "name": "given_opts", + "type": "const git_revert_options *", + "comment": "merge flags" + } + ], + "argline": "git_repository *repo, git_commit *commit, const git_revert_options *given_opts", + "sig": "git_repository *::git_commit *::const git_revert_options *", + "return": { + "type": "int", + "comment": " zero on success, -1 on failure." + }, + "description": "

Reverts the given commit, producing changes in the index and working directory.

\n", + "comments": "", + "group": "revert" + }, + "git_revparse_single": { + "type": "function", + "file": "revparse.h", + "line": 37, + "lineto": 38, + "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": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Find a single object, as specified by a revision string.

\n", + "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no\n longer needed.

\n", + "group": "revparse", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_revparse_single-26" + ], + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_revparse_single-34" + ], + "describe.c": [ + "ex/v0.23.2/describe.html#git_revparse_single-8" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revparse_single-47" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_revparse_single-13", + "ex/v0.23.2/tag.html#git_revparse_single-14", + "ex/v0.23.2/tag.html#git_revparse_single-15", + "ex/v0.23.2/tag.html#git_revparse_single-16" + ] + } + }, + "git_revparse_ext": { + "type": "function", + "file": "revparse.h", + "line": 61, + "lineto": 65, + "args": [ + { + "name": "object_out", + "type": "git_object **", + "comment": "pointer to output object" + }, + { + "name": "reference_out", + "type": "git_reference **", + "comment": "pointer to output reference or NULL" + }, + { + "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 **object_out, git_reference **reference_out, git_repository *repo, const char *spec", + "sig": "git_object **::git_reference **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC\n or an error code" + }, + "description": "

Find a single object and intermediate reference by a revision string.

\n", + "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

In some cases (\n@\n{\n<\n-n>} or `\n<branchname

\n\n
\n

@\n{upstream}), the expression may\n point to an intermediate reference. When such expressions are being passed\n in,reference_out` will be valued as well.

\n
\n\n

The returned object should be released with git_object_free and the\n returned reference with git_reference_free when no longer needed.

\n", + "group": "revparse" + }, + "git_revparse": { + "type": "function", + "file": "revparse.h", + "line": 105, + "lineto": 108, + "args": [ + { + "name": "revspec", + "type": "git_revspec *", + "comment": "Pointer to an user-allocated git_revspec struct where\n\t the result of the rev-parse will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to search in" + }, + { + "name": "spec", + "type": "const char *", + "comment": "the rev-parse spec to parse" + } + ], + "argline": "git_revspec *revspec, git_repository *repo, const char *spec", + "sig": "git_revspec *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code" + }, + "description": "

Parse a revision string for from, to, and intent.

\n", + "comments": "

See man gitrevisions or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n", + "group": "revparse", + "examples": { + "blame.c": [ + "ex/v0.23.2/blame.html#git_revparse-27" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revparse-48" + ], + "rev-parse.c": [ + "ex/v0.23.2/rev-parse.html#git_revparse-18", + "ex/v0.23.2/rev-parse.html#git_revparse-19" + ] + } + }, + "git_revwalk_new": { + "type": "function", + "file": "revwalk.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "out", + "type": "git_revwalk **", + "comment": "pointer to the new revision walker" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repo to walk through" + } + ], + "argline": "git_revwalk **out, 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.

\n", + "comments": "

This revision walker uses a custom memory pool and an internal\n commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be\n reused for different walks.

\n\n

This revision walker is not thread safe: it may only be\n used to walk a repository on a single thread; however,\n it is possible to have several revision walkers in\n several different threads walking the same repository.

\n", + "group": "revwalk", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_revwalk_new-62" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_new-49", + "ex/v0.23.2/log.html#git_revwalk_new-50" + ] + } + }, + "git_revwalk_reset": { + "type": "function", + "file": "revwalk.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "walker", + "type": "git_revwalk *", + "comment": "handle to reset." + } + ], + "argline": "git_revwalk *walker", + "sig": "git_revwalk *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Reset the revision walker for reuse.

\n", + "comments": "

This will clear all the pushed and hidden commits, and\n leave the walker in a blank state (just like at\n creation) ready to receive new commit pushes and\n start a new walk.

\n\n

The revision walk is automatically reset when a walk\n is over.

\n", + "group": "revwalk" + }, + "git_revwalk_push": { + "type": "function", + "file": "revwalk.h", + "line": 109, + "lineto": 109, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the oid of the commit to start from." + } + ], + "argline": "git_revwalk *walk, const git_oid *id", + "sig": "git_revwalk *::const git_oid *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Add a new root for the traversal

\n", + "comments": "

The pushed commit will be marked as one of the roots from which to\n start the walk. This commit may not be walked if it or a child is\n hidden.

\n\n

At least one commit must be pushed onto the walker before a walk\n can be started.

\n\n

The given id must belong to a committish on the walked\n repository.

\n", + "group": "revwalk", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_revwalk_push-63" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_push-51" + ] + } + }, + "git_revwalk_push_glob": { + "type": "function", + "file": "revwalk.h", + "line": 127, + "lineto": 127, + "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

\n", + "comments": "

The OIDs pointed to by the references that match the given glob\n pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n", + "group": "revwalk" + }, + "git_revwalk_push_head": { + "type": "function", + "file": "revwalk.h", + "line": 135, + "lineto": 135, + "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

\n", + "comments": "", + "group": "revwalk", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_push_head-52" + ] + } + }, + "git_revwalk_hide": { + "type": "function", + "file": "revwalk.h", + "line": 150, + "lineto": 150, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal." + }, + { + "name": "commit_id", + "type": "const git_oid *", + "comment": "the oid of commit that will be ignored during the traversal" + } + ], + "argline": "git_revwalk *walk, const git_oid *commit_id", + "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.

\n", + "comments": "

The given id must belong to a committish on the walked\n repository.

\n\n

The resolved commit and all its parents will be hidden from the\n output on the revision walk.

\n", + "group": "revwalk", + "examples": { + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_hide-53" + ] + } + }, + "git_revwalk_hide_glob": { + "type": "function", + "file": "revwalk.h", + "line": 169, + "lineto": 169, + "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.

\n", + "comments": "

The OIDs pointed to by the references that match the given glob\n pattern and their ancestors will be hidden from the output on the\n revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n", + "group": "revwalk" + }, + "git_revwalk_hide_head": { + "type": "function", + "file": "revwalk.h", + "line": 177, + "lineto": 177, + "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

\n", + "comments": "", + "group": "revwalk" + }, + "git_revwalk_push_ref": { + "type": "function", + "file": "revwalk.h", + "line": 188, + "lineto": 188, + "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

\n", + "comments": "

The reference must point to a committish.

\n", + "group": "revwalk" + }, + "git_revwalk_hide_ref": { + "type": "function", + "file": "revwalk.h", + "line": 199, + "lineto": 199, + "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

\n", + "comments": "

The reference must point to a committish.

\n", + "group": "revwalk" + }, + "git_revwalk_next": { + "type": "function", + "file": "revwalk.h", + "line": 219, + "lineto": 219, + "args": [ + { + "name": "out", + "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 *out, git_revwalk *walk", + "sig": "git_oid *::git_revwalk *", + "return": { + "type": "int", + "comment": " 0 if the next commit was found;\n\tGIT_ITEROVER if there are no commits left to iterate" + }, + "description": "

Get the next commit from the revision walk.

\n", + "comments": "

The initial call to this method is not blocking when\n iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial\n call blocking to preprocess the commit list, but this block should be\n mostly unnoticeable on most repositories (topological preprocessing\n times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n", + "group": "revwalk", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_revwalk_next-64" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_next-54" + ] + } + }, + "git_revwalk_sorting": { + "type": "function", + "file": "revwalk.h", + "line": 230, + "lineto": 230, + "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", + "comment": null + }, + "description": "

Change the sorting mode when iterating through the\n repository's contents.

\n", + "comments": "

Changing the sorting mode resets the walker.

\n", + "group": "revwalk", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_revwalk_sorting-65" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_sorting-55", + "ex/v0.23.2/log.html#git_revwalk_sorting-56" + ] + } + }, + "git_revwalk_push_range": { + "type": "function", + "file": "revwalk.h", + "line": 245, + "lineto": 245, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the walker being used for the traversal" + }, + { + "name": "range", + "type": "const char *", + "comment": "the range" + } + ], + "argline": "git_revwalk *walk, const char *range", + "sig": "git_revwalk *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Push and hide the respective endpoints of the given range.

\n", + "comments": "

The range should be of the form

\n\n

<commit

\n\n
\n

..\n<commit

\n\n

where each \n<commit\nis in the form accepted by 'git_revparse_single'.\n The left-hand commit will be hidden and the right-hand commit pushed.

\n
\n", + "group": "revwalk" + }, + "git_revwalk_simplify_first_parent": { + "type": "function", + "file": "revwalk.h", + "line": 252, + "lineto": 252, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": null + } + ], + "argline": "git_revwalk *walk", + "sig": "git_revwalk *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Simplify the history by first-parent

\n", + "comments": "

No parents other than the first for each commit will be enqueued.

\n", + "group": "revwalk" + }, + "git_revwalk_free": { + "type": "function", + "file": "revwalk.h", + "line": 260, + "lineto": 260, + "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", + "comment": null + }, + "description": "

Free a revision walker previously allocated.

\n", + "comments": "", + "group": "revwalk", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_revwalk_free-66" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_revwalk_free-57" + ] + } + }, + "git_revwalk_repository": { + "type": "function", + "file": "revwalk.h", + "line": 269, + "lineto": 269, + "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\n is operating.

\n", + "comments": "", + "group": "revwalk" + }, + "git_revwalk_add_hide_cb": { + "type": "function", + "file": "revwalk.h", + "line": 290, + "lineto": 293, + "args": [ + { + "name": "walk", + "type": "git_revwalk *", + "comment": "the revision walker" + }, + { + "name": "hide_cb", + "type": "git_revwalk_hide_cb", + "comment": "callback function to hide a commit and its parents" + }, + { + "name": "payload", + "type": "void *", + "comment": "data payload to be passed to callback function" + } + ], + "argline": "git_revwalk *walk, git_revwalk_hide_cb hide_cb, void *payload", + "sig": "git_revwalk *::git_revwalk_hide_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Adds a callback function to hide a commit and its parents

\n", + "comments": "", + "group": "revwalk" + }, + "git_signature_new": { + "type": "function", + "file": "signature.h", + "line": 37, + "lineto": 37, + "args": [ + { + "name": "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 **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.

\n", + "comments": "

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('\n<\n' and '>') characters are not allowed\n to be used in either the name or the email parameter.

\n", + "group": "signature", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_signature_new-67", + "ex/v0.23.2/general.html#git_signature_new-68" + ] + } + }, + "git_signature_now": { + "type": "function", + "file": "signature.h", + "line": 49, + "lineto": 49, + "args": [ + { + "name": "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 **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'.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "signature" + }, + "git_signature_default": { + "type": "function", + "file": "signature.h", + "line": 63, + "lineto": 63, + "args": [ + { + "name": "out", + "type": "git_signature **", + "comment": "new signature" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "repository pointer" + } + ], + "argline": "git_signature **out, git_repository *repo", + "sig": "git_signature **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" + }, + "description": "

Create a new action signature with default user and now timestamp.

\n", + "comments": "

This looks up the user.name and user.email from the configuration and\n uses the current time as the timestamp, and creates a new signature\n based on that information. It will return GIT_ENOTFOUND if either the\n user.name or user.email are not set.

\n", + "group": "signature", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_signature_default-12" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_signature_default-17" + ] + } + }, + "git_signature_dup": { + "type": "function", + "file": "signature.h", + "line": 75, + "lineto": 75, + "args": [ + { + "name": "dest", + "type": "git_signature **", + "comment": "pointer where to store the copy" + }, + { + "name": "sig", + "type": "const git_signature *", + "comment": "signature to duplicate" + } + ], + "argline": "git_signature **dest, const git_signature *sig", + "sig": "git_signature **::const git_signature *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create a copy of an existing signature. All internal strings are also\n duplicated.

\n", + "comments": "

Call git_signature_free() to free the data.

\n", + "group": "signature" + }, + "git_signature_free": { + "type": "function", + "file": "signature.h", + "line": 86, + "lineto": 86, + "args": [ + { + "name": "sig", + "type": "git_signature *", + "comment": "signature to free" + } + ], + "argline": "git_signature *sig", + "sig": "git_signature *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free an existing signature.

\n", + "comments": "

Because the signature is not an opaque structure, it is legal to free it\n manually, but be sure to free the "name" and "email" strings in addition\n to the structure itself.

\n", + "group": "signature", + "examples": { + "init.c": [ + "ex/v0.23.2/init.html#git_signature_free-13" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_signature_free-18" + ] + } + }, + "git_stash_apply_init_options": { + "type": "function", + "file": "stash.h", + "line": 153, + "lineto": 154, + "args": [ + { + "name": "opts", + "type": "git_stash_apply_options *", + "comment": "the `git_stash_apply_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "the version of the struct; you should pass\n `GIT_STASH_APPLY_OPTIONS_INIT` here." + } + ], + "argline": "git_stash_apply_options *opts, unsigned int version", + "sig": "git_stash_apply_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_stash_apply_options with default values. Equivalent to\n creating an instance with GIT_STASH_APPLY_OPTIONS_INIT.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_apply": { + "type": "function", + "file": "stash.h", + "line": 182, + "lineto": 185, + "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\n most recent stashed state." + }, + { + "name": "options", + "type": "const git_stash_apply_options *", + "comment": "Options to control how stashes are applied." + } + ], + "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", + "sig": "git_repository *::size_t::const git_stash_apply_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the\n given index, GIT_EMERGECONFLICT if changes exist in the working\n directory, or an error code" + }, + "description": "

Apply a single stashed state from the stash list.

\n", + "comments": "

If local changes in the working directory conflict with changes in the\n stash then GIT_EMERGECONFLICT will be returned. In this case, the index\n will always remain unmodified and all files in the working directory will\n remain unmodified. However, if you are restoring untracked files or\n ignored files and there is a conflict when applying the modified files,\n then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be\n conflicts when reinstating the index, the function will return\n GIT_EMERGECONFLICT and both the working directory and index will be left\n unmodified.

\n\n

Note that a minimum checkout strategy of GIT_CHECKOUT_SAFE is implied.

\n", + "group": "stash" + }, + "git_stash_foreach": { + "type": "function", + "file": "stash.h", + "line": 218, + "lineto": 221, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the stash." + }, + { + "name": "callback", + "type": "git_stash_cb", + "comment": "Callback to invoke per found stashed state. The most\n recent stash state will be enumerated first." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." + } + ], + "argline": "git_repository *repo, git_stash_cb callback, void *payload", + "sig": "git_repository *::git_stash_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code." + }, + "description": "

Loop over all the stashed states and issue a callback for each one.

\n", + "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": 234, + "lineto": 236, + "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\n most recent stashed state." + } + ], + "argline": "git_repository *repo, size_t index", + "sig": "git_repository *::size_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code." + }, + "description": "

Remove a single stashed state from the stash list.

\n", + "comments": "", + "group": "stash" + }, + "git_stash_pop": { + "type": "function", + "file": "stash.h", + "line": 250, + "lineto": 253, + "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\n most recent stashed state." + }, + { + "name": "options", + "type": "const git_stash_apply_options *", + "comment": "Options to control how stashes are applied." + } + ], + "argline": "git_repository *repo, size_t index, const git_stash_apply_options *options", + "sig": "git_repository *::size_t::const git_stash_apply_options *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the given\n index, or error code. (see git_stash_apply() above for details)" + }, + "description": "

Apply a single stashed state from the stash list and remove it from the list\n if successful.

\n", + "comments": "", + "group": "stash" + }, + "git_status_init_options": { + "type": "function", + "file": "status.h", + "line": 195, + "lineto": 197, + "args": [ + { + "name": "opts", + "type": "git_status_options *", + "comment": "The `git_status_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_STATUS_OPTIONS_VERSION`" + } + ], + "argline": "git_status_options *opts, unsigned int version", + "sig": "git_status_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_status_options with default values. Equivalent to\n creating an instance with GIT_STATUS_OPTIONS_INIT.

\n", + "comments": "", + "group": "status" + }, + "git_status_foreach": { + "type": "function", + "file": "status.h", + "line": 235, + "lineto": 238, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "callback", + "type": "git_status_cb", + "comment": "The function to call on each file" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to pass through to callback function" + } + ], + "argline": "git_repository *repo, git_status_cb callback, void *payload", + "sig": "git_repository *::git_status_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Gather file statuses and run a callback for each one.

\n", + "comments": "

The callback is passed the path of the file, the status (a combination of\n the git_status_t values above) and the payload data pointer passed\n into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping\n and return that value to caller.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_foreach-10" + ] + } + }, + "git_status_foreach_ext": { + "type": "function", + "file": "status.h", + "line": 259, + "lineto": 263, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object" + }, + { + "name": "opts", + "type": "const git_status_options *", + "comment": "Status options structure" + }, + { + "name": "callback", + "type": "git_status_cb", + "comment": "The function to call on each file" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to pass through to callback function" + } + ], + "argline": "git_repository *repo, const git_status_options *opts, git_status_cb callback, void *payload", + "sig": "git_repository *::const git_status_options *::git_status_cb::void *", + "return": { + "type": "int", + "comment": " 0 on success, non-zero callback return value, or error code" + }, + "description": "

Gather file status information and run callbacks as requested.

\n", + "comments": "

This is an extended version of the git_status_foreach() API that\n allows for more granular control over which paths will be processed and\n in what order. See the git_status_options structure for details\n about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_foreach_ext-11" + ] + } + }, + "git_status_file": { + "type": "function", + "file": "status.h", + "line": 291, + "lineto": 294, + "args": [ + { + "name": "status_flags", + "type": "unsigned int *", + "comment": "Output combination of git_status_t values for file" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "path", + "type": "const char *", + "comment": "The exact path to retrieve status for relative to the\n repository working directory" + } + ], + "argline": "unsigned int *status_flags, git_repository *repo, const 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,\n index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files\n or if it refers to a folder, and -1 on other errors." + }, + "description": "

Get file status for a single file.

\n", + "comments": "

This tries to get status for the filename that you give. If no files\n match that name (in either the HEAD, index, or working directory), this\n returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a\n directory or if running on a case- insensitive filesystem and yet the\n HEAD has two entries that both match the path), then this returns\n GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of\n targets and because of the path filtering, there is not enough\n information to check renames correctly. To check file status with rename\n detection, there is no choice but to do a full git_status_list_new and\n scan through looking for the path that you are interested in.

\n", + "group": "status" + }, + "git_status_list_new": { + "type": "function", + "file": "status.h", + "line": 309, + "lineto": 312, + "args": [ + { + "name": "out", + "type": "git_status_list **", + "comment": "Pointer to store the status results in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository object" + }, + { + "name": "opts", + "type": "const git_status_options *", + "comment": "Status options structure" + } + ], + "argline": "git_status_list **out, git_repository *repo, const git_status_options *opts", + "sig": "git_status_list **::git_repository *::const git_status_options *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Gather file status information and populate the git_status_list.

\n", + "comments": "

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_list_new-12", + "ex/v0.23.2/status.html#git_status_list_new-13" + ] + } + }, + "git_status_list_entrycount": { + "type": "function", + "file": "status.h", + "line": 323, + "lineto": 324, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + } + ], + "argline": "git_status_list *statuslist", + "sig": "git_status_list *", + "return": { + "type": "size_t", + "comment": " the number of status entries" + }, + "description": "

Gets the count of status entries in this list.

\n", + "comments": "

If there are no changes in status (at least according the options given\n when the status list was created), this can return 0.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_list_entrycount-14", + "ex/v0.23.2/status.html#git_status_list_entrycount-15" + ] + } + }, + "git_status_byindex": { + "type": "function", + "file": "status.h", + "line": 335, + "lineto": 337, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + }, + { + "name": "idx", + "type": "size_t", + "comment": "Position of the entry" + } + ], + "argline": "git_status_list *statuslist, size_t idx", + "sig": "git_status_list *::size_t", + "return": { + "type": "const git_status_entry *", + "comment": " Pointer to the entry; NULL if out of bounds" + }, + "description": "

Get a pointer to one of the entries in the status list.

\n", + "comments": "

The entry is not modifiable and should not be freed.

\n", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_byindex-16", + "ex/v0.23.2/status.html#git_status_byindex-17", + "ex/v0.23.2/status.html#git_status_byindex-18", + "ex/v0.23.2/status.html#git_status_byindex-19", + "ex/v0.23.2/status.html#git_status_byindex-20", + "ex/v0.23.2/status.html#git_status_byindex-21" + ] + } + }, + "git_status_list_free": { + "type": "function", + "file": "status.h", + "line": 344, + "lineto": 345, + "args": [ + { + "name": "statuslist", + "type": "git_status_list *", + "comment": "Existing status list object" + } + ], + "argline": "git_status_list *statuslist", + "sig": "git_status_list *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free an existing status list

\n", + "comments": "", + "group": "status", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_status_list_free-22" + ] + } + }, + "git_status_should_ignore": { + "type": "function", + "file": "status.h", + "line": 363, + "lineto": 366, + "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, git_repository *repo, const char *path", + "sig": "int *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." + }, + "description": "

Test if the ignore rules apply to a given file.

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n", + "group": "status" + }, + "git_strarray_free": { + "type": "function", + "file": "strarray.h", + "line": 41, + "lineto": 41, + "args": [ + { + "name": "array", + "type": "git_strarray *", + "comment": "git_strarray from which to free string data" + } + ], + "argline": "git_strarray *array", + "sig": "git_strarray *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close a string array object

\n", + "comments": "

This method should be called on git_strarray objects where the strings\n array is allocated and contains allocated strings, such as what you\n would get from git_strarray_copy(). Not doing so, will result in a\n memory leak.

\n\n

This does not free the git_strarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n", + "group": "strarray", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_strarray_free-69" + ], + "remote.c": [ + "ex/v0.23.2/remote.html#git_strarray_free-16", + "ex/v0.23.2/remote.html#git_strarray_free-17" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_strarray_free-19" + ] + } + }, + "git_strarray_copy": { + "type": "function", + "file": "strarray.h", + "line": 53, + "lineto": 53, + "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", + "comment": " 0 on success, \n<\n 0 on allocation failure" + }, + "description": "

Copy a string array object from source to target.

\n", + "comments": "

Note: target is overwritten and hence should be empty, otherwise its\n contents are leaked. Call git_strarray_free() if necessary.

\n", + "group": "strarray" + }, + "git_submodule_update_init_options": { + "type": "function", + "file": "submodule.h", + "line": 162, + "lineto": 163, + "args": [ + { + "name": "opts", + "type": "git_submodule_update_options *", + "comment": "The `git_submodule_update_options` instance to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`" + } + ], + "argline": "git_submodule_update_options *opts, unsigned int version", + "sig": "git_submodule_update_options *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_submodule_update_options with default values.\n Equivalent to creating an instance with GIT_SUBMODULE_UPDATE_OPTIONS_INIT.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_update": { + "type": "function", + "file": "submodule.h", + "line": 181, + "lineto": 181, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule object" + }, + { + "name": "init", + "type": "int", + "comment": "If the submodule is not initialized, setting this flag to true\n will initialize the submodule before updating. Otherwise, this will\n return an error if attempting to update an uninitialzed repository.\n but setting this to true forces them to be updated." + }, + { + "name": "options", + "type": "git_submodule_update_options *", + "comment": "configuration options for the update. If NULL, the\n function works as though GIT_SUBMODULE_UPDATE_OPTIONS_INIT was passed." + } + ], + "argline": "git_submodule *submodule, int init, git_submodule_update_options *options", + "sig": "git_submodule *::int::git_submodule_update_options *", + "return": { + "type": "int", + "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)." + }, + "description": "

Update a submodule. This will clone a missing submodule and\n checkout the subrepository to the commit specified in the index of\n containing repository.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_lookup": { + "type": "function", + "file": "submodule.h", + "line": 210, + "lineto": 213, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "Output ptr to submodule; pass NULL to just get return code" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The parent repository" + }, + { + "name": "name", + "type": "const char *", + "comment": "The name of or path to the submodule; trailing slashes okay" + } + ], + "argline": "git_submodule **out, git_repository *repo, const char *name", + "sig": "git_submodule **::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if submodule does not exist,\n GIT_EEXISTS if a repository is found in working directory only,\n -1 on other errors." + }, + "description": "

Lookup submodule information by name or path.

\n", + "comments": "

Given either the submodule name or path (they are usually the same), this\n returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n
    \n
  • The submodule is not mentioned in the HEAD, the index, and the config,\nbut does "exist" in the working directory (i.e. there is a subdirectory\nthat appears to be a Git repository). In this case, this function\nreturns GIT_EEXISTS to indicate a sub-repository exists but not in a\nstate where a git_submodule can be instantiated.
  • \n
  • The submodule is not mentioned in the HEAD, index, or config and the\nworking directory doesn't contain a value git repo at that path.\nThere may or may not be anything else at that path, but nothing that\nlooks like a submodule. In this case, this returns GIT_ENOTFOUND.
  • \n
\n\n

You must call git_submodule_free when done with the submodule.

\n", + "group": "submodule" + }, + "git_submodule_free": { + "type": "function", + "file": "submodule.h", + "line": 220, + "lineto": 220, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule object" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Release a submodule

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_foreach": { + "type": "function", + "file": "submodule.h", + "line": 240, + "lineto": 243, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository" + }, + { + "name": "callback", + "type": "int (*)(git_submodule *, const char *, void *)", + "comment": "Function to be called with the name of each submodule.\n Return a non-zero value to terminate the iteration." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra data to pass to callback" + } + ], + "argline": "git_repository *repo, int (*)(git_submodule *, const char *, void *) callback, void *payload", + "sig": "git_repository *::int (*)(git_submodule *, const char *, void *)::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.

\n", + "comments": "

See the note on git_submodule above. This iterates over the tracked\n submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like\n submodules but are not tracked, the diff API will generate a diff record\n for workdir items that look like submodules but are not tracked, showing\n them as added in the workdir. Also, the status API will treat the entire\n subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n", + "group": "submodule", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_submodule_foreach-23" + ] + } + }, + "git_submodule_add_setup": { + "type": "function", + "file": "submodule.h", + "line": 270, + "lineto": 275, + "args": [ + { + "name": "out", + "type": "git_submodule **", + "comment": "The newly created submodule ready to open for clone" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository in which you want to create the submodule" + }, + { + "name": "url", + "type": "const char *", + "comment": "URL for the submodule's 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\n .git/modules vs. repo directly in workdir." + } + ], + "argline": "git_submodule **out, git_repository *repo, const char *url, const char *path, int 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,\n -1 on other errors." + }, + "description": "

Set up a new git submodule for checkout.

\n", + "comments": "

This does "git submodule add" up to the fetch and checkout of the\n submodule contents. It preps a new submodule, creates an entry in\n .gitmodules and creates an empty initialized repository either at the\n given path in the working directory or in .git/modules with a gitlink\n from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the\n submodule 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\n

You must call git_submodule_free on the submodule object when done.

\n", + "group": "submodule" + }, + "git_submodule_add_finalize": { + "type": "function", + "file": "submodule.h", + "line": 287, + "lineto": 287, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to finish adding." + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Resolve the setup of a new git submodule.

\n", + "comments": "

This should be called on a submodule once you have called add setup\n and done the clone of the submodule. This adds the .gitmodules file\n and 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": 299, + "lineto": 301, + "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\n file. If you pass this as false, you will have to get the\n git_index and explicitly call `git_index_write()` on it to\n save the change." + } + ], + "argline": "git_submodule *submodule, int write_index", + "sig": "git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Add current submodule HEAD commit to index of superproject.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_owner": { + "type": "function", + "file": "submodule.h", + "line": 314, + "lineto": 314, + "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.

\n", + "comments": "

This returns a pointer to the repository that contains the submodule.\n This is a just a reference to the repository that was passed to the\n original git_submodule_lookup() call, so if that repository has been\n freed, then this may be a dangling reference.

\n", + "group": "submodule" + }, + "git_submodule_name": { + "type": "function", + "file": "submodule.h", + "line": 322, + "lineto": 322, + "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.

\n", + "comments": "", + "group": "submodule", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_submodule_name-24" + ] + } + }, + "git_submodule_path": { + "type": "function", + "file": "submodule.h", + "line": 333, + "lineto": 333, + "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.

\n", + "comments": "

The path is almost always the same as the submodule name, but the\n two are actually not required to match.

\n", + "group": "submodule", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_submodule_path-25" + ] + } + }, + "git_submodule_url": { + "type": "function", + "file": "submodule.h", + "line": 341, + "lineto": 341, + "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.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_resolve_url": { + "type": "function", + "file": "submodule.h", + "line": 351, + "lineto": 351, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "buffer to store the absolute submodule url in" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Pointer to repository object" + }, + { + "name": "url", + "type": "const char *", + "comment": "Relative url" + } + ], + "argline": "git_buf *out, git_repository *repo, const char *url", + "sig": "git_buf *::git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Resolve a submodule url relative to the given repository.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_branch": { + "type": "function", + "file": "submodule.h", + "line": 359, + "lineto": 359, + "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 branch" + }, + "description": "

Get the branch for the submodule.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_set_branch": { + "type": "function", + "file": "submodule.h", + "line": 372, + "lineto": 372, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "branch", + "type": "const char *", + "comment": "Branch that should be used for the submodule" + } + ], + "argline": "git_repository *repo, const char *name, const char *branch", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set the branch for the submodule in the configuration

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n", + "group": "submodule" + }, + "git_submodule_set_url": { + "type": "function", + "file": "submodule.h", + "line": 386, + "lineto": 386, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "url", + "type": "const char *", + "comment": "URL that should be used for the submodule" + } + ], + "argline": "git_repository *repo, const char *name, const char *url", + "sig": "git_repository *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set the URL for the submodule in the configuration

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n", + "group": "submodule" + }, + "git_submodule_index_id": { + "type": "function", + "file": "submodule.h", + "line": 394, + "lineto": 394, + "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.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_head_id": { + "type": "function", + "file": "submodule.h", + "line": 402, + "lineto": 402, + "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.

\n", + "comments": "", + "group": "submodule" + }, + "git_submodule_wd_id": { + "type": "function", + "file": "submodule.h", + "line": 415, + "lineto": 415, + "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.

\n", + "comments": "

This returns the OID that corresponds to looking up 'HEAD' in the checked\n out submodule. If there are pending changes in the index or anything\n else, this won't notice that. You should call git_submodule_status()\n for a more complete picture about the state of the working directory.

\n", + "group": "submodule" + }, + "git_submodule_ignore": { + "type": "function", + "file": "submodule.h", + "line": 440, + "lineto": 441, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to check" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_ignore_t", + "comment": " The current git_submodule_ignore_t valyue what will be used for\n this submodule." + }, + "description": "

Get the ignore rule that will be used for the submodule.

\n", + "comments": "

These values control the behavior of git_submodule_status() for this\n submodule. There are four ignore values:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_NONE will consider any change to the contents\nof the submodule from a clean checkout to be dirty, including the\naddition of untracked files. This is the default if unspecified.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED examines the contents of the\nworking tree (i.e. call git_status_foreach() on the submodule) but\nUNTRACKED files will not count as making the submodule dirty.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY means to only check if the HEAD of the\nsubmodule has moved for status. This is fast since it does not need to\nscan the working tree of the submodule at all.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL means not to open the submodule repo.\nThe working directory will be consider clean so long as there is a\nchecked out version present.
  • \n
\n", + "group": "submodule" + }, + "git_submodule_set_ignore": { + "type": "function", + "file": "submodule.h", + "line": 453, + "lineto": 456, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submdule" + }, + { + "name": "ignore", + "type": "git_submodule_ignore_t", + "comment": "The new value for the ignore rule" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_ignore_t ignore", + "sig": "git_repository *::const char *::git_submodule_ignore_t", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Set the ignore rule for the submodule in the configuration

\n", + "comments": "

This does not affect any currently-loaded instances.

\n", + "group": "submodule" + }, + "git_submodule_update_strategy": { + "type": "function", + "file": "submodule.h", + "line": 468, + "lineto": 469, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to check" + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_update_t", + "comment": " The current git_submodule_update_t value that will be used\n for this submodule." + }, + "description": "

Get the update rule that will be used for the submodule.

\n", + "comments": "

This value controls the behavior of the git submodule update command.\n There are four useful values documented with git_submodule_update_t.

\n", + "group": "submodule" + }, + "git_submodule_set_update": { + "type": "function", + "file": "submodule.h", + "line": 481, + "lineto": 484, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the name of the submodule to configure" + }, + { + "name": "update", + "type": "git_submodule_update_t", + "comment": "The new value to use" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_update_t update", + "sig": "git_repository *::const char *::git_submodule_update_t", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Set the update rule for the submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" + }, + "git_submodule_fetch_recurse_submodules": { + "type": "function", + "file": "submodule.h", + "line": 497, + "lineto": 498, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": null + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "git_submodule_recurse_t", + "comment": " 0 if fetchRecurseSubmodules is false, 1 if true" + }, + "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", + "comments": "

This accesses the submodule.\n<name

\n\n
\n

.fetchRecurseSubmodules value for\n the submodule that controls fetching behavior for the submodule.

\n
\n\n

Note that at this time, libgit2 does not honor this setting and the\n fetch functionality current ignores submodules.

\n", + "group": "submodule" + }, + "git_submodule_set_fetch_recurse_submodules": { + "type": "function", + "file": "submodule.h", + "line": 510, + "lineto": 513, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository to affect" + }, + { + "name": "name", + "type": "const char *", + "comment": "the submodule to configure" + }, + { + "name": "fetch_recurse_submodules", + "type": "git_submodule_recurse_t", + "comment": "Boolean value" + } + ], + "argline": "git_repository *repo, const char *name, git_submodule_recurse_t fetch_recurse_submodules", + "sig": "git_repository *::const char *::git_submodule_recurse_t", + "return": { + "type": "int", + "comment": " old value for fetchRecurseSubmodules" + }, + "description": "

Set the fetchRecurseSubmodules rule for a submodule in the configuration

\n", + "comments": "

This setting won't affect any existing instances.

\n", + "group": "submodule" + }, + "git_submodule_init": { + "type": "function", + "file": "submodule.h", + "line": 528, + "lineto": 528, + "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,\n 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, \n<\n0 on failure." + }, + "description": "

Copy submodule info into ".git/config" file.

\n", + "comments": "

Just like "git submodule init", this copies information about the\n submodule into ".git/config". You can use the accessor functions\n above to alter the in-memory git_submodule object and control what\n is written to the config, overriding what is in .gitmodules.

\n", + "group": "submodule" + }, + "git_submodule_repo_init": { + "type": "function", + "file": "submodule.h", + "line": 543, + "lineto": 546, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "Output pointer to the created git repository." + }, + { + "name": "sm", + "type": "const git_submodule *", + "comment": "The submodule to create a new subrepository from." + }, + { + "name": "use_gitlink", + "type": "int", + "comment": "Should the workdir contain a gitlink to\n the repo in .git/modules vs. repo directly in workdir." + } + ], + "argline": "git_repository **out, const git_submodule *sm, int use_gitlink", + "sig": "git_repository **::const git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure." + }, + "description": "

Set up the subrepository for a submodule in preparation for clone.

\n", + "comments": "

This function can be called to init and set up a submodule\n repository from a submodule in preparation to clone it from\n its remote.

\n", + "group": "submodule" + }, + "git_submodule_sync": { + "type": "function", + "file": "submodule.h", + "line": 556, + "lineto": 556, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": null + } + ], + "argline": "git_submodule *submodule", + "sig": "git_submodule *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Copy submodule remote info into submodule repo.

\n", + "comments": "

This copies the information about the submodules URL into the checked out\n submodule config, acting like "git submodule sync". This is useful if\n you have altered the URL for the submodule (or it has been altered by a\n fetch of upstream changes) and you need to update your local repo.

\n", + "group": "submodule" + }, + "git_submodule_open": { + "type": "function", + "file": "submodule.h", + "line": 570, + "lineto": 572, + "args": [ + { + "name": "repo", + "type": "git_repository **", + "comment": "Pointer to the submodule repo which was opened" + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule to be opened" + } + ], + "argline": "git_repository **repo, git_submodule *submodule", + "sig": "git_repository **::git_submodule *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 if submodule repo could not be opened." + }, + "description": "

Open the repository for a submodule.

\n", + "comments": "

This is a newly opened repository object. The caller is responsible for\n calling git_repository_free() on it when done. Multiple calls to this\n function will return distinct git_repository objects. This will only\n work if the submodule is checked out into the working directory.

\n", + "group": "submodule" + }, + "git_submodule_reload": { + "type": "function", + "file": "submodule.h", + "line": 584, + "lineto": 584, + "args": [ + { + "name": "submodule", + "type": "git_submodule *", + "comment": "The submodule to reload" + }, + { + "name": "force", + "type": "int", + "comment": "Force reload even if the data doesn't seem out of date" + } + ], + "argline": "git_submodule *submodule, int force", + "sig": "git_submodule *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on error" + }, + "description": "

Reread submodule info from config, index, and HEAD.

\n", + "comments": "

Call this to reread cached submodule information for this submodule if\n you have reason to believe that it has changed.

\n", + "group": "submodule" + }, + "git_submodule_status": { + "type": "function", + "file": "submodule.h", + "line": 600, + "lineto": 604, + "args": [ + { + "name": "status", + "type": "unsigned int *", + "comment": "Combination of `GIT_SUBMODULE_STATUS` flags" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which to look" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the submodule" + }, + { + "name": "ignore", + "type": "git_submodule_ignore_t", + "comment": "the ignore rules to follow" + } + ], + "argline": "unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore", + "sig": "unsigned int *::git_repository *::const char *::git_submodule_ignore_t", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on error" + }, + "description": "

Get the status for a submodule.

\n", + "comments": "

This looks at a submodule and tries to determine the status. It\n will return a combination of the GIT_SUBMODULE_STATUS values above.\n How deeply it examines the working directory to do this will depend\n on the git_submodule_ignore_t value for the submodule.

\n", + "group": "submodule", + "examples": { + "status.c": [ + "ex/v0.23.2/status.html#git_submodule_status-26" + ] + } + }, + "git_submodule_location": { + "type": "function", + "file": "submodule.h", + "line": 620, + "lineto": 622, + "args": [ + { + "name": "location_status", + "type": "unsigned int *", + "comment": "Combination of first four `GIT_SUBMODULE_STATUS` flags" + }, + { + "name": "submodule", + "type": "git_submodule *", + "comment": "Submodule for which to get status" + } + ], + "argline": "unsigned int *location_status, git_submodule *submodule", + "sig": "unsigned int *::git_submodule *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on error" + }, + "description": "

Get the locations of submodule information.

\n", + "comments": "

This is a bit like a very lightweight version of git_submodule_status.\n It just returns a made of the first four submodule status values (i.e.\n the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the\n submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.).\n This can be useful if you want to know if the submodule is present in the\n working directory at this point in time, etc.

\n", + "group": "submodule" + }, + "git_commit_create_from_ids": { + "type": "function", + "file": "sys/commit.h", + "line": 34, + "lineto": 44, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "update_ref", + "type": "const char *", + "comment": null + }, + { + "name": "author", + "type": "const git_signature *", + "comment": null + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": null + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": null + }, + { + "name": "message", + "type": "const char *", + "comment": null + }, + { + "name": "tree", + "type": "const git_oid *", + "comment": null + }, + { + "name": "parent_count", + "type": "size_t", + "comment": null + }, + { + "name": "parents", + "type": "const git_oid *[]", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create new commit in the repository from a list of git_oid values.

\n", + "comments": "

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree and\n parents now take git_oid. This is a dangerous API in that nor\n the tree, neither the parents list of git_oids are checked for\n validity.

\n", + "group": "commit" + }, + "git_commit_create_from_callback": { + "type": "function", + "file": "sys/commit.h", + "line": 66, + "lineto": 76, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "update_ref", + "type": "const char *", + "comment": null + }, + { + "name": "author", + "type": "const git_signature *", + "comment": null + }, + { + "name": "committer", + "type": "const git_signature *", + "comment": null + }, + { + "name": "message_encoding", + "type": "const char *", + "comment": null + }, + { + "name": "message", + "type": "const char *", + "comment": null + }, + { + "name": "tree", + "type": "const git_oid *", + "comment": null + }, + { + "name": "parent_cb", + "type": "git_commit_parent_callback", + "comment": null + }, + { + "name": "parent_payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, void *parent_payload", + "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::git_commit_parent_callback::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a new commit in the repository with an callback to supply parents.

\n", + "comments": "

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree takes a\n git_oid and doesn't check for validity, and parent_cb is invoked\n with parent_payload and should return git_oid values or NULL to\n indicate that all parents are accounted for.

\n", + "group": "commit" + }, + "git_config_init_backend": { + "type": "function", + "file": "sys/config.h", + "line": 83, + "lineto": 85, + "args": [ + { + "name": "backend", + "type": "git_config_backend *", + "comment": "the `git_config_backend` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_CONFIG_BACKEND_VERSION`" + } + ], + "argline": "git_config_backend *backend, unsigned int version", + "sig": "git_config_backend *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_config_backend with default values. Equivalent to\n creating an instance with GIT_CONFIG_BACKEND_INIT.

\n", + "comments": "", + "group": "config" + }, + "git_config_add_backend": { + "type": "function", + "file": "sys/config.h", + "line": 105, + "lineto": 109, + "args": [ + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration to add the file to" + }, + { + "name": "file", + "type": "git_config_backend *", + "comment": "the configuration file (backend) to add" + }, + { + "name": "level", + "type": "git_config_level_t", + "comment": "the priority level of the backend" + }, + { + "name": "force", + "type": "int", + "comment": "if a config file already exists for the given\n priority level, replace it" + } + ], + "argline": "git_config *cfg, git_config_backend *file, git_config_level_t level, int force", + "sig": "git_config *::git_config_backend *::git_config_level_t::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n 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

\n", + "comments": "

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n", + "group": "config" + }, + "git_diff_print_callback__to_buf": { + "type": "function", + "file": "sys/diff.h", + "line": 37, + "lineto": 41, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": null + }, + { + "name": "line", + "type": "const git_diff_line *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Diff print callback that writes to a git_buf.

\n", + "comments": "

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You\n must pass a git_buf * value as the payload to the git_diff_print\n and/or git_patch_print function. The data will be appended to the\n buffer (after any existing content).

\n", + "group": "diff" + }, + "git_diff_print_callback__to_file_handle": { + "type": "function", + "file": "sys/diff.h", + "line": 57, + "lineto": 61, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": null + }, + { + "name": "line", + "type": "const git_diff_line *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Diff print callback that writes to stdio FILE handle.

\n", + "comments": "

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You\n must pass a FILE * value (such as stdout or stderr or the return\n value from fopen()) as the payload to the git_diff_print\n and/or git_patch_print function. If you pass NULL, this will write\n data to stdout.

\n", + "group": "diff" + }, + "git_diff_get_perfdata": { + "type": "function", + "file": "sys/diff.h", + "line": 83, + "lineto": 84, + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *", + "comment": "Structure to be filled with diff performance data" + }, + { + "name": "diff", + "type": "const git_diff *", + "comment": "Diff to read performance data from" + } + ], + "argline": "git_diff_perfdata *out, const git_diff *diff", + "sig": "git_diff_perfdata *::const git_diff *", + "return": { + "type": "int", + "comment": " 0 for success, \n<\n0 for error" + }, + "description": "

Get performance data for a diff object.

\n", + "comments": "", + "group": "diff" + }, + "git_status_list_get_perfdata": { + "type": "function", + "file": "sys/diff.h", + "line": 89, + "lineto": 90, + "args": [ + { + "name": "out", + "type": "git_diff_perfdata *", + "comment": null + }, + { + "name": "status", + "type": "const git_status_list *", + "comment": null + } + ], + "argline": "git_diff_perfdata *out, const git_status_list *status", + "sig": "git_diff_perfdata *::const git_status_list *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Get performance data for diffs from a git_status_list

\n", + "comments": "", + "group": "status" + }, + "git_filter_lookup": { + "type": "function", + "file": "sys/filter.h", + "line": 27, + "lineto": 27, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The name of the filter" + } + ], + "argline": "const char *name", + "sig": "const char *", + "return": { + "type": "git_filter *", + "comment": " Pointer to the filter object or NULL if not found" + }, + "description": "

Look up a filter by name

\n", + "comments": "", + "group": "filter" + }, + "git_filter_list_new": { + "type": "function", + "file": "sys/filter.h", + "line": 57, + "lineto": 61, + "args": [ + { + "name": "out", + "type": "git_filter_list **", + "comment": null + }, + { + "name": "repo", + "type": "git_repository *", + "comment": null + }, + { + "name": "mode", + "type": "git_filter_mode_t", + "comment": null + }, + { + "name": "options", + "type": "uint32_t", + "comment": null + } + ], + "argline": "git_filter_list **out, git_repository *repo, git_filter_mode_t mode, uint32_t options", + "sig": "git_filter_list **::git_repository *::git_filter_mode_t::uint32_t", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a new empty filter list

\n", + "comments": "

Normally you won't use this because git_filter_list_load will create\n the filter list for you, but you can use this in combination with the\n git_filter_lookup and git_filter_list_push functions to assemble\n your own chains of filters.

\n", + "group": "filter" + }, + "git_filter_list_push": { + "type": "function", + "file": "sys/filter.h", + "line": 76, + "lineto": 77, + "args": [ + { + "name": "fl", + "type": "git_filter_list *", + "comment": null + }, + { + "name": "filter", + "type": "git_filter *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_filter_list *fl, git_filter *filter, void *payload", + "sig": "git_filter_list *::git_filter *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Add a filter to a filter list with the given payload.

\n", + "comments": "

Normally you won't have to do this because the filter list is created\n by calling the "check" function on registered filters when the filter\n attributes are set, but this does allow more direct manipulation of\n filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the\n filter. Using this function, you can either pass in a payload if you\n know the expected payload format, or you can pass NULL. Some filters\n may fail with a NULL payload. Good luck!

\n", + "group": "filter" + }, + "git_filter_list_length": { + "type": "function", + "file": "sys/filter.h", + "line": 90, + "lineto": 90, + "args": [ + { + "name": "fl", + "type": "const git_filter_list *", + "comment": "A filter list" + } + ], + "argline": "const git_filter_list *fl", + "sig": "const git_filter_list *", + "return": { + "type": "size_t", + "comment": " The number of filters in the list" + }, + "description": "

Look up how many filters are in the list

\n", + "comments": "

We will attempt to apply all of these filters to any data passed in,\n but note that the filter apply action still has the option of skipping\n data that is passed in (for example, the CRLF filter will skip data\n that appears to be binary).

\n", + "group": "filter" + }, + "git_filter_source_repo": { + "type": "function", + "file": "sys/filter.h", + "line": 100, + "lineto": 100, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "git_repository *", + "comment": null + }, + "description": "

Get the repository that the source data is coming from.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_source_path": { + "type": "function", + "file": "sys/filter.h", + "line": 105, + "lineto": 105, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "const char *", + "comment": null + }, + "description": "

Get the path that the source data is coming from.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_source_filemode": { + "type": "function", + "file": "sys/filter.h", + "line": 111, + "lineto": 111, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "uint16_t", + "comment": null + }, + "description": "

Get the file mode of the source file\n If the mode is unknown, this will return 0

\n", + "comments": "", + "group": "filter" + }, + "git_filter_source_id": { + "type": "function", + "file": "sys/filter.h", + "line": 118, + "lineto": 118, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "const git_oid *", + "comment": null + }, + "description": "

Get the OID of the source\n If the OID is unknown (often the case with GIT_FILTER_CLEAN) then\n this will return NULL.

\n", + "comments": "", + "group": "filter" + }, + "git_filter_source_mode": { + "type": "function", + "file": "sys/filter.h", + "line": 123, + "lineto": 123, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "git_filter_mode_t", + "comment": null + }, + "description": "

Get the git_filter_mode_t to be used

\n", + "comments": "", + "group": "filter" + }, + "git_filter_source_flags": { + "type": "function", + "file": "sys/filter.h", + "line": 128, + "lineto": 128, + "args": [ + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "const git_filter_source *src", + "sig": "const git_filter_source *", + "return": { + "type": "uint32_t", + "comment": null + }, + "description": "

Get the combination git_filter_flag_t options to be applied

\n", + "comments": "", + "group": "filter" + }, + "git_filter_register": { + "type": "function", + "file": "sys/filter.h", + "line": 289, + "lineto": 290, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "A name by which the filter can be referenced. Attempting\n \t\t\tto register with an in-use name will return GIT_EEXISTS." + }, + { + "name": "filter", + "type": "git_filter *", + "comment": "The filter definition. This pointer will be stored as is\n \t\t\tby libgit2 so it must be a durable allocation (either static\n \t\t\tor on the heap)." + }, + { + "name": "priority", + "type": "int", + "comment": "The priority for filter application" + } + ], + "argline": "const char *name, git_filter *filter, int priority", + "sig": "const char *::git_filter *::int", + "return": { + "type": "int", + "comment": " 0 on successful registry, error code \n<\n0 on failure" + }, + "description": "

Register a filter under a given name with a given priority.

\n", + "comments": "

As mentioned elsewhere, the initialize callback will not be invoked\n immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be\n issued in order of priority on smudge (to workdir), and in reverse\n order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2:\n - GIT_FILTER_CRLF with priority 0\n - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n", + "group": "filter" + }, + "git_filter_unregister": { + "type": "function", + "file": "sys/filter.h", + "line": 305, + "lineto": 305, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "The name under which the filter was registered" + } + ], + "argline": "const char *name", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 0 on success, error code \n<\n0 on failure" + }, + "description": "

Remove the filter with the given name

\n", + "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and\n will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n", + "group": "filter" + }, + "git_hashsig_create": { + "type": "function", + "file": "sys/hashsig.h", + "line": 62, + "lineto": 66, + "args": [ + { + "name": "out", + "type": "git_hashsig **", + "comment": "The computed similarity signature." + }, + { + "name": "buf", + "type": "const char *", + "comment": "The input buffer." + }, + { + "name": "buflen", + "type": "size_t", + "comment": "The input buffer size." + }, + { + "name": "opts", + "type": "git_hashsig_option_t", + "comment": "The signature computation options (see above)." + } + ], + "argline": "git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts", + "sig": "git_hashsig **::const char *::size_t::git_hashsig_option_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." + }, + "description": "

Compute a similarity signature for a text buffer

\n", + "comments": "

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the\n whitespace will be removed from the buffer while it is being processed,\n modifying the buffer in place. Sorry about that!

\n", + "group": "hashsig" + }, + "git_hashsig_create_fromfile": { + "type": "function", + "file": "sys/hashsig.h", + "line": 81, + "lineto": 84, + "args": [ + { + "name": "out", + "type": "git_hashsig **", + "comment": "The computed similarity signature." + }, + { + "name": "path", + "type": "const char *", + "comment": "The path to the input file." + }, + { + "name": "opts", + "type": "git_hashsig_option_t", + "comment": "The signature computation options (see above)." + } + ], + "argline": "git_hashsig **out, const char *path, git_hashsig_option_t opts", + "sig": "git_hashsig **::const char *::git_hashsig_option_t", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." + }, + "description": "

Compute a similarity signature for a text file

\n", + "comments": "

This walks through the file, only loading a maximum of 4K of file data at\n a time. Otherwise, it acts just like git_hashsig_create.

\n", + "group": "hashsig" + }, + "git_hashsig_free": { + "type": "function", + "file": "sys/hashsig.h", + "line": 91, + "lineto": 91, + "args": [ + { + "name": "sig", + "type": "git_hashsig *", + "comment": "The similarity signature to free." + } + ], + "argline": "git_hashsig *sig", + "sig": "git_hashsig *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Release memory for a content similarity signature

\n", + "comments": "", + "group": "hashsig" + }, + "git_hashsig_compare": { + "type": "function", + "file": "sys/hashsig.h", + "line": 100, + "lineto": 102, + "args": [ + { + "name": "a", + "type": "const git_hashsig *", + "comment": "The first similarity signature to compare." + }, + { + "name": "b", + "type": "const git_hashsig *", + "comment": "The second similarity signature to compare." + } + ], + "argline": "const git_hashsig *a, const git_hashsig *b", + "sig": "const git_hashsig *::const git_hashsig *", + "return": { + "type": "int", + "comment": " [0 to 100] on success as the similarity score, or error code." + }, + "description": "

Measure similarity score between two similarity signatures

\n", + "comments": "", + "group": "hashsig" + }, + "git_mempack_new": { + "type": "function", + "file": "sys/mempack.h", + "line": 44, + "lineto": 44, + "args": [ + { + "name": "out", + "type": "git_odb_backend **", + "comment": "Poiter where to store the ODB backend" + } + ], + "argline": "git_odb_backend **out", + "sig": "git_odb_backend **", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "
Instantiate a new mempack backend.\n
\n", + "comments": "
The backend must be added to an existing ODB with the highest\npriority.\n\n    git_mempack_new(\n
\n\n

&mempacker\n);\n git_repository_odb(\n&odb\n, repository);\n git_odb_add_backend(odb, mempacker, 999);

\n\n
Once the backend has been loaded, all writes to the ODB will\ninstead be queued in memory, and can be finalized with\n`git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store\nto ensure consistency, until the memory store is dumped.\n
\n", + "group": "mempack" + }, + "git_mempack_reset": { + "type": "function", + "file": "sys/mempack.h", + "line": 81, + "lineto": 81, + "args": [ + { + "name": "backend", + "type": "git_odb_backend *", + "comment": "The mempack backend" + } + ], + "argline": "git_odb_backend *backend", + "sig": "git_odb_backend *", + "return": { + "type": "void", + "comment": null + }, + "description": "
Reset the memory packer by clearing all the queued objects.\n
\n", + "comments": "
This assumes that `git_mempack_dump` has been called before to\nstore all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"\nall the recently written objects, giving transaction-like\nsemantics to the Git repository.\n
\n", + "group": "mempack" + }, + "git_odb_init_backend": { + "type": "function", + "file": "sys/odb_backend.h", + "line": 100, + "lineto": 102, + "args": [ + { + "name": "backend", + "type": "git_odb_backend *", + "comment": "the `git_odb_backend` struct to initialize." + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version the struct; pass `GIT_ODB_BACKEND_VERSION`" + } + ], + "argline": "git_odb_backend *backend, unsigned int version", + "sig": "git_odb_backend *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_odb_backend with default values. Equivalent to\n creating an instance with GIT_ODB_BACKEND_INIT.

\n", + "comments": "", + "group": "odb" + }, + "git_openssl_set_locking": { + "type": "function", + "file": "sys/openssl.h", + "line": 34, + "lineto": 34, + "args": [], + "argline": "", + "sig": "", + "return": { + "type": "int", + "comment": " 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support." + }, + "description": "

Initialize the OpenSSL locks

\n", + "comments": "

OpenSSL requires the application to determine how it performs\n locking.

\n\n

This is a last-resort convenience function which libgit2 provides for\n allocating and initializing the locks as well as setting the\n locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed\n when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it\n likely sets up locking. You should very strongly prefer that over\n this function.

\n", + "group": "openssl" + }, + "git_refdb_init_backend": { + "type": "function", + "file": "sys/refdb_backend.h", + "line": 182, + "lineto": 184, + "args": [ + { + "name": "backend", + "type": "git_refdb_backend *", + "comment": "the `git_refdb_backend` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_REFDB_BACKEND_VERSION`" + } + ], + "argline": "git_refdb_backend *backend, unsigned int version", + "sig": "git_refdb_backend *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_refdb_backend with default values. Equivalent to\n creating an instance with GIT_REFDB_BACKEND_INIT.

\n", + "comments": "", + "group": "refdb" + }, + "git_refdb_backend_fs": { + "type": "function", + "file": "sys/refdb_backend.h", + "line": 197, + "lineto": 199, + "args": [ + { + "name": "backend_out", + "type": "git_refdb_backend **", + "comment": "Output pointer to the git_refdb_backend object" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Git repository to access" + } + ], + "argline": "git_refdb_backend **backend_out, git_repository *repo", + "sig": "git_refdb_backend **::git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 error code on failure" + }, + "description": "

Constructors for default filesystem-based refdb backend

\n", + "comments": "

Under normal usage, this is called for you when the repository is\n opened / created, but you can use this to explicitly construct a\n filesystem refdb backend for a repository.

\n", + "group": "refdb" + }, + "git_refdb_set_backend": { + "type": "function", + "file": "sys/refdb_backend.h", + "line": 211, + "lineto": 213, + "args": [ + { + "name": "refdb", + "type": "git_refdb *", + "comment": "database to add the backend to" + }, + { + "name": "backend", + "type": "git_refdb_backend *", + "comment": "pointer to a git_refdb_backend instance" + } + ], + "argline": "git_refdb *refdb, git_refdb_backend *backend", + "sig": "git_refdb *::git_refdb_backend *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Sets the custom backend to an existing reference DB

\n", + "comments": "

The git_refdb will take ownership of the git_refdb_backend so you\n should NOT free it after calling this function.

\n", + "group": "refdb" + }, + "git_reference__alloc": { + "type": "function", + "file": "sys/refs.h", + "line": 31, + "lineto": 34, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "the reference name" + }, + { + "name": "oid", + "type": "const git_oid *", + "comment": "the object id for a direct reference" + }, + { + "name": "peel", + "type": "const git_oid *", + "comment": "the first non-tag object's OID, or NULL" + } + ], + "argline": "const char *name, const git_oid *oid, const git_oid *peel", + "sig": "const char *::const git_oid *::const git_oid *", + "return": { + "type": "git_reference *", + "comment": " the created git_reference or NULL on error" + }, + "description": "

Create a new direct reference from an OID.

\n", + "comments": "", + "group": "reference" + }, + "git_reference__alloc_symbolic": { + "type": "function", + "file": "sys/refs.h", + "line": 43, + "lineto": 45, + "args": [ + { + "name": "name", + "type": "const char *", + "comment": "the reference name" + }, + { + "name": "target", + "type": "const char *", + "comment": "the target for a symbolic reference" + } + ], + "argline": "const char *name, const char *target", + "sig": "const char *::const char *", + "return": { + "type": "git_reference *", + "comment": " the created git_reference or NULL on error" + }, + "description": "

Create a new symbolic reference.

\n", + "comments": "", + "group": "reference" + }, + "git_repository_new": { + "type": "function", + "file": "sys/repository.h", + "line": 31, + "lineto": 31, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "The blank repository" + } + ], + "argline": "git_repository **out", + "sig": "git_repository **", + "return": { + "type": "int", + "comment": " 0 on success, or an error code" + }, + "description": "

Create a new repository with neither backends nor config object

\n", + "comments": "

Note that this is only useful if you wish to associate the repository\n with a non-filesystem-backed object database and config store.

\n", + "group": "repository" + }, + "git_repository__cleanup": { + "type": "function", + "file": "sys/repository.h", + "line": 44, + "lineto": 44, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": null + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Reset all the internal state in a repository.

\n", + "comments": "

This will free all the mapped memory and internal objects\n of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're\n trying to aggressively cleanup the repo before its\n deallocation. git_repository_free already performs this operation\n before deallocation the repo.

\n", + "group": "repository" + }, + "git_repository_reinit_filesystem": { + "type": "function", + "file": "sys/repository.h", + "line": 61, + "lineto": 63, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "recurse_submodules", + "type": "int", + "comment": "Should submodules be updated recursively" + } + ], + "argline": "git_repository *repo, int recurse_submodules", + "sig": "git_repository *::int", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n 0 on error" + }, + "description": "

Update the filesystem config settings for an open repository

\n", + "comments": "

When a repository is initialized, config values are set based on the\n properties of the filesystem that the repository is on, such as\n "core.ignorecase", "core.filemode", "core.symlinks", etc. If the\n repository is moved to a new filesystem, these properties may no\n longer be correct and API calls may not behave as expected. This\n call reruns the phase of repository initialization that sets those\n properties to compensate for the current filesystem of the repo.

\n", + "group": "repository" + }, + "git_repository_set_config": { + "type": "function", + "file": "sys/repository.h", + "line": 78, + "lineto": 78, + "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", + "comment": null + }, + "description": "

Set the configuration file for this repository

\n", + "comments": "

This configuration file will be used for all configuration\n queries involving this repository.

\n\n

The repository will keep a reference to the config file;\n the user must still free the config after setting it\n to the repository, or it will leak.

\n", + "group": "repository" + }, + "git_repository_set_odb": { + "type": "function", + "file": "sys/repository.h", + "line": 93, + "lineto": 93, + "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", + "comment": null + }, + "description": "

Set the Object Database for this repository

\n", + "comments": "

The ODB will be used for all object-related operations\n involving this repository.

\n\n

The repository will keep a reference to the ODB; the user\n must still free the ODB object after setting it to the\n repository, or it will leak.

\n", + "group": "repository" + }, + "git_repository_set_refdb": { + "type": "function", + "file": "sys/repository.h", + "line": 108, + "lineto": 108, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "A repository object" + }, + { + "name": "refdb", + "type": "git_refdb *", + "comment": "An refdb object" + } + ], + "argline": "git_repository *repo, git_refdb *refdb", + "sig": "git_repository *::git_refdb *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Set the Reference Database Backend for this repository

\n", + "comments": "

The refdb will be used for all reference related operations\n involving this repository.

\n\n

The repository will keep a reference to the refdb; the user\n must still free the refdb object after setting it to the\n repository, or it will leak.

\n", + "group": "repository" + }, + "git_repository_set_index": { + "type": "function", + "file": "sys/repository.h", + "line": 123, + "lineto": 123, + "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", + "comment": null + }, + "description": "

Set the index file for this repository

\n", + "comments": "

This index will be used for all index-related operations\n involving this repository.

\n\n

The repository will keep a reference to the index file;\n the user must still free the index after setting it\n to the repository, or it will leak.

\n", + "group": "repository" + }, + "git_repository_set_bare": { + "type": "function", + "file": "sys/repository.h", + "line": 136, + "lineto": 136, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repo to make bare" + } + ], + "argline": "git_repository *repo", + "sig": "git_repository *", + "return": { + "type": "int", + "comment": " 0 on success, \n<\n0 on failure" + }, + "description": "

Set a repository to be bare.

\n", + "comments": "

Clear the working directory and set core.bare to true. You may also\n want to call git_repository_set_index(repo, NULL) since a bare repo\n typically does not have an index, but this function will not do that\n for you.

\n", + "group": "repository" + }, + "git_transport_init": { + "type": "function", + "file": "sys/transport.h", + "line": 111, + "lineto": 113, + "args": [ + { + "name": "opts", + "type": "git_transport *", + "comment": "the `git_transport` struct to initialize" + }, + { + "name": "version", + "type": "unsigned int", + "comment": "Version of struct; pass `GIT_TRANSPORT_VERSION`" + } + ], + "argline": "git_transport *opts, unsigned int version", + "sig": "git_transport *::unsigned int", + "return": { + "type": "int", + "comment": " Zero on success; -1 on failure." + }, + "description": "

Initializes a git_transport with default values. Equivalent to\n creating an instance with GIT_TRANSPORT_INIT.

\n", + "comments": "", + "group": "transport" + }, + "git_transport_new": { + "type": "function", + "file": "sys/transport.h", + "line": 125, + "lineto": 125, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "The newly created transport (out)" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "The git_remote which will own this transport" + }, + { + "name": "url", + "type": "const char *", + "comment": "The URL to connect to" + } + ], + "argline": "git_transport **out, git_remote *owner, const char *url", + "sig": "git_transport **::git_remote *::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\n is scanned to find a transport that implements the scheme of the URI (i.e.\n git:// or http://) and a transport object is returned to the caller.

\n", + "comments": "", + "group": "transport" + }, + "git_transport_ssh_with_paths": { + "type": "function", + "file": "sys/transport.h", + "line": 141, + "lineto": 141, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "the resulting transport" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "the owning remote" + }, + { + "name": "payload", + "type": "void *", + "comment": "a strarray with the paths" + } + ], + "argline": "git_transport **out, git_remote *owner, void *payload", + "sig": "git_transport **::git_remote *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an ssh transport with custom git command paths

\n", + "comments": "

This is a factory function suitable for setting as the transport\n callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for\n the git-upload-pack and git-receive-pack at index 0 and 1.

\n", + "group": "transport" + }, + "git_transport_unregister": { + "type": "function", + "file": "sys/transport.h", + "line": 169, + "lineto": 170, + "args": [ + { + "name": "prefix", + "type": "const char *", + "comment": "From the previous call to git_transport_register" + } + ], + "argline": "const char *prefix", + "sig": "const char *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Unregister a custom transport definition which was previously registered\n with git_transport_register.

\n", + "comments": "", + "group": "transport" + }, + "git_transport_dummy": { + "type": "function", + "file": "sys/transport.h", + "line": 183, + "lineto": 186, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "The newly created transport (out)" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "The git_remote which will own this transport" + }, + { + "name": "payload", + "type": "void *", + "comment": "You must pass NULL for this parameter." + } + ], + "argline": "git_transport **out, git_remote *owner, void *payload", + "sig": "git_transport **::git_remote *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the dummy transport.

\n", + "comments": "", + "group": "transport" + }, + "git_transport_local": { + "type": "function", + "file": "sys/transport.h", + "line": 196, + "lineto": 199, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "The newly created transport (out)" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "The git_remote which will own this transport" + }, + { + "name": "payload", + "type": "void *", + "comment": "You must pass NULL for this parameter." + } + ], + "argline": "git_transport **out, git_remote *owner, void *payload", + "sig": "git_transport **::git_remote *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the local transport.

\n", + "comments": "", + "group": "transport" + }, + "git_transport_smart": { + "type": "function", + "file": "sys/transport.h", + "line": 209, + "lineto": 212, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": "The newly created transport (out)" + }, + { + "name": "owner", + "type": "git_remote *", + "comment": "The git_remote which will own this transport" + }, + { + "name": "payload", + "type": "void *", + "comment": "A pointer to a git_smart_subtransport_definition" + } + ], + "argline": "git_transport **out, git_remote *owner, void *payload", + "sig": "git_transport **::git_remote *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the smart transport.

\n", + "comments": "", + "group": "transport" + }, + "git_smart_subtransport_http": { + "type": "function", + "file": "sys/transport.h", + "line": 322, + "lineto": 325, + "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" + }, + { + "name": "param", + "type": "void *", + "comment": null + } + ], + "argline": "git_smart_subtransport **out, git_transport *owner, void *param", + "sig": "git_smart_subtransport **::git_transport *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the http subtransport. This subtransport\n also supports https. On Win32, this subtransport may be implemented\n using the WinHTTP library.

\n", + "comments": "", + "group": "smart" + }, + "git_smart_subtransport_git": { + "type": "function", + "file": "sys/transport.h", + "line": 334, + "lineto": 337, + "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" + }, + { + "name": "param", + "type": "void *", + "comment": null + } + ], + "argline": "git_smart_subtransport **out, git_transport *owner, void *param", + "sig": "git_smart_subtransport **::git_transport *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the git subtransport.

\n", + "comments": "", + "group": "smart" + }, + "git_smart_subtransport_ssh": { + "type": "function", + "file": "sys/transport.h", + "line": 346, + "lineto": 349, + "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" + }, + { + "name": "param", + "type": "void *", + "comment": null + } + ], + "argline": "git_smart_subtransport **out, git_transport *owner, void *param", + "sig": "git_smart_subtransport **::git_transport *::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Create an instance of the ssh subtransport.

\n", + "comments": "", + "group": "smart" + }, + "git_tag_lookup": { + "type": "function", + "file": "tag.h", + "line": 33, + "lineto": 34, + "args": [ + { + "name": "out", + "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 **out, 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.

\n", + "comments": "", + "group": "tag", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_tag_lookup-70" + ] + } + }, + "git_tag_lookup_prefix": { + "type": "function", + "file": "tag.h", + "line": 48, + "lineto": 49, + "args": [ + { + "name": "out", + "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 **out, 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,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "tag" + }, + "git_tag_free": { + "type": "function", + "file": "tag.h", + "line": 61, + "lineto": 61, + "args": [ + { + "name": "tag", + "type": "git_tag *", + "comment": "the tag to close" + } + ], + "argline": "git_tag *tag", + "sig": "git_tag *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open tag

\n", + "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to\n release memory. Failure to do so will cause a memory leak.

\n", + "group": "tag" + }, + "git_tag_id": { + "type": "function", + "file": "tag.h", + "line": 69, + "lineto": 69, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_oid *", + "comment": " object identity for the tag." + }, + "description": "

Get the id of a tag.

\n", + "comments": "", + "group": "tag" + }, + "git_tag_owner": { + "type": "function", + "file": "tag.h", + "line": 77, + "lineto": 77, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "A previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this tag." + }, + "description": "

Get the repository that contains the tag.

\n", + "comments": "", + "group": "tag" + }, + "git_tag_target": { + "type": "function", + "file": "tag.h", + "line": 89, + "lineto": 89, + "args": [ + { + "name": "target_out", + "type": "git_object **", + "comment": "pointer where to store the target" + }, + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "git_object **target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Get the tagged object of a tag

\n", + "comments": "

This method performs a repository lookup for the\n given object and returns it

\n", + "group": "tag", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_tag_target-71" + ] + } + }, + "git_tag_target_id": { + "type": "function", + "file": "tag.h", + "line": 97, + "lineto": 97, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_oid *", + "comment": " pointer to the OID" + }, + "description": "

Get the OID of the tagged object of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tag_target_id-35" + ] + } + }, + "git_tag_target_type": { + "type": "function", + "file": "tag.h", + "line": 105, + "lineto": 105, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "git_otype", + "comment": " type of the tagged object" + }, + "description": "

Get the type of a tag's tagged object

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tag_target_type-36" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tag_target_type-72" + ] + } + }, + "git_tag_name": { + "type": "function", + "file": "tag.h", + "line": 113, + "lineto": 113, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const char *", + "comment": " name of the tag" + }, + "description": "

Get the name of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tag_name-37" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tag_name-73" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_name-20" + ] + } + }, + "git_tag_tagger": { + "type": "function", + "file": "tag.h", + "line": 121, + "lineto": 121, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const git_signature *", + "comment": " reference to the tag's author or NULL when unspecified" + }, + "description": "

Get the tagger (author) of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tag_tagger-38" + ] + } + }, + "git_tag_message": { + "type": "function", + "file": "tag.h", + "line": 129, + "lineto": 129, + "args": [ + { + "name": "tag", + "type": "const git_tag *", + "comment": "a previously loaded tag." + } + ], + "argline": "const git_tag *tag", + "sig": "const git_tag *", + "return": { + "type": "const char *", + "comment": " message of the tag or NULL when unspecified" + }, + "description": "

Get the message of a tag

\n", + "comments": "", + "group": "tag", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tag_message-39", + "ex/v0.23.2/cat-file.html#git_tag_message-40" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tag_message-74" + ], + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_message-21" + ] + } + }, + "git_tag_create": { + "type": "function", + "file": "tag.h", + "line": 171, + "lineto": 178, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag. If the tag already exists, this parameter\n will be the oid of the existing tag, and the function will\n 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\n for consistency. It should also not conflict with an\n already existing tag name" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n 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, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it" + }, + "description": "

Create a new tag in the repository from an object

\n", + "comments": "

A new reference will also be created pointing to\n this tag object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid\n the characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\n sequences ".." and "\n@\n{" which have special meaning to revparse.

\n", + "group": "tag", + "examples": { + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_create-22" + ] + } + }, + "git_tag_annotation_create": { + "type": "function", + "file": "tag.h", + "line": 203, + "lineto": 209, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the\n newly created tag" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to store the tag" + }, + { + "name": "tag_name", + "type": "const char *", + "comment": "Name for the tag" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "tagger", + "type": "const git_signature *", + "comment": "Signature of the tagger for this tag, and\n of the tagging time" + }, + { + "name": "message", + "type": "const char *", + "comment": "Full message for this tag" + } + ], + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, const git_signature *tagger, const char *message", + "sig": "git_oid *::git_repository *::const char *::const git_object *::const git_signature *::const char *", + "return": { + "type": "int", + "comment": " 0 on success or an error code" + }, + "description": "

Create a new tag in the object database pointing to a git_object

\n", + "comments": "

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n", + "group": "tag" + }, + "git_tag_create_frombuffer": { + "type": "function", + "file": "tag.h", + "line": 220, + "lineto": 224, + "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, git_repository *repo, const char *buffer, int 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

\n", + "comments": "", + "group": "tag" + }, + "git_tag_create_lightweight": { + "type": "function", + "file": "tag.h", + "line": 256, + "lineto": 261, + "args": [ + { + "name": "oid", + "type": "git_oid *", + "comment": "Pointer where to store the OID of the provided\n target object. If the tag already exists, this parameter\n will be filled with the oid of the existing pointed object\n 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\n for consistency. It should also not conflict with an\n already existing tag name" + }, + { + "name": "target", + "type": "const git_object *", + "comment": "Object to which this tag points. This object\n must belong to the given `repo`." + }, + { + "name": "force", + "type": "int", + "comment": "Overwrite existing references" + } + ], + "argline": "git_oid *oid, git_repository *repo, const char *tag_name, const git_object *target, int force", + "sig": "git_oid *::git_repository *::const char *::const git_object *::int", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object" + }, + "description": "

Create a new lightweight tag pointing at a target object

\n", + "comments": "

A new direct reference will be created pointing to\n this target object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_create_lightweight-23" + ] + } + }, + "git_tag_delete": { + "type": "function", + "file": "tag.h", + "line": 276, + "lineto": 278, + "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;\n this name is validated for consistency." + } + ], + "argline": "git_repository *repo, const char *tag_name", + "sig": "git_repository *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" + }, + "description": "

Delete an existing tag reference.

\n", + "comments": "

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "group": "tag", + "examples": { + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_delete-24" + ] + } + }, + "git_tag_list": { + "type": "function", + "file": "tag.h", + "line": 293, + "lineto": 295, + "args": [ + { + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe tag names will be stored" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository where to find the tags" + } + ], + "argline": "git_strarray *tag_names, git_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

\n", + "comments": "

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should 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": 315, + "lineto": 318, + "args": [ + { + "name": "tag_names", + "type": "git_strarray *", + "comment": "Pointer to a git_strarray structure where\n\t\tthe 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, const char *pattern, git_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\n which name match a defined pattern

\n", + "comments": "

If an empty pattern is provided, all the tags\n will be returned.

\n\n

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n", + "group": "tag", + "examples": { + "tag.c": [ + "ex/v0.23.2/tag.html#git_tag_list_match-25" + ] + } + }, + "git_tag_foreach": { + "type": "function", + "file": "tag.h", + "line": 330, + "lineto": 333, + "args": [ + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository" + }, + { + "name": "callback", + "type": "git_tag_foreach_cb", + "comment": "Callback function" + }, + { + "name": "payload", + "type": "void *", + "comment": "Pointer to callback data (optional)" + } + ], + "argline": "git_repository *repo, git_tag_foreach_cb callback, void *payload", + "sig": "git_repository *::git_tag_foreach_cb::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Call callback `cb' for each tag in the repository

\n", + "comments": "", + "group": "tag" + }, + "git_tag_peel": { + "type": "function", + "file": "tag.h", + "line": 346, + "lineto": 348, + "args": [ + { + "name": "tag_target_out", + "type": "git_object **", + "comment": "Pointer to the peeled git_object" + }, + { + "name": "tag", + "type": "const git_tag *", + "comment": "The tag to be processed" + } + ], + "argline": "git_object **tag_target_out, const git_tag *tag", + "sig": "git_object **::const git_tag *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Recursively peel a tag until a non tag git_object is found

\n", + "comments": "

The retrieved tag_target object is owned by the repository\n and should be closed with the git_object_free method.

\n", + "group": "tag" + }, + "git_trace_set": { + "type": "function", + "file": "trace.h", + "line": 63, + "lineto": 63, + "args": [ + { + "name": "level", + "type": "git_trace_level_t", + "comment": "Level to set tracing to" + }, + { + "name": "cb", + "type": "git_trace_callback", + "comment": "Function to call with trace data" + } + ], + "argline": "git_trace_level_t level, git_trace_callback cb", + "sig": "git_trace_level_t::git_trace_callback", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Sets the system tracing configuration to the specified level with the\n specified callback. When system events occur at a level equal to, or\n lower than, the given level they will be reported to the given callback.

\n", + "comments": "", + "group": "trace" + }, + "git_cred_has_username": { + "type": "function", + "file": "transport.h", + "line": 197, + "lineto": 197, + "args": [ + { + "name": "cred", + "type": "git_cred *", + "comment": "object to check" + } + ], + "argline": "git_cred *cred", + "sig": "git_cred *", + "return": { + "type": "int", + "comment": " 1 if the credential object has non-NULL username, 0 otherwise" + }, + "description": "

Check whether a credential object contains username information.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_userpass_plaintext_new": { + "type": "function", + "file": "transport.h", + "line": 208, + "lineto": 211, + "args": [ + { + "name": "out", + "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 **out, const char *username, const char *password", + "sig": "git_cred **::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new plain-text username and password credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_ssh_key_new": { + "type": "function", + "file": "transport.h", + "line": 224, + "lineto": 229, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The path to the public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The path to the private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." + } + ], + "argline": "git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_cred **::const char *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new passphrase-protected ssh key credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_ssh_interactive_new": { + "type": "function", + "file": "transport.h", + "line": 240, + "lineto": 244, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": null + }, + { + "name": "username", + "type": "const char *", + "comment": "Username to use to authenticate." + }, + { + "name": "prompt_callback", + "type": "git_cred_ssh_interactive_callback", + "comment": "The callback method used for prompts." + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." + } + ], + "argline": "git_cred **out, const char *username, git_cred_ssh_interactive_callback prompt_callback, void *payload", + "sig": "git_cred **::const char *::git_cred_ssh_interactive_callback::void *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure." + }, + "description": "

Create a new ssh keyboard-interactive based credential object.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_ssh_key_from_agent": { + "type": "function", + "file": "transport.h", + "line": 254, + "lineto": 256, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + } + ], + "argline": "git_cred **out, const char *username", + "sig": "git_cred **::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new ssh key credential object used for querying an ssh-agent.\n The supplied credential parameter will be internally duplicated.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_ssh_custom_new": { + "type": "function", + "file": "transport.h", + "line": 276, + "lineto": 282, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate" + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The bytes of the public key." + }, + { + "name": "publickey_len", + "type": "size_t", + "comment": "The length of the public key in bytes." + }, + { + "name": "sign_callback", + "type": "git_cred_sign_callback", + "comment": "The callback method to sign the data during the challenge." + }, + { + "name": "payload", + "type": "void *", + "comment": "Additional data to pass to the callback." + } + ], + "argline": "git_cred **out, const char *username, const char *publickey, size_t publickey_len, git_cred_sign_callback sign_callback, void *payload", + "sig": "git_cred **::const char *::const char *::size_t::git_cred_sign_callback::void *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create an ssh key credential with a custom signing function.

\n", + "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness\n and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", + "group": "cred" + }, + "git_cred_default_new": { + "type": "function", + "file": "transport.h", + "line": 290, + "lineto": 290, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": null + } + ], + "argline": "git_cred **out", + "sig": "git_cred **", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a "default" credential usable for Negotiate mechanisms like NTLM\n or Kerberos authentication.

\n", + "comments": "", + "group": "cred" + }, + "git_cred_username_new": { + "type": "function", + "file": "transport.h", + "line": 298, + "lineto": 298, + "args": [ + { + "name": "cred", + "type": "git_cred **", + "comment": null + }, + { + "name": "username", + "type": "const char *", + "comment": null + } + ], + "argline": "git_cred **cred, const char *username", + "sig": "git_cred **::const char *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a credential to specify a username.

\n", + "comments": "

This is used with ssh authentication to query for the username if\n none is specified in the url.

\n", + "group": "cred" + }, + "git_cred_ssh_key_memory_new": { + "type": "function", + "file": "transport.h", + "line": 310, + "lineto": 315, + "args": [ + { + "name": "out", + "type": "git_cred **", + "comment": "The newly created credential object." + }, + { + "name": "username", + "type": "const char *", + "comment": "username to use to authenticate." + }, + { + "name": "publickey", + "type": "const char *", + "comment": "The public key of the credential." + }, + { + "name": "privatekey", + "type": "const char *", + "comment": "The private key of the credential." + }, + { + "name": "passphrase", + "type": "const char *", + "comment": "The passphrase of the credential." + } + ], + "argline": "git_cred **out, const char *username, const char *publickey, const char *privatekey, const char *passphrase", + "sig": "git_cred **::const char *::const char *::const char *::const char *", + "return": { + "type": "int", + "comment": " 0 for success or an error code for failure" + }, + "description": "

Create a new ssh key credential object reading the keys from memory.

\n", + "comments": "", + "group": "cred" + }, + "git_tree_lookup": { + "type": "function", + "file": "tree.h", + "line": 32, + "lineto": 33, + "args": [ + { + "name": "out", + "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 **out, 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.

\n", + "comments": "", + "group": "tree", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_tree_lookup-75", + "ex/v0.23.2/general.html#git_tree_lookup-76" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_tree_lookup-14" + ] + } + }, + "git_tree_lookup_prefix": { + "type": "function", + "file": "tree.h", + "line": 47, + "lineto": 51, + "args": [ + { + "name": "out", + "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 **out, git_repository *repo, const git_oid *id, size_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,\n given a prefix of its identifier (short id).

\n", + "comments": "", + "group": "tree" + }, + "git_tree_free": { + "type": "function", + "file": "tree.h", + "line": 63, + "lineto": 63, + "args": [ + { + "name": "tree", + "type": "git_tree *", + "comment": "The tree to close" + } + ], + "argline": "git_tree *tree", + "sig": "git_tree *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Close an open tree

\n", + "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to\n release memory. Failure to do so will cause a memory leak.

\n", + "group": "tree", + "examples": { + "diff.c": [ + "ex/v0.23.2/diff.html#git_tree_free-17", + "ex/v0.23.2/diff.html#git_tree_free-18" + ], + "init.c": [ + "ex/v0.23.2/init.html#git_tree_free-15" + ], + "log.c": [ + "ex/v0.23.2/log.html#git_tree_free-58", + "ex/v0.23.2/log.html#git_tree_free-59", + "ex/v0.23.2/log.html#git_tree_free-60", + "ex/v0.23.2/log.html#git_tree_free-61", + "ex/v0.23.2/log.html#git_tree_free-62" + ] + } + }, + "git_tree_id": { + "type": "function", + "file": "tree.h", + "line": 71, + "lineto": 71, + "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.

\n", + "comments": "", + "group": "tree" + }, + "git_tree_owner": { + "type": "function", + "file": "tree.h", + "line": 79, + "lineto": 79, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "A previously loaded tree." + } + ], + "argline": "const git_tree *tree", + "sig": "const git_tree *", + "return": { + "type": "git_repository *", + "comment": " Repository that contains this tree." + }, + "description": "

Get the repository that contains the tree.

\n", + "comments": "", + "group": "tree" + }, + "git_tree_entrycount": { + "type": "function", + "file": "tree.h", + "line": 87, + "lineto": 87, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + } + ], + "argline": "const git_tree *tree", + "sig": "const git_tree *", + "return": { + "type": "size_t", + "comment": " the number of entries in the tree" + }, + "description": "

Get the number of entries listed in a tree

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entrycount-41" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tree_entrycount-77" + ] + } + }, + "git_tree_entry_byname": { + "type": "function", + "file": "tree.h", + "line": 99, + "lineto": 100, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "filename", + "type": "const char *", + "comment": "the filename of the desired entry" + } + ], + "argline": "const git_tree *tree, const char *filename", + "sig": "const 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

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_tree_entry_byname-78" + ] + } + }, + "git_tree_entry_byindex": { + "type": "function", + "file": "tree.h", + "line": 112, + "lineto": 113, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "idx", + "type": "size_t", + "comment": "the position in the entry list" + } + ], + "argline": "const git_tree *tree, size_t idx", + "sig": "const 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

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entry_byindex-42" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tree_entry_byindex-79" + ] + } + }, + "git_tree_entry_byid": { + "type": "function", + "file": "tree.h", + "line": 127, + "lineto": 128, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "a previously loaded tree." + }, + { + "name": "id", + "type": "const git_oid *", + "comment": "the sha being looked for" + } + ], + "argline": "const git_tree *tree, const git_oid *id", + "sig": "const 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.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", + "group": "tree" + }, + "git_tree_entry_bypath": { + "type": "function", + "file": "tree.h", + "line": 142, + "lineto": 145, + "args": [ + { + "name": "out", + "type": "git_tree_entry **", + "comment": "Pointer where to store the tree entry" + }, + { + "name": "root", + "type": "const git_tree *", + "comment": "Previously loaded tree which is the root of the relative path" + }, + { + "name": "path", + "type": "const char *", + "comment": "Path to the contained entry" + } + ], + "argline": "git_tree_entry **out, const git_tree *root, const char *path", + "sig": "git_tree_entry **::const 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 of its subtrees,\n given its relative path.

\n", + "comments": "

Unlike the other lookup functions, the returned tree entry is owned by\n the user and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" + }, + "git_tree_entry_dup": { + "type": "function", + "file": "tree.h", + "line": 157, + "lineto": 157, + "args": [ + { + "name": "dest", + "type": "git_tree_entry **", + "comment": "pointer where to store the copy" + }, + { + "name": "source", + "type": "const git_tree_entry *", + "comment": "tree entry to duplicate" + } + ], + "argline": "git_tree_entry **dest, const git_tree_entry *source", + "sig": "git_tree_entry **::const git_tree_entry *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Duplicate a tree entry

\n", + "comments": "

Create a copy of a tree entry. The returned copy is owned by the user,\n and must be freed explicitly with git_tree_entry_free().

\n", + "group": "tree" + }, + "git_tree_entry_free": { + "type": "function", + "file": "tree.h", + "line": 168, + "lineto": 168, + "args": [ + { + "name": "entry", + "type": "git_tree_entry *", + "comment": "The entry to free" + } + ], + "argline": "git_tree_entry *entry", + "sig": "git_tree_entry *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a user-owned tree entry

\n", + "comments": "

IMPORTANT: This function is only needed for tree entries owned by the\n user, such as the ones returned by git_tree_entry_dup() or\n git_tree_entry_bypath().

\n", + "group": "tree" + }, + "git_tree_entry_name": { + "type": "function", + "file": "tree.h", + "line": 176, + "lineto": 176, + "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

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entry_name-43" + ], + "general.c": [ + "ex/v0.23.2/general.html#git_tree_entry_name-80", + "ex/v0.23.2/general.html#git_tree_entry_name-81" + ] + } + }, + "git_tree_entry_id": { + "type": "function", + "file": "tree.h", + "line": 184, + "lineto": 184, + "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

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entry_id-44" + ] + } + }, + "git_tree_entry_type": { + "type": "function", + "file": "tree.h", + "line": 192, + "lineto": 192, + "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

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entry_type-45" + ] + } + }, + "git_tree_entry_filemode": { + "type": "function", + "file": "tree.h", + "line": 200, + "lineto": 200, + "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

\n", + "comments": "", + "group": "tree", + "examples": { + "cat-file.c": [ + "ex/v0.23.2/cat-file.html#git_tree_entry_filemode-46" + ] + } + }, + "git_tree_entry_filemode_raw": { + "type": "function", + "file": "tree.h", + "line": 212, + "lineto": 212, + "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 raw UNIX file attributes of a tree entry

\n", + "comments": "

This function does not perform any normalization and is only useful\n if you need to be able to recreate the original tree object.

\n", + "group": "tree" + }, + "git_tree_entry_cmp": { + "type": "function", + "file": "tree.h", + "line": 220, + "lineto": 220, + "args": [ + { + "name": "e1", + "type": "const git_tree_entry *", + "comment": "first tree entry" + }, + { + "name": "e2", + "type": "const git_tree_entry *", + "comment": "second tree entry" + } + ], + "argline": "const git_tree_entry *e1, const git_tree_entry *e2", + "sig": "const git_tree_entry *::const git_tree_entry *", + "return": { + "type": "int", + "comment": " \n<\n0 if e1 is before e2, 0 if e1 == e2, >0 if e1 is after e2" + }, + "description": "

Compare two tree entries

\n", + "comments": "", + "group": "tree" + }, + "git_tree_entry_to_object": { + "type": "function", + "file": "tree.h", + "line": 232, + "lineto": 235, + "args": [ + { + "name": "object_out", + "type": "git_object **", + "comment": "pointer to the converted 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, git_repository *repo, const 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 to.

\n", + "comments": "

You must call git_object_free() on the object when you are done with it.

\n", + "group": "tree", + "examples": { + "general.c": [ + "ex/v0.23.2/general.html#git_tree_entry_to_object-82" + ] + } + }, + "git_treebuilder_new": { + "type": "function", + "file": "tree.h", + "line": 254, + "lineto": 255, + "args": [ + { + "name": "out", + "type": "git_treebuilder **", + "comment": "Pointer where to store the tree builder" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "Repository in which to store the object" + }, + { + "name": "source", + "type": "const git_tree *", + "comment": "Source tree to initialize the builder (optional)" + } + ], + "argline": "git_treebuilder **out, git_repository *repo, const git_tree *source", + "sig": "git_treebuilder **::git_repository *::const git_tree *", + "return": { + "type": "int", + "comment": " 0 on success; error code otherwise" + }, + "description": "

Create a new tree builder.

\n", + "comments": "

The tree builder can be used to create or modify trees in memory and\n write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be\n initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no\n entries and will have to be filled manually.

\n", + "group": "treebuilder" + }, + "git_treebuilder_clear": { + "type": "function", + "file": "tree.h", + "line": 262, + "lineto": 262, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to clear" + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Clear all the entires in the builder

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_entrycount": { + "type": "function", + "file": "tree.h", + "line": 270, + "lineto": 270, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "a previously loaded treebuilder." + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { + "type": "unsigned int", + "comment": " the number of entries in the treebuilder" + }, + "description": "

Get the number of entries listed in a treebuilder

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_free": { + "type": "function", + "file": "tree.h", + "line": 281, + "lineto": 281, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Builder to free" + } + ], + "argline": "git_treebuilder *bld", + "sig": "git_treebuilder *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a tree builder

\n", + "comments": "

This will clear all the entries and free to builder.\n Failing to free the builder after you're done using it\n will result in a memory leak

\n", + "group": "treebuilder" + }, + "git_treebuilder_get": { + "type": "function", + "file": "tree.h", + "line": 293, + "lineto": 294, + "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

\n", + "comments": "

The returned entry is owned by the builder and should\n not be freed manually.

\n", + "group": "treebuilder" + }, + "git_treebuilder_insert": { + "type": "function", + "file": "tree.h", + "line": 323, + "lineto": 328, + "args": [ + { + "name": "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\n\t\t\tbe valued with one of the following entries: 0040000, 0100644,\n\t\t\t0100755, 0120000 or 0160000." + } + ], + "argline": "const git_tree_entry **out, git_treebuilder *bld, const char *filename, const git_oid *id, git_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

\n", + "comments": "

Insert a new entry for filename in the builder with the\n given attributes.

\n\n

If an entry named filename already exists, its attributes\n will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the\n newly created/updated entry. Pass NULL if you do not need it. The\n pointer may not be valid past the next operation in this\n builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points\n to an existing git object in the object database, nor that the\n attributes make sense regarding the type of the pointed at object.

\n", + "group": "treebuilder" + }, + "git_treebuilder_remove": { + "type": "function", + "file": "tree.h", + "line": 336, + "lineto": 337, + "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", + "comment": null + }, + "description": "

Remove an entry from the builder by its filename

\n", + "comments": "", + "group": "treebuilder" + }, + "git_treebuilder_filter": { + "type": "function", + "file": "tree.h", + "line": 360, + "lineto": 363, + "args": [ + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder" + }, + { + "name": "filter", + "type": "git_treebuilder_filter_cb", + "comment": "Callback to filter entries" + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra data to pass to filter callback" + } + ], + "argline": "git_treebuilder *bld, git_treebuilder_filter_cb filter, void *payload", + "sig": "git_treebuilder *::git_treebuilder_filter_cb::void *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Selectively remove entries in the tree

\n", + "comments": "

The filter callback will be called for each entry in the tree with a\n pointer to the entry and the provided payload; if the callback returns\n non-zero, the entry will be filtered (removed from the builder).

\n", + "group": "treebuilder" + }, + "git_treebuilder_write": { + "type": "function", + "file": "tree.h", + "line": 375, + "lineto": 376, + "args": [ + { + "name": "id", + "type": "git_oid *", + "comment": "Pointer to store the OID of the newly written tree" + }, + { + "name": "bld", + "type": "git_treebuilder *", + "comment": "Tree builder to write" + } + ], + "argline": "git_oid *id, git_treebuilder *bld", + "sig": "git_oid *::git_treebuilder *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Write the contents of the tree builder as a tree object

\n", + "comments": "

The tree builder will be written to the given repo, and its\n identifying SHA1 hash will be stored in the id pointer.

\n", + "group": "treebuilder" + }, + "git_tree_walk": { + "type": "function", + "file": "tree.h", + "line": 406, + "lineto": 410, + "args": [ + { + "name": "tree", + "type": "const git_tree *", + "comment": "The tree to walk" + }, + { + "name": "mode", + "type": "git_treewalk_mode", + "comment": "Traversal mode (pre or post-order)" + }, + { + "name": "callback", + "type": "git_treewalk_cb", + "comment": "Function to call on each tree entry" + }, + { + "name": "payload", + "type": "void *", + "comment": "Opaque pointer to be passed on each callback" + } + ], + "argline": "const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload", + "sig": "const git_tree *::git_treewalk_mode::git_treewalk_cb::void *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Traverse the entries in a tree and its subtrees in post or pre order.

\n", + "comments": "

The entries will be traversed in the specified order, children subtrees\n will be automatically loaded as required, and the callback will be\n called once per entry with the current (relative) root for the entry and\n the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be\n skipped on the traversal (in pre mode). A negative value stops the walk.

\n", + "group": "tree" + } + }, + "callbacks": { + "git_checkout_notify_cb": { + "type": "callback", + "file": "checkout.h", + "line": 223, + "lineto": 229, + "args": [ + { + "name": "why", + "type": "git_checkout_notify_t", + "comment": null + }, + { + "name": "path", + "type": "const char *", + "comment": null + }, + { + "name": "baseline", + "type": "const git_diff_file *", + "comment": null + }, + { + "name": "target", + "type": "const git_diff_file *", + "comment": null + }, + { + "name": "workdir", + "type": "const git_diff_file *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_checkout_notify_t why, const char *path, const git_diff_file *baseline, const git_diff_file *target, const git_diff_file *workdir, void *payload", + "sig": "git_checkout_notify_t::const char *::const git_diff_file *::const git_diff_file *::const git_diff_file *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Checkout notification callback function

\n", + "comments": "" + }, + "git_checkout_progress_cb": { + "type": "callback", + "file": "checkout.h", + "line": 232, + "lineto": 236, + "args": [ + { + "name": "path", + "type": "const char *", + "comment": null + }, + { + "name": "completed_steps", + "type": "size_t", + "comment": null + }, + { + "name": "total_steps", + "type": "size_t", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const char *path, size_t completed_steps, size_t total_steps, void *payload", + "sig": "const char *::size_t::size_t::void *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Checkout progress notification function

\n", + "comments": "" + }, + "git_checkout_perfdata_cb": { + "type": "callback", + "file": "checkout.h", + "line": 239, + "lineto": 241, + "args": [ + { + "name": "perfdata", + "type": "const git_checkout_perfdata *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_checkout_perfdata *perfdata, void *payload", + "sig": "const git_checkout_perfdata *::void *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Checkout perfdata notification function

\n", + "comments": "" + }, + "git_remote_create_cb": { + "type": "callback", + "file": "clone.h", + "line": 69, + "lineto": 74, + "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" + }, + { + "name": "payload", + "type": "void *", + "comment": "an opaque payload" + } + ], + "argline": "git_remote **out, git_repository *repo, const char *name, const char *url, void *payload", + "sig": "git_remote **::git_repository *::const char *::const char *::void *", + "return": { + "type": "int", + "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" + }, + "description": "

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n", + "comments": "

Callers of git_clone may provide a function matching this signature to override\n the remote creation and customization process during a clone operation.

\n" + }, + "git_repository_create_cb": { + "type": "callback", + "file": "clone.h", + "line": 90, + "lineto": 94, + "args": [ + { + "name": "out", + "type": "git_repository **", + "comment": "the resulting repository" + }, + { + "name": "path", + "type": "const char *", + "comment": "path in which to create the repository" + }, + { + "name": "bare", + "type": "int", + "comment": "whether the repository is bare. This is the value from the clone options" + }, + { + "name": "payload", + "type": "void *", + "comment": "payload specified by the options" + } + ], + "argline": "git_repository **out, const char *path, int bare, void *payload", + "sig": "git_repository **::const char *::int::void *", + "return": { + "type": "int", + "comment": " 0, or a negative value to indicate error" + }, + "description": "

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n", + "comments": "

Callers of git_clone my provide a function matching this signature\n to override the repository creation and customization process\n during a clone operation.

\n" + }, + "git_diff_notify_cb": { + "type": "callback", + "file": "diff.h", + "line": 343, + "lineto": 347, + "args": [ + { + "name": "diff_so_far", + "type": "const git_diff *", + "comment": null + }, + { + "name": "delta_to_add", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "matched_pathspec", + "type": "const char *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff *diff_so_far, const git_diff_delta *delta_to_add, const char *matched_pathspec, void *payload", + "sig": "const git_diff *::const git_diff_delta *::const char *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Diff notification callback function.

\n", + "comments": "

The callback will be called for each file, just before the git_delta_t\n gets inserted into the diff.

\n\n

When the callback:\n - returns \n<\n 0, the diff process will be aborted.\n - returns > 0, the delta will not be inserted into the diff, but the\n diff process continues.\n - returns 0, the delta is inserted into the diff, and the diff process\n continues.

\n" + }, + "git_diff_file_cb": { + "type": "callback", + "file": "diff.h", + "line": 423, + "lineto": 426, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": "A pointer to the delta data for the file" + }, + { + "name": "progress", + "type": "float", + "comment": "Goes from 0 to 1 over the diff" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified pointer from foreach function" + } + ], + "argline": "const git_diff_delta *delta, float progress, void *payload", + "sig": "const git_diff_delta *::float::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When iterating over a diff, callback that will be made per file.

\n", + "comments": "" + }, + "git_diff_binary_cb": { + "type": "callback", + "file": "diff.h", + "line": 470, + "lineto": 473, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "binary", + "type": "const git_diff_binary *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff_delta *delta, const git_diff_binary *binary, void *payload", + "sig": "const git_diff_delta *::const git_diff_binary *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When iterating over a diff, callback that will be made for\n binary content within the diff.

\n", + "comments": "" + }, + "git_diff_hunk_cb": { + "type": "callback", + "file": "diff.h", + "line": 490, + "lineto": 493, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When iterating over a diff, callback that will be made per hunk.

\n", + "comments": "" + }, + "git_diff_line_cb": { + "type": "callback", + "file": "diff.h", + "line": 543, + "lineto": 547, + "args": [ + { + "name": "delta", + "type": "const git_diff_delta *", + "comment": null + }, + { + "name": "hunk", + "type": "const git_diff_hunk *", + "comment": null + }, + { + "name": "line", + "type": "const git_diff_line *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, void *payload", + "sig": "const git_diff_delta *::const git_diff_hunk *::const git_diff_line *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n", + "comments": "

When printing a diff, callback that will be made to output each line\n of text. This uses some extra GIT_DIFF_LINE_... constants for output\n of lines of file and hunk headers.

\n" + }, + "git_index_matched_path_cb": { + "type": "callback", + "file": "index.h", + "line": 146, + "lineto": 147, + "args": [ + { + "name": "path", + "type": "const char *", + "comment": null + }, + { + "name": "matched_pathspec", + "type": "const char *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const char *path, const char *matched_pathspec, void *payload", + "sig": "const char *::const char *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for APIs that add/remove/update files matching pathspec

\n", + "comments": "" + }, + "git_headlist_cb": { + "type": "callback", + "file": "net.h", + "line": 55, + "lineto": 55, + "args": [ + { + "name": "rhead", + "type": "git_remote_head *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_remote_head *rhead, void *payload", + "sig": "git_remote_head *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for listing the remote heads

\n", + "comments": "" + }, + "git_note_foreach_cb": { + "type": "callback", + "file": "notes.h", + "line": 29, + "lineto": 30, + "args": [ + { + "name": "blob_id", + "type": "const git_oid *", + "comment": null + }, + { + "name": "annotated_object_id", + "type": "const git_oid *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_oid *blob_id, const git_oid *annotated_object_id, void *payload", + "sig": "const git_oid *::const git_oid *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for git_note_foreach.

\n", + "comments": "

Receives:\n - blob_id: Oid of the blob containing the message\n - annotated_object_id: Oid of the git object being annotated\n - payload: Payload data passed to git_note_foreach

\n" + }, + "git_odb_foreach_cb": { + "type": "callback", + "file": "odb.h", + "line": 26, + "lineto": 26, + "args": [ + { + "name": "id", + "type": "const git_oid *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_oid *id, void *payload", + "sig": "const git_oid *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Function type for callbacks from git_odb_foreach.

\n", + "comments": "" + }, + "git_packbuilder_progress": { + "type": "callback", + "file": "pack.h", + "line": 210, + "lineto": 214, + "args": [ + { + "name": "stage", + "type": "int", + "comment": null + }, + { + "name": "current", + "type": "unsigned int", + "comment": null + }, + { + "name": "total", + "type": "unsigned int", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "int stage, unsigned int current, unsigned int total, void *payload", + "sig": "int::unsigned int::unsigned int::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Packbuilder progress notification function

\n", + "comments": "" + }, + "git_remote_rename_problem_cb": { + "type": "callback", + "file": "remote.h", + "line": 28, + "lineto": 28, + "args": [ + { + "name": "problematic_refspec", + "type": "const char *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const char *problematic_refspec, void *payload", + "sig": "const char *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

git2/remote.h

\n", + "comments": "

@\n{

\n" + }, + "git_push_transfer_progress": { + "type": "callback", + "file": "remote.h", + "line": 332, + "lineto": 336, + "args": [ + { + "name": "current", + "type": "unsigned int", + "comment": null + }, + { + "name": "total", + "type": "unsigned int", + "comment": null + }, + { + "name": "bytes", + "type": "size_t", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "unsigned int current, unsigned int total, size_t bytes, void *payload", + "sig": "unsigned int::unsigned int::size_t::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Push network progress notification function

\n", + "comments": "" + }, + "git_push_negotiation": { + "type": "callback", + "file": "remote.h", + "line": 365, + "lineto": 365, + "args": [ + { + "name": "updates", + "type": "const git_push_update **", + "comment": "an array containing the updates which will be sent\n as commands to the destination." + }, + { + "name": "len", + "type": "size_t", + "comment": "number of elements in `updates`" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "const git_push_update **updates, size_t len, void *payload", + "sig": "const git_push_update **::size_t::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "", + "comments": "" + }, + "git_revwalk_hide_cb": { + "type": "callback", + "file": "revwalk.h", + "line": 279, + "lineto": 281, + "args": [ + { + "name": "commit_id", + "type": "const git_oid *", + "comment": "oid of Commit" + }, + { + "name": "payload", + "type": "void *", + "comment": "User-specified pointer to data to be passed as data payload" + } + ], + "argline": "const git_oid *commit_id, void *payload", + "sig": "const git_oid *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

This is a callback function that user can provide to hide a\n commit and its parents. If the callback function returns non-zero value,\n then this commit and its parents will be hidden.

\n", + "comments": "" + }, + "git_stash_apply_progress_cb": { + "type": "callback", + "file": "stash.h", + "line": 113, + "lineto": 115, + "args": [ + { + "name": "progress", + "type": "git_stash_apply_progress_t", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_stash_apply_progress_t progress, void *payload", + "sig": "git_stash_apply_progress_t::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Stash application progress notification function.\n Return 0 to continue processing, or a negative value to\n abort the stash application.

\n", + "comments": "" + }, + "git_stash_cb": { + "type": "callback", + "file": "stash.h", + "line": 198, + "lineto": 202, + "args": [ + { + "name": "index", + "type": "size_t", + "comment": "The position within the stash list. 0 points to the\n most recent stashed state." + }, + { + "name": "message", + "type": "const char *", + "comment": "The stash message." + }, + { + "name": "stash_id", + "type": "const int *", + "comment": "The commit oid of the stashed state." + }, + { + "name": "payload", + "type": "void *", + "comment": "Extra parameter to callback function." + } + ], + "argline": "size_t index, const char *message, const int *stash_id, void *payload", + "sig": "size_t::const char *::const int *::void *", + "return": { + "type": "int", + "comment": " 0 to continue iterating or non-zero to stop." + }, + "description": "

This is a callback function you can provide to iterate over all the\n stashed states that will be invoked per entry.

\n", + "comments": "" + }, + "git_status_cb": { + "type": "callback", + "file": "status.h", + "line": 61, + "lineto": 62, + "args": [ + { + "name": "path", + "type": "const char *", + "comment": null + }, + { + "name": "status_flags", + "type": "unsigned int", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const char *path, unsigned int status_flags, void *payload", + "sig": "const char *::unsigned int::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Function pointer to receive status on individual files

\n", + "comments": "

path is the relative path to the file from the root of the repository.

\n\n

status_flags is a combination of git_status_t values that apply.

\n\n

payload is the value you passed to the foreach function as payload.

\n" + }, + "git_filter_init_fn": { + "type": "callback", + "file": "sys/filter.h", + "line": 152, + "lineto": 152, + "args": [ + { + "name": "self", + "type": "git_filter *", + "comment": null + } + ], + "argline": "git_filter *self", + "sig": "git_filter *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Initialize callback on filter

\n", + "comments": "

Specified as filter.initialize, this is an optional callback invoked\n before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right\n before the first use of the filter, so you can defer expensive\n initialization operations (in case libgit2 is being used in a way that\n doesn't need the filter).

\n" + }, + "git_filter_shutdown_fn": { + "type": "callback", + "file": "sys/filter.h", + "line": 164, + "lineto": 164, + "args": [ + { + "name": "self", + "type": "git_filter *", + "comment": null + } + ], + "argline": "git_filter *self", + "sig": "git_filter *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Shutdown callback on filter

\n", + "comments": "

Specified as filter.shutdown, this is an optional callback invoked\n when the filter is unregistered or when libgit2 is shutting down. It\n will be called once at most and should release resources as needed.\n This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n" + }, + "git_filter_check_fn": { + "type": "callback", + "file": "sys/filter.h", + "line": 186, + "lineto": 190, + "args": [ + { + "name": "self", + "type": "git_filter *", + "comment": null + }, + { + "name": "payload", + "type": "void **", + "comment": null + }, + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + }, + { + "name": "attr_values", + "type": "const char **", + "comment": null + } + ], + "argline": "git_filter *self, void **payload, const git_filter_source *src, const char **attr_values", + "sig": "git_filter *::void **::const git_filter_source *::const char **", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback to decide if a given source needs this filter

\n", + "comments": "

Specified as filter.check, this is an optional callback that checks\n if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success),\n GIT_PASSTHROUGH if the filter should not be applied, or an error code\n to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in\n the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter.\n This will start as NULL, but check can assign to this pointer for\n later use by the apply callback. Note that the value should be heap\n allocated (not stack), so that it doesn't go away before the apply\n callback can use it. If a filter allocates and assigns a value to the\n payload, it will need a cleanup callback to free the payload.

\n" + }, + "git_filter_apply_fn": { + "type": "callback", + "file": "sys/filter.h", + "line": 204, + "lineto": 209, + "args": [ + { + "name": "self", + "type": "git_filter *", + "comment": null + }, + { + "name": "payload", + "type": "void **", + "comment": null + }, + { + "name": "to", + "type": "git_buf *", + "comment": null + }, + { + "name": "from", + "type": "const git_buf *", + "comment": null + }, + { + "name": "src", + "type": "const git_filter_source *", + "comment": null + } + ], + "argline": "git_filter *self, void **payload, git_buf *to, const git_buf *from, const git_filter_source *src", + "sig": "git_filter *::void **::git_buf *::const git_buf *::const git_filter_source *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback to actually perform the data filtering

\n", + "comments": "

Specified as filter.apply, this is the callback that actually filters\n data. If it successfully writes the output, it should return 0. Like\n check, it can return GIT_PASSTHROUGH to indicate that the filter\n doesn't want to run. Other error codes will stop filter processing and\n return to the caller.

\n\n

The payload value will refer to any payload that was set by the\n check callback. It may be read from or written to as needed.

\n" + }, + "git_filter_cleanup_fn": { + "type": "callback", + "file": "sys/filter.h", + "line": 226, + "lineto": 228, + "args": [ + { + "name": "self", + "type": "git_filter *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_filter *self, void *payload", + "sig": "git_filter *::void *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Callback to clean up after filtering has been applied

\n", + "comments": "

Specified as filter.cleanup, this is an optional callback invoked\n after the filter has been applied. If the check or apply callbacks\n allocated a payload to keep per-source filter state, use this\n callback to free that payload and release resources as required.

\n" + }, + "git_trace_callback": { + "type": "callback", + "file": "trace.h", + "line": 52, + "lineto": 52, + "args": [ + { + "name": "level", + "type": "git_trace_level_t", + "comment": null + }, + { + "name": "msg", + "type": "const char *", + "comment": null + } + ], + "argline": "git_trace_level_t level, const char *msg", + "sig": "git_trace_level_t::const char *", + "return": { + "type": "void", + "comment": null + }, + "description": "

An instance for a tracing function

\n", + "comments": "" + }, + "git_transport_cb": { + "type": "callback", + "file": "transport.h", + "line": 24, + "lineto": 24, + "args": [ + { + "name": "out", + "type": "git_transport **", + "comment": null + }, + { + "name": "owner", + "type": "git_remote *", + "comment": null + }, + { + "name": "param", + "type": "void *", + "comment": null + } + ], + "argline": "git_transport **out, git_remote *owner, void *param", + "sig": "git_transport **::git_remote *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Signature of a function which creates a transport

\n", + "comments": "" + }, + "git_cred_acquire_cb": { + "type": "callback", + "file": "transport.h", + "line": 329, + "lineto": 334, + "args": [ + { + "name": "cred", + "type": "git_cred **", + "comment": null + }, + { + "name": "url", + "type": "const char *", + "comment": null + }, + { + "name": "username_from_url", + "type": "const char *", + "comment": null + }, + { + "name": "allowed_types", + "type": "unsigned int", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload", + "sig": "git_cred **::const char *::const char *::unsigned int::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Signature of a function which acquires a credential object.

\n", + "comments": "
    \n
  • cred: The newly created credential object.
  • \n
  • url: The resource for which we are demanding a credential.
  • \n
  • username_from_url: The username that was embedded in a "user\n@\nhost"\n remote url, or NULL if not included.
  • \n
  • allowed_types: A bitmask stating which cred types are OK to return.
  • \n
  • payload: The payload provided when specifying this callback.
  • \n
  • returns 0 for success, \n<\n0 to indicate an error, > 0 to indicate\n no credential was acquired
  • \n
\n" + }, + "git_treebuilder_filter_cb": { + "type": "callback", + "file": "tree.h", + "line": 346, + "lineto": 347, + "args": [ + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_tree_entry *entry, void *payload", + "sig": "const git_tree_entry *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for git_treebuilder_filter

\n", + "comments": "

The return value is treated as a boolean, with zero indicating that the\n entry should be left alone and any non-zero value meaning that the\n entry should be removed from the treebuilder list (i.e. filtered out).

\n" + }, + "git_treewalk_cb": { + "type": "callback", + "file": "tree.h", + "line": 380, + "lineto": 381, + "args": [ + { + "name": "root", + "type": "const char *", + "comment": null + }, + { + "name": "entry", + "type": "const git_tree_entry *", + "comment": null + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const char *root, const git_tree_entry *entry, void *payload", + "sig": "const char *::const git_tree_entry *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for the tree traversal method

\n", + "comments": "" + }, + "git_transfer_progress_cb": { + "type": "callback", + "file": "types.h", + "line": 270, + "lineto": 270, + "args": [ + { + "name": "stats", + "type": "const git_transfer_progress *", + "comment": "Structure containing information about the state of the transfer" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by caller" + } + ], + "argline": "const git_transfer_progress *stats, void *payload", + "sig": "const git_transfer_progress *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Type for progress callbacks during indexing. Return a value less than zero\n to cancel the transfer.

\n", + "comments": "" + }, + "git_transport_message_cb": { + "type": "callback", + "file": "types.h", + "line": 280, + "lineto": 280, + "args": [ + { + "name": "str", + "type": "const char *", + "comment": "The message from the transport" + }, + { + "name": "len", + "type": "int", + "comment": "The length of the message" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "const char *str, int len, void *payload", + "sig": "const char *::int::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Type for messages delivered by the transport. Return a negative value\n to cancel the network operation.

\n", + "comments": "" + }, + "git_transport_certificate_check_cb": { + "type": "callback", + "file": "types.h", + "line": 330, + "lineto": 330, + "args": [ + { + "name": "cert", + "type": "git_cert *", + "comment": "The host certificate" + }, + { + "name": "valid", + "type": "int", + "comment": "Whether the libgit2 checks (OpenSSL or WinHTTP) think\n this certificate is valid" + }, + { + "name": "host", + "type": "const char *", + "comment": "Hostname of the host libgit2 connected to" + }, + { + "name": "payload", + "type": "void *", + "comment": "Payload provided by the caller" + } + ], + "argline": "git_cert *cert, int valid, const char *host, void *payload", + "sig": "git_cert *::int::const char *::void *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Callback for the user's custom certificate checks.

\n", + "comments": "" + } + }, + "globals": {}, + "types": [ + [ + "git_annotated_commit", + { + "decl": "git_annotated_commit", + "type": "struct", + "value": "git_annotated_commit", + "file": "types.h", + "line": 178, + "lineto": 178, + "tdef": "typedef", + "description": " Annotated commits, the input to merge and rebase. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup", + "git_branch_create_from_annotated", + "git_merge", + "git_merge_analysis", + "git_rebase_init", + "git_repository_set_head_detached_from_annotated", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_attr_t", + { + "decl": [ + "GIT_ATTR_UNSPECIFIED_T", + "GIT_ATTR_TRUE_T", + "GIT_ATTR_FALSE_T", + "GIT_ATTR_VALUE_T" + ], + "type": "enum", + "file": "attr.h", + "line": 82, + "lineto": 87, + "block": "GIT_ATTR_UNSPECIFIED_T\nGIT_ATTR_TRUE_T\nGIT_ATTR_FALSE_T\nGIT_ATTR_VALUE_T", + "tdef": "typedef", + "description": " Possible states for an attribute", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_ATTR_UNSPECIFIED_T", + "comments": "

The attribute has been left unspecified

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_ATTR_TRUE_T", + "comments": "

The attribute has been set

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_ATTR_FALSE_T", + "comments": "

The attribute has been unset

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_ATTR_VALUE_T", + "comments": "

This attribute has a value

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_blame_flag_t", + { + "decl": [ + "GIT_BLAME_NORMAL", + "GIT_BLAME_TRACK_COPIES_SAME_FILE", + "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", + "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", + "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", + "GIT_BLAME_FIRST_PARENT" + ], + "type": "enum", + "file": "blame.h", + "line": 26, + "lineto": 46, + "block": "GIT_BLAME_NORMAL\nGIT_BLAME_TRACK_COPIES_SAME_FILE\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES\nGIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES\nGIT_BLAME_FIRST_PARENT", + "tdef": "typedef", + "description": " Flags for indicating option behavior for git_blame APIs.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BLAME_NORMAL", + "comments": "

Normal blame, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_FILE", + "comments": "

Track lines that have moved within a file (like git blame -M).\n NOT IMPLEMENTED.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES", + "comments": "

Track lines that have moved across files in the same commit (like git blame -C).\n NOT IMPLEMENTED.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists in the\n same commit (like git blame -CC). Implies SAME_FILE.\n NOT IMPLEMENTED.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES", + "comments": "

Track lines that have been copied from another file that exists in any\n commit (like git blame -CCC). Implies SAME_COMMIT_COPIES.\n NOT IMPLEMENTED.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_BLAME_FIRST_PARENT", + "comments": "

Restrict the search of commits to those reachable following only the\n first parents.

\n", + "value": 16 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_blame_hunk", + { + "decl": [ + "uint16_t lines_in_hunk", + "git_oid final_commit_id", + "uint16_t final_start_line_number", + "git_signature * final_signature", + "git_oid orig_commit_id", + "const char * orig_path", + "uint16_t orig_start_line_number", + "git_signature * orig_signature", + "char boundary" + ], + "type": "struct", + "value": "git_blame_hunk", + "file": "blame.h", + "line": 115, + "lineto": 128, + "block": "uint16_t lines_in_hunk\ngit_oid final_commit_id\nuint16_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nuint16_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary", + "tdef": "typedef", + "description": " Structure that represents a blame hunk.", + "comments": "
    \n
  • lines_in_hunk is the number of lines in this hunk
  • \n
  • final_commit_id is the OID of the commit where this line was last\nchanged.
  • \n
  • final_start_line_number is the 1-based line number where this hunk\nbegins, in the final version of the file
  • \n
  • orig_commit_id is the OID of the commit where this hunk was found. This\nwill usually be the same as final_commit_id, except when\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES has been specified.
  • \n
  • orig_path is the path to the file where this hunk originated, as of the\ncommit specified by orig_commit_id.
  • \n
  • orig_start_line_number is the 1-based line number where this hunk begins\nin the file named by orig_path in the commit specified by\norig_commit_id.
  • \n
  • boundary is 1 iff the hunk has been tracked to a boundary commit (the\nroot, or the commit specified in git_blame_options.oldest_commit)
  • \n
\n", + "fields": [ + { + "type": "uint16_t", + "name": "lines_in_hunk", + "comments": "" + }, + { + "type": "git_oid", + "name": "final_commit_id", + "comments": "" + }, + { + "type": "uint16_t", + "name": "final_start_line_number", + "comments": "" + }, + { + "type": "git_signature *", + "name": "final_signature", + "comments": "" + }, + { + "type": "git_oid", + "name": "orig_commit_id", + "comments": "" + }, + { + "type": "const char *", + "name": "orig_path", + "comments": "" + }, + { + "type": "uint16_t", + "name": "orig_start_line_number", + "comments": "" + }, + { + "type": "git_signature *", + "name": "orig_signature", + "comments": "" + }, + { + "type": "char", + "name": "boundary", + "comments": "" + } + ], + "used": { + "returns": [ + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline" + ], + "needs": [] + } + } + ], + [ + "git_blame_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "uint16_t min_match_characters", + "git_oid newest_commit", + "git_oid oldest_commit", + "uint32_t min_line", + "uint32_t max_line" + ], + "type": "struct", + "value": "git_blame_options", + "file": "blame.h", + "line": 70, + "lineto": 79, + "block": "unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nuint32_t min_line\nuint32_t max_line", + "tdef": "typedef", + "description": " Blame options structure", + "comments": "

Use zeros to indicate default settings. It's easiest to use the\n GIT_BLAME_OPTIONS_INIT macro:\n git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n
    \n
  • flags is a combination of the git_blame_flag_t values above.
  • \n
  • min_match_characters is the lower bound on the number of alphanumeric\ncharacters that must be detected as moving/copying within a file for it to\nassociate those lines with the parent commit. The default value is 20.\nThis value only takes effect if any of the GIT_BLAME_TRACK_COPIES_*\nflags are specified.
  • \n
  • newest_commit is the id of the newest commit to consider. The default\n is HEAD.
  • \n
  • oldest_commit is the id of the oldest commit to consider. The default\n is the first commit encountered with a NULL parent.\n\n
      \n
    • min_line is the first line in the file to blame. The default is 1 (line\n numbers start with 1).
    • \n
    • max_line is the last line in the file to blame. The default is the last\n line of the file.
    • \n
  • \n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": "" + }, + { + "type": "uint16_t", + "name": "min_match_characters", + "comments": "" + }, + { + "type": "git_oid", + "name": "newest_commit", + "comments": "" + }, + { + "type": "git_oid", + "name": "oldest_commit", + "comments": "" + }, + { + "type": "uint32_t", + "name": "min_line", + "comments": "" + }, + { + "type": "uint32_t", + "name": "max_line", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_blame_file", + "git_blame_init_options" + ] + } + } + ], + [ + "git_blob", + { + "decl": "git_blob", + "type": "struct", + "value": "git_blob", + "file": "types.h", + "line": 117, + "lineto": 117, + "tdef": "typedef", + "description": " In-memory representation of a blob object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_blob_filtered_content", + "git_blob_free", + "git_blob_id", + "git_blob_is_binary", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_filter_list_apply_to_blob", + "git_filter_list_load", + "git_filter_list_stream_blob", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs" + ] + } + } + ], + [ + "git_branch_iterator", + { + "decl": "git_branch_iterator", + "type": "struct", + "value": "git_branch_iterator", + "file": "branch.h", + "line": 88, + "lineto": 88, + "tdef": "typedef", + "description": " Iterator type for branches ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_iterator_free", + "git_branch_iterator_new", + "git_branch_next" + ] + } + } + ], + [ + "git_branch_t", + { + "decl": [ + "GIT_BRANCH_LOCAL", + "GIT_BRANCH_REMOTE", + "GIT_BRANCH_ALL" + ], + "type": "enum", + "file": "types.h", + "line": 198, + "lineto": 202, + "block": "GIT_BRANCH_LOCAL\nGIT_BRANCH_REMOTE\nGIT_BRANCH_ALL", + "tdef": "typedef", + "description": " Basic type of any Git branch. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_BRANCH_LOCAL", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_BRANCH_REMOTE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_BRANCH_ALL", + "comments": "", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [ + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_next" + ] + } + } + ], + [ + "git_buf", + { + "decl": [ + "char * ptr", + "size_t asize", + "size_t size" + ], + "type": "struct", + "value": "git_buf", + "file": "buffer.h", + "line": 52, + "lineto": 55, + "block": "char * ptr\nsize_t asize\nsize_t size", + "tdef": "typedef", + "description": " A data buffer for exporting data from libgit2", + "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the\n caller and have the caller take responsibility for freeing that memory.\n This can be awkward if the caller does not have easy access to the same\n allocation functions that libgit2 is using. In those cases, libgit2\n will fill in a git_buf and the caller can use git_buf_free() to\n release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to\n a block of memory they hold. In this case, libgit2 will not resize or\n free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n
    \n
  • ptr points to the start of the allocated memory. If it is NULL,\nthen the git_buf is considered empty and libgit2 will feel free\nto overwrite it with new data.

  • \n
  • size holds the size (in bytes) of the data that is actually used.

  • \n
  • asize holds the known total amount of allocated memory if the ptr\nwas allocated by libgit2. It may be larger than size. If ptr\nwas not allocated by libgit2 and should not be resized and/or freed,\nthen asize will be set to zero.

  • \n
\n\n

Some APIs may occasionally do something slightly unusual with a buffer,\n such as setting ptr to a value that was passed in by the user. In\n those cases, the behavior will be clearly documented by the API.

\n", + "fields": [ + { + "type": "char *", + "name": "ptr", + "comments": "" + }, + { + "type": "size_t", + "name": "asize", + "comments": "" + }, + { + "type": "size_t", + "name": "size", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_blob_filtered_content", + "git_buf_contains_nul", + "git_buf_free", + "git_buf_grow", + "git_buf_is_binary", + "git_buf_set", + "git_commit_header_field", + "git_config_find_global", + "git_config_find_system", + "git_config_find_xdg", + "git_config_get_path", + "git_config_get_string_buf", + "git_config_parse_path", + "git_describe_format", + "git_diff_commit_as_email", + "git_diff_format_email", + "git_diff_stats_to_buf", + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_stream_data", + "git_message_prettify", + "git_object_short_id", + "git_patch_to_buf", + "git_refspec_rtransform", + "git_refspec_transform", + "git_remote_default_branch", + "git_repository_discover", + "git_repository_message", + "git_submodule_resolve_url" + ] + } + } + ], + [ + "git_cert", + { + "decl": [ + "git_cert_t cert_type" + ], + "type": "struct", + "value": "git_cert", + "file": "types.h", + "line": 314, + "lineto": 319, + "block": "git_cert_t cert_type", + "tdef": "typedef", + "description": " Parent type for `git_cert_hostkey` and `git_cert_x509`.", + "comments": "", + "fields": [ + { + "type": "git_cert_t", + "name": "cert_type", + "comments": " Type of certificate. A `GIT_CERT_` value." + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cert_hostkey", + { + "decl": [ + "git_cert_t cert_type", + "git_cert_ssh_t type", + "unsigned char [16] hash_md5", + "unsigned char [20] hash_sha1" + ], + "type": "struct", + "value": "git_cert_hostkey", + "file": "transport.h", + "line": 39, + "lineto": 62, + "block": "git_cert_t cert_type\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1", + "tdef": "typedef", + "description": " Hostkey information taken from libssh2", + "comments": "", + "fields": [ + { + "type": "git_cert_t", + "name": "cert_type", + "comments": " Type of certificate. Here to share the header with\n `git_cert`." + }, + { + "type": "git_cert_ssh_t", + "name": "type", + "comments": " A hostkey type from libssh2, either\n `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`" + }, + { + "type": "unsigned char [16]", + "name": "hash_md5", + "comments": " Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will\n have the MD5 hash of the hostkey." + }, + { + "type": "unsigned char [20]", + "name": "hash_sha1", + "comments": " Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will\n have the SHA-1 hash of the hostkey." + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cert_ssh_t", + { + "decl": [ + "GIT_CERT_SSH_MD5", + "GIT_CERT_SSH_SHA1" + ], + "type": "enum", + "file": "transport.h", + "line": 29, + "lineto": 34, + "block": "GIT_CERT_SSH_MD5\nGIT_CERT_SSH_SHA1", + "tdef": "typedef", + "description": " Type of SSH host fingerprint", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CERT_SSH_MD5", + "comments": "

MD5 is available

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CERT_SSH_SHA1", + "comments": "

SHA-1 is available

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cert_t", + { + "decl": [ + "GIT_CERT_NONE", + "GIT_CERT_X509", + "GIT_CERT_HOSTKEY_LIBSSH2", + "GIT_CERT_STRARRAY" + ], + "type": "enum", + "file": "types.h", + "line": 286, + "lineto": 309, + "block": "GIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY\nGIT_CERT_NONE\nGIT_CERT_X509\nGIT_CERT_HOSTKEY_LIBSSH2\nGIT_CERT_STRARRAY", + "tdef": "typedef", + "description": " Type of host certificate structure that is passed to the check callback", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CERT_NONE", + "comments": "

No information about the certificate is available. This may\n happen when using curl.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CERT_X509", + "comments": "

The data argument to the callback will be a pointer to\n the DER-encoded data.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CERT_HOSTKEY_LIBSSH2", + "comments": "

The data argument to the callback will be a pointer to a\n git_cert_hostkey structure.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CERT_STRARRAY", + "comments": "

The data argument to the callback will be a pointer to a\n git_strarray with name:content strings containing\n information about the certificate. This is used when using\n curl.

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cert_x509", + { + "decl": [ + "git_cert_t cert_type", + "void * data", + "size_t len" + ], + "type": "struct", + "value": "git_cert_x509", + "file": "transport.h", + "line": 67, + "lineto": 81, + "block": "git_cert_t cert_type\nvoid * data\nsize_t len", + "tdef": "typedef", + "description": " X.509 certificate information", + "comments": "", + "fields": [ + { + "type": "git_cert_t", + "name": "cert_type", + "comments": " Type of certificate. Here to share the header with\n `git_cert`." + }, + { + "type": "void *", + "name": "data", + "comments": " Pointer to the X.509 certificate data" + }, + { + "type": "size_t", + "name": "len", + "comments": " Length of the memory block pointed to by `data`." + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_checkout_notify_t", + { + "decl": [ + "GIT_CHECKOUT_NOTIFY_NONE", + "GIT_CHECKOUT_NOTIFY_CONFLICT", + "GIT_CHECKOUT_NOTIFY_DIRTY", + "GIT_CHECKOUT_NOTIFY_UPDATED", + "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "GIT_CHECKOUT_NOTIFY_IGNORED", + "GIT_CHECKOUT_NOTIFY_ALL" + ], + "type": "enum", + "file": "checkout.h", + "line": 205, + "lineto": 214, + "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", + "tdef": "typedef", + "description": " Checkout notification flags", + "comments": "

Checkout will invoke an options notification callback (notify_cb) for\n certain cases - you pick which ones via notify_flags:

\n\n
    \n
  • GIT_CHECKOUT_NOTIFY_CONFLICT invokes checkout on conflicting paths.

  • \n
  • GIT_CHECKOUT_NOTIFY_DIRTY notifies about "dirty" files, i.e. those that\ndo not need an update but no longer match the baseline. Core git\ndisplays these files when checkout runs, but won't stop the checkout.

  • \n
  • GIT_CHECKOUT_NOTIFY_UPDATED sends notification for any file changed.

  • \n
  • GIT_CHECKOUT_NOTIFY_UNTRACKED notifies about untracked files.

  • \n
  • GIT_CHECKOUT_NOTIFY_IGNORED notifies about ignored files.

  • \n
\n\n

Returning a non-zero value from this callback will cancel the checkout.\n The non-zero return value will be propagated back and returned by the\n git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk,\n so canceling on any notification will still happen prior to any files\n being modified.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_CONFLICT", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_DIRTY", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UPDATED", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_UNTRACKED", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_IGNORED", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NOTIFY_ALL", + "comments": "", + "value": 65535 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_checkout_options", + { + "decl": [ + "unsigned int version", + "unsigned int checkout_strategy", + "int disable_filters", + "unsigned int dir_mode", + "unsigned int file_mode", + "int file_open_flags", + "unsigned int notify_flags", + "git_checkout_notify_cb notify_cb", + "void * notify_payload", + "git_checkout_progress_cb progress_cb", + "void * progress_payload", + "git_strarray paths", + "git_tree * baseline", + "git_index * baseline_index", + "const char * target_directory", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_checkout_perfdata_cb perfdata_cb", + "void * perfdata_payload" + ], + "type": "struct", + "value": "git_checkout_options", + "file": "checkout.h", + "line": 251, + "lineto": 295, + "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", + "tdef": "typedef", + "description": " Checkout options structure", + "comments": "

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "checkout_strategy", + "comments": " default will be a dry run " + }, + { + "type": "int", + "name": "disable_filters", + "comments": " don't apply filters like CRLF conversion " + }, + { + "type": "unsigned int", + "name": "dir_mode", + "comments": " default is 0755 " + }, + { + "type": "unsigned int", + "name": "file_mode", + "comments": " default is 0644 or 0755 as dictated by blob " + }, + { + "type": "int", + "name": "file_open_flags", + "comments": " default is O_CREAT | O_TRUNC | O_WRONLY " + }, + { + "type": "unsigned int", + "name": "notify_flags", + "comments": " see `git_checkout_notify_t` above " + }, + { + "type": "git_checkout_notify_cb", + "name": "notify_cb", + "comments": "" + }, + { + "type": "void *", + "name": "notify_payload", + "comments": "" + }, + { + "type": "git_checkout_progress_cb", + "name": "progress_cb", + "comments": " Optional callback to notify the consumer of checkout progress. " + }, + { + "type": "void *", + "name": "progress_payload", + "comments": "" + }, + { + "type": "git_strarray", + "name": "paths", + "comments": " When not zeroed out, array of fnmatch patterns specifying which\n paths should be taken into account, otherwise all files. Use\n GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list." + }, + { + "type": "git_tree *", + "name": "baseline", + "comments": " The expected content of the working directory; defaults to HEAD.\n If the working directory does not match this baseline information,\n that will produce a checkout conflict." + }, + { + "type": "git_index *", + "name": "baseline_index", + "comments": " expected content of workdir, expressed as an index. " + }, + { + "type": "const char *", + "name": "target_directory", + "comments": " alternative checkout path to workdir " + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " the name of the common ancestor side of conflicts " + }, + { + "type": "const char *", + "name": "our_label", + "comments": " the name of the \"our\" side of conflicts " + }, + { + "type": "const char *", + "name": "their_label", + "comments": " the name of the \"their\" side of conflicts " + }, + { + "type": "git_checkout_perfdata_cb", + "name": "perfdata_cb", + "comments": " Optional callback to notify the consumer of performance data. " + }, + { + "type": "void *", + "name": "perfdata_payload", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_checkout_head", + "git_checkout_index", + "git_checkout_init_options", + "git_checkout_tree", + "git_merge", + "git_reset", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_checkout_strategy_t", + { + "decl": [ + "GIT_CHECKOUT_NONE", + "GIT_CHECKOUT_SAFE", + "GIT_CHECKOUT_FORCE", + "GIT_CHECKOUT_RECREATE_MISSING", + "GIT_CHECKOUT_ALLOW_CONFLICTS", + "GIT_CHECKOUT_REMOVE_UNTRACKED", + "GIT_CHECKOUT_REMOVE_IGNORED", + "GIT_CHECKOUT_UPDATE_ONLY", + "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "GIT_CHECKOUT_NO_REFRESH", + "GIT_CHECKOUT_SKIP_UNMERGED", + "GIT_CHECKOUT_USE_OURS", + "GIT_CHECKOUT_USE_THEIRS", + "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "GIT_CHECKOUT_DONT_WRITE_INDEX", + "GIT_CHECKOUT_UPDATE_SUBMODULES", + "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED" + ], + "type": "enum", + "file": "checkout.h", + "line": 106, + "lineto": 177, + "block": "GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "tdef": "typedef", + "description": " Checkout behavior flags", + "comments": "

In libgit2, checkout is used to update the working directory and index\n to match a target tree. Unlike git checkout, it does not move the HEAD\n commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to\n check out, the "baseline" tree of what was checked out previously, the\n working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n
    \n
  • GIT_CHECKOUT_NONE is a dry-run strategy that checks for conflicts,\netc., but doesn't make any actual changes.

  • \n
  • GIT_CHECKOUT_FORCE is at the opposite extreme, taking any action to\nmake the working directory match the target (including potentially\ndiscarding modified files).

  • \n
  • GIT_CHECKOUT_SAFE is between these two options, it will only make\nmodifications that will not lose changes.

    \n\n
                     |  target == baseline   |  target != baseline  |\n
    \n\n

    ---------------------|-----------------------|----------------------|\n workdir == baseline | no action | create, update, or |\n | | delete file |\n---------------------|-----------------------|----------------------|\n workdir exists and | no action | conflict (notify |\n is != baseline | notify dirty MODIFIED | and cancel checkout) |\n---------------------|-----------------------|----------------------|\n workdir missing, | notify dirty DELETED | create file |\n baseline present | | |\n---------------------|-----------------------|----------------------|

  • \n
\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout\n notification callback (see below) that displays information about dirty\n files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a\n notification callback that cancels the operation if a dirty-but-existing\n file is found in the working directory. This core git command isn't\n quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n
    \n
  • GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates\neven if there are conflicts (instead of cancelling the checkout).

  • \n
  • GIT_CHECKOUT_REMOVE_UNTRACKED means remove untracked files (i.e. not\nin target, baseline, or index, and not ignored) from the working dir.

  • \n
  • GIT_CHECKOUT_REMOVE_IGNORED means remove ignored files (that are also\nuntracked) from the working directory as well.

  • \n
  • GIT_CHECKOUT_UPDATE_ONLY means to only update the content of files that\nalready exist. Files will not be created nor deleted. This just skips\napplying adds, deletes, and typechanges.

  • \n
  • GIT_CHECKOUT_DONT_UPDATE_INDEX prevents checkout from writing the\nupdated files' information to the index.

  • \n
  • Normally, checkout will reload the index and git attributes from disk\nbefore any operations. GIT_CHECKOUT_NO_REFRESH prevents this reload.

  • \n
  • Unmerged index entries are conflicts. GIT_CHECKOUT_SKIP_UNMERGED skips\nfiles with unmerged index entries instead. GIT_CHECKOUT_USE_OURS and\nGIT_CHECKOUT_USE_THEIRS to proceed with the checkout using either the\nstage 2 ("ours") or stage 3 ("theirs") version of files in the index.

  • \n
  • GIT_CHECKOUT_DONT_OVERWRITE_IGNORED prevents ignored files from being\noverwritten. Normally, files that are ignored in the working directory\nare not considered "precious" and may be overwritten if the checkout\ntarget contains that file.

  • \n
  • GIT_CHECKOUT_DONT_REMOVE_EXISTING prevents checkout from removing\nfiles or folders that fold to the same name on case insensitive\nfilesystems. This can cause files to retain their existing names\nand write through existing symbolic links.

  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_CHECKOUT_NONE", + "comments": "

default is a dry run, no actual updates

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SAFE", + "comments": "

Allow safe updates that cannot overwrite uncommitted data

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_FORCE", + "comments": "

Allow all updates to force working directory to look like index

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_RECREATE_MISSING", + "comments": "

Allow checkout to recreate missing files

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_ALLOW_CONFLICTS", + "comments": "

Allow checkout to make safe updates even if conflicts are found

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_REMOVE_UNTRACKED", + "comments": "

Remove untracked files not in index (that are not ignored)

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_REMOVE_IGNORED", + "comments": "

Remove ignored files not in index

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_ONLY", + "comments": "

Only update existing files, don't create new ones

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_UPDATE_INDEX", + "comments": "

Normally checkout updates index entries as it goes; this stops that.\n Implies GIT_CHECKOUT_DONT_WRITE_INDEX.

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_NO_REFRESH", + "comments": "

Don't refresh index/config/etc before doing checkout

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_UNMERGED", + "comments": "

Allow checkout to skip unmerged files

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_OURS", + "comments": "

For unmerged files, checkout stage 2 from index

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_USE_THEIRS", + "comments": "

For unmerged files, checkout stage 3 from index

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH", + "comments": "

Treat pathspec as simple list of exact match file paths

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES", + "comments": "

Ignore directories in use, they will be left empty

\n", + "value": 262144 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_OVERWRITE_IGNORED", + "comments": "

Don't overwrite ignored files that exist in the checkout target

\n", + "value": 524288 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_MERGE", + "comments": "

Write normal merge files for conflicts

\n", + "value": 1048576 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_CONFLICT_STYLE_DIFF3", + "comments": "

Include common ancestor data in diff3 format files for conflicts

\n", + "value": 2097152 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_REMOVE_EXISTING", + "comments": "

Don't overwrite existing files or folders

\n", + "value": 4194304 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_DONT_WRITE_INDEX", + "comments": "

Normally checkout writes the index upon completion; this prevents that.

\n", + "value": 8388608 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES", + "comments": "

Recursively checkout submodules with same options (NOT IMPLEMENTED)

\n", + "value": 65536 + }, + { + "type": "int", + "name": "GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", + "comments": "

Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)

\n", + "value": 131072 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cherrypick_options", + { + "decl": [ + "unsigned int version", + "unsigned int mainline", + "git_merge_options merge_opts", + "git_checkout_options checkout_opts" + ], + "type": "struct", + "value": "git_cherrypick_options", + "file": "cherrypick.h", + "line": 26, + "lineto": 34, + "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", + "tdef": "typedef", + "description": " Cherry-pick options", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "mainline", + "comments": " For merge commits, the \"mainline\" is treated as the parent. " + }, + { + "type": "git_merge_options", + "name": "merge_opts", + "comments": " Options for the merging " + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " + } + ], + "used": { + "returns": [], + "needs": [ + "git_cherrypick", + "git_cherrypick_init_options" + ] + } + } + ], + [ + "git_clone_local_t", + { + "decl": [ + "GIT_CLONE_LOCAL_AUTO", + "GIT_CLONE_LOCAL", + "GIT_CLONE_NO_LOCAL", + "GIT_CLONE_LOCAL_NO_LINKS" + ], + "type": "enum", + "file": "clone.h", + "line": 33, + "lineto": 53, + "block": "GIT_CLONE_LOCAL_AUTO\nGIT_CLONE_LOCAL\nGIT_CLONE_NO_LOCAL\nGIT_CLONE_LOCAL_NO_LINKS", + "tdef": "typedef", + "description": " Options for bypassing the git-aware transport on clone. Bypassing\n it means that instead of a fetch, libgit2 will copy the object\n database directory instead of figuring out what it needs, which is\n faster. If possible, it will hardlink the files to save space.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CLONE_LOCAL_AUTO", + "comments": "

Auto-detect (default), libgit2 will bypass the git-aware\n transport for local paths, but use a normal fetch for\n file:// urls.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CLONE_LOCAL", + "comments": "

Bypass the git-aware transport even for a file:// url.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CLONE_NO_LOCAL", + "comments": "

Do no bypass the git-aware transport

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CLONE_LOCAL_NO_LINKS", + "comments": "

Bypass the git-aware transport, but do not try to use\n hardlinks.

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_clone_options", + { + "decl": [ + "unsigned int version", + "git_checkout_options checkout_opts", + "git_fetch_options fetch_opts", + "int bare", + "git_clone_local_t local", + "const char * checkout_branch", + "git_repository_create_cb repository_cb", + "void * repository_cb_payload", + "git_remote_create_cb remote_cb", + "void * remote_cb_payload" + ], + "type": "struct", + "value": "git_clone_options", + "file": "clone.h", + "line": 103, + "lineto": 164, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nint bare\ngit_clone_local_t local\nconst char * checkout_branch\ngit_repository_create_cb repository_cb\nvoid * repository_cb_payload\ngit_remote_create_cb remote_cb\nvoid * remote_cb_payload", + "tdef": "typedef", + "description": " Clone options structure", + "comments": "

Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:

\n\n
    git_clone_options opts = GIT_CLONE_OPTIONS_INIT;\n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`." + }, + { + "type": "git_fetch_options", + "name": "fetch_opts", + "comments": " Options which control the fetch, including callbacks.\n\n The callbacks are used for reporting fetch progress, and for acquiring\n credentials in the event they are needed." + }, + { + "type": "int", + "name": "bare", + "comments": " Set to zero (false) to create a standard repo, or non-zero\n for a bare repo" + }, + { + "type": "git_clone_local_t", + "name": "local", + "comments": " Whether to use a fetch or copy the object database." + }, + { + "type": "const char *", + "name": "checkout_branch", + "comments": " The name of the branch to checkout. NULL means use the\n remote's default branch." + }, + { + "type": "git_repository_create_cb", + "name": "repository_cb", + "comments": " A callback used to create the new repository into which to\n clone. If NULL, the 'bare' field will be used to determine\n whether to create a bare repository." + }, + { + "type": "void *", + "name": "repository_cb_payload", + "comments": " An opaque payload to pass to the git_repository creation callback.\n This parameter is ignored unless repository_cb is non-NULL." + }, + { + "type": "git_remote_create_cb", + "name": "remote_cb", + "comments": " A callback used to create the git_remote, prior to its being\n used to perform the clone operation. See the documentation for\n git_remote_create_cb for details. This parameter may be NULL,\n indicating that git_clone should provide default behavior." + }, + { + "type": "void *", + "name": "remote_cb_payload", + "comments": " An opaque payload to pass to the git_remote creation callback.\n This parameter is ignored unless remote_cb is non-NULL." + } + ], + "used": { + "returns": [], + "needs": [ + "git_clone", + "git_clone_init_options" + ] + } + } + ], + [ + "git_commit", + { + "decl": "git_commit", + "type": "struct", + "value": "git_commit", + "file": "types.h", + "line": 120, + "lineto": 120, + "tdef": "typedef", + "description": " Parsed representation of a commit object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_branch_create", + "git_cherrypick", + "git_cherrypick_commit", + "git_commit_amend", + "git_commit_author", + "git_commit_committer", + "git_commit_create", + "git_commit_free", + "git_commit_header_field", + "git_commit_id", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_message", + "git_commit_message_encoding", + "git_commit_message_raw", + "git_commit_nth_gen_ancestor", + "git_commit_owner", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_parentcount", + "git_commit_raw_header", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_tree", + "git_commit_tree_id", + "git_diff_commit_as_email", + "git_merge_commits", + "git_revert", + "git_revert_commit" + ] + } + } + ], + [ + "git_config", + { + "decl": "git_config", + "type": "struct", + "value": "git_config", + "file": "types.h", + "line": 138, + "lineto": 138, + "tdef": "typedef", + "description": " Memory representation of a set of config files ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_config_add_backend", + "git_config_add_file_ondisk", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_foreach", + "git_config_foreach_match", + "git_config_free", + "git_config_get_bool", + "git_config_get_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_mapped", + "git_config_get_multivar_foreach", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_multivar_iterator_new", + "git_config_new", + "git_config_open_default", + "git_config_open_global", + "git_config_open_level", + "git_config_open_ondisk", + "git_config_set_bool", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_multivar", + "git_config_set_string", + "git_config_snapshot", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_set_config" + ] + } + } + ], + [ + "git_config_backend", + { + "decl": "git_config_backend", + "type": "struct", + "value": "git_config_backend", + "file": "types.h", + "line": 141, + "lineto": 141, + "block": "unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nvoid (*)(struct git_config_backend *) free", + "tdef": "typedef", + "description": " Interface to access a configuration file ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "int", + "name": "readonly", + "comments": " True if this backend is for a snapshot " + }, + { + "type": "struct git_config *", + "name": "cfg", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend *, git_config_level_t)", + "name": "open", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend *, const char *, git_config_entry **)", + "name": "get", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend *, const char *, const char *)", + "name": "set", + "comments": "" + }, + { + "type": "int (*)(git_config_backend *, const char *, const char *, const char *)", + "name": "set_multivar", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend *, const char *)", + "name": "del", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend *, const char *, const char *)", + "name": "del_multivar", + "comments": "" + }, + { + "type": "int (*)(git_config_iterator **, struct git_config_backend *)", + "name": "iterator", + "comments": "" + }, + { + "type": "int (*)(struct git_config_backend **, struct git_config_backend *)", + "name": "snapshot", + "comments": " Produce a read-only version of this backend " + }, + { + "type": "void (*)(struct git_config_backend *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_add_backend", + "git_config_backend_foreach_match", + "git_config_init_backend" + ] + } + } + ], + [ + "git_config_entry", + { + "decl": [ + "const char * name", + "const char * value", + "git_config_level_t level", + "void (*)(struct git_config_entry *) free", + "void * payload" + ], + "type": "struct", + "value": "git_config_entry", + "file": "config.h", + "line": 61, + "lineto": 67, + "block": "const char * name\nconst char * value\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload", + "tdef": "typedef", + "description": " An entry in a configuration file", + "comments": "", + "fields": [ + { + "type": "const char *", + "name": "name", + "comments": " Name of the entry (normalised) " + }, + { + "type": "const char *", + "name": "value", + "comments": " String value of the entry " + }, + { + "type": "git_config_level_t", + "name": "level", + "comments": " Which config file this was found in " + }, + { + "type": "void (*)(struct git_config_entry *)", + "name": "free", + "comments": " Free function for this entry " + }, + { + "type": "void *", + "name": "payload", + "comments": " Opaque value for the free function. Do not read or write " + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_entry_free", + "git_config_get_entry", + "git_config_next" + ] + } + } + ], + [ + "git_config_iterator", + { + "decl": [ + "git_config_backend * backend", + "unsigned int flags", + "int (*)(git_config_entry **, git_config_iterator *) next", + "void (*)(git_config_iterator *) free" + ], + "type": "struct", + "value": "git_config_iterator", + "file": "sys/config.h", + "line": 34, + "lineto": 48, + "block": "git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free", + "tdef": null, + "description": " Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as", + "comments": "
 struct my_iterator {\n         git_config_iterator parent;\n         ...\n }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n", + "fields": [ + { + "type": "git_config_backend *", + "name": "backend", + "comments": "" + }, + { + "type": "unsigned int", + "name": "flags", + "comments": "" + }, + { + "type": "int (*)(git_config_entry **, git_config_iterator *)", + "name": "next", + "comments": " Return the current entry and advance the iterator. The\n memory belongs to the library." + }, + { + "type": "void (*)(git_config_iterator *)", + "name": "free", + "comments": " Free the iterator" + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_multivar_iterator_new", + "git_config_next" + ] + } + } + ], + [ + "git_config_level_t", + { + "decl": [ + "GIT_CONFIG_LEVEL_SYSTEM", + "GIT_CONFIG_LEVEL_XDG", + "GIT_CONFIG_LEVEL_GLOBAL", + "GIT_CONFIG_LEVEL_LOCAL", + "GIT_CONFIG_LEVEL_APP", + "GIT_CONFIG_HIGHEST_LEVEL" + ], + "type": "enum", + "file": "config.h", + "line": 31, + "lineto": 56, + "block": "GIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", + "tdef": "typedef", + "description": " Priority level of a config file.\n These priority levels correspond to the natural escalation logic\n (from higher to lower) when searching for config entries in git.git.", + "comments": "

git_config_open_default() and git_repository_config() honor those\n priority levels as well.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_SYSTEM", + "comments": "

System-wide configuration file; /etc/gitconfig on Linux systems

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_XDG", + "comments": "

XDG compatible configuration file; typically ~/.config/git/config

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_GLOBAL", + "comments": "

User-specific configuration file (also called Global configuration\n file); typically ~/.gitconfig

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_LOCAL", + "comments": "

Repository specific configuration file; $WORK_DIR/.git/config on\n non-bare repos

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_APP", + "comments": "

Application specific configuration file; freely defined by applications

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_CONFIG_HIGHEST_LEVEL", + "comments": "

Represents the highest level available config file (i.e. the most\n specific config file available that actually is loaded)

\n", + "value": -1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_add_backend", + "git_config_add_file_ondisk", + "git_config_open_level" + ] + } + } + ], + [ + "git_cred_default", + { + "decl": "git_cred_default", + "type": "struct", + "value": "git_cred_default", + "file": "transport.h", + "line": 183, + "lineto": 183, + "tdef": "typedef", + "description": " A key for NTLM/Kerberos \"default\" credentials ", + "comments": "", + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_ssh_custom", + { + "decl": [ + "git_cred parent", + "char * username", + "char * publickey", + "size_t publickey_len", + "git_cred_sign_callback sign_callback", + "void * payload" + ], + "type": "struct", + "value": "git_cred_ssh_custom", + "file": "transport.h", + "line": 173, + "lineto": 180, + "block": "git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload", + "tdef": "typedef", + "description": " A key with a custom signature function", + "comments": "", + "fields": [ + { + "type": "git_cred", + "name": "parent", + "comments": "" + }, + { + "type": "char *", + "name": "username", + "comments": "" + }, + { + "type": "char *", + "name": "publickey", + "comments": "" + }, + { + "type": "size_t", + "name": "publickey_len", + "comments": "" + }, + { + "type": "git_cred_sign_callback", + "name": "sign_callback", + "comments": "" + }, + { + "type": "void *", + "name": "payload", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_ssh_interactive", + { + "decl": [ + "git_cred parent", + "char * username", + "git_cred_ssh_interactive_callback prompt_callback", + "void * payload" + ], + "type": "struct", + "value": "git_cred_ssh_interactive", + "file": "transport.h", + "line": 163, + "lineto": 168, + "block": "git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload", + "tdef": "typedef", + "description": " Keyboard-interactive based ssh authentication", + "comments": "", + "fields": [ + { + "type": "git_cred", + "name": "parent", + "comments": "" + }, + { + "type": "char *", + "name": "username", + "comments": "" + }, + { + "type": "git_cred_ssh_interactive_callback", + "name": "prompt_callback", + "comments": "" + }, + { + "type": "void *", + "name": "payload", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_ssh_key", + { + "decl": [ + "git_cred parent", + "char * username", + "char * publickey", + "char * privatekey", + "char * passphrase" + ], + "type": "struct", + "value": "git_cred_ssh_key", + "file": "transport.h", + "line": 152, + "lineto": 158, + "block": "git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase", + "tdef": "typedef", + "description": " A ssh key from disk", + "comments": "", + "fields": [ + { + "type": "git_cred", + "name": "parent", + "comments": "" + }, + { + "type": "char *", + "name": "username", + "comments": "" + }, + { + "type": "char *", + "name": "publickey", + "comments": "" + }, + { + "type": "char *", + "name": "privatekey", + "comments": "" + }, + { + "type": "char *", + "name": "passphrase", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_username", + { + "decl": [ + "git_cred parent", + "char [1] username" + ], + "type": "struct", + "value": "git_cred_username", + "file": "transport.h", + "line": 186, + "lineto": 189, + "block": "git_cred parent\nchar [1] username", + "tdef": "typedef", + "description": " Username-only credential information ", + "comments": "", + "fields": [ + { + "type": "git_cred", + "name": "parent", + "comments": "" + }, + { + "type": "char [1]", + "name": "username", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_userpass_payload", + { + "decl": [ + "const char * username", + "const char * password" + ], + "type": "struct", + "value": "git_cred_userpass_payload", + "file": "cred_helpers.h", + "line": 24, + "lineto": 27, + "block": "const char * username\nconst char * password", + "tdef": "typedef", + "description": " Payload for git_cred_stock_userpass_plaintext.", + "comments": "", + "fields": [ + { + "type": "const char *", + "name": "username", + "comments": "" + }, + { + "type": "const char *", + "name": "password", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cred_userpass_plaintext", + { + "decl": [ + "git_cred parent", + "char * username", + "char * password" + ], + "type": "struct", + "value": "git_cred_userpass_plaintext", + "file": "transport.h", + "line": 129, + "lineto": 133, + "block": "git_cred parent\nchar * username\nchar * password", + "tdef": "typedef", + "description": " A plaintext username and password ", + "comments": "", + "fields": [ + { + "type": "git_cred", + "name": "parent", + "comments": "" + }, + { + "type": "char *", + "name": "username", + "comments": "" + }, + { + "type": "char *", + "name": "password", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_credtype_t", + { + "decl": [ + "GIT_CREDTYPE_USERPASS_PLAINTEXT", + "GIT_CREDTYPE_SSH_KEY", + "GIT_CREDTYPE_SSH_CUSTOM", + "GIT_CREDTYPE_DEFAULT", + "GIT_CREDTYPE_SSH_INTERACTIVE", + "GIT_CREDTYPE_USERNAME", + "GIT_CREDTYPE_SSH_MEMORY" + ], + "type": "enum", + "file": "transport.h", + "line": 88, + "lineto": 118, + "block": "GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME\nGIT_CREDTYPE_SSH_MEMORY", + "tdef": "typedef", + "description": " Authentication type requested ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CREDTYPE_USERPASS_PLAINTEXT", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_SSH_KEY", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_SSH_CUSTOM", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_DEFAULT", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_SSH_INTERACTIVE", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_USERNAME", + "comments": "

Username-only information

\n\n

If the SSH transport does not know which username to use,\n it will ask via this credential type.

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_CREDTYPE_SSH_MEMORY", + "comments": "

Credentials read from memory.

\n\n

Only available for libssh2+OpenSSL for now.

\n", + "value": 64 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_cvar_map", + { + "decl": [ + "git_cvar_t cvar_type", + "const char * str_match", + "int map_value" + ], + "type": "struct", + "value": "git_cvar_map", + "file": "config.h", + "line": 90, + "lineto": 94, + "block": "git_cvar_t cvar_type\nconst char * str_match\nint map_value", + "tdef": "typedef", + "description": " Mapping from config variables to values.", + "comments": "", + "fields": [ + { + "type": "git_cvar_t", + "name": "cvar_type", + "comments": "" + }, + { + "type": "const char *", + "name": "str_match", + "comments": "" + }, + { + "type": "int", + "name": "map_value", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_config_get_mapped", + "git_config_lookup_map_value" + ] + } + } + ], + [ + "git_cvar_t", + { + "decl": [ + "GIT_CVAR_FALSE", + "GIT_CVAR_TRUE", + "GIT_CVAR_INT32", + "GIT_CVAR_STRING" + ], + "type": "enum", + "file": "config.h", + "line": 80, + "lineto": 85, + "block": "GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING", + "tdef": "typedef", + "description": " Config var type", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_CVAR_FALSE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_CVAR_TRUE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_CVAR_INT32", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_CVAR_STRING", + "comments": "", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_delta_t", + { + "decl": [ + "GIT_DELTA_UNMODIFIED", + "GIT_DELTA_ADDED", + "GIT_DELTA_DELETED", + "GIT_DELTA_MODIFIED", + "GIT_DELTA_RENAMED", + "GIT_DELTA_COPIED", + "GIT_DELTA_IGNORED", + "GIT_DELTA_UNTRACKED", + "GIT_DELTA_TYPECHANGE", + "GIT_DELTA_UNREADABLE", + "GIT_DELTA_CONFLICTED" + ], + "type": "enum", + "file": "diff.h", + "line": 242, + "lineto": 254, + "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\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", + "tdef": "typedef", + "description": " What type of change is described by a git_diff_delta?", + "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run\n git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE\n in the option flags (otherwise type changes will be split into ADDED /\n DELETED pairs).

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DELTA_UNMODIFIED", + "comments": "

no changes

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DELTA_ADDED", + "comments": "

entry does not exist in old version

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DELTA_DELETED", + "comments": "

entry does not exist in new version

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DELTA_MODIFIED", + "comments": "

entry content changed between old and new

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DELTA_RENAMED", + "comments": "

entry was renamed between old and new

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DELTA_COPIED", + "comments": "

entry was copied from another old entry

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_DELTA_IGNORED", + "comments": "

entry is ignored item in workdir

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_DELTA_UNTRACKED", + "comments": "

entry is untracked item in workdir

\n", + "value": 7 + }, + { + "type": "int", + "name": "GIT_DELTA_TYPECHANGE", + "comments": "

type of entry changed between old and new

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DELTA_UNREADABLE", + "comments": "

entry is unreadable

\n", + "value": 9 + }, + { + "type": "int", + "name": "GIT_DELTA_CONFLICTED", + "comments": "

entry in the index is conflicted

\n", + "value": 10 + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_num_deltas_of_type", + "git_diff_status_char" + ] + } + } + ], + [ + "git_describe_format_options", + { + "decl": [ + "unsigned int version", + "unsigned int abbreviated_size", + "int always_use_long_format", + "const char * dirty_suffix" + ], + "type": "struct", + "value": "git_describe_format_options", + "file": "describe.h", + "line": 78, + "lineto": 98, + "block": "unsigned int version\nunsigned int abbreviated_size\nint always_use_long_format\nconst char * dirty_suffix", + "tdef": "typedef", + "description": " Options for formatting the describe string", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "abbreviated_size", + "comments": " Size of the abbreviated commit id to use. This value is the\n lower bound for the length of the abbreviated string. The\n default is 7." + }, + { + "type": "int", + "name": "always_use_long_format", + "comments": " Set to use the long format even when a shorter name could be used." + }, + { + "type": "const char *", + "name": "dirty_suffix", + "comments": " If the workdir is dirty and this is set, this string will\n be appended to the description string." + } + ], + "used": { + "returns": [], + "needs": [ + "git_describe_format" + ] + } + } + ], + [ + "git_describe_options", + { + "decl": [ + "unsigned int version", + "unsigned int max_candidates_tags", + "unsigned int describe_strategy", + "const char * pattern", + "int only_follow_first_parent", + "int show_commit_oid_as_fallback" + ], + "type": "struct", + "value": "git_describe_options", + "file": "describe.h", + "line": 44, + "lineto": 62, + "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", + "tdef": "typedef", + "description": " Describe options structure", + "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set\n the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "max_candidates_tags", + "comments": "" + }, + { + "type": "unsigned int", + "name": "describe_strategy", + "comments": " default: 10 " + }, + { + "type": "const char *", + "name": "pattern", + "comments": " default: GIT_DESCRIBE_DEFAULT " + }, + { + "type": "int", + "name": "only_follow_first_parent", + "comments": " When calculating the distance from the matching tag or\n reference, only walk down the first-parent ancestry." + }, + { + "type": "int", + "name": "show_commit_oid_as_fallback", + "comments": " If no matching tag or reference is found, the describe\n operation would normally fail. If this option is set, it\n will instead fall back to showing the full id of the\n commit." + } + ], + "used": { + "returns": [], + "needs": [ + "git_describe_commit", + "git_describe_workdir" + ] + } + } + ], + [ + "git_describe_strategy_t", + { + "decl": [ + "GIT_DESCRIBE_DEFAULT", + "GIT_DESCRIBE_TAGS", + "GIT_DESCRIBE_ALL" + ], + "type": "enum", + "file": "describe.h", + "line": 30, + "lineto": 34, + "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", + "tdef": "typedef", + "description": " Reference lookup strategy", + "comments": "

These behave like the --tags and --all optios to git-describe,\n namely they say to look for any reference in either refs/tags/ or\n refs/ respectively.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DESCRIBE_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DESCRIBE_TAGS", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DESCRIBE_ALL", + "comments": "", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff", + { + "decl": "git_diff", + "type": "struct", + "value": "git_diff", + "file": "diff.h", + "line": 215, + "lineto": 215, + "tdef": "typedef", + "description": " The diff object that contains all individual file deltas.", + "comments": "

This is an opaque structure which will be allocated by one of the diff\n generator functions below (such as git_diff_tree_to_tree). You are\n responsible for releasing the object memory when done, using the\n git_diff_free() function.

\n", + "used": { + "returns": [], + "needs": [ + "git_diff_find_similar", + "git_diff_foreach", + "git_diff_format_email", + "git_diff_free", + "git_diff_get_delta", + "git_diff_get_perfdata", + "git_diff_get_stats", + "git_diff_index_to_workdir", + "git_diff_is_sorted_icase", + "git_diff_merge", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_print", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_diff", + "git_pathspec_match_diff" + ] + } + } + ], + [ + "git_diff_binary", + { + "decl": [ + "git_diff_binary_file old_file", + "git_diff_binary_file new_file" + ], + "type": "struct", + "value": "git_diff_binary", + "file": "diff.h", + "line": 461, + "lineto": 464, + "block": "git_diff_binary_file old_file\ngit_diff_binary_file new_file", + "tdef": "typedef", + "description": " Structure describing the binary contents of a diff. ", + "comments": "", + "fields": [ + { + "type": "git_diff_binary_file", + "name": "old_file", + "comments": " The contents of the old file. " + }, + { + "type": "git_diff_binary_file", + "name": "new_file", + "comments": " The contents of the new file. " + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_binary_file", + { + "decl": [ + "git_diff_binary_t type", + "const char * data", + "size_t datalen", + "size_t inflatedlen" + ], + "type": "struct", + "value": "git_diff_binary_file", + "file": "diff.h", + "line": 446, + "lineto": 458, + "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", + "tdef": "typedef", + "description": " The contents of one of the files in a binary diff. ", + "comments": "", + "fields": [ + { + "type": "git_diff_binary_t", + "name": "type", + "comments": " The type of binary data for this file. " + }, + { + "type": "const char *", + "name": "data", + "comments": " The binary data, deflated. " + }, + { + "type": "size_t", + "name": "datalen", + "comments": " The length of the binary data. " + }, + { + "type": "size_t", + "name": "inflatedlen", + "comments": " The length of the binary data after inflation. " + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_binary_t", + { + "decl": [ + "GIT_DIFF_BINARY_NONE", + "GIT_DIFF_BINARY_LITERAL", + "GIT_DIFF_BINARY_DELTA" + ], + "type": "enum", + "file": "diff.h", + "line": 434, + "lineto": 443, + "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", + "tdef": "typedef", + "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_BINARY_NONE", + "comments": "

There is no binary delta.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_BINARY_LITERAL", + "comments": "

The binary data is the literal contents of the file.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_BINARY_DELTA", + "comments": "

The binary data is the delta from one side to the other.

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_delta", + { + "decl": [ + "git_delta_t status", + "uint32_t flags", + "uint16_t similarity", + "uint16_t nfiles", + "git_diff_file old_file", + "git_diff_file new_file" + ], + "type": "struct", + "value": "git_diff_delta", + "file": "diff.h", + "line": 321, + "lineto": 328, + "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", + "tdef": "typedef", + "description": " Description of changes to one entry.", + "comments": "

When iterating over a diff, this will be passed to most callbacks and\n you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file\n represents to "to" side of the diff. What those means depend on the\n function that was used to generate the diff and will be documented below.\n You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file",\n they actually may correspond to entries that represent a file, a symbolic\n link, a submodule commit id, or even a tree (if you are tracking type\n changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will\n be filled in, but we generally try to fill in as much as possible. One\n example is that the "flags" field may not have either the BINARY or the\n NOT_BINARY flag set to avoid examining file contents if you do not pass\n in hunk and/or line callbacks to the diff foreach iteration function. It\n will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar()\n which does a similarity analysis of files in the diff. Use that\n function to do rename and copy detection, and to split heavily modified\n files in add/delete pairs. After that call, deltas with a status of\n GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score\n between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to\n break, but to not actually break the records, then GIT_DELTA_MODIFIED\n records may have a non-zero similarity score if the self-similarity is\n below the split threshold. To display this value like core Git, invert\n the score (a la printf("M%03d", 100 - delta->similarity)).

\n", + "fields": [ + { + "type": "git_delta_t", + "name": "status", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " git_diff_flag_t values " + }, + { + "type": "uint16_t", + "name": "similarity", + "comments": " for RENAMED and COPIED, value 0-100 " + }, + { + "type": "uint16_t", + "name": "nfiles", + "comments": " number of files in this delta " + }, + { + "type": "git_diff_file", + "name": "old_file", + "comments": "" + }, + { + "type": "git_diff_file", + "name": "new_file", + "comments": "" + } + ], + "used": { + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], + "needs": [ + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle" + ] + } + } + ], + [ + "git_diff_file", + { + "decl": [ + "git_oid id", + "const char * path", + "git_off_t size", + "uint32_t flags", + "uint16_t mode" + ], + "type": "struct", + "value": "git_diff_file", + "file": "diff.h", + "line": 277, + "lineto": 283, + "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode", + "tdef": "typedef", + "description": " Description of one side of a delta.", + "comments": "

Although this is called a "file", it could represent a file, a symbolic\n link, a submodule commit id, or even a tree (although that only if you\n are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an\n absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta),\n then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working\n directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will\n be restricted to one of the git_filemode_t values.

\n", + "fields": [ + { + "type": "git_oid", + "name": "id", + "comments": "" + }, + { + "type": "const char *", + "name": "path", + "comments": "" + }, + { + "type": "git_off_t", + "name": "size", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": "" + }, + { + "type": "uint16_t", + "name": "mode", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_find_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "uint16_t rename_threshold", + "uint16_t rename_from_rewrite_threshold", + "uint16_t copy_threshold", + "uint16_t break_rewrite_threshold", + "size_t rename_limit", + "git_diff_similarity_metric * metric" + ], + "type": "struct", + "value": "git_diff_find_options", + "file": "diff.h", + "line": 658, + "lineto": 684, + "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", + "tdef": "typedef", + "description": " Control behavior of rename and copy detection", + "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n\n
    \n
  • rename_threshold is the same as the -M option with a value
  • \n
  • copy_threshold is the same as the -C option with a value
  • \n
  • rename_from_rewrite_threshold matches the top of the -B option
  • \n
  • break_rewrite_threshold matches the bottom of the -B option
  • \n
  • rename_limit is the maximum number of matches to consider for\na particular file. This is a little different from the -l option\nto regular Git because we will still process up to this many matches\nbefore abandoning the search.
  • \n
\n\n

The metric option allows you to plug in a custom similarity metric.\n Set it to NULL for the default internal metric which is based on sampling\n hashes of ranges of data in the file. The default metric is a pretty\n good similarity approximation that should work fairly well for both text\n and binary data, and is pretty fast with fixed memory overhead.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG).\n NOTE: if you don't explicitly set this, `diff.renames` could be set\n to false, resulting in `git_diff_find_similar` doing nothing." + }, + { + "type": "uint16_t", + "name": "rename_threshold", + "comments": " Similarity to consider a file renamed (default 50) " + }, + { + "type": "uint16_t", + "name": "rename_from_rewrite_threshold", + "comments": " Similarity of modified to be eligible rename source (default 50) " + }, + { + "type": "uint16_t", + "name": "copy_threshold", + "comments": " Similarity to consider a file a copy (default 50) " + }, + { + "type": "uint16_t", + "name": "break_rewrite_threshold", + "comments": " Similarity to split modify into delete/add pair (default 60) " + }, + { + "type": "size_t", + "name": "rename_limit", + "comments": " Maximum similarity sources to examine for a file (somewhat like\n git-diff's `-l` option or `diff.renameLimit` config) (default 200)" + }, + { + "type": "git_diff_similarity_metric *", + "name": "metric", + "comments": " Pluggable similarity metric; pass NULL to use internal metric " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_find_init_options", + "git_diff_find_similar" + ] + } + } + ], + [ + "git_diff_find_t", + { + "decl": [ + "GIT_DIFF_FIND_BY_CONFIG", + "GIT_DIFF_FIND_RENAMES", + "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "GIT_DIFF_FIND_COPIES", + "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "GIT_DIFF_FIND_REWRITES", + "GIT_DIFF_BREAK_REWRITES", + "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "GIT_DIFF_FIND_FOR_UNTRACKED", + "GIT_DIFF_FIND_ALL", + "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "GIT_DIFF_FIND_REMOVE_UNMODIFIED" + ], + "type": "enum", + "file": "diff.h", + "line": 552, + "lineto": 621, + "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", + "tdef": "typedef", + "description": " Flags to control the behavior of diff rename/copy detection.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FIND_BY_CONFIG", + "comments": "

Obey diff.renames. Overridden by any other GIT_DIFF_FIND_... flag.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_RENAMES", + "comments": "

Look for renames? (--find-renames)

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_RENAMES_FROM_REWRITES", + "comments": "

Consider old side of MODIFIED for renames? (--break-rewrites=N)

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_COPIES", + "comments": "

Look for copies? (a la --find-copies).

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED", + "comments": "

Consider UNMODIFIED as copy sources? (--find-copies-harder).

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNMODIFIED when\n the initial git_diff is being generated.

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_REWRITES", + "comments": "

Mark significant rewrites for split (--break-rewrites=/M)

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_DIFF_BREAK_REWRITES", + "comments": "

Actually split large rewrites into delete/add pairs

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_AND_BREAK_REWRITES", + "comments": "

Mark rewrites for split and break into delete/add pairs

\n", + "value": 48 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_FOR_UNTRACKED", + "comments": "

Find renames/copies for UNTRACKED items in working directory.

\n\n

For this to work correctly, use GIT_DIFF_INCLUDE_UNTRACKED when the\n initial git_diff is being generated (and obviously the diff must\n be against the working directory for this to make sense).

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_ALL", + "comments": "

Turn on all finding features.

\n", + "value": 255 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE", + "comments": "

Measure similarity ignoring leading whitespace (default)

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_IGNORE_WHITESPACE", + "comments": "

Measure similarity ignoring all whitespace

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE", + "comments": "

Measure similarity including all data

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_EXACT_MATCH_ONLY", + "comments": "

Measure similarity only by comparing SHAs (fast and cheap)

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY", + "comments": "

Do not break rewrites unless they contribute to a rename.

\n\n

Normally, GIT_DIFF_FIND_AND_BREAK_REWRITES will measure the self-\n similarity of modified files and split the ones that have changed a\n lot into a DELETE / ADD pair. Then the sides of that pair will be\n considered candidates for rename and copy detection.

\n\n

If you add this flag in and the split pair is not used for an\n actual rename or copy, then the modified record will be restored to\n a regular MODIFIED record instead of being split.

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_DIFF_FIND_REMOVE_UNMODIFIED", + "comments": "

Remove any UNMODIFIED deltas after find_similar is done.

\n\n

Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the\n --find-copies-harder behavior requires building a diff with the\n GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED\n records in the final result, pass this flag to have them removed.

\n", + "value": 65536 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_flag_t", + { + "decl": [ + "GIT_DIFF_FLAG_BINARY", + "GIT_DIFF_FLAG_NOT_BINARY", + "GIT_DIFF_FLAG_VALID_ID", + "GIT_DIFF_FLAG_EXISTS" + ], + "type": "enum", + "file": "diff.h", + "line": 225, + "lineto": 230, + "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS", + "tdef": "typedef", + "description": " Flags for the delta object and the file objects on each side.", + "comments": "

These flags are used for both the flags value of the git_diff_delta\n and the flags for the git_diff_file objects representing the old and\n new sides of the delta. Values outside of this public range should be\n considered reserved for internal or future use.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FLAG_BINARY", + "comments": "

file(s) treated as binary data

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_NOT_BINARY", + "comments": "

file(s) treated as text data

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_VALID_ID", + "comments": "

id value is known correct

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FLAG_EXISTS", + "comments": "

file exists at this side of the delta

\n", + "value": 8 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_format_email_flags_t", + { + "decl": [ + "GIT_DIFF_FORMAT_EMAIL_NONE", + "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER" + ], + "type": "enum", + "file": "diff.h", + "line": 1218, + "lineto": 1225, + "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", + "tdef": "typedef", + "description": " Formatting options for diff e-mail generation", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_NONE", + "comments": "

Normal patch, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", + "comments": "

Don't insert "[PATCH]" in the subject header

\n", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_commit_as_email" + ] + } + } + ], + [ + "git_diff_format_email_options", + { + "decl": [ + "unsigned int version", + "git_diff_format_email_flags_t flags", + "size_t patch_no", + "size_t total_patches", + "const git_oid * id", + "const char * summary", + "const git_signature * author" + ], + "type": "struct", + "value": "git_diff_format_email_options", + "file": "diff.h", + "line": 1230, + "lineto": 1249, + "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst git_signature * author", + "tdef": "typedef", + "description": " Options for controlling the formatting of the generated e-mail.", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_diff_format_email_flags_t", + "name": "flags", + "comments": "" + }, + { + "type": "size_t", + "name": "patch_no", + "comments": " This patch number " + }, + { + "type": "size_t", + "name": "total_patches", + "comments": " Total number of patches in this series " + }, + { + "type": "const git_oid *", + "name": "id", + "comments": " id to use for the commit " + }, + { + "type": "const char *", + "name": "summary", + "comments": " Summary of the change " + }, + { + "type": "const git_signature *", + "name": "author", + "comments": " Author of the change " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_format_email", + "git_diff_format_email_init_options" + ] + } + } + ], + [ + "git_diff_format_t", + { + "decl": [ + "GIT_DIFF_FORMAT_PATCH", + "GIT_DIFF_FORMAT_PATCH_HEADER", + "GIT_DIFF_FORMAT_RAW", + "GIT_DIFF_FORMAT_NAME_ONLY", + "GIT_DIFF_FORMAT_NAME_STATUS" + ], + "type": "enum", + "file": "diff.h", + "line": 981, + "lineto": 987, + "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS", + "tdef": "typedef", + "description": " Possible output formats for diff data", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH", + "comments": "

full git diff

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_PATCH_HEADER", + "comments": "

just the file headers of patch

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_RAW", + "comments": "

like git diff --raw

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_NAME_ONLY", + "comments": "

like git diff --name-only

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_FORMAT_NAME_STATUS", + "comments": "

like git diff --name-status

\n", + "value": 5 + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_print" + ] + } + } + ], + [ + "git_diff_hunk", + { + "decl": [ + "int old_start", + "int old_lines", + "int new_start", + "int new_lines", + "size_t header_len", + "char [128] header" + ], + "type": "struct", + "value": "git_diff_hunk", + "file": "diff.h", + "line": 478, + "lineto": 485, + "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", + "tdef": "typedef", + "description": " Structure describing a hunk of a diff.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "old_start", + "comments": " Starting line number in old_file " + }, + { + "type": "int", + "name": "old_lines", + "comments": " Number of lines in old_file " + }, + { + "type": "int", + "name": "new_start", + "comments": " Starting line number in new_file " + }, + { + "type": "int", + "name": "new_lines", + "comments": " Number of lines in new_file " + }, + { + "type": "size_t", + "name": "header_len", + "comments": " Number of bytes in header text " + }, + { + "type": "char [128]", + "name": "header", + "comments": " Header text, NUL-byte terminated " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle", + "git_patch_get_hunk" + ] + } + } + ], + [ + "git_diff_line", + { + "decl": [ + "char origin", + "int old_lineno", + "int new_lineno", + "int num_lines", + "size_t content_len", + "git_off_t content_offset", + "const char * content" + ], + "type": "struct", + "value": "git_diff_line", + "file": "diff.h", + "line": 525, + "lineto": 533, + "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", + "tdef": "typedef", + "description": " Structure describing a line (or data span) of a diff.", + "comments": "", + "fields": [ + { + "type": "char", + "name": "origin", + "comments": " A git_diff_line_t value " + }, + { + "type": "int", + "name": "old_lineno", + "comments": " Line number in old file or -1 for added line " + }, + { + "type": "int", + "name": "new_lineno", + "comments": " Line number in new file or -1 for deleted line " + }, + { + "type": "int", + "name": "num_lines", + "comments": " Number of newline characters in content " + }, + { + "type": "size_t", + "name": "content_len", + "comments": " Number of bytes of data " + }, + { + "type": "git_off_t", + "name": "content_offset", + "comments": " Offset in the original file to the content " + }, + { + "type": "const char *", + "name": "content", + "comments": " Pointer to diff text, not NUL-byte terminated " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle", + "git_patch_get_line_in_hunk" + ] + } + } + ], + [ + "git_diff_line_t", + { + "decl": [ + "GIT_DIFF_LINE_CONTEXT", + "GIT_DIFF_LINE_ADDITION", + "GIT_DIFF_LINE_DELETION", + "GIT_DIFF_LINE_CONTEXT_EOFNL", + "GIT_DIFF_LINE_ADD_EOFNL", + "GIT_DIFF_LINE_DEL_EOFNL", + "GIT_DIFF_LINE_FILE_HDR", + "GIT_DIFF_LINE_HUNK_HDR", + "GIT_DIFF_LINE_BINARY" + ], + "type": "enum", + "file": "diff.h", + "line": 504, + "lineto": 520, + "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\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", + "description": " Line origin constants.", + "comments": "

These values describe where a line came from and will be passed to\n the git_diff_line_cb when iterating over a diff. There are some\n special origin constants at the end that are used for the text\n output callbacks to demarcate lines that are actually part of\n the file or hunk headers.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_ADDITION", + "comments": "", + "value": 43 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_DELETION", + "comments": "", + "value": 45 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_CONTEXT_EOFNL", + "comments": "

Both files have no LF at end

\n", + "value": 61 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_ADD_EOFNL", + "comments": "

Old has no LF at end, new does

\n", + "value": 62 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_DEL_EOFNL", + "comments": "

Old has LF at end, new does not

\n", + "value": 60 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_FILE_HDR", + "comments": "", + "value": 70 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_HUNK_HDR", + "comments": "", + "value": 72 + }, + { + "type": "int", + "name": "GIT_DIFF_LINE_BINARY", + "comments": "

For "Binary files x and y differ"

\n", + "value": 66 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_option_t", + { + "decl": [ + "GIT_DIFF_NORMAL", + "GIT_DIFF_REVERSE", + "GIT_DIFF_INCLUDE_IGNORED", + "GIT_DIFF_RECURSE_IGNORED_DIRS", + "GIT_DIFF_INCLUDE_UNTRACKED", + "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "GIT_DIFF_INCLUDE_UNMODIFIED", + "GIT_DIFF_INCLUDE_TYPECHANGE", + "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "GIT_DIFF_IGNORE_FILEMODE", + "GIT_DIFF_IGNORE_SUBMODULES", + "GIT_DIFF_IGNORE_CASE", + "GIT_DIFF_INCLUDE_CASECHANGE", + "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "GIT_DIFF_SKIP_BINARY_CHECK", + "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "GIT_DIFF_UPDATE_INDEX", + "GIT_DIFF_INCLUDE_UNREADABLE", + "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "GIT_DIFF_FORCE_TEXT", + "GIT_DIFF_FORCE_BINARY", + "GIT_DIFF_IGNORE_WHITESPACE", + "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "GIT_DIFF_SHOW_UNMODIFIED", + "GIT_DIFF_PATIENCE", + "GIT_DIFF_MINIMAL", + "GIT_DIFF_SHOW_BINARY" + ], + "type": "enum", + "file": "diff.h", + "line": 72, + "lineto": 205, + "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", + "tdef": "typedef", + "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_NORMAL", + "comments": "

Normal diff, the default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_REVERSE", + "comments": "

Reverse the sides of the diff

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_IGNORED", + "comments": "

Include ignored files in the diff

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_RECURSE_IGNORED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_IGNORED, an entire ignored directory\n will be marked with only a single entry in the diff; this flag\n adds all files under the directory as IGNORED entries, too.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNTRACKED", + "comments": "

Include untracked files in the diff

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_DIFF_RECURSE_UNTRACKED_DIRS", + "comments": "

Even with GIT_DIFF_INCLUDE_UNTRACKED, an entire untracked\n directory will be marked with only a single entry in the diff\n (a la what core Git does in git status); this flag adds all\n files under untracked directories as UNTRACKED entries, too.

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNMODIFIED", + "comments": "

Include unmodified files in the diff

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_TYPECHANGE", + "comments": "

Normally, a type change between files will be converted into a\n DELETED record for the old and an ADDED record for the new; this\n options enabled the generation of TYPECHANGE delta records.

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_TYPECHANGE_TREES", + "comments": "

Even with GIT_DIFF_INCLUDE_TYPECHANGE, blob->tree changes still\n generally show as a DELETED blob. This flag tries to correctly\n label blob->tree transitions as TYPECHANGE records with new_file's\n mode set to tree. Note: the tree SHA will not be available.

\n", + "value": 128 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_FILEMODE", + "comments": "

Ignore file mode changes

\n", + "value": 256 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_SUBMODULES", + "comments": "

Treat all submodules as unmodified

\n", + "value": 512 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_CASE", + "comments": "

Use case insensitive filename comparisons

\n", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_CASECHANGE", + "comments": "

May be combined with GIT_DIFF_IGNORE_CASE to specify that a file\n that has changed case will be returned as an add/delete pair.

\n", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_DIFF_DISABLE_PATHSPEC_MATCH", + "comments": "

If the pathspec is set in the diff options, this flags means to\n apply it as an exact match instead of as an fnmatch pattern.

\n", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_DIFF_SKIP_BINARY_CHECK", + "comments": "

Disable updating of the binary flag in delta records. This is\n useful when iterating over a diff if you don't need hunk and data\n callbacks and want to avoid having to load file completely.

\n", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS", + "comments": "

When diff finds an untracked directory, to match the behavior of\n core Git, it scans the contents for IGNORED and UNTRACKED files.\n If all contents are IGNORED, then the directory is IGNORED; if\n any contents are not IGNORED, then the directory is UNTRACKED.\n This is extra work that may not matter in many cases. This flag\n turns off that scan and immediately labels an untracked directory\n as UNTRACKED (changing the behavior to not match core Git).

\n", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_DIFF_UPDATE_INDEX", + "comments": "

When diff finds a file in the working directory with stat\n information different from the index, but the OID ends up being the\n same, write the correct stat information into the index. Note:\n without this flag, diff will always leave the index untouched.

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNREADABLE", + "comments": "

Include unreadable files in the diff

\n", + "value": 65536 + }, + { + "type": "int", + "name": "GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "

Include unreadable files in the diff

\n", + "value": 131072 + }, + { + "type": "int", + "name": "GIT_DIFF_FORCE_TEXT", + "comments": "

Treat all files as text, disabling binary attributes \n&\n detection

\n", + "value": 1048576 + }, + { + "type": "int", + "name": "GIT_DIFF_FORCE_BINARY", + "comments": "

Treat all files as binary, disabling text diffs

\n", + "value": 2097152 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE", + "comments": "

Ignore all whitespace

\n", + "value": 4194304 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_CHANGE", + "comments": "

Ignore changes in amount of whitespace

\n", + "value": 8388608 + }, + { + "type": "int", + "name": "GIT_DIFF_IGNORE_WHITESPACE_EOL", + "comments": "

Ignore whitespace at end of line

\n", + "value": 16777216 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNTRACKED_CONTENT", + "comments": "

When generating patch text, include the content of untracked\n files. This automatically turns on GIT_DIFF_INCLUDE_UNTRACKED but\n it does not turn on GIT_DIFF_RECURSE_UNTRACKED_DIRS. Add that\n flag if you want the content of every single UNTRACKED file.

\n", + "value": 33554432 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_UNMODIFIED", + "comments": "

When generating output, include the names of unmodified files if\n they are included in the git_diff. Normally these are skipped in\n the formats that list files (e.g. name-only, name-status, raw).\n Even with this, these will not be included in patch format.

\n", + "value": 67108864 + }, + { + "type": "int", + "name": "GIT_DIFF_PATIENCE", + "comments": "

Use the "patience diff" algorithm

\n", + "value": 268435456 + }, + { + "type": "int", + "name": "GIT_DIFF_MINIMAL", + "comments": "

Take extra time to find minimal diff

\n", + "value": 536870912 + }, + { + "type": "int", + "name": "GIT_DIFF_SHOW_BINARY", + "comments": "

Include the necessary deflate / delta information so that git-apply\n can apply given diff information to binary files.

\n", + "value": 1073741824 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "git_submodule_ignore_t ignore_submodules", + "git_strarray pathspec", + "git_diff_notify_cb notify_cb", + "void * notify_payload", + "uint32_t context_lines", + "uint32_t interhunk_lines", + "uint16_t id_abbrev", + "git_off_t max_size", + "const char * old_prefix", + "const char * new_prefix" + ], + "type": "struct", + "value": "git_diff_options", + "file": "diff.h", + "line": 374, + "lineto": 393, + "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\nvoid * notify_payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", + "tdef": "typedef", + "description": " Structure describing options about how the diff should be executed.", + "comments": "

Setting all values of the structure to zero will yield the default\n values. Similarly, passing NULL for the options structure will\n give the defaults. The default values are marked below.

\n\n
    \n
  • flags is a combination of the git_diff_option_t values above
  • \n
  • context_lines is the number of unchanged lines that define the\nboundary of a hunk (and to display before and after)
  • \n
  • interhunk_lines is the maximum number of unchanged lines between\nhunk boundaries before the hunks will be merged into a one.
  • \n
  • old_prefix is the virtual "directory" to prefix to old file names\nin hunk headers (default "a")
  • \n
  • new_prefix is the virtual "directory" to prefix to new file names\nin hunk headers (default "b")
  • \n
  • pathspec is an array of paths / fnmatch patterns to constrain diff
  • \n
  • max_size is a file size (in bytes) above which a blob will be marked\nas binary automatically; pass a negative value to disable.
  • \n
  • notify_cb is an optional callback function, notifying the consumer of\nwhich files are being examined as the diff is generated
  • \n
  • notify_payload is the payload data to pass to the notify_cb function
  • \n
  • ignore_submodules overrides the submodule ignore setting for all\nsubmodules in the diff.
  • \n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": " version for the struct " + }, + { + "type": "uint32_t", + "name": "flags", + "comments": " defaults to GIT_DIFF_NORMAL " + }, + { + "type": "git_submodule_ignore_t", + "name": "ignore_submodules", + "comments": " submodule ignore rule " + }, + { + "type": "git_strarray", + "name": "pathspec", + "comments": " defaults to include all paths " + }, + { + "type": "git_diff_notify_cb", + "name": "notify_cb", + "comments": "" + }, + { + "type": "void *", + "name": "notify_payload", + "comments": "" + }, + { + "type": "uint32_t", + "name": "context_lines", + "comments": " defaults to 3 " + }, + { + "type": "uint32_t", + "name": "interhunk_lines", + "comments": " defaults to 0 " + }, + { + "type": "uint16_t", + "name": "id_abbrev", + "comments": " default 'core.abbrev' or 7 if unset " + }, + { + "type": "git_off_t", + "name": "max_size", + "comments": " defaults to 512MB " + }, + { + "type": "const char *", + "name": "old_prefix", + "comments": " defaults to \"a\" " + }, + { + "type": "const char *", + "name": "new_prefix", + "comments": " defaults to \"b\" " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_index_to_workdir", + "git_diff_init_options", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers" + ] + } + } + ], + [ + "git_diff_perfdata", + { + "decl": [ + "unsigned int version", + "size_t stat_calls", + "size_t oid_calculations" + ], + "type": "struct", + "value": "git_diff_perfdata", + "file": "sys/diff.h", + "line": 67, + "lineto": 71, + "block": "unsigned int version\nsize_t stat_calls\nsize_t oid_calculations", + "tdef": "typedef", + "description": " Performance data from diffing", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "size_t", + "name": "stat_calls", + "comments": " Number of stat() calls performed " + }, + { + "type": "size_t", + "name": "oid_calculations", + "comments": " Number of ID calculations " + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_get_perfdata", + "git_status_list_get_perfdata" + ] + } + } + ], + [ + "git_diff_similarity_metric", + { + "decl": [ + "int (*)(void **, const git_diff_file *, const char *, void *) file_signature", + "int (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature", + "void (*)(void *, void *) free_signature", + "int (*)(int *, void *, void *, void *) similarity", + "void * payload" + ], + "type": "struct", + "value": "git_diff_similarity_metric", + "file": "diff.h", + "line": 626, + "lineto": 636, + "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", + "tdef": "typedef", + "description": " Pluggable similarity metric", + "comments": "", + "fields": [ + { + "type": "int (*)(void **, const git_diff_file *, const char *, void *)", + "name": "file_signature", + "comments": "" + }, + { + "type": "int (*)(void **, const git_diff_file *, const char *, size_t, void *)", + "name": "buffer_signature", + "comments": "" + }, + { + "type": "void (*)(void *, void *)", + "name": "free_signature", + "comments": "" + }, + { + "type": "int (*)(int *, void *, void *, void *)", + "name": "similarity", + "comments": "" + }, + { + "type": "void *", + "name": "payload", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_diff_stats", + { + "decl": "git_diff_stats", + "type": "struct", + "value": "git_diff_stats", + "file": "diff.h", + "line": 1132, + "lineto": 1132, + "tdef": "typedef", + "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_diff_get_stats", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf" + ] + } + } + ], + [ + "git_diff_stats_format_t", + { + "decl": [ + "GIT_DIFF_STATS_NONE", + "GIT_DIFF_STATS_FULL", + "GIT_DIFF_STATS_SHORT", + "GIT_DIFF_STATS_NUMBER", + "GIT_DIFF_STATS_INCLUDE_SUMMARY" + ], + "type": "enum", + "file": "diff.h", + "line": 1137, + "lineto": 1152, + "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", + "tdef": "typedef", + "description": " Formatting options for diff stats", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_DIFF_STATS_NONE", + "comments": "

No stats

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_FULL", + "comments": "

Full statistics, equivalent of --stat

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_SHORT", + "comments": "

Short statistics, equivalent of --shortstat

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_NUMBER", + "comments": "

Number statistics, equivalent of --numstat

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_DIFF_STATS_INCLUDE_SUMMARY", + "comments": "

Extended header information such as creations, renames and mode changes, equivalent of --summary

\n", + "value": 8 + } + ], + "used": { + "returns": [], + "needs": [ + "git_diff_stats_to_buf" + ] + } + } + ], + [ + "git_direction", + { + "decl": [ + "GIT_DIRECTION_FETCH", + "GIT_DIRECTION_PUSH" + ], + "type": "enum", + "file": "net.h", + "line": 31, + "lineto": 34, + "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", + "tdef": "typedef", + "description": " Direction of the connection.", + "comments": "

We need this because we need to know whether we should call\n git-upload-pack or git-receive-pack on the remote end when get_refs\n gets called.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_DIRECTION_FETCH", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_DIRECTION_PUSH", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_connect" + ] + } + } + ], + [ + "git_error", + { + "decl": [ + "char * message", + "int klass" + ], + "type": "struct", + "value": "git_error", + "file": "errors.h", + "line": 63, + "lineto": 66, + "block": "char * message\nint klass", + "tdef": "typedef", + "description": " Structure to store extra details of the last error that occurred.", + "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the\n library was build, otherwise one is kept globally for the library

\n", + "fields": [ + { + "type": "char *", + "name": "message", + "comments": "" + }, + { + "type": "int", + "name": "klass", + "comments": "" + } + ], + "used": { + "returns": [ + "giterr_last" + ], + "needs": [ + "giterr_detach" + ] + } + } + ], + [ + "git_error_code", + { + "decl": [ + "GIT_OK", + "GIT_ERROR", + "GIT_ENOTFOUND", + "GIT_EEXISTS", + "GIT_EAMBIGUOUS", + "GIT_EBUFS", + "GIT_EUSER", + "GIT_EBAREREPO", + "GIT_EUNBORNBRANCH", + "GIT_EUNMERGED", + "GIT_ENONFASTFORWARD", + "GIT_EINVALIDSPEC", + "GIT_ECONFLICT", + "GIT_ELOCKED", + "GIT_EMODIFIED", + "GIT_EAUTH", + "GIT_ECERTIFICATE", + "GIT_EAPPLIED", + "GIT_EPEEL", + "GIT_EEOF", + "GIT_EINVALID", + "GIT_EUNCOMMITTED", + "GIT_EDIRECTORY", + "GIT_PASSTHROUGH", + "GIT_ITEROVER" + ], + "type": "enum", + "file": "errors.h", + "line": 21, + "lineto": 55, + "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_PASSTHROUGH\nGIT_ITEROVER", + "tdef": "typedef", + "description": " Generic return codes ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OK", + "comments": "

No error

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_ERROR", + "comments": "

Generic error

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_ENOTFOUND", + "comments": "

Requested object could not be found

\n", + "value": -3 + }, + { + "type": "int", + "name": "GIT_EEXISTS", + "comments": "

Object exists preventing operation

\n", + "value": -4 + }, + { + "type": "int", + "name": "GIT_EAMBIGUOUS", + "comments": "

More than one object matches

\n", + "value": -5 + }, + { + "type": "int", + "name": "GIT_EBUFS", + "comments": "

Output buffer too short to hold data

\n", + "value": -6 + }, + { + "type": "int", + "name": "GIT_EUSER", + "comments": "", + "value": -7 + }, + { + "type": "int", + "name": "GIT_EBAREREPO", + "comments": "

Operation not allowed on bare repository

\n", + "value": -8 + }, + { + "type": "int", + "name": "GIT_EUNBORNBRANCH", + "comments": "

HEAD refers to branch with no commits

\n", + "value": -9 + }, + { + "type": "int", + "name": "GIT_EUNMERGED", + "comments": "

Merge in progress prevented operation

\n", + "value": -10 + }, + { + "type": "int", + "name": "GIT_ENONFASTFORWARD", + "comments": "

Reference was not fast-forwardable

\n", + "value": -11 + }, + { + "type": "int", + "name": "GIT_EINVALIDSPEC", + "comments": "

Name/ref spec was not in a valid format

\n", + "value": -12 + }, + { + "type": "int", + "name": "GIT_ECONFLICT", + "comments": "

Checkout conflicts prevented operation

\n", + "value": -13 + }, + { + "type": "int", + "name": "GIT_ELOCKED", + "comments": "

Lock file prevented operation

\n", + "value": -14 + }, + { + "type": "int", + "name": "GIT_EMODIFIED", + "comments": "

Reference value does not match expected

\n", + "value": -15 + }, + { + "type": "int", + "name": "GIT_EAUTH", + "comments": "

Authentication error

\n", + "value": -16 + }, + { + "type": "int", + "name": "GIT_ECERTIFICATE", + "comments": "

Server certificate is invalid

\n", + "value": -17 + }, + { + "type": "int", + "name": "GIT_EAPPLIED", + "comments": "

Patch/merge has already been applied

\n", + "value": -18 + }, + { + "type": "int", + "name": "GIT_EPEEL", + "comments": "

The requested peel operation is not possible

\n", + "value": -19 + }, + { + "type": "int", + "name": "GIT_EEOF", + "comments": "

Unexpected EOF

\n", + "value": -20 + }, + { + "type": "int", + "name": "GIT_EINVALID", + "comments": "

Invalid operation or input

\n", + "value": -21 + }, + { + "type": "int", + "name": "GIT_EUNCOMMITTED", + "comments": "

Uncommitted changes in index prevented operation

\n", + "value": -22 + }, + { + "type": "int", + "name": "GIT_EDIRECTORY", + "comments": "

The operation is not valid for a directory

\n", + "value": -23 + }, + { + "type": "int", + "name": "GIT_PASSTHROUGH", + "comments": "

Internal only

\n", + "value": -30 + }, + { + "type": "int", + "name": "GIT_ITEROVER", + "comments": "

Signals end of iteration with iterator

\n", + "value": -31 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_error_t", + { + "decl": [ + "GITERR_NONE", + "GITERR_NOMEMORY", + "GITERR_OS", + "GITERR_INVALID", + "GITERR_REFERENCE", + "GITERR_ZLIB", + "GITERR_REPOSITORY", + "GITERR_CONFIG", + "GITERR_REGEX", + "GITERR_ODB", + "GITERR_INDEX", + "GITERR_OBJECT", + "GITERR_NET", + "GITERR_TAG", + "GITERR_TREE", + "GITERR_INDEXER", + "GITERR_SSL", + "GITERR_SUBMODULE", + "GITERR_THREAD", + "GITERR_STASH", + "GITERR_CHECKOUT", + "GITERR_FETCHHEAD", + "GITERR_MERGE", + "GITERR_SSH", + "GITERR_FILTER", + "GITERR_REVERT", + "GITERR_CALLBACK", + "GITERR_CHERRYPICK", + "GITERR_DESCRIBE", + "GITERR_REBASE", + "GITERR_FILESYSTEM" + ], + "type": "enum", + "file": "errors.h", + "line": 69, + "lineto": 101, + "block": "GITERR_NONE\nGITERR_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\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM", + "tdef": "typedef", + "description": " Error classes ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GITERR_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GITERR_NOMEMORY", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GITERR_OS", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GITERR_INVALID", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GITERR_REFERENCE", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GITERR_ZLIB", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GITERR_REPOSITORY", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GITERR_CONFIG", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GITERR_REGEX", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GITERR_ODB", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GITERR_INDEX", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GITERR_OBJECT", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GITERR_NET", + "comments": "", + "value": 12 + }, + { + "type": "int", + "name": "GITERR_TAG", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GITERR_TREE", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GITERR_INDEXER", + "comments": "", + "value": 15 + }, + { + "type": "int", + "name": "GITERR_SSL", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GITERR_SUBMODULE", + "comments": "", + "value": 17 + }, + { + "type": "int", + "name": "GITERR_THREAD", + "comments": "", + "value": 18 + }, + { + "type": "int", + "name": "GITERR_STASH", + "comments": "", + "value": 19 + }, + { + "type": "int", + "name": "GITERR_CHECKOUT", + "comments": "", + "value": 20 + }, + { + "type": "int", + "name": "GITERR_FETCHHEAD", + "comments": "", + "value": 21 + }, + { + "type": "int", + "name": "GITERR_MERGE", + "comments": "", + "value": 22 + }, + { + "type": "int", + "name": "GITERR_SSH", + "comments": "", + "value": 23 + }, + { + "type": "int", + "name": "GITERR_FILTER", + "comments": "", + "value": 24 + }, + { + "type": "int", + "name": "GITERR_REVERT", + "comments": "", + "value": 25 + }, + { + "type": "int", + "name": "GITERR_CALLBACK", + "comments": "", + "value": 26 + }, + { + "type": "int", + "name": "GITERR_CHERRYPICK", + "comments": "", + "value": 27 + }, + { + "type": "int", + "name": "GITERR_DESCRIBE", + "comments": "", + "value": 28 + }, + { + "type": "int", + "name": "GITERR_REBASE", + "comments": "", + "value": 29 + }, + { + "type": "int", + "name": "GITERR_FILESYSTEM", + "comments": "", + "value": 30 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_feature_t", + { + "decl": [ + "GIT_FEATURE_THREADS", + "GIT_FEATURE_HTTPS", + "GIT_FEATURE_SSH" + ], + "type": "enum", + "file": "common.h", + "line": 100, + "lineto": 104, + "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH", + "tdef": "typedef", + "description": " Combinations of these values describe the features with which libgit2\n was compiled", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FEATURE_THREADS", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FEATURE_HTTPS", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_FEATURE_SSH", + "comments": "", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_fetch_options", + { + "decl": [ + "int version", + "git_remote_callbacks callbacks", + "git_fetch_prune_t prune", + "int update_fetchhead", + "git_remote_autotag_option_t download_tags" + ], + "type": "struct", + "value": "git_fetch_options", + "file": "remote.h", + "line": 522, + "lineto": 549, + "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags", + "tdef": "typedef", + "description": " Fetch options structure.", + "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", + "fields": [ + { + "type": "int", + "name": "version", + "comments": "" + }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this fetch operation" + }, + { + "type": "git_fetch_prune_t", + "name": "prune", + "comments": " Whether to perform a prune after the fetch" + }, + { + "type": "int", + "name": "update_fetchhead", + "comments": " Whether to write the results to FETCH_HEAD. Defaults to\n on. Leave this default in order to behave like git." + }, + { + "type": "git_remote_autotag_option_t", + "name": "download_tags", + "comments": " Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags." + } + ], + "used": { + "returns": [], + "needs": [ + "git_fetch_init_options", + "git_remote_download", + "git_remote_fetch" + ] + } + } + ], + [ + "git_filemode_t", + { + "decl": [ + "GIT_FILEMODE_UNREADABLE", + "GIT_FILEMODE_TREE", + "GIT_FILEMODE_BLOB", + "GIT_FILEMODE_BLOB_EXECUTABLE", + "GIT_FILEMODE_LINK", + "GIT_FILEMODE_COMMIT" + ], + "type": "enum", + "file": "types.h", + "line": 205, + "lineto": 212, + "block": "GIT_FILEMODE_UNREADABLE\nGIT_FILEMODE_TREE\nGIT_FILEMODE_BLOB\nGIT_FILEMODE_BLOB_EXECUTABLE\nGIT_FILEMODE_LINK\nGIT_FILEMODE_COMMIT", + "tdef": "typedef", + "description": " Valid modes for index and tree entries. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILEMODE_UNREADABLE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILEMODE_TREE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_FILEMODE_BLOB", + "comments": "", + "value": 33188 + }, + { + "type": "int", + "name": "GIT_FILEMODE_BLOB_EXECUTABLE", + "comments": "", + "value": 33261 + }, + { + "type": "int", + "name": "GIT_FILEMODE_LINK", + "comments": "", + "value": 40960 + }, + { + "type": "int", + "name": "GIT_FILEMODE_COMMIT", + "comments": "", + "value": 57344 + } + ], + "used": { + "returns": [], + "needs": [ + "git_treebuilder_insert" + ] + } + } + ], + [ + "git_filter", + { + "decl": [ + "unsigned int version", + "const char * attributes", + "git_filter_init_fn initialize", + "git_filter_shutdown_fn shutdown", + "git_filter_check_fn check", + "git_filter_apply_fn apply", + "git_filter_stream_fn stream", + "git_filter_cleanup_fn cleanup" + ], + "type": "struct", + "value": "git_filter", + "file": "sys/filter.h", + "line": 248, + "lineto": 259, + "tdef": null, + "description": " Filter structure used to register custom filters.", + "comments": "

To associate extra data with a filter, allocate extra data and put the\n git_filter struct at the start of your data buffer, then cast the\n self pointer to your larger structure when your callback is invoked.

\n\n

version should be set to GIT_FILTER_VERSION

\n\n

attributes is a whitespace-separated list of attribute names to check\n for this filter (e.g. "eol crlf text"). If the attribute name is bare,\n it will be simply loaded and passed to the check callback. If it has\n a value (i.e. "name=value"), the attribute must match that value for\n the filter to be applied.

\n\n

The initialize, shutdown, check, apply, and cleanup callbacks\n are all documented above with the respective function pointer typedefs.

\n", + "block": "unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_stream_fn stream\ngit_filter_cleanup_fn cleanup", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "const char *", + "name": "attributes", + "comments": "" + }, + { + "type": "git_filter_init_fn", + "name": "initialize", + "comments": "" + }, + { + "type": "git_filter_shutdown_fn", + "name": "shutdown", + "comments": "" + }, + { + "type": "git_filter_check_fn", + "name": "check", + "comments": "" + }, + { + "type": "git_filter_apply_fn", + "name": "apply", + "comments": "" + }, + { + "type": "git_filter_stream_fn", + "name": "stream", + "comments": "" + }, + { + "type": "git_filter_cleanup_fn", + "name": "cleanup", + "comments": "" + } + ], + "used": { + "returns": [ + "git_filter_lookup" + ], + "needs": [ + "git_filter_list_push", + "git_filter_register" + ] + } + } + ], + [ + "git_filter_flag_t", + { + "decl": [ + "GIT_FILTER_DEFAULT", + "GIT_FILTER_ALLOW_UNSAFE" + ], + "type": "enum", + "file": "filter.h", + "line": 41, + "lineto": 44, + "block": "GIT_FILTER_DEFAULT\nGIT_FILTER_ALLOW_UNSAFE", + "tdef": "typedef", + "description": " Filter option flags.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILTER_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_ALLOW_UNSAFE", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_filter_list", + { + "decl": "git_filter_list", + "type": "struct", + "value": "git_filter_list", + "file": "filter.h", + "line": 73, + "lineto": 73, + "tdef": "typedef", + "description": " List of filters to be applied", + "comments": "

This represents a list of filters to be applied to a file / blob. You\n can build the list with one call, apply it with another, and dispose it\n with a third. In typical usage, there are not many occasions where a\n git_filter_list is needed directly since the library will generally\n handle conversions for you, but it can be convenient to be able to\n build and apply the list sometimes.

\n", + "used": { + "returns": [], + "needs": [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_length", + "git_filter_list_load", + "git_filter_list_new", + "git_filter_list_push", + "git_filter_list_stream_blob", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ], + [ + "git_filter_mode_t", + { + "decl": [ + "GIT_FILTER_TO_WORKTREE", + "GIT_FILTER_SMUDGE", + "GIT_FILTER_TO_ODB", + "GIT_FILTER_CLEAN" + ], + "type": "enum", + "file": "filter.h", + "line": 31, + "lineto": 36, + "block": "GIT_FILTER_TO_WORKTREE\nGIT_FILTER_SMUDGE\nGIT_FILTER_TO_ODB\nGIT_FILTER_CLEAN", + "tdef": "typedef", + "description": " Filters are applied in one of two directions: smudging - which is\n exporting a file from the Git object database to the working directory,\n and cleaning - which is importing a file from the working directory to\n the Git object database. These values control which direction of\n change is being applied.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_FILTER_TO_WORKTREE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_SMUDGE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_FILTER_TO_ODB", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_FILTER_CLEAN", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_filter_list_load", + "git_filter_list_new" + ] + } + } + ], + [ + "git_filter_source", + { + "decl": "git_filter_source", + "type": "struct", + "value": "git_filter_source", + "file": "sys/filter.h", + "line": 95, + "lineto": 95, + "tdef": "typedef", + "description": " A filter source represents a file/blob to be processed", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_filter_source_filemode", + "git_filter_source_flags", + "git_filter_source_id", + "git_filter_source_mode", + "git_filter_source_path", + "git_filter_source_repo" + ] + } + } + ], + [ + "git_hashsig", + { + "decl": "git_hashsig", + "type": "struct", + "value": "git_hashsig", + "file": "sys/hashsig.h", + "line": 17, + "lineto": 17, + "tdef": "typedef", + "description": " Similarity signature of arbitrary text content based on line hashes", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_hashsig_compare", + "git_hashsig_create", + "git_hashsig_create_fromfile", + "git_hashsig_free" + ] + } + } + ], + [ + "git_hashsig_option_t", + { + "decl": [ + "GIT_HASHSIG_NORMAL", + "GIT_HASHSIG_IGNORE_WHITESPACE", + "GIT_HASHSIG_SMART_WHITESPACE", + "GIT_HASHSIG_ALLOW_SMALL_FILES" + ], + "type": "enum", + "file": "sys/hashsig.h", + "line": 25, + "lineto": 45, + "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", + "tdef": "typedef", + "description": " Options for hashsig computation", + "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE,\n GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_HASHSIG_NORMAL", + "comments": "

Use all data

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_HASHSIG_IGNORE_WHITESPACE", + "comments": "

Ignore whitespace

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_HASHSIG_SMART_WHITESPACE", + "comments": "

Ignore

\n\n

and all space after

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_HASHSIG_ALLOW_SMALL_FILES", + "comments": "

Allow hashing of small files

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [ + "git_hashsig_create", + "git_hashsig_create_fromfile" + ] + } + } + ], + [ + "git_idxentry_extended_flag_t", + { + "decl": [ + "GIT_IDXENTRY_INTENT_TO_ADD", + "GIT_IDXENTRY_SKIP_WORKTREE", + "GIT_IDXENTRY_EXTENDED2", + "GIT_IDXENTRY_EXTENDED_FLAGS", + "GIT_IDXENTRY_UPDATE", + "GIT_IDXENTRY_REMOVE", + "GIT_IDXENTRY_UPTODATE", + "GIT_IDXENTRY_ADDED", + "GIT_IDXENTRY_HASHED", + "GIT_IDXENTRY_UNHASHED", + "GIT_IDXENTRY_WT_REMOVE", + "GIT_IDXENTRY_CONFLICTED", + "GIT_IDXENTRY_UNPACKED", + "GIT_IDXENTRY_NEW_SKIP_WORKTREE" + ], + "type": "enum", + "file": "index.h", + "line": 115, + "lineto": 135, + "block": "GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE", + "tdef": "typedef", + "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", + "comments": "

In memory, the flags_extended fields are divided into two parts: the\n fields that are read from and written to disk, and other fields that\n in-memory only and used by libgit2. Only the flags in\n GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the\n git_index_entry flags_extended value that belong on disk. You\n can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry\n flags_extended value that are only used in-memory by libgit2.\n You can use them to interpret the data in the flags_extended.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_IDXENTRY_INTENT_TO_ADD", + "comments": "", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_SKIP_WORKTREE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_EXTENDED2", + "comments": "

Reserved for future extension

\n", + "value": 32768 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_EXTENDED_FLAGS", + "comments": "

Reserved for future extension

\n", + "value": 24576 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_UPDATE", + "comments": "

Reserved for future extension

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_REMOVE", + "comments": "

Reserved for future extension

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_UPTODATE", + "comments": "

Reserved for future extension

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_ADDED", + "comments": "

Reserved for future extension

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_HASHED", + "comments": "

Reserved for future extension

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_UNHASHED", + "comments": "

Reserved for future extension

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_WT_REMOVE", + "comments": "

remove in work directory

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_CONFLICTED", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_UNPACKED", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_NEW_SKIP_WORKTREE", + "comments": "", + "value": 512 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_index", + { + "decl": "git_index", + "type": "struct", + "value": "git_index", + "file": "types.h", + "line": 132, + "lineto": 132, + "tdef": "typedef", + "description": " Memory representation of an index file. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_checkout_index", + "git_cherrypick_commit", + "git_diff_index_to_workdir", + "git_diff_tree_to_index", + "git_index_add", + "git_index_add_all", + "git_index_add_bypath", + "git_index_add_frombuffer", + "git_index_caps", + "git_index_checksum", + "git_index_clear", + "git_index_conflict_add", + "git_index_conflict_cleanup", + "git_index_conflict_get", + "git_index_conflict_iterator_new", + "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_path", + "git_index_read", + "git_index_read_tree", + "git_index_remove", + "git_index_remove_all", + "git_index_remove_bypath", + "git_index_remove_directory", + "git_index_set_caps", + "git_index_update_all", + "git_index_write", + "git_index_write_tree", + "git_index_write_tree_to", + "git_merge_commits", + "git_merge_trees", + "git_pathspec_match_index", + "git_repository_index", + "git_repository_set_index", + "git_revert_commit" + ] + } + } + ], + [ + "git_index_add_option_t", + { + "decl": [ + "GIT_INDEX_ADD_DEFAULT", + "GIT_INDEX_ADD_FORCE", + "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "GIT_INDEX_ADD_CHECK_PATHSPEC" + ], + "type": "enum", + "file": "index.h", + "line": 150, + "lineto": 155, + "block": "GIT_INDEX_ADD_DEFAULT\nGIT_INDEX_ADD_FORCE\nGIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH\nGIT_INDEX_ADD_CHECK_PATHSPEC", + "tdef": "typedef", + "description": " Flags for APIs that add files matching pathspec ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEX_ADD_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_FORCE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEX_ADD_CHECK_PATHSPEC", + "comments": "", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_index_conflict_iterator", + { + "decl": "git_index_conflict_iterator", + "type": "struct", + "value": "git_index_conflict_iterator", + "file": "types.h", + "line": 135, + "lineto": 135, + "tdef": "typedef", + "description": " An iterator for conflicts in the index. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next" + ] + } + } + ], + [ + "git_index_entry", + { + "decl": [ + "git_index_time ctime", + "git_index_time mtime", + "uint32_t dev", + "uint32_t ino", + "uint32_t mode", + "uint32_t uid", + "uint32_t gid", + "uint32_t file_size", + "git_oid id", + "uint16_t flags", + "uint16_t flags_extended", + "const char * path" + ], + "type": "struct", + "value": "git_index_entry", + "file": "index.h", + "line": 53, + "lineto": 70, + "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", + "tdef": "typedef", + "description": " In-memory representation of a file entry in the index.", + "comments": "

This is a public structure that represents a file entry in the index.\n The meaning of the fields corresponds to core Git's documentation (in\n "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be\n accessed via the first set of GIT_IDXENTRY_... bitmasks below. These\n flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be\n accessed via the later GIT_IDXENTRY_... bitmasks below. Some of\n these flags are read from and written to disk, but some are set aside\n for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This\n is enough to detect changes, which is enough for the index to\n function as a cache, but it should not be taken as an authoritative\n source for that data.

\n", + "fields": [ + { + "type": "git_index_time", + "name": "ctime", + "comments": "" + }, + { + "type": "git_index_time", + "name": "mtime", + "comments": "" + }, + { + "type": "uint32_t", + "name": "dev", + "comments": "" + }, + { + "type": "uint32_t", + "name": "ino", + "comments": "" + }, + { + "type": "uint32_t", + "name": "mode", + "comments": "" + }, + { + "type": "uint32_t", + "name": "uid", + "comments": "" + }, + { + "type": "uint32_t", + "name": "gid", + "comments": "" + }, + { + "type": "uint32_t", + "name": "file_size", + "comments": "" + }, + { + "type": "git_oid", + "name": "id", + "comments": "" + }, + { + "type": "uint16_t", + "name": "flags", + "comments": "" + }, + { + "type": "uint16_t", + "name": "flags_extended", + "comments": "" + }, + { + "type": "const char *", + "name": "path", + "comments": "" + } + ], + "used": { + "returns": [ + "git_index_get_byindex", + "git_index_get_bypath" + ], + "needs": [ + "git_index_add", + "git_index_add_frombuffer", + "git_index_conflict_add", + "git_index_conflict_get", + "git_index_conflict_next", + "git_index_entry_is_conflict", + "git_index_entry_stage", + "git_merge_file_from_index" + ] + } + } + ], + [ + "git_index_time", + { + "decl": [ + "int32_t seconds", + "uint32_t nanoseconds" + ], + "type": "struct", + "value": "git_index_time", + "file": "index.h", + "line": 26, + "lineto": 30, + "block": "int32_t seconds\nuint32_t nanoseconds", + "tdef": "typedef", + "description": " Time structure used in a git index entry ", + "comments": "", + "fields": [ + { + "type": "int32_t", + "name": "seconds", + "comments": "" + }, + { + "type": "uint32_t", + "name": "nanoseconds", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_indexcap_t", + { + "decl": [ + "GIT_INDEXCAP_IGNORE_CASE", + "GIT_INDEXCAP_NO_FILEMODE", + "GIT_INDEXCAP_NO_SYMLINKS", + "GIT_INDEXCAP_FROM_OWNER" + ], + "type": "enum", + "file": "index.h", + "line": 138, + "lineto": 143, + "block": "GIT_INDEXCAP_IGNORE_CASE\nGIT_INDEXCAP_NO_FILEMODE\nGIT_INDEXCAP_NO_SYMLINKS\nGIT_INDEXCAP_FROM_OWNER", + "tdef": "typedef", + "description": " Capabilities of system that affect index actions. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_INDEXCAP_IGNORE_CASE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_INDEXCAP_NO_FILEMODE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_INDEXCAP_NO_SYMLINKS", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_INDEXCAP_FROM_OWNER", + "comments": "", + "value": -1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_indxentry_flag_t", + { + "decl": [ + "GIT_IDXENTRY_EXTENDED", + "GIT_IDXENTRY_VALID" + ], + "type": "enum", + "file": "index.h", + "line": 86, + "lineto": 89, + "block": "GIT_IDXENTRY_EXTENDED\nGIT_IDXENTRY_VALID", + "tdef": "typedef", + "description": " Flags for index entries", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_IDXENTRY_EXTENDED", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_IDXENTRY_VALID", + "comments": "", + "value": 32768 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_libgit2_opt_t", + { + "decl": [ + "GIT_OPT_GET_MWINDOW_SIZE", + "GIT_OPT_SET_MWINDOW_SIZE", + "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "GIT_OPT_GET_SEARCH_PATH", + "GIT_OPT_SET_SEARCH_PATH", + "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "GIT_OPT_SET_CACHE_MAX_SIZE", + "GIT_OPT_ENABLE_CACHING", + "GIT_OPT_GET_CACHED_MEMORY", + "GIT_OPT_GET_TEMPLATE_PATH", + "GIT_OPT_SET_TEMPLATE_PATH", + "GIT_OPT_SET_SSL_CERT_LOCATIONS" + ], + "type": "enum", + "file": "common.h", + "line": 132, + "lineto": 146, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS", + "tdef": "typedef", + "description": " Global library options", + "comments": "

These are used to select which global option to set or get and are\n used in git_libgit2_opts().

\n", + "fields": [ + { + "type": "int", + "name": "GIT_OPT_GET_MWINDOW_SIZE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_OPT_SET_MWINDOW_SIZE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OPT_GET_MWINDOW_MAPPED_LIMIT", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OPT_SET_MWINDOW_MAPPED_LIMIT", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OPT_GET_SEARCH_PATH", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SEARCH_PATH", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_OPT_SET_CACHE_OBJECT_LIMIT", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OPT_SET_CACHE_MAX_SIZE", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_CACHING", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_OPT_GET_CACHED_MEMORY", + "comments": "", + "value": 9 + }, + { + "type": "int", + "name": "GIT_OPT_GET_TEMPLATE_PATH", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_OPT_SET_TEMPLATE_PATH", + "comments": "", + "value": 11 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "comments": "", + "value": 12 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_merge_analysis_t", + { + "decl": [ + "GIT_MERGE_ANALYSIS_NONE", + "GIT_MERGE_ANALYSIS_NORMAL", + "GIT_MERGE_ANALYSIS_UP_TO_DATE", + "GIT_MERGE_ANALYSIS_FASTFORWARD", + "GIT_MERGE_ANALYSIS_UNBORN" + ], + "type": "enum", + "file": "merge.h", + "line": 272, + "lineto": 301, + "block": "GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN", + "tdef": "typedef", + "description": " The results of `git_merge_analysis` indicate the merge opportunities.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_NONE", + "comments": "

No merge is possible. (Unused.)

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_NORMAL", + "comments": "

A "normal" merge; both HEAD and the given merge input have diverged\n from their common ancestor. The divergent commits must be merged.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_UP_TO_DATE", + "comments": "

All given merge inputs are reachable from HEAD, meaning the\n repository is up-to-date and no merge needs to be performed.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_FASTFORWARD", + "comments": "

The given merge input is a fast-forward from HEAD and no merge\n needs to be performed. Instead, the client can check out the\n given merge input.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_ANALYSIS_UNBORN", + "comments": "

The HEAD of the current repository is "unborn" and does not point to\n a valid commit. No merge can be performed, but the caller may wish\n to simply set HEAD to the target commit(s).

\n", + "value": 8 + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_analysis" + ] + } + } + ], + [ + "git_merge_file_favor_t", + { + "decl": [ + "GIT_MERGE_FILE_FAVOR_NORMAL", + "GIT_MERGE_FILE_FAVOR_OURS", + "GIT_MERGE_FILE_FAVOR_THEIRS", + "GIT_MERGE_FILE_FAVOR_UNION" + ], + "type": "enum", + "file": "merge.h", + "line": 81, + "lineto": 111, + "block": "GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION", + "tdef": "typedef", + "description": " Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_NORMAL", + "comments": "

When a region of a file is changed in both branches, a conflict\n will be recorded in the index so that git_checkout can produce\n a merge file with conflict markers in the working directory.\n This is the default.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_OURS", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain the "ours" side of any conflicting\n region. The index will not record a conflict.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_THEIRS", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain the "theirs" side of any conflicting\n region. The index will not record a conflict.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_FAVOR_UNION", + "comments": "

When a region of a file is changed in both branches, the file\n created in the index will contain each unique line from each side,\n which has the result of combining both files. The index will not\n record a conflict.

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_merge_file_flags_t", + { + "decl": [ + "GIT_MERGE_FILE_DEFAULT", + "GIT_MERGE_FILE_STYLE_MERGE", + "GIT_MERGE_FILE_STYLE_DIFF3", + "GIT_MERGE_FILE_SIMPLIFY_ALNUM", + "GIT_MERGE_FILE_IGNORE_WHITESPACE", + "GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE", + "GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL", + "GIT_MERGE_FILE_DIFF_PATIENCE", + "GIT_MERGE_FILE_DIFF_MINIMAL" + ], + "type": "enum", + "file": "merge.h", + "line": 116, + "lineto": 143, + "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL", + "tdef": "typedef", + "description": " File merging flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FILE_DEFAULT", + "comments": "

Defaults

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_MERGE", + "comments": "

Create standard conflicted merge files

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_STYLE_DIFF3", + "comments": "

Create diff3-style files

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_SIMPLIFY_ALNUM", + "comments": "

Condense non-alphanumeric regions for simplified diff file

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE", + "comments": "

Ignore all whitespace

\n", + "value": 8 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE", + "comments": "

Ignore changes in amount of whitespace

\n", + "value": 16 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL", + "comments": "

Ignore whitespace at end of line

\n", + "value": 32 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_DIFF_PATIENCE", + "comments": "

Use the "patience diff" algorithm

\n", + "value": 64 + }, + { + "type": "int", + "name": "GIT_MERGE_FILE_DIFF_MINIMAL", + "comments": "

Take extra time to find minimal diff

\n", + "value": 128 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_merge_file_input", + { + "decl": [ + "unsigned int version", + "const char * ptr", + "size_t size", + "const char * path", + "unsigned int mode" + ], + "type": "struct", + "value": "git_merge_file_input", + "file": "merge.h", + "line": 32, + "lineto": 46, + "block": "unsigned int version\nconst char * ptr\nsize_t size\nconst char * path\nunsigned int mode", + "tdef": "typedef", + "description": " The file inputs to `git_merge_file`. Callers should populate the\n `git_merge_file_input` structure with descriptions of the files in\n each side of the conflict for use in producing the merge file.", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "const char *", + "name": "ptr", + "comments": " Pointer to the contents of the file. " + }, + { + "type": "size_t", + "name": "size", + "comments": " Size of the contents pointed to in `ptr`. " + }, + { + "type": "const char *", + "name": "path", + "comments": " File name of the conflicted file, or `NULL` to not merge the path. " + }, + { + "type": "unsigned int", + "name": "mode", + "comments": " File mode of the conflicted file, or `0` to not merge the mode. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_file", + "git_merge_file_init_input" + ] + } + } + ], + [ + "git_merge_file_options", + { + "decl": [ + "unsigned int version", + "const char * ancestor_label", + "const char * our_label", + "const char * their_label", + "git_merge_file_favor_t favor", + "unsigned int flags" + ], + "type": "struct", + "value": "git_merge_file_options", + "file": "merge.h", + "line": 148, + "lineto": 174, + "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\nunsigned int flags", + "tdef": "typedef", + "description": " Options for merging a file", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "const char *", + "name": "ancestor_label", + "comments": " Label for the ancestor file side of the conflict which will be prepended\n to labels in diff3-format merge files." + }, + { + "type": "const char *", + "name": "our_label", + "comments": " Label for our file side of the conflict which will be prepended\n to labels in merge files." + }, + { + "type": "const char *", + "name": "their_label", + "comments": " Label for their file side of the conflict which will be prepended\n to labels in merge files." + }, + { + "type": "git_merge_file_favor_t", + "name": "favor", + "comments": " The file to favor in region conflicts. " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " see `git_merge_file_flags_t` above " + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_init_options" + ] + } + } + ], + [ + "git_merge_file_result", + { + "decl": [ + "unsigned int automergeable", + "const char * path", + "unsigned int mode", + "const char * ptr", + "size_t len" + ], + "type": "struct", + "value": "git_merge_file_result", + "file": "merge.h", + "line": 195, + "lineto": 216, + "block": "unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len", + "tdef": "typedef", + "description": " Information about file-level merging", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "automergeable", + "comments": " True if the output was automerged, false if the output contains\n conflict markers." + }, + { + "type": "const char *", + "name": "path", + "comments": " The path that the resultant merge file should use, or NULL if a\n filename conflict would occur." + }, + { + "type": "unsigned int", + "name": "mode", + "comments": " The mode that the resultant merge file should use. " + }, + { + "type": "const char *", + "name": "ptr", + "comments": " The contents of the merge. " + }, + { + "type": "size_t", + "name": "len", + "comments": " The length of the merge contents. " + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_result_free" + ] + } + } + ], + [ + "git_merge_options", + { + "decl": [ + "unsigned int version", + "git_merge_tree_flag_t tree_flags", + "unsigned int rename_threshold", + "unsigned int target_limit", + "git_diff_similarity_metric * metric", + "git_merge_file_favor_t file_favor", + "unsigned int file_flags" + ], + "type": "struct", + "value": "git_merge_options", + "file": "merge.h", + "line": 221, + "lineto": 251, + "block": "unsigned int version\ngit_merge_tree_flag_t tree_flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\ngit_merge_file_favor_t file_favor\nunsigned int file_flags", + "tdef": "typedef", + "description": " Merging options", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_merge_tree_flag_t", + "name": "tree_flags", + "comments": "" + }, + { + "type": "unsigned int", + "name": "rename_threshold", + "comments": " Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename." + }, + { + "type": "unsigned int", + "name": "target_limit", + "comments": " Maximum similarity sources to examine for renames (default 200).\n If the number of rename candidates (add / delete pairs) is greater\n than this value, inexact rename detection is aborted.\n\n This setting overrides the `merge.renameLimit` configuration value." + }, + { + "type": "git_diff_similarity_metric *", + "name": "metric", + "comments": " Pluggable similarity metric; pass NULL to use internal metric " + }, + { + "type": "git_merge_file_favor_t", + "name": "file_favor", + "comments": " Flags for handling conflicting content. " + }, + { + "type": "unsigned int", + "name": "file_flags", + "comments": " see `git_merge_file_flags_t` above " + } + ], + "used": { + "returns": [], + "needs": [ + "git_cherrypick_commit", + "git_merge", + "git_merge_commits", + "git_merge_init_options", + "git_merge_trees", + "git_revert_commit" + ] + } + } + ], + [ + "git_merge_preference_t", + { + "decl": [ + "GIT_MERGE_PREFERENCE_NONE", + "GIT_MERGE_PREFERENCE_NO_FASTFORWARD", + "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY" + ], + "type": "enum", + "file": "merge.h", + "line": 306, + "lineto": 324, + "block": "GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", + "tdef": "typedef", + "description": " The user's stated preference for merges.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_NONE", + "comments": "

No configuration was found that suggests a preferred behavior for\n merge.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_NO_FASTFORWARD", + "comments": "

There is a merge.ff=false configuration setting, suggesting that\n the user does not want to allow a fast-forward merge.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", + "comments": "

There is a merge.ff=only configuration setting, suggesting that\n the user only wants fast-forward merges.

\n", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_analysis" + ] + } + } + ], + [ + "git_merge_result", + { + "decl": "git_merge_result", + "type": "struct", + "value": "git_merge_result", + "file": "types.h", + "line": 181, + "lineto": 181, + "tdef": "typedef", + "description": " Merge result ", + "comments": "", + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_merge_tree_flag_t", + { + "decl": [ + "GIT_MERGE_TREE_FIND_RENAMES" + ], + "type": "enum", + "file": "merge.h", + "line": 68, + "lineto": 75, + "block": "GIT_MERGE_TREE_FIND_RENAMES", + "tdef": "typedef", + "description": " Flags for `git_merge_tree` options. A combination of these flags can be\n passed in via the `tree_flags` value in the `git_merge_options`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_TREE_FIND_RENAMES", + "comments": "

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_note", + { + "decl": "git_note", + "type": "struct", + "value": "git_note", + "file": "types.h", + "line": 150, + "lineto": 150, + "tdef": "typedef", + "description": " Representation of a git note ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_note_author", + "git_note_committer", + "git_note_free", + "git_note_id", + "git_note_message", + "git_note_read" + ] + } + } + ], + [ + "git_note_iterator", + { + "decl": "git_note_iterator", + "type": "struct", + "value": "git_note_iterator", + "file": "notes.h", + "line": 35, + "lineto": 35, + "tdef": "typedef", + "description": " note iterator", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_note_iterator_free", + "git_note_iterator_new", + "git_note_next" + ] + } + } + ], + [ + "git_object", + { + "decl": "git_object", + "type": "struct", + "value": "git_object", + "file": "types.h", + "line": 108, + "lineto": 108, + "tdef": "typedef", + "description": " Representation of a generic object in a repository ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_checkout_tree", + "git_describe_commit", + "git_object_dup", + "git_object_free", + "git_object_id", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_owner", + "git_object_peel", + "git_object_short_id", + "git_object_type", + "git_reference_peel", + "git_reset", + "git_reset_default", + "git_revparse_ext", + "git_revparse_single", + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_lightweight", + "git_tag_peel", + "git_tag_target", + "git_tree_entry_to_object" + ] + } + } + ], + [ + "git_odb", + { + "decl": "git_odb", + "type": "struct", + "value": "git_odb", + "file": "types.h", + "line": 81, + "lineto": 81, + "tdef": "typedef", + "description": " An open object database handle. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_indexer_new", + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_add_disk_alternate", + "git_odb_exists", + "git_odb_exists_prefix", + "git_odb_foreach", + "git_odb_free", + "git_odb_get_backend", + "git_odb_new", + "git_odb_num_backends", + "git_odb_open", + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_read", + "git_odb_read_header", + "git_odb_read_prefix", + "git_odb_refresh", + "git_odb_write", + "git_odb_write_pack", + "git_repository_odb", + "git_repository_set_odb", + "git_repository_wrap_odb" + ] + } + } + ], + [ + "git_odb_backend", + { + "decl": "git_odb_backend", + "type": "struct", + "value": "git_odb_backend", + "file": "types.h", + "line": 84, + "lineto": 84, + "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free", + "tdef": "typedef", + "description": " A custom backend in an ODB ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_odb *", + "name": "odb", + "comments": "" + }, + { + "type": "int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", + "name": "read", + "comments": "" + }, + { + "type": "int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)", + "name": "read_prefix", + "comments": "" + }, + { + "type": "int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)", + "name": "read_header", + "comments": "" + }, + { + "type": "int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)", + "name": "write", + "comments": " Write an object into the backend. The id of the object has\n already been calculated and is passed in." + }, + { + "type": "int (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype)", + "name": "writestream", + "comments": "" + }, + { + "type": "int (*)(git_odb_stream **, git_odb_backend *, const git_oid *)", + "name": "readstream", + "comments": "" + }, + { + "type": "int (*)(git_odb_backend *, const git_oid *)", + "name": "exists", + "comments": "" + }, + { + "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)", + "name": "exists_prefix", + "comments": "" + }, + { + "type": "int (*)(git_odb_backend *)", + "name": "refresh", + "comments": " If the backend implements a refreshing mechanism, it should be exposed\n through this endpoint. Each call to `git_odb_refresh()` will invoke it.\n\n However, the backend implementation should try to stay up-to-date as much\n as possible by itself as libgit2 will not automatically invoke\n `git_odb_refresh()`. For instance, a potential strategy for the backend\n implementation to achieve this could be to internally invoke this\n endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`)." + }, + { + "type": "int (*)(git_odb_backend *, git_odb_foreach_cb, void *)", + "name": "foreach", + "comments": "" + }, + { + "type": "int (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *)", + "name": "writepack", + "comments": "" + }, + { + "type": "void (*)(git_odb_backend *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_mempack_new", + "git_mempack_reset", + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_get_backend", + "git_odb_init_backend" + ] + } + } + ], + [ + "git_odb_object", + { + "decl": "git_odb_object", + "type": "struct", + "value": "git_odb_object", + "file": "types.h", + "line": 87, + "lineto": 87, + "tdef": "typedef", + "description": " An object read from the ODB ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_odb_object_data", + "git_odb_object_dup", + "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", + { + "decl": "git_odb_stream", + "type": "struct", + "value": "git_odb_stream", + "file": "types.h", + "line": 90, + "lineto": 90, + "block": "git_odb_backend * backend\nunsigned int mode\nvoid * hash_ctx\ngit_off_t declared_size\ngit_off_t received_bytes\nint (*)(git_odb_stream *, char *, size_t) read\nint (*)(git_odb_stream *, const char *, size_t) write\nint (*)(git_odb_stream *, const int *) finalize_write\nvoid (*)(git_odb_stream *) free", + "tdef": "typedef", + "description": " A stream to read/write from the ODB ", + "comments": "", + "fields": [ + { + "type": "git_odb_backend *", + "name": "backend", + "comments": "" + }, + { + "type": "unsigned int", + "name": "mode", + "comments": "" + }, + { + "type": "void *", + "name": "hash_ctx", + "comments": "" + }, + { + "type": "git_off_t", + "name": "declared_size", + "comments": "" + }, + { + "type": "git_off_t", + "name": "received_bytes", + "comments": "" + }, + { + "type": "int (*)(git_odb_stream *, char *, size_t)", + "name": "read", + "comments": " Write at most `len` bytes into `buffer` and advance the stream." + }, + { + "type": "int (*)(git_odb_stream *, const char *, size_t)", + "name": "write", + "comments": " Write `len` bytes from `buffer` into the stream." + }, + { + "type": "int (*)(git_odb_stream *, const int *)", + "name": "finalize_write", + "comments": " Store the contents of the stream as an object with the id\n specified in `oid`.\n\n This method might not be invoked if:\n - an error occurs earlier with the `write` callback,\n - the object referred to by `oid` already exists in any backend, or\n - the final number of received bytes differs from the size declared\n with `git_odb_open_wstream()`" + }, + { + "type": "void (*)(git_odb_stream *)", + "name": "free", + "comments": " Free the stream's memory.\n\n This method might be called without a call to `finalize_write` if\n an error occurs or if the object is already present in the ODB." + } + ], + "used": { + "returns": [], + "needs": [ + "git_odb_open_rstream", + "git_odb_open_wstream", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write" + ] + } + } + ], + [ + "git_odb_stream_t", + { + "decl": [ + "GIT_STREAM_RDONLY", + "GIT_STREAM_WRONLY", + "GIT_STREAM_RW" + ], + "type": "enum", + "file": "odb_backend.h", + "line": 70, + "lineto": 74, + "block": "GIT_STREAM_RDONLY\nGIT_STREAM_WRONLY\nGIT_STREAM_RW", + "tdef": "typedef", + "description": " Streaming mode ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STREAM_RDONLY", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STREAM_WRONLY", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STREAM_RW", + "comments": "", + "value": 6 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_odb_writepack", + { + "decl": "git_odb_writepack", + "type": "struct", + "value": "git_odb_writepack", + "file": "types.h", + "line": 93, + "lineto": 93, + "block": "git_odb_backend * backend\nint (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *) append\nint (*)(git_odb_writepack *, git_transfer_progress *) commit\nvoid (*)(git_odb_writepack *) free", + "tdef": "typedef", + "description": " A stream to write a packfile to the ODB ", + "comments": "", + "fields": [ + { + "type": "git_odb_backend *", + "name": "backend", + "comments": "" + }, + { + "type": "int (*)(git_odb_writepack *, const void *, size_t, git_transfer_progress *)", + "name": "append", + "comments": "" + }, + { + "type": "int (*)(git_odb_writepack *, git_transfer_progress *)", + "name": "commit", + "comments": "" + }, + { + "type": "void (*)(git_odb_writepack *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_odb_write_pack" + ] + } + } + ], + [ + "git_oid", + { + "decl": [ + "unsigned char [20] id" + ], + "type": "struct", + "value": "git_oid", + "file": "oid.h", + "line": 33, + "lineto": 36, + "block": "unsigned char [20] id", + "tdef": "typedef", + "description": " Unique identity of any object (commit, tree, blob, tag). ", + "comments": "", + "fields": [ + { + "type": "unsigned char [20]", + "name": "id", + "comments": " raw binary formatted id " + } + ], + "used": { + "returns": [ + "git_annotated_commit_id", + "git_blob_id", + "git_commit_id", + "git_commit_parent_id", + "git_commit_tree_id", + "git_filter_source_id", + "git_index_checksum", + "git_indexer_hash", + "git_note_id", + "git_object_id", + "git_odb_object_id", + "git_packbuilder_hash", + "git_reference_target", + "git_reference_target_peel", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_submodule_head_id", + "git_submodule_index_id", + "git_submodule_wd_id", + "git_tag_id", + "git_tag_target_id", + "git_tree_entry_id", + "git_tree_id" + ], + "needs": [ + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_lookup", + "git_blob_create_frombuffer", + "git_blob_create_fromchunks", + "git_blob_create_fromdisk", + "git_blob_create_fromworkdir", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_commit_amend", + "git_commit_create", + "git_commit_create_from_callback", + "git_commit_create_from_ids", + "git_commit_create_v", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_index_write_tree", + "git_index_write_tree_to", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_note_create", + "git_note_next", + "git_note_read", + "git_note_remove", + "git_object_lookup", + "git_object_lookup_prefix", + "git_odb_exists", + "git_odb_exists_prefix", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_open_rstream", + "git_odb_read", + "git_odb_read_header", + "git_odb_read_prefix", + "git_odb_stream_finalize_write", + "git_odb_write", + "git_oid_cmp", + "git_oid_cpy", + "git_oid_equal", + "git_oid_fmt", + "git_oid_fromraw", + "git_oid_fromstr", + "git_oid_fromstrn", + "git_oid_fromstrp", + "git_oid_iszero", + "git_oid_ncmp", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_strcmp", + "git_oid_streq", + "git_oid_tostr", + "git_oid_tostr_s", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_rebase_commit", + "git_reference__alloc", + "git_reference_create", + "git_reference_create_matching", + "git_reference_name_to_id", + "git_reference_set_target", + "git_reflog_append", + "git_repository_hashfile", + "git_repository_set_head_detached", + "git_revwalk_hide", + "git_revwalk_next", + "git_revwalk_push", + "git_tag_annotation_create", + "git_tag_create", + "git_tag_create_frombuffer", + "git_tag_create_lightweight", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tree_entry_byid", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_treebuilder_insert", + "git_treebuilder_write" + ] + } + } + ], + [ + "git_oid_shorten", + { + "decl": "git_oid_shorten", + "type": "struct", + "value": "git_oid_shorten", + "file": "oid.h", + "line": 216, + "lineto": 216, + "tdef": "typedef", + "description": " OID Shortener object", + "comments": "", + "used": { + "returns": [ + "git_oid_shorten_new" + ], + "needs": [ + "git_oid_shorten_add", + "git_oid_shorten_free" + ] + } + } + ], + [ + "git_oidarray", + { + "decl": [ + "git_oid * ids", + "size_t count" + ], + "type": "struct", + "value": "git_oidarray", + "file": "oidarray.h", + "line": 16, + "lineto": 19, + "block": "git_oid * ids\nsize_t count", + "tdef": "typedef", + "description": " Array of object ids ", + "comments": "", + "fields": [ + { + "type": "git_oid *", + "name": "ids", + "comments": "" + }, + { + "type": "size_t", + "name": "count", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_merge_bases", + "git_merge_bases_many", + "git_oidarray_free" + ] + } + } + ], + [ + "git_otype", + { + "decl": [ + "GIT_OBJ_ANY", + "GIT_OBJ_BAD", + "GIT_OBJ__EXT1", + "GIT_OBJ_COMMIT", + "GIT_OBJ_TREE", + "GIT_OBJ_BLOB", + "GIT_OBJ_TAG", + "GIT_OBJ__EXT2", + "GIT_OBJ_OFS_DELTA", + "GIT_OBJ_REF_DELTA" + ], + "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", + "description": " Basic type (loose or packed) of any Git object. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_OBJ_ANY", + "comments": "

Object can be any of the following

\n", + "value": -2 + }, + { + "type": "int", + "name": "GIT_OBJ_BAD", + "comments": "

Object is invalid.

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_OBJ__EXT1", + "comments": "

Reserved for future use.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_OBJ_COMMIT", + "comments": "

A commit object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_OBJ_TREE", + "comments": "

A tree (directory listing) object.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_OBJ_BLOB", + "comments": "

A file revision object.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_OBJ_TAG", + "comments": "

An annotated tag object.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_OBJ__EXT2", + "comments": "

Reserved for future use.

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_OBJ_OFS_DELTA", + "comments": "

A delta, base is given by an offset.

\n", + "value": 6 + }, + { + "type": "int", + "name": "GIT_OBJ_REF_DELTA", + "comments": "

A delta, base is given by object id.

\n", + "value": 7 + } + ], + "used": { + "returns": [], + "needs": [ + "git_object__size", + "git_object_lookup", + "git_object_lookup_bypath", + "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", + { + "decl": "git_packbuilder", + "type": "struct", + "value": "git_packbuilder", + "file": "types.h", + "line": 153, + "lineto": 153, + "tdef": "typedef", + "description": " Representation of a git packbuilder ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_packbuilder_foreach", + "git_packbuilder_free", + "git_packbuilder_hash", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_walk", + "git_packbuilder_new", + "git_packbuilder_object_count", + "git_packbuilder_set_callbacks", + "git_packbuilder_set_threads", + "git_packbuilder_write", + "git_packbuilder_written" + ] + } + } + ], + [ + "git_packbuilder_stage_t", + { + "decl": [ + "GIT_PACKBUILDER_ADDING_OBJECTS", + "GIT_PACKBUILDER_DELTAFICATION" + ], + "type": "enum", + "file": "pack.h", + "line": 51, + "lineto": 54, + "block": "GIT_PACKBUILDER_ADDING_OBJECTS\nGIT_PACKBUILDER_DELTAFICATION", + "tdef": "typedef", + "description": " Stages that are reported by the packbuilder progress callback.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_PACKBUILDER_ADDING_OBJECTS", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PACKBUILDER_DELTAFICATION", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_patch", + { + "decl": "git_patch", + "type": "struct", + "value": "git_patch", + "file": "patch.h", + "line": 29, + "lineto": 29, + "tdef": "typedef", + "description": " The diff patch is used to store all the text diffs for a delta.", + "comments": "

You can easily loop over the content of patches and get information about\n them.

\n", + "used": { + "returns": [], + "needs": [ + "git_patch_free", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_delta", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_line_stats", + "git_patch_num_hunks", + "git_patch_num_lines_in_hunk", + "git_patch_print", + "git_patch_size", + "git_patch_to_buf" + ] + } + } + ], + [ + "git_pathspec", + { + "decl": "git_pathspec", + "type": "struct", + "value": "git_pathspec", + "file": "pathspec.h", + "line": 20, + "lineto": 20, + "tdef": "typedef", + "description": " Compiled pathspec", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_pathspec_free", + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_tree", + "git_pathspec_match_workdir", + "git_pathspec_matches_path", + "git_pathspec_new" + ] + } + } + ], + [ + "git_pathspec_flag_t", + { + "decl": [ + "GIT_PATHSPEC_DEFAULT", + "GIT_PATHSPEC_IGNORE_CASE", + "GIT_PATHSPEC_USE_CASE", + "GIT_PATHSPEC_NO_GLOB", + "GIT_PATHSPEC_NO_MATCH_ERROR", + "GIT_PATHSPEC_FIND_FAILURES", + "GIT_PATHSPEC_FAILURES_ONLY" + ], + "type": "enum", + "file": "pathspec.h", + "line": 48, + "lineto": 56, + "block": "GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY", + "tdef": "typedef", + "description": " Options controlling how pathspec match should be executed", + "comments": "
    \n
  • GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\nstring comparison for matching
  • \n
  • GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\ncode GIT_ENOTFOUND if no matches are found; otherwise no matches is\nstill success (return 0) but git_pathspec_match_list_entrycount\nwill indicate 0 matches.
  • \n
  • GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\nshould track which patterns matched which files so that at the end of\nthe match we can identify patterns that did not match any files.
  • \n
  • GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\ndoes not need to keep the actual matching filenames. Use this to\njust test if there were any matches at all or in combination with\nGIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_PATHSPEC_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_IGNORE_CASE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_USE_CASE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_NO_GLOB", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_NO_MATCH_ERROR", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_FIND_FAILURES", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_PATHSPEC_FAILURES_ONLY", + "comments": "", + "value": 32 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_pathspec_match_list", + { + "decl": "git_pathspec_match_list", + "type": "struct", + "value": "git_pathspec_match_list", + "file": "pathspec.h", + "line": 25, + "lineto": 25, + "tdef": "typedef", + "description": " List of filenames matching a pathspec", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", + "git_pathspec_match_tree", + "git_pathspec_match_workdir" + ] + } + } + ], + [ + "git_push", + { + "decl": "git_push", + "type": "struct", + "value": "git_push", + "file": "types.h", + "line": 236, + "lineto": 236, + "tdef": "typedef", + "description": " Preparation for a push operation. Can be used to configure what to\n push and the level of parallelism of the packfile builder.", + "comments": "", + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_push_options", + { + "decl": [ + "unsigned int version", + "unsigned int pb_parallelism", + "git_remote_callbacks callbacks" + ], + "type": "struct", + "value": "git_push_options", + "file": "remote.h", + "line": 571, + "lineto": 588, + "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks", + "tdef": "typedef", + "description": " Controls the behavior of a git_push object.", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "pb_parallelism", + "comments": " If the transport being used to push to the remote requires the creation\n of a pack file, this controls the number of worker threads used by\n the packbuilder when creating that pack file to be sent to the remote.\n\n If set to 0, the packbuilder will auto-detect the number of threads\n to create. The default value is 1." + }, + { + "type": "git_remote_callbacks", + "name": "callbacks", + "comments": " Callbacks to use for this push operation" + } + ], + "used": { + "returns": [], + "needs": [ + "git_push_init_options", + "git_remote_push", + "git_remote_upload" + ] + } + } + ], + [ + "git_push_update", + { + "decl": [ + "char * src_refname", + "char * dst_refname", + "git_oid src", + "git_oid dst" + ], + "type": "struct", + "value": "git_push_update", + "file": "remote.h", + "line": 340, + "lineto": 357, + "block": "char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst", + "tdef": "typedef", + "description": " Represents an update which will be performed on the remote during push", + "comments": "", + "fields": [ + { + "type": "char *", + "name": "src_refname", + "comments": " The source name of the reference" + }, + { + "type": "char *", + "name": "dst_refname", + "comments": " The name of the reference to update on the server" + }, + { + "type": "git_oid", + "name": "src", + "comments": " The current target of the reference" + }, + { + "type": "git_oid", + "name": "dst", + "comments": " The new target for the reference" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_rebase", + { + "decl": "git_rebase", + "type": "struct", + "value": "git_rebase", + "file": "types.h", + "line": 187, + "lineto": 187, + "tdef": "typedef", + "description": " Representation of a rebase ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_rebase_abort", + "git_rebase_commit", + "git_rebase_finish", + "git_rebase_free", + "git_rebase_init", + "git_rebase_next", + "git_rebase_open", + "git_rebase_operation_byindex", + "git_rebase_operation_current", + "git_rebase_operation_entrycount" + ] + } + } + ], + [ + "git_rebase_operation", + { + "decl": [ + "git_rebase_operation_t type", + "const git_oid id", + "const char * exec" + ], + "type": "struct", + "value": "git_rebase_operation", + "file": "rebase.h", + "line": 115, + "lineto": 130, + "block": "git_rebase_operation_t type\nconst git_oid id\nconst char * exec", + "tdef": "typedef", + "description": " A rebase operation", + "comments": "

Describes a single instruction/operation to be performed during the\n rebase.

\n", + "fields": [ + { + "type": "git_rebase_operation_t", + "name": "type", + "comments": " The type of rebase operation. " + }, + { + "type": "const git_oid", + "name": "id", + "comments": " The commit ID being cherry-picked. This will be populated for\n all operations except those of type `GIT_REBASE_OPERATION_EXEC`." + }, + { + "type": "const char *", + "name": "exec", + "comments": " The executable the user has requested be run. This will only\n be populated for operations of type `GIT_REBASE_OPERATION_EXEC`." + } + ], + "used": { + "returns": [ + "git_rebase_operation_byindex" + ], + "needs": [ + "git_rebase_next" + ] + } + } + ], + [ + "git_rebase_operation_t", + { + "decl": [ + "GIT_REBASE_OPERATION_PICK", + "GIT_REBASE_OPERATION_REWORD", + "GIT_REBASE_OPERATION_EDIT", + "GIT_REBASE_OPERATION_SQUASH", + "GIT_REBASE_OPERATION_FIXUP", + "GIT_REBASE_OPERATION_EXEC" + ], + "type": "enum", + "file": "rebase.h", + "line": 64, + "lineto": 100, + "block": "GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC", + "tdef": "typedef", + "description": " Type of rebase operation in-progress after calling `git_rebase_next`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REBASE_OPERATION_PICK", + "comments": "

The given commit is to be cherry-picked. The client should commit\n the changes and continue if there are no conflicts.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_REWORD", + "comments": "

The given commit is to be cherry-picked, but the client should prompt\n the user to provide an updated commit message.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_EDIT", + "comments": "

The given commit is to be cherry-picked, but the client should stop\n to allow the user to edit the changes before committing them.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_SQUASH", + "comments": "

The given commit is to be squashed into the previous commit. The\n commit message will be merged with the previous message.

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_FIXUP", + "comments": "

The given commit is to be squashed into the previous commit. The\n commit message from this commit will be discarded.

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REBASE_OPERATION_EXEC", + "comments": "

No commit will be cherry-picked. The client should run the given\n command and (if successful) continue.

\n", + "value": 5 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_ref_t", + { + "decl": [ + "GIT_REF_INVALID", + "GIT_REF_OID", + "GIT_REF_SYMBOLIC", + "GIT_REF_LISTALL" + ], + "type": "enum", + "file": "types.h", + "line": 190, + "lineto": 195, + "block": "GIT_REF_INVALID\nGIT_REF_OID\nGIT_REF_SYMBOLIC\nGIT_REF_LISTALL", + "tdef": "typedef", + "description": " Basic type of any Git reference. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REF_INVALID", + "comments": "

Invalid reference

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REF_OID", + "comments": "

A reference which points at an object id

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REF_SYMBOLIC", + "comments": "

A reference which points at another reference

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REF_LISTALL", + "comments": "", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_refdb", + { + "decl": "git_refdb", + "type": "struct", + "value": "git_refdb", + "file": "types.h", + "line": 96, + "lineto": 96, + "tdef": "typedef", + "description": " An open refs database handle. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_refdb_compress", + "git_refdb_free", + "git_refdb_new", + "git_refdb_open", + "git_refdb_set_backend", + "git_repository_refdb", + "git_repository_set_refdb" + ] + } + } + ], + [ + "git_refdb_backend", + { + "decl": "git_refdb_backend", + "type": "struct", + "value": "git_refdb_backend", + "file": "types.h", + "line": 99, + "lineto": 99, + "block": "unsigned int version\nint (*)(int *, git_refdb_backend *, const char *) exists\nint (*)(git_reference **, git_refdb_backend *, const char *) lookup\nint (*)(git_reference_iterator **, struct git_refdb_backend *, const char *) iterator\nint (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *) write\nint (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *) rename\nint (*)(git_refdb_backend *, const char *, const git_oid *, const char *) del\nint (*)(git_refdb_backend *) compress\nint (*)(git_refdb_backend *, const char *) has_log\nint (*)(git_refdb_backend *, const char *) ensure_log\nvoid (*)(git_refdb_backend *) free\nint (*)(git_reflog **, git_refdb_backend *, const char *) reflog_read\nint (*)(git_refdb_backend *, git_reflog *) reflog_write\nint (*)(git_refdb_backend *, const char *, const char *) reflog_rename\nint (*)(git_refdb_backend *, const char *) reflog_delete\nint (*)(void **, git_refdb_backend *, const char *) lock\nint (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *) unlock", + "tdef": "typedef", + "description": " A custom backend for refs ", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "int (*)(int *, git_refdb_backend *, const char *)", + "name": "exists", + "comments": " Queries the refdb backend to determine if the given ref_name\n exists. A refdb implementation must provide this function." + }, + { + "type": "int (*)(git_reference **, git_refdb_backend *, const char *)", + "name": "lookup", + "comments": " Queries the refdb backend for a given reference. A refdb\n implementation must provide this function." + }, + { + "type": "int (*)(git_reference_iterator **, struct git_refdb_backend *, const char *)", + "name": "iterator", + "comments": " Allocate an iterator object for the backend.\n\n A refdb implementation must provide this function." + }, + { + "type": "int (*)(git_refdb_backend *, const git_reference *, int, const git_signature *, const char *, const git_oid *, const char *)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(git_reference **, git_refdb_backend *, const char *, const char *, int, const git_signature *, const char *)", + "name": "rename", + "comments": "" + }, + { + "type": "int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)", + "name": "del", + "comments": " Deletes the given reference from the refdb. A refdb implementation\n must provide this function." + }, + { + "type": "int (*)(git_refdb_backend *)", + "name": "compress", + "comments": " Suggests that the given refdb compress or optimize its references.\n This mechanism is implementation specific. (For on-disk reference\n databases, this may pack all loose references.) A refdb\n implementation may provide this function; if it is not provided,\n nothing will be done." + }, + { + "type": "int (*)(git_refdb_backend *, const char *)", + "name": "has_log", + "comments": " Query whether a particular reference has a log (may be empty)" + }, + { + "type": "int (*)(git_refdb_backend *, const char *)", + "name": "ensure_log", + "comments": " Make sure a particular reference will have a reflog which\n will be appended to on writes." + }, + { + "type": "void (*)(git_refdb_backend *)", + "name": "free", + "comments": " Frees any resources held by the refdb. A refdb implementation may\n provide this function; if it is not provided, nothing will be done." + }, + { + "type": "int (*)(git_reflog **, git_refdb_backend *, const char *)", + "name": "reflog_read", + "comments": " Read the reflog for the given reference name." + }, + { + "type": "int (*)(git_refdb_backend *, git_reflog *)", + "name": "reflog_write", + "comments": " Write a reflog to disk." + }, + { + "type": "int (*)(git_refdb_backend *, const char *, const char *)", + "name": "reflog_rename", + "comments": " Rename a reflog" + }, + { + "type": "int (*)(git_refdb_backend *, const char *)", + "name": "reflog_delete", + "comments": " Remove a reflog." + }, + { + "type": "int (*)(void **, git_refdb_backend *, const char *)", + "name": "lock", + "comments": " Lock a reference. The opaque parameter will be passed to the unlock function" + }, + { + "type": "int (*)(git_refdb_backend *, void *, int, int, const git_reference *, const git_signature *, const char *)", + "name": "unlock", + "comments": " Unlock a reference. Only one of target or symbolic_target\n will be set. success indicates whether to update the\n reference or discard the lock (if it's false)" + } + ], + "used": { + "returns": [], + "needs": [ + "git_refdb_backend_fs", + "git_refdb_init_backend", + "git_refdb_set_backend" + ] + } + } + ], + [ + "git_reference", + { + "decl": "git_reference", + "type": "struct", + "value": "git_reference", + "file": "types.h", + "line": 169, + "lineto": 169, + "tdef": "typedef", + "description": " In-memory representation of a reference. ", + "comments": "", + "used": { + "returns": [ + "git_reference__alloc", + "git_reference__alloc_symbolic" + ], + "needs": [ + "git_annotated_commit_from_ref", + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_is_head", + "git_branch_lookup", + "git_branch_move", + "git_branch_name", + "git_branch_next", + "git_branch_set_upstream", + "git_branch_upstream", + "git_reference_cmp", + "git_reference_create", + "git_reference_create_matching", + "git_reference_delete", + "git_reference_dwim", + "git_reference_free", + "git_reference_is_branch", + "git_reference_is_note", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_lookup", + "git_reference_name", + "git_reference_next", + "git_reference_owner", + "git_reference_peel", + "git_reference_rename", + "git_reference_resolve", + "git_reference_set_target", + "git_reference_shorthand", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_set_target", + "git_reference_symbolic_target", + "git_reference_target", + "git_reference_target_peel", + "git_reference_type", + "git_repository_head", + "git_revparse_ext" + ] + } + } + ], + [ + "git_reference_iterator", + { + "decl": "git_reference_iterator", + "type": "struct", + "value": "git_reference_iterator", + "file": "types.h", + "line": 172, + "lineto": 172, + "block": "git_refdb * db\nint (*)(git_reference **, git_reference_iterator *) next\nint (*)(const char **, git_reference_iterator *) next_name\nvoid (*)(git_reference_iterator *) free", + "tdef": "typedef", + "description": " Iterator for references ", + "comments": "", + "fields": [ + { + "type": "git_refdb *", + "name": "db", + "comments": "" + }, + { + "type": "int (*)(git_reference **, git_reference_iterator *)", + "name": "next", + "comments": " Return the current reference and advance the iterator." + }, + { + "type": "int (*)(const char **, git_reference_iterator *)", + "name": "next_name", + "comments": " Return the name of the current reference and advance the iterator" + }, + { + "type": "void (*)(git_reference_iterator *)", + "name": "free", + "comments": " Free the iterator" + } + ], + "used": { + "returns": [], + "needs": [ + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_next", + "git_reference_next_name" + ] + } + } + ], + [ + "git_reference_normalize_t", + { + "decl": [ + "GIT_REF_FORMAT_NORMAL", + "GIT_REF_FORMAT_ALLOW_ONELEVEL", + "GIT_REF_FORMAT_REFSPEC_PATTERN", + "GIT_REF_FORMAT_REFSPEC_SHORTHAND" + ], + "type": "enum", + "file": "refs.h", + "line": 625, + "lineto": 654, + "block": "GIT_REF_FORMAT_NORMAL\nGIT_REF_FORMAT_ALLOW_ONELEVEL\nGIT_REF_FORMAT_REFSPEC_PATTERN\nGIT_REF_FORMAT_REFSPEC_SHORTHAND", + "tdef": "typedef", + "description": " Normalization options for reference lookup", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REF_FORMAT_NORMAL", + "comments": "

No particular normalization.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REF_FORMAT_ALLOW_ONELEVEL", + "comments": "

Control whether one-level refnames are accepted\n (i.e., refnames that do not contain multiple /-separated\n components). Those are expected to be written only using\n uppercase letters and underscore (FETCH_HEAD, ...)

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REF_FORMAT_REFSPEC_PATTERN", + "comments": "

Interpret the provided name as a reference pattern for a\n refspec (as used with remote repositories). If this option\n is enabled, the name is allowed to contain a single * (\n<star

\n\n
\n

)\n in place of a one full pathname component\n (e.g., foo/\n<star\n/bar but not foo/bar\n<star\n).

\n
\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REF_FORMAT_REFSPEC_SHORTHAND", + "comments": "

Interpret the name as part of a refspec in shorthand form\n so the ONELEVEL naming rules aren't enforced and 'master'\n becomes a valid name.

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_reflog", + { + "decl": "git_reflog", + "type": "struct", + "value": "git_reflog", + "file": "types.h", + "line": 147, + "lineto": 147, + "tdef": "typedef", + "description": " Representation of a reference log ", + "comments": "", + "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", + { + "decl": "git_reflog_entry", + "type": "struct", + "value": "git_reflog_entry", + "file": "types.h", + "line": 144, + "lineto": 144, + "tdef": "typedef", + "description": " Representation of a reference log entry ", + "comments": "", + "used": { + "returns": [ + "git_reflog_entry_byindex" + ], + "needs": [ + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message" + ] + } + } + ], + [ + "git_remote", + { + "decl": "git_remote", + "type": "struct", + "value": "git_remote", + "file": "types.h", + "line": 224, + "lineto": 224, + "tdef": "typedef", + "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_remote_autotag", + "git_remote_connect", + "git_remote_connected", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_with_fetchspec", + "git_remote_default_branch", + "git_remote_disconnect", + "git_remote_download", + "git_remote_dup", + "git_remote_fetch", + "git_remote_free", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_get_refspec", + "git_remote_lookup", + "git_remote_ls", + "git_remote_name", + "git_remote_owner", + "git_remote_prune", + "git_remote_prune_refs", + "git_remote_push", + "git_remote_pushurl", + "git_remote_refspec_count", + "git_remote_stats", + "git_remote_stop", + "git_remote_update_tips", + "git_remote_upload", + "git_remote_url", + "git_transport_dummy", + "git_transport_local", + "git_transport_new", + "git_transport_smart", + "git_transport_ssh_with_paths" + ] + } + } + ], + [ + "git_remote_autotag_option_t", + { + "decl": [ + "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED", + "GIT_REMOTE_DOWNLOAD_TAGS_AUTO", + "GIT_REMOTE_DOWNLOAD_TAGS_NONE", + "GIT_REMOTE_DOWNLOAD_TAGS_ALL" + ], + "type": "enum", + "file": "remote.h", + "line": 494, + "lineto": 512, + "block": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL", + "tdef": "typedef", + "description": " Automatic tag following option", + "comments": "

Lets us select the --tags option to use.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED", + "comments": "

Use the setting from the configuration.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_AUTO", + "comments": "

Ask the server for tags pointing to objects we're already\n downloading.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_NONE", + "comments": "

Don't ask for any tags beyond the refspecs.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REMOTE_DOWNLOAD_TAGS_ALL", + "comments": "

Ask for the all the tags.

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_set_autotag", + "git_remote_update_tips" + ] + } + } + ], + [ + "git_remote_callbacks", + { + "decl": [ + "unsigned int version", + "git_transport_message_cb sideband_progress", + "int (*)(git_remote_completion_type, void *) completion", + "git_cred_acquire_cb credentials", + "git_transport_certificate_check_cb certificate_check", + "git_transfer_progress_cb transfer_progress", + "int (*)(const char *, const git_oid *, const git_oid *, void *) update_tips", + "git_packbuilder_progress pack_progress", + "git_push_transfer_progress push_transfer_progress", + "int (*)(const char *, const char *, void *) push_update_reference", + "git_push_negotiation push_negotiation", + "git_transport_cb transport", + "void * payload" + ], + "type": "struct", + "value": "git_remote_callbacks", + "file": "remote.h", + "line": 373, + "lineto": 457, + "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\nint (*)(const char *, const char *, void *) push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload", + "tdef": null, + "description": " The callback settings structure", + "comments": "

Set the callbacks to be called by the remote when informing the user\n about the progress of the network operations.

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_transport_message_cb", + "name": "sideband_progress", + "comments": " Textual progress from the remote. Text send over the\n progress side-band will be passed to this function (this is\n the 'counting objects' output." + }, + { + "type": "int (*)(git_remote_completion_type, void *)", + "name": "completion", + "comments": " Completion is called when different parts of the download\n process are done (currently unused)." + }, + { + "type": "git_cred_acquire_cb", + "name": "credentials", + "comments": " This will be called if the remote host requires\n authentication in order to connect to it.\n\n Returning GIT_PASSTHROUGH will make libgit2 behave as\n though this field isn't set." + }, + { + "type": "git_transport_certificate_check_cb", + "name": "certificate_check", + "comments": " If cert verification fails, this will be called to let the\n user make the final decision of whether to allow the\n connection to proceed. Returns 1 to allow the connection, 0\n to disallow it or a negative value to indicate an error." + }, + { + "type": "git_transfer_progress_cb", + "name": "transfer_progress", + "comments": " During the download of new data, this will be regularly\n called with the current count of progress done by the\n indexer." + }, + { + "type": "int (*)(const char *, const git_oid *, const git_oid *, void *)", + "name": "update_tips", + "comments": " Each time a reference is updated locally, this function\n will be called with information about it." + }, + { + "type": "git_packbuilder_progress", + "name": "pack_progress", + "comments": " Function to call with progress information during pack\n building. Be aware that this is called inline with pack\n building operations, so performance may be affected." + }, + { + "type": "git_push_transfer_progress", + "name": "push_transfer_progress", + "comments": " Function to call with progress information during the\n upload portion of a push. Be aware that this is called\n inline with pack building operations, so performance may be\n affected." + }, + { + "type": "int (*)(const char *, const char *, void *)", + "name": "push_update_reference", + "comments": " Called for each updated reference on push. If `status` is\n not `NULL`, the update was rejected by the remote server\n and `status` contains the reason given." + }, + { + "type": "git_push_negotiation", + "name": "push_negotiation", + "comments": " Called once between the negotiation step and the upload. It\n provides information about what updates will be performed." + }, + { + "type": "git_transport_cb", + "name": "transport", + "comments": " Create the transport to use for this operation. Leave NULL\n to auto-detect." + }, + { + "type": "void *", + "name": "payload", + "comments": " This will be passed to each of the callbacks in this struct\n as the last parameter." + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_connect", + "git_remote_init_callbacks", + "git_remote_prune", + "git_remote_update_tips" + ] + } + } + ], + [ + "git_remote_completion_type", + { + "decl": [ + "GIT_REMOTE_COMPLETION_DOWNLOAD", + "GIT_REMOTE_COMPLETION_INDEXING", + "GIT_REMOTE_COMPLETION_ERROR" + ], + "type": "enum", + "file": "remote.h", + "line": 325, + "lineto": 329, + "block": "GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR", + "tdef": "typedef", + "description": " Argument to the completion callback which tells it which operation\n finished.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_DOWNLOAD", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_INDEXING", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REMOTE_COMPLETION_ERROR", + "comments": "", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_remote_head", + { + "decl": [ + "int local", + "git_oid oid", + "git_oid loid", + "char * name", + "char * symref_target" + ], + "type": "struct", + "value": "git_remote_head", + "file": "net.h", + "line": 40, + "lineto": 50, + "block": "int local\ngit_oid oid\ngit_oid loid\nchar * name\nchar * symref_target", + "tdef": null, + "description": " Description of a reference advertised by a remote server, given out\n on `ls` calls.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "local", + "comments": "" + }, + { + "type": "git_oid", + "name": "oid", + "comments": "" + }, + { + "type": "git_oid", + "name": "loid", + "comments": "" + }, + { + "type": "char *", + "name": "name", + "comments": "" + }, + { + "type": "char *", + "name": "symref_target", + "comments": " If the server send a symref mapping for this ref, this will\n point to the target." + } + ], + "used": { + "returns": [], + "needs": [ + "git_remote_ls" + ] + } + } + ], + [ + "git_repository", + { + "decl": "git_repository", + "type": "struct", + "value": "git_repository", + "file": "types.h", + "line": 105, + "lineto": 105, + "tdef": "typedef", + "description": " Representation of an existing git repository,\n including all its object contents", + "comments": "", + "used": { + "returns": [ + "git_blob_owner", + "git_commit_owner", + "git_filter_source_repo", + "git_index_owner", + "git_object_owner", + "git_reference_owner", + "git_remote_owner", + "git_revwalk_repository", + "git_submodule_owner", + "git_tag_owner", + "git_tree_owner" + ], + "needs": [ + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_lookup", + "git_attr_add_macro", + "git_attr_cache_flush", + "git_attr_foreach", + "git_attr_get", + "git_attr_get_many", + "git_blame_file", + "git_blob_create_frombuffer", + "git_blob_create_fromchunks", + "git_blob_create_fromdisk", + "git_blob_create_fromworkdir", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_iterator_new", + "git_branch_lookup", + "git_checkout_head", + "git_checkout_index", + "git_checkout_tree", + "git_cherrypick", + "git_cherrypick_commit", + "git_clone", + "git_commit_create", + "git_commit_create_from_callback", + "git_commit_create_from_ids", + "git_commit_create_v", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_describe_workdir", + "git_diff_commit_as_email", + "git_diff_index_to_workdir", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_filter_list_apply_to_file", + "git_filter_list_load", + "git_filter_list_new", + "git_filter_list_stream_file", + "git_graph_ahead_behind", + "git_graph_descendant_of", + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored", + "git_index_write_tree_to", + "git_merge", + "git_merge_analysis", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_merge_commits", + "git_merge_file_from_index", + "git_merge_trees", + "git_note_create", + "git_note_foreach", + "git_note_iterator_new", + "git_note_read", + "git_note_remove", + "git_object_lookup", + "git_object_lookup_prefix", + "git_packbuilder_new", + "git_pathspec_match_workdir", + "git_rebase_init", + "git_rebase_open", + "git_refdb_backend_fs", + "git_refdb_new", + "git_refdb_open", + "git_reference_create", + "git_reference_create_matching", + "git_reference_dwim", + "git_reference_ensure_log", + "git_reference_foreach", + "git_reference_foreach_glob", + "git_reference_foreach_name", + "git_reference_has_log", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_list", + "git_reference_lookup", + "git_reference_name_to_id", + "git_reference_remove", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reflog_delete", + "git_reflog_read", + "git_reflog_rename", + "git_remote_add_fetch", + "git_remote_add_push", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_with_fetchspec", + "git_remote_delete", + "git_remote_list", + "git_remote_lookup", + "git_remote_rename", + "git_remote_set_autotag", + "git_remote_set_pushurl", + "git_remote_set_url", + "git_repository__cleanup", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_detach_head", + "git_repository_fetchhead_foreach", + "git_repository_free", + "git_repository_get_namespace", + "git_repository_hashfile", + "git_repository_head", + "git_repository_head_detached", + "git_repository_head_unborn", + "git_repository_ident", + "git_repository_index", + "git_repository_init", + "git_repository_init_ext", + "git_repository_is_bare", + "git_repository_is_empty", + "git_repository_is_shallow", + "git_repository_mergehead_foreach", + "git_repository_message", + "git_repository_message_remove", + "git_repository_new", + "git_repository_odb", + "git_repository_open", + "git_repository_open_bare", + "git_repository_open_ext", + "git_repository_path", + "git_repository_refdb", + "git_repository_reinit_filesystem", + "git_repository_set_bare", + "git_repository_set_config", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_set_ident", + "git_repository_set_index", + "git_repository_set_namespace", + "git_repository_set_odb", + "git_repository_set_refdb", + "git_repository_set_workdir", + "git_repository_state", + "git_repository_state_cleanup", + "git_repository_workdir", + "git_repository_wrap_odb", + "git_reset", + "git_reset_default", + "git_reset_from_annotated", + "git_revert", + "git_revert_commit", + "git_revparse", + "git_revparse_ext", + "git_revparse_single", + "git_revwalk_new", + "git_signature_default", + "git_stash_apply", + "git_stash_drop", + "git_stash_foreach", + "git_stash_pop", + "git_status_file", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_list_new", + "git_status_should_ignore", + "git_submodule_add_setup", + "git_submodule_foreach", + "git_submodule_lookup", + "git_submodule_open", + "git_submodule_repo_init", + "git_submodule_resolve_url", + "git_submodule_set_branch", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_set_ignore", + "git_submodule_set_update", + "git_submodule_set_url", + "git_submodule_status", + "git_tag_annotation_create", + "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_new" + ] + } + } + ], + [ + "git_repository_init_flag_t", + { + "decl": [ + "GIT_REPOSITORY_INIT_BARE", + "GIT_REPOSITORY_INIT_NO_REINIT", + "GIT_REPOSITORY_INIT_NO_DOTGIT_DIR", + "GIT_REPOSITORY_INIT_MKDIR", + "GIT_REPOSITORY_INIT_MKPATH", + "GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE", + "GIT_REPOSITORY_INIT_RELATIVE_GITLINK" + ], + "type": "enum", + "file": "repository.h", + "line": 202, + "lineto": 210, + "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\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", + "tdef": "typedef", + "description": " Option flags for `git_repository_init_ext`.", + "comments": "

These flags configure extra behaviors to git_repository_init_ext.\n In every case, the default behavior is the zero value (i.e. flag is\n not set). Just OR the flag values together for the flags parameter\n when initializing a new repo. Details of individual values are:

\n\n
    \n
  • BARE - Create a bare repository with no working directory.
  • \n
  • NO_REINIT - Return an GIT_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.
  • \n
  • GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is\n specified, use relative paths for the gitdir and core.worktree.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_BARE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_NO_REINIT", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_NO_DOTGIT_DIR", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_MKDIR", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_MKPATH", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_RELATIVE_GITLINK", + "comments": "", + "value": 64 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_repository_init_mode_t", + { + "decl": [ + "GIT_REPOSITORY_INIT_SHARED_UMASK", + "GIT_REPOSITORY_INIT_SHARED_GROUP", + "GIT_REPOSITORY_INIT_SHARED_ALL" + ], + "type": "enum", + "file": "repository.h", + "line": 225, + "lineto": 229, + "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", + "tdef": "typedef", + "description": " Mode options for `git_repository_init_ext`.", + "comments": "

Set the mode field of the git_repository_init_options structure\n either to the custom mode that you would like, or to one of the\n following modes:

\n\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.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_UMASK", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_GROUP", + "comments": "", + "value": 1533 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_INIT_SHARED_ALL", + "comments": "", + "value": 1535 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_repository_init_options", + { + "decl": [ + "unsigned int version", + "uint32_t flags", + "uint32_t mode", + "const char * workdir_path", + "const char * description", + "const char * template_path", + "const char * initial_head", + "const char * origin_url" + ], + "type": "struct", + "value": "git_repository_init_options", + "file": "repository.h", + "line": 259, + "lineto": 268, + "block": "unsigned int version\nuint32_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", + "description": " Extended options structure for `git_repository_init_ext`.", + "comments": "

This contains extra options for git_repository_init_ext that enable\n additional initialization features. The fields are:

\n\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.
  • \n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "uint32_t", + "name": "flags", + "comments": "" + }, + { + "type": "uint32_t", + "name": "mode", + "comments": "" + }, + { + "type": "const char *", + "name": "workdir_path", + "comments": "" + }, + { + "type": "const char *", + "name": "description", + "comments": "" + }, + { + "type": "const char *", + "name": "template_path", + "comments": "" + }, + { + "type": "const char *", + "name": "initial_head", + "comments": "" + }, + { + "type": "const char *", + "name": "origin_url", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_repository_init_ext", + "git_repository_init_init_options" + ] + } + } + ], + [ + "git_repository_open_flag_t", + { + "decl": [ + "GIT_REPOSITORY_OPEN_NO_SEARCH", + "GIT_REPOSITORY_OPEN_CROSS_FS", + "GIT_REPOSITORY_OPEN_BARE" + ], + "type": "enum", + "file": "repository.h", + "line": 99, + "lineto": 103, + "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE", + "tdef": "typedef", + "description": " Option flags for `git_repository_open_ext`.", + "comments": "
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be\nimmediately found in the start_path. Do not walk up from the\nstart_path looking at parent directories.
  • \n
  • GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not\ncontinue searching across filesystem boundaries (i.e. when st_dev\nchanges from the stat system call). (E.g. Searching in a user's home\ndirectory "/home/user/source/" will not return "/.git/" as the found\nrepo if "/" is a different filesystem than "/home".)
  • \n
  • GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless\nof core.bare config, and defer loading config file for faster setup.\nUnlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_NO_SEARCH", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_CROSS_FS", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_OPEN_BARE", + "comments": "", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_repository_state_t", + { + "decl": [ + "GIT_REPOSITORY_STATE_NONE", + "GIT_REPOSITORY_STATE_MERGE", + "GIT_REPOSITORY_STATE_REVERT", + "GIT_REPOSITORY_STATE_CHERRYPICK", + "GIT_REPOSITORY_STATE_BISECT", + "GIT_REPOSITORY_STATE_REBASE", + "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", + "GIT_REPOSITORY_STATE_REBASE_MERGE", + "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE" + ], + "type": "enum", + "file": "repository.h", + "line": 674, + "lineto": 685, + "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "tdef": "typedef", + "description": " Repository state", + "comments": "

These values represent possible states for the repository to be in,\n based on the current operation which is ongoing.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_NONE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_MERGE", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REVERT", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_CHERRYPICK", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_BISECT", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE", + "comments": "", + "value": 5 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", + "comments": "", + "value": 6 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_REBASE_MERGE", + "comments": "", + "value": 7 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "comments": "", + "value": 9 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_reset_t", + { + "decl": [ + "GIT_RESET_SOFT", + "GIT_RESET_MIXED", + "GIT_RESET_HARD" + ], + "type": "enum", + "file": "reset.h", + "line": 26, + "lineto": 30, + "block": "GIT_RESET_SOFT\nGIT_RESET_MIXED\nGIT_RESET_HARD", + "tdef": "typedef", + "description": " Kinds of reset operation", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_RESET_SOFT", + "comments": "

Move the head to the given commit

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_RESET_MIXED", + "comments": "

SOFT plus reset index to the commit

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_RESET_HARD", + "comments": "

MIXED plus changes in working tree discarded

\n", + "value": 3 + } + ], + "used": { + "returns": [], + "needs": [ + "git_reset", + "git_reset_from_annotated" + ] + } + } + ], + [ + "git_revert_options", + { + "decl": [ + "unsigned int version", + "unsigned int mainline", + "git_merge_options merge_opts", + "git_checkout_options checkout_opts" + ], + "type": "struct", + "value": "git_revert_options", + "file": "revert.h", + "line": 26, + "lineto": 34, + "block": "unsigned int version\nunsigned int mainline\ngit_merge_options merge_opts\ngit_checkout_options checkout_opts", + "tdef": "typedef", + "description": " Options for revert", + "comments": "", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "unsigned int", + "name": "mainline", + "comments": " For merge commits, the \"mainline\" is treated as the parent. " + }, + { + "type": "git_merge_options", + "name": "merge_opts", + "comments": " Options for the merging " + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " Options for the checkout " + } + ], + "used": { + "returns": [], + "needs": [ + "git_revert", + "git_revert_init_options" + ] + } + } + ], + [ + "git_revparse_mode_t", + { + "decl": [ + "GIT_REVPARSE_SINGLE", + "GIT_REVPARSE_RANGE", + "GIT_REVPARSE_MERGE_BASE" + ], + "type": "enum", + "file": "revparse.h", + "line": 71, + "lineto": 78, + "block": "GIT_REVPARSE_SINGLE\nGIT_REVPARSE_RANGE\nGIT_REVPARSE_MERGE_BASE", + "tdef": "typedef", + "description": " Revparse flags. These indicate the intended behavior of the spec passed to\n git_revparse.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_REVPARSE_SINGLE", + "comments": "

The spec targeted a single object.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_REVPARSE_RANGE", + "comments": "

The spec targeted a range of commits.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_REVPARSE_MERGE_BASE", + "comments": "

The spec used the '...' operator, which invokes special semantics.

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_revspec", + { + "decl": [ + "git_object * from", + "git_object * to", + "unsigned int flags" + ], + "type": "struct", + "value": "git_revspec", + "file": "revparse.h", + "line": 83, + "lineto": 90, + "block": "git_object * from\ngit_object * to\nunsigned int flags", + "tdef": "typedef", + "description": " Git Revision Spec: output of a `git_revparse` operation", + "comments": "", + "fields": [ + { + "type": "git_object *", + "name": "from", + "comments": " The left element of the revspec; must be freed by the user " + }, + { + "type": "git_object *", + "name": "to", + "comments": " The right element of the revspec; must be freed by the user " + }, + { + "type": "unsigned int", + "name": "flags", + "comments": " The intent of the revspec (i.e. `git_revparse_mode_t` flags) " + } + ], + "used": { + "returns": [], + "needs": [ + "git_revparse" + ] + } + } + ], + [ + "git_revwalk", + { + "decl": "git_revwalk", + "type": "struct", + "value": "git_revwalk", + "file": "types.h", + "line": 111, + "lineto": 111, + "tdef": "typedef", + "description": " Representation of an in-progress walk through the commits in a repo ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_packbuilder_insert_walk", + "git_revwalk_add_hide_cb", + "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_range", + "git_revwalk_push_ref", + "git_revwalk_repository", + "git_revwalk_reset", + "git_revwalk_simplify_first_parent", + "git_revwalk_sorting" + ] + } + } + ], + [ + "git_signature", + { + "decl": [ + "char * name", + "char * email", + "git_time when" + ], + "type": "struct", + "value": "git_signature", + "file": "types.h", + "line": 162, + "lineto": 166, + "block": "char * name\nchar * email\ngit_time when", + "tdef": "typedef", + "description": " An action signature (e.g. for committers, taggers, etc) ", + "comments": "", + "fields": [ + { + "type": "char *", + "name": "name", + "comments": " full name of the author " + }, + { + "type": "char *", + "name": "email", + "comments": " email of the author " + }, + { + "type": "git_time", + "name": "when", + "comments": " time when the action happened " + } + ], + "used": { + "returns": [ + "git_commit_author", + "git_commit_committer", + "git_note_author", + "git_note_committer", + "git_reflog_entry_committer", + "git_tag_tagger" + ], + "needs": [ + "git_commit_amend", + "git_commit_create", + "git_commit_create_from_callback", + "git_commit_create_from_ids", + "git_commit_create_v", + "git_note_create", + "git_note_remove", + "git_rebase_commit", + "git_rebase_finish", + "git_reflog_append", + "git_signature_default", + "git_signature_dup", + "git_signature_free", + "git_signature_new", + "git_signature_now", + "git_tag_annotation_create", + "git_tag_create" + ] + } + } + ], + [ + "git_smart_subtransport_definition", + { + "decl": [ + "git_smart_subtransport_cb callback", + "unsigned int rpc", + "void * param" + ], + "type": "struct", + "value": "git_smart_subtransport_definition", + "file": "sys/transport.h", + "line": 296, + "lineto": 309, + "block": "git_smart_subtransport_cb callback\nunsigned int rpc\nvoid * param", + "tdef": "typedef", + "description": " Definition for a \"subtransport\"", + "comments": "

This is used to let the smart protocol code know about the protocol\n which you are implementing.

\n", + "fields": [ + { + "type": "git_smart_subtransport_cb", + "name": "callback", + "comments": " The function to use to create the git_smart_subtransport " + }, + { + "type": "unsigned int", + "name": "rpc", + "comments": " True if the protocol is stateless; false otherwise. For example,\n http:// is stateless, but git:// is not." + }, + { + "type": "void *", + "name": "param", + "comments": " Param of the callback" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_sort_t", + { + "decl": [ + "GIT_SORT_NONE", + "GIT_SORT_TOPOLOGICAL", + "GIT_SORT_TIME", + "GIT_SORT_REVERSE" + ], + "type": "enum", + "file": "revwalk.h", + "line": 26, + "lineto": 55, + "block": "GIT_SORT_NONE\nGIT_SORT_TOPOLOGICAL\nGIT_SORT_TIME\nGIT_SORT_REVERSE", + "tdef": "typedef", + "description": " Flags to specify the sorting which a revwalk should perform.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_SORT_NONE", + "comments": "

Sort the repository contents in no particular ordering;\n this sorting is arbitrary, implementation-specific\n and subject to change at any time.\n This is the default sorting for new walkers.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_SORT_TOPOLOGICAL", + "comments": "

Sort the repository contents in topological order\n (parents before children); this sorting mode\n can be combined with time sorting.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SORT_TIME", + "comments": "

Sort the repository contents by commit time;\n this sorting mode can be combined with\n topological sorting.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SORT_REVERSE", + "comments": "

Iterate through the repository contents in reverse\n order; this sorting mode can be combined with\n any of the above.

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_stash_apply_flags", + { + "decl": [ + "GIT_STASH_APPLY_DEFAULT", + "GIT_STASH_APPLY_REINSTATE_INDEX" + ], + "type": "enum", + "file": "stash.h", + "line": 74, + "lineto": 81, + "block": "GIT_STASH_APPLY_DEFAULT\nGIT_STASH_APPLY_REINSTATE_INDEX", + "tdef": "typedef", + "description": " Stash application flags. ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_APPLY_DEFAULT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_APPLY_REINSTATE_INDEX", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_stash_flags", + { + "decl": [ + "GIT_STASH_DEFAULT", + "GIT_STASH_KEEP_INDEX", + "GIT_STASH_INCLUDE_UNTRACKED", + "GIT_STASH_INCLUDE_IGNORED" + ], + "type": "enum", + "file": "stash.h", + "line": 24, + "lineto": 47, + "block": "GIT_STASH_DEFAULT\nGIT_STASH_KEEP_INDEX\nGIT_STASH_INCLUDE_UNTRACKED\nGIT_STASH_INCLUDE_IGNORED", + "tdef": "typedef", + "description": " Stash flags", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_STASH_DEFAULT", + "comments": "

No option, default

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STASH_KEEP_INDEX", + "comments": "

All changes already added to the index are left intact in\n the working directory

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STASH_INCLUDE_UNTRACKED", + "comments": "

All untracked files are also stashed and then cleaned up\n from the working directory

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STASH_INCLUDE_IGNORED", + "comments": "

All ignored files are also stashed and then cleaned up from\n the working directory

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_status_list", + { + "decl": "git_status_list", + "type": "struct", + "value": "git_status_list", + "file": "types.h", + "line": 184, + "lineto": 184, + "tdef": "typedef", + "description": " Representation of a status collection ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_status_byindex", + "git_status_list_entrycount", + "git_status_list_free", + "git_status_list_get_perfdata", + "git_status_list_new" + ] + } + } + ], + [ + "git_status_opt_t", + { + "decl": [ + "GIT_STATUS_OPT_INCLUDE_UNTRACKED", + "GIT_STATUS_OPT_INCLUDE_IGNORED", + "GIT_STATUS_OPT_INCLUDE_UNMODIFIED", + "GIT_STATUS_OPT_EXCLUDE_SUBMODULES", + "GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS", + "GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH", + "GIT_STATUS_OPT_RECURSE_IGNORED_DIRS", + "GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX", + "GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR", + "GIT_STATUS_OPT_SORT_CASE_SENSITIVELY", + "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", + "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", + "GIT_STATUS_OPT_NO_REFRESH", + "GIT_STATUS_OPT_UPDATE_INDEX", + "GIT_STATUS_OPT_INCLUDE_UNREADABLE", + "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED" + ], + "type": "enum", + "file": "status.h", + "line": 137, + "lineto": 154, + "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\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", + "tdef": "typedef", + "description": " Flags to control status callbacks", + "comments": "
    \n
  • GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made\non untracked files. These will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files get callbacks.\nAgain, these callbacks will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be\nmade even on unmodified files.
  • \n
  • GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that submodules should be\nskipped. This only applies if there are no pending typechanges to\nthe submodule (either from or to another type).
  • \n
  • GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that all files in\nuntracked directories should be included. Normally if an entire\ndirectory is new, then just the top-level directory is included (with\na trailing slash on the entry name). This flag says to include all\nof the individual files in the directory instead.
  • \n
  • GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path\nshould be treated as a literal path, and not as a pathspec pattern.
  • \n
  • GIT_STATUS_OPT_RECURSE_IGNORED_DIRS indicates that the contents of\nignored directories should be included in the status. This is like\ndoing git ls-files -o -i --exclude-standard with core git.
  • \n
  • GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX indicates that rename detection\nshould be processed between the head and the index and enables\nthe GIT_STATUS_INDEX_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates that rename\ndetection should be run between the index and the working directory\nand enabled GIT_STATUS_WT_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-sensitive order
  • \n
  • GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-insensitive order
  • \n
  • GIT_STATUS_OPT_RENAMES_FROM_REWRITES indicates that rename detection\nshould include rewritten files
  • \n
  • GIT_STATUS_OPT_NO_REFRESH bypasses the default status behavior of\ndoing a "soft" index reload (i.e. reloading the index data if the\nfile on disk has been modified outside libgit2).
  • \n
  • GIT_STATUS_OPT_UPDATE_INDEX tells libgit2 to refresh the stat cache\nin the index for files that are unchanged but have out of date stat\ninformation in the index. It will result in less work being done on\nsubsequent calls to get status. This is mutually exclusive with the\nNO_REFRESH option.
  • \n
\n\n

Calling git_status_foreach() is like calling the extended version\n with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED,\n and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled\n together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNTRACKED", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_IGNORED", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNMODIFIED", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_EXCLUDE_SUBMODULES", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RECURSE_IGNORED_DIRS", + "comments": "", + "value": 64 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_SORT_CASE_SENSITIVELY", + "comments": "", + "value": 512 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY", + "comments": "", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_RENAMES_FROM_REWRITES", + "comments": "", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_NO_REFRESH", + "comments": "", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_UPDATE_INDEX", + "comments": "", + "value": 8192 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", + "comments": "", + "value": 32768 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_status_show_t", + { + "decl": [ + "GIT_STATUS_SHOW_INDEX_AND_WORKDIR", + "GIT_STATUS_SHOW_INDEX_ONLY", + "GIT_STATUS_SHOW_WORKDIR_ONLY" + ], + "type": "enum", + "file": "status.h", + "line": 79, + "lineto": 83, + "block": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY", + "tdef": "typedef", + "description": " Select the files on which to report status.", + "comments": "

With git_status_foreach_ext, this will control which changes get\n callbacks. With git_status_list_new, these will control which\n changes are included in the list.

\n\n
    \n
  • GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This roughly\nmatches git status --porcelain regarding which files are\nincluded and in what order.
  • \n
  • GIT_STATUS_SHOW_INDEX_ONLY only gives status based on HEAD to index\ncomparison, not looking at working directory changes.
  • \n
  • GIT_STATUS_SHOW_WORKDIR_ONLY only gives status based on index to\nworking directory comparison, not comparing the index to the HEAD.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STATUS_SHOW_INDEX_ONLY", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_SHOW_WORKDIR_ONLY", + "comments": "", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_status_t", + { + "decl": [ + "GIT_STATUS_CURRENT", + "GIT_STATUS_INDEX_NEW", + "GIT_STATUS_INDEX_MODIFIED", + "GIT_STATUS_INDEX_DELETED", + "GIT_STATUS_INDEX_RENAMED", + "GIT_STATUS_INDEX_TYPECHANGE", + "GIT_STATUS_WT_NEW", + "GIT_STATUS_WT_MODIFIED", + "GIT_STATUS_WT_DELETED", + "GIT_STATUS_WT_TYPECHANGE", + "GIT_STATUS_WT_RENAMED", + "GIT_STATUS_WT_UNREADABLE", + "GIT_STATUS_IGNORED", + "GIT_STATUS_CONFLICTED" + ], + "type": "enum", + "file": "status.h", + "line": 32, + "lineto": 50, + "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_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED", + "tdef": "typedef", + "description": " Status flags for a single file.", + "comments": "

A combination of these values will be returned to indicate the status of\n a file. Status compares the working directory, the index, and the\n current HEAD of the repository. The GIT_STATUS_INDEX set of flags\n represents 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\n working directory relative to the index.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_STATUS_CURRENT", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_NEW", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_MODIFIED", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_DELETED", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_RENAMED", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_STATUS_INDEX_TYPECHANGE", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_NEW", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_MODIFIED", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_DELETED", + "comments": "", + "value": 512 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_TYPECHANGE", + "comments": "", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_RENAMED", + "comments": "", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_STATUS_WT_UNREADABLE", + "comments": "", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_STATUS_IGNORED", + "comments": "", + "value": 16384 + }, + { + "type": "int", + "name": "GIT_STATUS_CONFLICTED", + "comments": "", + "value": 32768 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_strarray", + { + "decl": [ + "char ** strings", + "size_t count" + ], + "type": "struct", + "value": "git_strarray", + "file": "strarray.h", + "line": 22, + "lineto": 25, + "block": "char ** strings\nsize_t count", + "tdef": "typedef", + "description": " Array of strings ", + "comments": "", + "fields": [ + { + "type": "char **", + "name": "strings", + "comments": "" + }, + { + "type": "size_t", + "name": "count", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [ + "git_index_add_all", + "git_index_remove_all", + "git_index_update_all", + "git_pathspec_new", + "git_reference_list", + "git_remote_download", + "git_remote_fetch", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_list", + "git_remote_push", + "git_remote_rename", + "git_remote_upload", + "git_reset_default", + "git_strarray_copy", + "git_strarray_free", + "git_tag_list", + "git_tag_list_match" + ] + } + } + ], + [ + "git_stream", + { + "decl": [ + "int version", + "int encrypted", + "int proxy_support", + "int (*)(struct git_stream *) connect", + "int (*)(git_cert **, struct git_stream *) certificate", + "int (*)(struct git_stream *, const char *) set_proxy", + "ssize_t (*)(struct git_stream *, void *, size_t) read", + "ssize_t (*)(struct git_stream *, const char *, size_t, int) write", + "int (*)(struct git_stream *) close", + "void (*)(struct git_stream *) free" + ], + "type": "struct", + "value": "git_stream", + "file": "sys/stream.h", + "line": 28, + "lineto": 40, + "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const char *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", + "tdef": "typedef", + "description": " Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as", + "comments": "
 struct my_stream {\n         git_stream parent;\n         ...\n }\n
\n\n

and fill the functions

\n", + "fields": [ + { + "type": "int", + "name": "version", + "comments": "" + }, + { + "type": "int", + "name": "encrypted", + "comments": "" + }, + { + "type": "int", + "name": "proxy_support", + "comments": "" + }, + { + "type": "int (*)(struct git_stream *)", + "name": "connect", + "comments": "" + }, + { + "type": "int (*)(git_cert **, struct git_stream *)", + "name": "certificate", + "comments": "" + }, + { + "type": "int (*)(struct git_stream *, const char *)", + "name": "set_proxy", + "comments": "" + }, + { + "type": "ssize_t (*)(struct git_stream *, void *, size_t)", + "name": "read", + "comments": "" + }, + { + "type": "ssize_t (*)(struct git_stream *, const char *, size_t, int)", + "name": "write", + "comments": "" + }, + { + "type": "int (*)(struct git_stream *)", + "name": "close", + "comments": "" + }, + { + "type": "void (*)(struct git_stream *)", + "name": "free", + "comments": "" + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_submodule", + { + "decl": "git_submodule", + "type": "struct", + "value": "git_submodule", + "file": "types.h", + "line": 335, + "lineto": 335, + "tdef": "typedef", + "description": " Opaque structure representing a submodule.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_submodule_add_finalize", + "git_submodule_add_setup", + "git_submodule_add_to_index", + "git_submodule_branch", + "git_submodule_fetch_recurse_submodules", + "git_submodule_foreach", + "git_submodule_free", + "git_submodule_head_id", + "git_submodule_ignore", + "git_submodule_index_id", + "git_submodule_init", + "git_submodule_location", + "git_submodule_lookup", + "git_submodule_name", + "git_submodule_open", + "git_submodule_owner", + "git_submodule_path", + "git_submodule_reload", + "git_submodule_repo_init", + "git_submodule_sync", + "git_submodule_update", + "git_submodule_update_strategy", + "git_submodule_url", + "git_submodule_wd_id" + ] + } + } + ], + [ + "git_submodule_ignore_t", + { + "decl": [ + "GIT_SUBMODULE_IGNORE_UNSPECIFIED", + "GIT_SUBMODULE_IGNORE_NONE", + "GIT_SUBMODULE_IGNORE_UNTRACKED", + "GIT_SUBMODULE_IGNORE_DIRTY", + "GIT_SUBMODULE_IGNORE_ALL" + ], + "type": "enum", + "file": "types.h", + "line": 399, + "lineto": 406, + "block": "GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL", + "tdef": "typedef", + "description": " Submodule ignore values", + "comments": "

These values represent settings for the submodule.$name.ignore\n configuration value which says how deeply to look at the working\n directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with\n git_submodule_set_ignore() and can write the changed value to disk\n with git_submodule_save(). If you have overwritten the value, you\n can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration
  • \n
  • GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an\nuntracked file, will mark the submodule as dirty. Ignored files are\nstill ignored, of course.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files; only changes\nto tracked files, or the index or the HEAD commit will matter.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory,\nonly considering changes if the HEAD of submodule has moved from the\nvalue in the superproject.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty
  • \n
  • GIT_SUBMODULE_IGNORE_DEFAULT: not used except as static initializer\nwhen we don't want any particular ignore rule to be specified.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_UNSPECIFIED", + "comments": "

use the submodule's configuration

\n", + "value": -1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_NONE", + "comments": "

any change or untracked == dirty

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_UNTRACKED", + "comments": "

dirty if tracked files change

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_DIRTY", + "comments": "

only dirty if HEAD moved

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_IGNORE_ALL", + "comments": "

never dirty

\n", + "value": 4 + } + ], + "used": { + "returns": [], + "needs": [ + "git_submodule_set_ignore", + "git_submodule_status" + ] + } + } + ], + [ + "git_submodule_recurse_t", + { + "decl": [ + "GIT_SUBMODULE_RECURSE_NO", + "GIT_SUBMODULE_RECURSE_YES", + "GIT_SUBMODULE_RECURSE_ONDEMAND" + ], + "type": "enum", + "file": "types.h", + "line": 418, + "lineto": 422, + "block": "GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND", + "tdef": "typedef", + "description": " Options for submodule recurse.", + "comments": "

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n
    \n
  • GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_YES - recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when\n commit not already in local clone
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_NO", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_YES", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_RECURSE_ONDEMAND", + "comments": "", + "value": 2 + } + ], + "used": { + "returns": [], + "needs": [ + "git_submodule_set_fetch_recurse_submodules" + ] + } + } + ], + [ + "git_submodule_status_t", + { + "decl": [ + "GIT_SUBMODULE_STATUS_IN_HEAD", + "GIT_SUBMODULE_STATUS_IN_INDEX", + "GIT_SUBMODULE_STATUS_IN_CONFIG", + "GIT_SUBMODULE_STATUS_IN_WD", + "GIT_SUBMODULE_STATUS_INDEX_ADDED", + "GIT_SUBMODULE_STATUS_INDEX_DELETED", + "GIT_SUBMODULE_STATUS_INDEX_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_UNINITIALIZED", + "GIT_SUBMODULE_STATUS_WD_ADDED", + "GIT_SUBMODULE_STATUS_WD_DELETED", + "GIT_SUBMODULE_STATUS_WD_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_WD_MODIFIED", + "GIT_SUBMODULE_STATUS_WD_UNTRACKED" + ], + "type": "enum", + "file": "submodule.h", + "line": 74, + "lineto": 89, + "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", + "description": " Return codes for submodule status.", + "comments": "

A combination of these flags will be returned to describe the status of a\n submodule. Depending on the "ignore" property of the submodule, some of\n the flags may never be returned because they indicate changes that are\n supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config\n files (both .git/config and .gitmodules), and the working directory. Any\n or all of those places might be missing information about the submodule\n depending on what state the repo is in. We consider all four places to\n build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info\n about what sources of submodule data are available. These will be\n returned even if ignore is set to "ALL".

\n\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
\n\n

The following values will be returned so long as ignore is not "ALL".

\n\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
\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n
    \n
  • WD_INDEX_MODIFIED - submodule workdir index is dirty
  • \n
  • WD_WD_MODIFIED - submodule workdir has modified files
  • \n
\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n
    \n
  • WD_UNTRACKED - wd contains untracked files
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_HEAD", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_INDEX", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_CONFIG", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_IN_WD", + "comments": "", + "value": 8 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_ADDED", + "comments": "", + "value": 16 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_DELETED", + "comments": "", + "value": 32 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_INDEX_MODIFIED", + "comments": "", + "value": 64 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_UNINITIALIZED", + "comments": "", + "value": 128 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_ADDED", + "comments": "", + "value": 256 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_DELETED", + "comments": "", + "value": 512 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_MODIFIED", + "comments": "", + "value": 1024 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED", + "comments": "", + "value": 2048 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_WD_MODIFIED", + "comments": "", + "value": 4096 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_STATUS_WD_UNTRACKED", + "comments": "", + "value": 8192 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_submodule_update_options", + { + "decl": [ + "unsigned int version", + "git_checkout_options checkout_opts", + "git_fetch_options fetch_opts", + "unsigned int clone_checkout_strategy" + ], + "type": "struct", + "value": "git_submodule_update_options", + "file": "submodule.h", + "line": 118, + "lineto": 146, + "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nunsigned int clone_checkout_strategy", + "tdef": "typedef", + "description": " Submodule update options structure", + "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings,\n like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", + "fields": [ + { + "type": "unsigned int", + "name": "version", + "comments": "" + }, + { + "type": "git_checkout_options", + "name": "checkout_opts", + "comments": " These options are passed to the checkout step. To disable\n checkout, set the `checkout_strategy` to\n `GIT_CHECKOUT_NONE`. Generally you will want the use\n GIT_CHECKOUT_SAFE to update files in the working\n directory. Use the `clone_checkout_strategy` field\n to set the checkout strategy that will be used in\n the case where update needs to clone the repository." + }, + { + "type": "git_fetch_options", + "name": "fetch_opts", + "comments": " Options which control the fetch, including callbacks.\n\n The callbacks to use for reporting fetch progress, and for acquiring\n credentials in the event they are needed." + }, + { + "type": "unsigned int", + "name": "clone_checkout_strategy", + "comments": " The checkout strategy to use when the sub repository needs to\n be cloned. Use GIT_CHECKOUT_SAFE to create all files\n in the working directory for the newly cloned repository." + } + ], + "used": { + "returns": [], + "needs": [ + "git_submodule_update", + "git_submodule_update_init_options" + ] + } + } + ], + [ + "git_submodule_update_t", + { + "decl": [ + "GIT_SUBMODULE_UPDATE_CHECKOUT", + "GIT_SUBMODULE_UPDATE_REBASE", + "GIT_SUBMODULE_UPDATE_MERGE", + "GIT_SUBMODULE_UPDATE_NONE", + "GIT_SUBMODULE_UPDATE_DEFAULT" + ], + "type": "enum", + "file": "types.h", + "line": 363, + "lineto": 370, + "block": "GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT", + "tdef": "typedef", + "description": " Submodule update values", + "comments": "

These values represent settings for the submodule.$name.update\n configuration value which says how to handle git submodule update for\n this submodule. The value is usually set in the ".gitmodules" file and\n copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with\n git_submodule_set_update() and write the changed value to disk using\n git_submodule_save(). If you have overwritten the value, you can\n revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is\nupdated, checkout the new detached HEAD to the submodule directory.
  • \n
  • GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked\nout branch onto the commit from the superproject.
  • \n
  • GIT_SUBMODULE_UPDATE_MERGE: update by merging the commit in the\nsuperproject into the current checkout out branch of the submodule.
  • \n
  • GIT_SUBMODULE_UPDATE_NONE: do not update this submodule even when\nthe commit in the superproject is updated.
  • \n
  • GIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer\nwhen we don't want any particular update rule to be specified.
  • \n
\n", + "fields": [ + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_CHECKOUT", + "comments": "", + "value": 1 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_REBASE", + "comments": "", + "value": 2 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_MERGE", + "comments": "", + "value": 3 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_NONE", + "comments": "", + "value": 4 + }, + { + "type": "int", + "name": "GIT_SUBMODULE_UPDATE_DEFAULT", + "comments": "", + "value": 0 + } + ], + "used": { + "returns": [], + "needs": [ + "git_submodule_set_update" + ] + } + } + ], + [ + "git_tag", + { + "decl": "git_tag", + "type": "struct", + "value": "git_tag", + "file": "types.h", + "line": 114, + "lineto": 114, + "tdef": "typedef", + "description": " Parsed representation of a tag object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_tag_free", + "git_tag_id", + "git_tag_lookup", + "git_tag_lookup_prefix", + "git_tag_message", + "git_tag_name", + "git_tag_owner", + "git_tag_peel", + "git_tag_tagger", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type" + ] + } + } + ], + [ + "git_time", + { + "decl": [ + "git_time_t time", + "int offset" + ], + "type": "struct", + "value": "git_time", + "file": "types.h", + "line": 156, + "lineto": 159, + "block": "git_time_t time\nint offset", + "tdef": "typedef", + "description": " Time in a signature ", + "comments": "", + "fields": [ + { + "type": "git_time_t", + "name": "time", + "comments": " time in seconds from epoch " + }, + { + "type": "int", + "name": "offset", + "comments": " timezone offset, in minutes " + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_trace_level_t", + { + "decl": [ + "GIT_TRACE_NONE", + "GIT_TRACE_FATAL", + "GIT_TRACE_ERROR", + "GIT_TRACE_WARN", + "GIT_TRACE_INFO", + "GIT_TRACE_DEBUG", + "GIT_TRACE_TRACE" + ], + "type": "enum", + "file": "trace.h", + "line": 26, + "lineto": 47, + "block": "GIT_TRACE_NONE\nGIT_TRACE_FATAL\nGIT_TRACE_ERROR\nGIT_TRACE_WARN\nGIT_TRACE_INFO\nGIT_TRACE_DEBUG\nGIT_TRACE_TRACE", + "tdef": "typedef", + "description": " Available tracing levels. When tracing is set to a particular level,\n callers will be provided tracing at the given level and all lower levels.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TRACE_NONE", + "comments": "

No tracing will be performed.

\n", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TRACE_FATAL", + "comments": "

Severe errors that may impact the program's execution

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_TRACE_ERROR", + "comments": "

Errors that do not impact the program's execution

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_TRACE_WARN", + "comments": "

Warnings that suggest abnormal data

\n", + "value": 3 + }, + { + "type": "int", + "name": "GIT_TRACE_INFO", + "comments": "

Informational messages about program execution

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_TRACE_DEBUG", + "comments": "

Detailed data that allows for debugging

\n", + "value": 5 + }, + { + "type": "int", + "name": "GIT_TRACE_TRACE", + "comments": "

Exceptionally detailed debugging data

\n", + "value": 6 + } + ], + "used": { + "returns": [], + "needs": [ + "git_trace_set" + ] + } + } + ], + [ + "git_transaction", + { + "decl": "git_transaction", + "type": "struct", + "value": "git_transaction", + "file": "types.h", + "line": 175, + "lineto": 175, + "tdef": "typedef", + "description": " Transactional interface to references ", + "comments": "", + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_transfer_progress", + { + "decl": [ + "unsigned int total_objects", + "unsigned int indexed_objects", + "unsigned int received_objects", + "unsigned int local_objects", + "unsigned int total_deltas", + "unsigned int indexed_deltas", + "size_t received_bytes" + ], + "type": "struct", + "value": "git_transfer_progress", + "file": "types.h", + "line": 253, + "lineto": 261, + "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", + "tdef": "typedef", + "description": " This is passed as the first argument to the callback to allow the\n user to see the progress.", + "comments": "
    \n
  • total_objects: number of objects in the packfile being downloaded
  • \n
  • indexed_objects: received objects that have been hashed
  • \n
  • received_objects: objects which have been downloaded
  • \n
  • local_objects: locally-available objects that have been injected\nin order to fix a thin pack.
  • \n
  • received-bytes: size of the packfile received up to now
  • \n
\n", + "fields": [ + { + "type": "unsigned int", + "name": "total_objects", + "comments": "" + }, + { + "type": "unsigned int", + "name": "indexed_objects", + "comments": "" + }, + { + "type": "unsigned int", + "name": "received_objects", + "comments": "" + }, + { + "type": "unsigned int", + "name": "local_objects", + "comments": "" + }, + { + "type": "unsigned int", + "name": "total_deltas", + "comments": "" + }, + { + "type": "unsigned int", + "name": "indexed_deltas", + "comments": "" + }, + { + "type": "size_t", + "name": "received_bytes", + "comments": "" + } + ], + "used": { + "returns": [ + "git_remote_stats" + ], + "needs": [ + "git_indexer_append", + "git_indexer_commit" + ] + } + } + ], + [ + "git_transport", + { + "decl": "git_transport", + "type": "struct", + "value": "git_transport", + "file": "types.h", + "line": 230, + "lineto": 230, + "tdef": "typedef", + "description": " Interface which represents a transport to communicate with a\n remote.", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_smart_subtransport_git", + "git_smart_subtransport_http", + "git_smart_subtransport_ssh", + "git_transport_dummy", + "git_transport_init", + "git_transport_local", + "git_transport_new", + "git_transport_smart", + "git_transport_ssh_with_paths" + ] + } + } + ], + [ + "git_transport_flags_t", + { + "decl": [ + "GIT_TRANSPORTFLAGS_NONE" + ], + "type": "enum", + "file": "sys/transport.h", + "line": 29, + "lineto": 31, + "block": "GIT_TRANSPORTFLAGS_NONE", + "tdef": "typedef", + "description": " Flags to pass to transport", + "comments": "

Currently unused.

\n", + "fields": [ + { + "type": "int", + "name": "GIT_TRANSPORTFLAGS_NONE", + "comments": "", + "value": 0 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], + [ + "git_tree", + { + "decl": "git_tree", + "type": "struct", + "value": "git_tree", + "file": "types.h", + "line": 126, + "lineto": 126, + "tdef": "typedef", + "description": " Representation of a tree object. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_commit_amend", + "git_commit_create", + "git_commit_create_v", + "git_commit_tree", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index", + "git_index_read_tree", + "git_merge_trees", + "git_pathspec_match_tree", + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_tree_entry_bypath", + "git_tree_entrycount", + "git_tree_free", + "git_tree_id", + "git_tree_lookup", + "git_tree_lookup_prefix", + "git_tree_owner", + "git_tree_walk", + "git_treebuilder_new" + ] + } + } + ], + [ + "git_tree_entry", + { + "decl": "git_tree_entry", + "type": "struct", + "value": "git_tree_entry", + "file": "types.h", + "line": 123, + "lineto": 123, + "tdef": "typedef", + "description": " Representation of each one of the entries in a tree object. ", + "comments": "", + "used": { + "returns": [ + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_treebuilder_get" + ], + "needs": [ + "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type", + "git_treebuilder_insert" + ] + } + } + ], + [ + "git_treebuilder", + { + "decl": "git_treebuilder", + "type": "struct", + "value": "git_treebuilder", + "file": "types.h", + "line": 129, + "lineto": 129, + "tdef": "typedef", + "description": " Constructor for in-memory trees ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write" + ] + } + } + ], + [ + "git_treewalk_mode", + { + "decl": [ + "GIT_TREEWALK_PRE", + "GIT_TREEWALK_POST" + ], + "type": "enum", + "file": "tree.h", + "line": 384, + "lineto": 387, + "block": "GIT_TREEWALK_PRE\nGIT_TREEWALK_POST", + "tdef": "typedef", + "description": " Tree traversal modes ", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_TREEWALK_PRE", + "comments": "", + "value": 0 + }, + { + "type": "int", + "name": "GIT_TREEWALK_POST", + "comments": "", + "value": 1 + } + ], + "used": { + "returns": [], + "needs": [ + "git_tree_walk" + ] + } + } + ], + [ + "git_writestream", + { + "decl": "git_writestream", + "type": "struct", + "value": "git_writestream", + "file": "types.h", + "line": 425, + "lineto": 425, + "tdef": "typedef", + "description": " A type to write in a streaming fashion, for example, for filters. ", + "comments": "", + "used": { + "returns": [], + "needs": [ + "git_filter_list_stream_blob", + "git_filter_list_stream_data", + "git_filter_list_stream_file" + ] + } + } + ] + ], + "prefix": "include/git2", + "groups": [ + [ + "annotated", + [ + "git_annotated_commit_free", + "git_annotated_commit_from_fetchhead", + "git_annotated_commit_from_ref", + "git_annotated_commit_from_revspec", + "git_annotated_commit_id", + "git_annotated_commit_lookup" + ] + ], + [ + "attr", + [ + "git_attr_add_macro", + "git_attr_cache_flush", + "git_attr_foreach", + "git_attr_get", + "git_attr_get_many", + "git_attr_value" + ] + ], + [ + "blame", + [ + "git_blame_buffer", + "git_blame_file", + "git_blame_free", + "git_blame_get_hunk_byindex", + "git_blame_get_hunk_byline", + "git_blame_get_hunk_count", + "git_blame_init_options" + ] + ], + [ + "blob", + [ + "git_blob_create_frombuffer", + "git_blob_create_fromchunks", + "git_blob_create_fromdisk", + "git_blob_create_fromworkdir", + "git_blob_filtered_content", + "git_blob_free", + "git_blob_id", + "git_blob_is_binary", + "git_blob_lookup", + "git_blob_lookup_prefix", + "git_blob_owner", + "git_blob_rawcontent", + "git_blob_rawsize" + ] + ], + [ + "branch", + [ + "git_branch_create", + "git_branch_create_from_annotated", + "git_branch_delete", + "git_branch_is_head", + "git_branch_iterator_free", + "git_branch_iterator_new", + "git_branch_lookup", + "git_branch_move", + "git_branch_name", + "git_branch_next", + "git_branch_set_upstream", + "git_branch_upstream" + ] + ], + [ + "buf", + [ + "git_buf_contains_nul", + "git_buf_free", + "git_buf_grow", + "git_buf_is_binary", + "git_buf_set" + ] + ], + [ + "checkout", + [ + "git_checkout_head", + "git_checkout_index", + "git_checkout_init_options", + "git_checkout_tree" + ] + ], + [ + "cherrypick", + [ + "git_cherrypick", + "git_cherrypick_commit", + "git_cherrypick_init_options" + ] + ], + [ + "clone", + [ + "git_clone", + "git_clone_init_options" + ] + ], + [ + "commit", + [ + "git_commit_amend", + "git_commit_author", + "git_commit_committer", + "git_commit_create", + "git_commit_create_from_callback", + "git_commit_create_from_ids", + "git_commit_create_v", + "git_commit_free", + "git_commit_header_field", + "git_commit_id", + "git_commit_lookup", + "git_commit_lookup_prefix", + "git_commit_message", + "git_commit_message_encoding", + "git_commit_message_raw", + "git_commit_nth_gen_ancestor", + "git_commit_owner", + "git_commit_parent", + "git_commit_parent_id", + "git_commit_parentcount", + "git_commit_raw_header", + "git_commit_summary", + "git_commit_time", + "git_commit_time_offset", + "git_commit_tree", + "git_commit_tree_id" + ] + ], + [ + "config", + [ + "git_config_add_backend", + "git_config_add_file_ondisk", + "git_config_backend_foreach_match", + "git_config_delete_entry", + "git_config_delete_multivar", + "git_config_entry_free", + "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_entry", + "git_config_get_int32", + "git_config_get_int64", + "git_config_get_mapped", + "git_config_get_multivar_foreach", + "git_config_get_path", + "git_config_get_string", + "git_config_get_string_buf", + "git_config_init_backend", + "git_config_iterator_free", + "git_config_iterator_glob_new", + "git_config_iterator_new", + "git_config_lookup_map_value", + "git_config_multivar_iterator_new", + "git_config_new", + "git_config_next", + "git_config_open_default", + "git_config_open_global", + "git_config_open_level", + "git_config_open_ondisk", + "git_config_parse_bool", + "git_config_parse_int32", + "git_config_parse_int64", + "git_config_parse_path", + "git_config_set_bool", + "git_config_set_int32", + "git_config_set_int64", + "git_config_set_multivar", + "git_config_set_string", + "git_config_snapshot" + ] + ], + [ + "cred", + [ + "git_cred_default_new", + "git_cred_has_username", + "git_cred_ssh_custom_new", + "git_cred_ssh_interactive_new", + "git_cred_ssh_key_from_agent", + "git_cred_ssh_key_memory_new", + "git_cred_ssh_key_new", + "git_cred_username_new", + "git_cred_userpass", + "git_cred_userpass_plaintext_new" + ] + ], + [ + "describe", + [ + "git_describe_commit", + "git_describe_format", + "git_describe_result_free", + "git_describe_workdir" + ] + ], + [ + "diff", + [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_find_init_options", + "git_diff_find_similar", + "git_diff_foreach", + "git_diff_format_email", + "git_diff_format_email_init_options", + "git_diff_free", + "git_diff_get_delta", + "git_diff_get_perfdata", + "git_diff_get_stats", + "git_diff_index_to_workdir", + "git_diff_init_options", + "git_diff_is_sorted_icase", + "git_diff_merge", + "git_diff_num_deltas", + "git_diff_num_deltas_of_type", + "git_diff_print", + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf", + "git_diff_status_char", + "git_diff_tree_to_index", + "git_diff_tree_to_tree", + "git_diff_tree_to_workdir", + "git_diff_tree_to_workdir_with_index" + ] + ], + [ + "fetch", + [ + "git_fetch_init_options" + ] + ], + [ + "filter", + [ + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_length", + "git_filter_list_load", + "git_filter_list_new", + "git_filter_list_push", + "git_filter_list_stream_blob", + "git_filter_list_stream_data", + "git_filter_list_stream_file", + "git_filter_lookup", + "git_filter_register", + "git_filter_source_filemode", + "git_filter_source_flags", + "git_filter_source_id", + "git_filter_source_mode", + "git_filter_source_path", + "git_filter_source_repo", + "git_filter_unregister" + ] + ], + [ + "giterr", + [ + "giterr_clear", + "giterr_detach", + "giterr_last", + "giterr_set_oom", + "giterr_set_str" + ] + ], + [ + "graph", + [ + "git_graph_ahead_behind", + "git_graph_descendant_of" + ] + ], + [ + "hashsig", + [ + "git_hashsig_compare", + "git_hashsig_create", + "git_hashsig_create_fromfile", + "git_hashsig_free" + ] + ], + [ + "ignore", + [ + "git_ignore_add_rule", + "git_ignore_clear_internal_rules", + "git_ignore_path_is_ignored" + ] + ], + [ + "index", + [ + "git_index_add", + "git_index_add_all", + "git_index_add_bypath", + "git_index_add_frombuffer", + "git_index_caps", + "git_index_checksum", + "git_index_clear", + "git_index_conflict_add", + "git_index_conflict_cleanup", + "git_index_conflict_get", + "git_index_conflict_iterator_free", + "git_index_conflict_iterator_new", + "git_index_conflict_next", + "git_index_conflict_remove", + "git_index_entry_is_conflict", + "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_path", + "git_index_read", + "git_index_read_tree", + "git_index_remove", + "git_index_remove_all", + "git_index_remove_bypath", + "git_index_remove_directory", + "git_index_set_caps", + "git_index_update_all", + "git_index_write", + "git_index_write_tree", + "git_index_write_tree_to" + ] + ], + [ + "indexer", + [ + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_new" + ] + ], + [ + "libgit2", + [ + "git_libgit2_features", + "git_libgit2_init", + "git_libgit2_opts", + "git_libgit2_shutdown", + "git_libgit2_version" + ] + ], + [ + "mempack", + [ + "git_mempack_new", + "git_mempack_reset" + ] + ], + [ + "merge", + [ + "git_merge", + "git_merge_analysis", + "git_merge_base", + "git_merge_base_many", + "git_merge_base_octopus", + "git_merge_bases", + "git_merge_bases_many", + "git_merge_commits", + "git_merge_file", + "git_merge_file_from_index", + "git_merge_file_init_input", + "git_merge_file_init_options", + "git_merge_file_result_free", + "git_merge_init_options", + "git_merge_trees" + ] + ], + [ + "message", + [ + "git_message_prettify" + ] + ], + [ + "note", + [ + "git_note_author", + "git_note_committer", + "git_note_create", + "git_note_foreach", + "git_note_free", + "git_note_id", + "git_note_iterator_free", + "git_note_iterator_new", + "git_note_message", + "git_note_next", + "git_note_read", + "git_note_remove" + ] + ], + [ + "object", + [ + "git_object__size", + "git_object_dup", + "git_object_free", + "git_object_id", + "git_object_lookup", + "git_object_lookup_bypath", + "git_object_lookup_prefix", + "git_object_owner", + "git_object_peel", + "git_object_short_id", + "git_object_string2type", + "git_object_type", + "git_object_type2string", + "git_object_typeisloose" + ] + ], + [ + "odb", + [ + "git_odb_add_alternate", + "git_odb_add_backend", + "git_odb_add_disk_alternate", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", + "git_odb_exists", + "git_odb_exists_prefix", + "git_odb_foreach", + "git_odb_free", + "git_odb_get_backend", + "git_odb_hash", + "git_odb_hashfile", + "git_odb_init_backend", + "git_odb_new", + "git_odb_num_backends", + "git_odb_object_data", + "git_odb_object_dup", + "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_refresh", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write", + "git_odb_write", + "git_odb_write_pack" + ] + ], + [ + "oid", + [ + "git_oid_cmp", + "git_oid_cpy", + "git_oid_equal", + "git_oid_fmt", + "git_oid_fromraw", + "git_oid_fromstr", + "git_oid_fromstrn", + "git_oid_fromstrp", + "git_oid_iszero", + "git_oid_ncmp", + "git_oid_nfmt", + "git_oid_pathfmt", + "git_oid_shorten_add", + "git_oid_shorten_free", + "git_oid_shorten_new", + "git_oid_strcmp", + "git_oid_streq", + "git_oid_tostr", + "git_oid_tostr_s" + ] + ], + [ + "oidarray", + [ + "git_oidarray_free" + ] + ], + [ + "openssl", + [ + "git_openssl_set_locking" + ] + ], + [ + "packbuilder", + [ + "git_packbuilder_foreach", + "git_packbuilder_free", + "git_packbuilder_hash", + "git_packbuilder_insert", + "git_packbuilder_insert_commit", + "git_packbuilder_insert_recur", + "git_packbuilder_insert_tree", + "git_packbuilder_insert_walk", + "git_packbuilder_new", + "git_packbuilder_object_count", + "git_packbuilder_set_callbacks", + "git_packbuilder_set_threads", + "git_packbuilder_write", + "git_packbuilder_written" + ] + ], + [ + "patch", + [ + "git_patch_free", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", + "git_patch_from_diff", + "git_patch_get_delta", + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_line_stats", + "git_patch_num_hunks", + "git_patch_num_lines_in_hunk", + "git_patch_print", + "git_patch_size", + "git_patch_to_buf" + ] + ], + [ + "pathspec", + [ + "git_pathspec_free", + "git_pathspec_match_diff", + "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", + "git_pathspec_match_tree", + "git_pathspec_match_workdir", + "git_pathspec_matches_path", + "git_pathspec_new" + ] + ], + [ + "push", + [ + "git_push_init_options" + ] + ], + [ + "rebase", + [ + "git_rebase_abort", + "git_rebase_commit", + "git_rebase_finish", + "git_rebase_free", + "git_rebase_init", + "git_rebase_init_options", + "git_rebase_next", + "git_rebase_open", + "git_rebase_operation_byindex", + "git_rebase_operation_current", + "git_rebase_operation_entrycount" + ] + ], + [ + "refdb", + [ + "git_refdb_backend_fs", + "git_refdb_compress", + "git_refdb_free", + "git_refdb_init_backend", + "git_refdb_new", + "git_refdb_open", + "git_refdb_set_backend" + ] + ], + [ + "reference", + [ + "git_reference__alloc", + "git_reference__alloc_symbolic", + "git_reference_cmp", + "git_reference_create", + "git_reference_create_matching", + "git_reference_delete", + "git_reference_dwim", + "git_reference_ensure_log", + "git_reference_foreach", + "git_reference_foreach_glob", + "git_reference_foreach_name", + "git_reference_free", + "git_reference_has_log", + "git_reference_is_branch", + "git_reference_is_note", + "git_reference_is_remote", + "git_reference_is_tag", + "git_reference_is_valid_name", + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", + "git_reference_list", + "git_reference_lookup", + "git_reference_name", + "git_reference_name_to_id", + "git_reference_next", + "git_reference_next_name", + "git_reference_normalize_name", + "git_reference_owner", + "git_reference_peel", + "git_reference_remove", + "git_reference_rename", + "git_reference_resolve", + "git_reference_set_target", + "git_reference_shorthand", + "git_reference_symbolic_create", + "git_reference_symbolic_create_matching", + "git_reference_symbolic_set_target", + "git_reference_symbolic_target", + "git_reference_target", + "git_reference_target_peel", + "git_reference_type" + ] + ], + [ + "reflog", + [ + "git_reflog_append", + "git_reflog_delete", + "git_reflog_drop", + "git_reflog_entry_byindex", + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message", + "git_reflog_entrycount", + "git_reflog_free", + "git_reflog_read", + "git_reflog_rename", + "git_reflog_write" + ] + ], + [ + "refspec", + [ + "git_refspec_direction", + "git_refspec_dst", + "git_refspec_dst_matches", + "git_refspec_force", + "git_refspec_rtransform", + "git_refspec_src", + "git_refspec_src_matches", + "git_refspec_string", + "git_refspec_transform" + ] + ], + [ + "remote", + [ + "git_remote_add_fetch", + "git_remote_add_push", + "git_remote_autotag", + "git_remote_connect", + "git_remote_connected", + "git_remote_create", + "git_remote_create_anonymous", + "git_remote_create_with_fetchspec", + "git_remote_default_branch", + "git_remote_delete", + "git_remote_disconnect", + "git_remote_download", + "git_remote_dup", + "git_remote_fetch", + "git_remote_free", + "git_remote_get_fetch_refspecs", + "git_remote_get_push_refspecs", + "git_remote_get_refspec", + "git_remote_init_callbacks", + "git_remote_is_valid_name", + "git_remote_list", + "git_remote_lookup", + "git_remote_ls", + "git_remote_name", + "git_remote_owner", + "git_remote_prune", + "git_remote_prune_refs", + "git_remote_push", + "git_remote_pushurl", + "git_remote_refspec_count", + "git_remote_rename", + "git_remote_set_autotag", + "git_remote_set_pushurl", + "git_remote_set_url", + "git_remote_stats", + "git_remote_stop", + "git_remote_update_tips", + "git_remote_upload", + "git_remote_url" + ] + ], + [ + "repository", + [ + "git_repository__cleanup", + "git_repository_config", + "git_repository_config_snapshot", + "git_repository_detach_head", + "git_repository_discover", + "git_repository_fetchhead_foreach", + "git_repository_free", + "git_repository_get_namespace", + "git_repository_hashfile", + "git_repository_head", + "git_repository_head_detached", + "git_repository_head_unborn", + "git_repository_ident", + "git_repository_index", + "git_repository_init", + "git_repository_init_ext", + "git_repository_init_init_options", + "git_repository_is_bare", + "git_repository_is_empty", + "git_repository_is_shallow", + "git_repository_mergehead_foreach", + "git_repository_message", + "git_repository_message_remove", + "git_repository_new", + "git_repository_odb", + "git_repository_open", + "git_repository_open_bare", + "git_repository_open_ext", + "git_repository_path", + "git_repository_refdb", + "git_repository_reinit_filesystem", + "git_repository_set_bare", + "git_repository_set_config", + "git_repository_set_head", + "git_repository_set_head_detached", + "git_repository_set_head_detached_from_annotated", + "git_repository_set_ident", + "git_repository_set_index", + "git_repository_set_namespace", + "git_repository_set_odb", + "git_repository_set_refdb", + "git_repository_set_workdir", + "git_repository_state", + "git_repository_state_cleanup", + "git_repository_workdir", + "git_repository_wrap_odb" + ] + ], + [ + "reset", + [ + "git_reset", + "git_reset_default", + "git_reset_from_annotated" + ] + ], + [ + "revert", + [ + "git_revert", + "git_revert_commit", + "git_revert_init_options" + ] + ], + [ + "revparse", + [ + "git_revparse", + "git_revparse_ext", + "git_revparse_single" + ] + ], + [ + "revwalk", + [ + "git_revwalk_add_hide_cb", + "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_range", + "git_revwalk_push_ref", + "git_revwalk_repository", + "git_revwalk_reset", + "git_revwalk_simplify_first_parent", + "git_revwalk_sorting" + ] + ], + [ + "signature", + [ + "git_signature_default", + "git_signature_dup", + "git_signature_free", + "git_signature_new", + "git_signature_now" + ] + ], + [ + "smart", + [ + "git_smart_subtransport_git", + "git_smart_subtransport_http", + "git_smart_subtransport_ssh" + ] + ], + [ + "stash", + [ + "git_stash_apply", + "git_stash_apply_init_options", + "git_stash_drop", + "git_stash_foreach", + "git_stash_pop" + ] + ], + [ + "status", + [ + "git_status_byindex", + "git_status_file", + "git_status_foreach", + "git_status_foreach_ext", + "git_status_init_options", + "git_status_list_entrycount", + "git_status_list_free", + "git_status_list_get_perfdata", + "git_status_list_new", + "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_branch", + "git_submodule_fetch_recurse_submodules", + "git_submodule_foreach", + "git_submodule_free", + "git_submodule_head_id", + "git_submodule_ignore", + "git_submodule_index_id", + "git_submodule_init", + "git_submodule_location", + "git_submodule_lookup", + "git_submodule_name", + "git_submodule_open", + "git_submodule_owner", + "git_submodule_path", + "git_submodule_reload", + "git_submodule_repo_init", + "git_submodule_resolve_url", + "git_submodule_set_branch", + "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_update_init_options", + "git_submodule_update_strategy", + "git_submodule_url", + "git_submodule_wd_id" + ] + ], + [ + "tag", + [ + "git_tag_annotation_create", + "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_owner", + "git_tag_peel", + "git_tag_tagger", + "git_tag_target", + "git_tag_target_id", + "git_tag_target_type" + ] + ], + [ + "trace", + [ + "git_trace_set" + ] + ], + [ + "transport", + [ + "git_transport_dummy", + "git_transport_init", + "git_transport_local", + "git_transport_new", + "git_transport_smart", + "git_transport_ssh_with_paths", + "git_transport_unregister" + ] + ], + [ + "tree", + [ + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "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_owner", + "git_tree_walk" + ] + ], + [ + "treebuilder", + [ + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write" + ] + ] + ], + "examples": [ + [ + "add.c", + "ex/v0.23.2/add.html" + ], + [ + "blame.c", + "ex/v0.23.2/blame.html" + ], + [ + "cat-file.c", + "ex/v0.23.2/cat-file.html" + ], + [ + "common.c", + "ex/v0.23.2/common.html" + ], + [ + "describe.c", + "ex/v0.23.2/describe.html" + ], + [ + "diff.c", + "ex/v0.23.2/diff.html" + ], + [ + "for-each-ref.c", + "ex/v0.23.2/for-each-ref.html" + ], + [ + "general.c", + "ex/v0.23.2/general.html" + ], + [ + "init.c", + "ex/v0.23.2/init.html" + ], + [ + "log.c", + "ex/v0.23.2/log.html" + ], + [ + "network/clone.c", + "ex/v0.23.2/network/clone.html" + ], + [ + "network/common.c", + "ex/v0.23.2/network/common.html" + ], + [ + "network/fetch.c", + "ex/v0.23.2/network/fetch.html" + ], + [ + "network/git2.c", + "ex/v0.23.2/network/git2.html" + ], + [ + "network/index-pack.c", + "ex/v0.23.2/network/index-pack.html" + ], + [ + "network/ls-remote.c", + "ex/v0.23.2/network/ls-remote.html" + ], + [ + "remote.c", + "ex/v0.23.2/remote.html" + ], + [ + "rev-list.c", + "ex/v0.23.2/rev-list.html" + ], + [ + "rev-parse.c", + "ex/v0.23.2/rev-parse.html" + ], + [ + "showindex.c", + "ex/v0.23.2/showindex.html" + ], + [ + "status.c", + "ex/v0.23.2/status.html" + ], + [ + "tag.c", + "ex/v0.23.2/tag.html" + ] + ] +} From 138f39826b0c1784156889e25df5628ec66a7a34 Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 25 Apr 2016 11:36:36 -0700 Subject: [PATCH 03/11] Rename libgit2 docs json to just `libgit2-docs.json` --- generate/input/{v0.23.4.json => libgit2-docs.json} | 0 generate/scripts/generateJson.js | 3 +-- generate/scripts/helpers.js | 3 +-- package.json | 3 +-- 4 files changed, 3 insertions(+), 6 deletions(-) rename generate/input/{v0.23.4.json => libgit2-docs.json} (100%) diff --git a/generate/input/v0.23.4.json b/generate/input/libgit2-docs.json similarity index 100% rename from generate/input/v0.23.4.json rename to generate/input/libgit2-docs.json diff --git a/generate/scripts/generateJson.js b/generate/scripts/generateJson.js index af43ef508..369218b2e 100644 --- a/generate/scripts/generateJson.js +++ b/generate/scripts/generateJson.js @@ -2,8 +2,7 @@ const path = require("path"); const utils = require("./utils"); var _; -var version = require("../../package.json").vendorDependencies.libgit2.version; -var libgit2 = require("../input/v" + version + ".json"); +var libgit2 = require("../input/libgit2-docs.json"); var descriptor = require("../input/descriptor.json"); var supplement = require("../input/libgit2-supplement.json"); diff --git a/generate/scripts/helpers.js b/generate/scripts/helpers.js index ace88803b..bd8d61fc5 100644 --- a/generate/scripts/helpers.js +++ b/generate/scripts/helpers.js @@ -6,10 +6,9 @@ var path = require("path"); var fs = require("fs"); // TODO: When libgit2's docs include callbacks we should be able to remove this -var version = require("../../package.json").vendorDependencies.libgit2.version; var callbackDefs = require("../input/callbacks.json"); var descriptor = require("../input/descriptor.json"); -var libgit2 = require("../input/v" + version + ".json"); +var libgit2 = require("../input/libgit2-docs.json"); var cTypes = libgit2.groups.map(function(group) { return group[0];}); diff --git a/package.json b/package.json index 526ab5873..dd165323f 100644 --- a/package.json +++ b/package.json @@ -57,8 +57,7 @@ }, "vendorDependencies": { "libgit2": { - "sha": "e8feafe32007ebd16a61820c70abd221655d053c", - "version": "0.23.4" + "sha": "e8feafe32007ebd16a61820c70abd221655d053c" }, "libssh2": "1.6.0", "http_parser": "2.5.0" From eab9618c315748189b5c65ee7a42dfd3d5ed6fa6 Mon Sep 17 00:00:00 2001 From: John Haley Date: Tue, 26 Apr 2016 10:21:13 -0700 Subject: [PATCH 04/11] Update to libgit2 v0.24.1 --- generate/input/libgit2-docs.json | 4234 ++++++++++------- vendor/libgit2/.mailmap | 3 +- vendor/libgit2/.travis.yml | 4 +- vendor/libgit2/CHANGELOG.md | 116 +- vendor/libgit2/CMakeLists.txt | 88 +- vendor/libgit2/CODE_OF_CONDUCT.md | 75 + vendor/libgit2/CONVENTIONS.md | 32 + vendor/libgit2/PROJECTS.md | 6 +- vendor/libgit2/README.md | 22 +- vendor/libgit2/THREADING.md | 16 +- vendor/libgit2/appveyor.yml | 6 +- vendor/libgit2/deps/http-parser/http_parser.c | 7 +- vendor/libgit2/examples/network/fetch.c | 102 +- vendor/libgit2/examples/network/ls-remote.c | 2 +- vendor/libgit2/git.git-authors | 1 + vendor/libgit2/include/git2/blame.h | 12 +- vendor/libgit2/include/git2/blob.h | 4 +- vendor/libgit2/include/git2/commit.h | 31 + vendor/libgit2/include/git2/common.h | 51 +- vendor/libgit2/include/git2/config.h | 42 +- vendor/libgit2/include/git2/diff.h | 63 +- vendor/libgit2/include/git2/errors.h | 18 +- vendor/libgit2/include/git2/index.h | 39 +- vendor/libgit2/include/git2/merge.h | 60 +- vendor/libgit2/include/git2/rebase.h | 36 +- vendor/libgit2/include/git2/remote.h | 13 +- vendor/libgit2/include/git2/repository.h | 2 + vendor/libgit2/include/git2/stash.h | 4 +- vendor/libgit2/include/git2/submodule.h | 13 +- vendor/libgit2/include/git2/sys/config.h | 14 + vendor/libgit2/include/git2/sys/filter.h | 56 +- vendor/libgit2/include/git2/sys/index.h | 2 +- vendor/libgit2/include/git2/sys/odb_backend.h | 4 + .../libgit2/include/git2/sys/refdb_backend.h | 9 +- vendor/libgit2/include/git2/sys/stream.h | 13 + vendor/libgit2/include/git2/sys/transport.h | 27 + vendor/libgit2/include/git2/transport.h | 46 +- vendor/libgit2/include/git2/version.h | 8 +- vendor/libgit2/libgit2.pc.in | 2 +- vendor/libgit2/script/cibuild.sh | 6 +- vendor/libgit2/script/coverity.sh | 21 +- vendor/libgit2/script/install-deps-osx.sh | 3 +- vendor/libgit2/script/user_nodefs.h | 34 + vendor/libgit2/src/annotated_commit.c | 89 +- vendor/libgit2/src/annotated_commit.h | 27 +- vendor/libgit2/src/array.h | 40 + vendor/libgit2/src/attr_file.c | 11 +- vendor/libgit2/src/attrcache.c | 5 +- vendor/libgit2/src/blame.c | 35 +- vendor/libgit2/src/blame.h | 6 +- vendor/libgit2/src/blame_git.c | 41 +- vendor/libgit2/src/branch.c | 13 +- vendor/libgit2/src/checkout.c | 51 +- vendor/libgit2/src/clone.c | 4 +- vendor/libgit2/src/commit.c | 234 +- vendor/libgit2/src/commit.h | 1 + vendor/libgit2/src/commit_list.c | 2 +- vendor/libgit2/src/common.h | 29 +- vendor/libgit2/src/config.c | 46 + vendor/libgit2/src/config.h | 16 + vendor/libgit2/src/config_cache.c | 3 +- vendor/libgit2/src/config_file.c | 183 +- vendor/libgit2/src/config_file.h | 10 + vendor/libgit2/src/crlf.c | 2 +- vendor/libgit2/src/curl_stream.c | 20 +- vendor/libgit2/src/describe.c | 3 +- vendor/libgit2/src/diff.c | 169 +- vendor/libgit2/src/diff.h | 1 - vendor/libgit2/src/diff_file.c | 25 + vendor/libgit2/src/diff_print.c | 6 +- vendor/libgit2/src/diff_tform.c | 39 +- vendor/libgit2/src/errors.c | 115 +- vendor/libgit2/src/filebuf.c | 13 +- vendor/libgit2/src/fileops.c | 325 +- vendor/libgit2/src/fileops.h | 22 +- vendor/libgit2/src/filter.c | 286 +- vendor/libgit2/src/filter.h | 2 + vendor/libgit2/src/global.c | 247 +- vendor/libgit2/src/global.h | 4 + vendor/libgit2/src/idxmap.h | 93 + vendor/libgit2/src/ignore.c | 30 +- vendor/libgit2/src/index.c | 767 ++- vendor/libgit2/src/index.h | 44 +- vendor/libgit2/src/indexer.c | 18 +- vendor/libgit2/src/iterator.c | 521 +- vendor/libgit2/src/iterator.h | 49 +- vendor/libgit2/src/merge.c | 546 ++- vendor/libgit2/src/merge.h | 4 +- vendor/libgit2/src/mwindow.c | 14 +- vendor/libgit2/src/netops.c | 4 + vendor/libgit2/src/notes.c | 2 +- vendor/libgit2/src/object.c | 35 +- vendor/libgit2/src/object.h | 23 + vendor/libgit2/src/odb.c | 20 +- vendor/libgit2/src/odb.h | 3 +- vendor/libgit2/src/odb_loose.c | 24 +- vendor/libgit2/src/odb_mempack.c | 5 +- vendor/libgit2/src/odb_pack.c | 8 +- vendor/libgit2/src/oid.h | 9 + vendor/libgit2/src/oidmap.h | 2 + vendor/libgit2/src/openssl_stream.c | 156 +- vendor/libgit2/src/openssl_stream.h | 2 + vendor/libgit2/src/pack-objects.c | 29 +- vendor/libgit2/src/pack.c | 37 +- vendor/libgit2/src/pack.h | 7 - vendor/libgit2/src/path.c | 51 +- vendor/libgit2/src/path.h | 31 +- vendor/libgit2/src/pathspec.c | 37 +- vendor/libgit2/src/pool.c | 329 +- vendor/libgit2/src/pool.h | 80 +- vendor/libgit2/src/posix.c | 14 +- vendor/libgit2/src/posix.h | 1 + vendor/libgit2/src/push.c | 15 +- vendor/libgit2/src/push.h | 1 + vendor/libgit2/src/rebase.c | 400 +- vendor/libgit2/src/refdb.c | 8 +- vendor/libgit2/src/refdb_fs.c | 49 +- vendor/libgit2/src/refs.c | 11 +- vendor/libgit2/src/refs.h | 5 + vendor/libgit2/src/refspec.c | 8 +- vendor/libgit2/src/remote.c | 63 +- vendor/libgit2/src/repository.c | 48 +- vendor/libgit2/src/reset.c | 12 +- vendor/libgit2/src/revwalk.c | 9 +- vendor/libgit2/src/settings.c | 67 +- vendor/libgit2/src/signature.c | 5 +- vendor/libgit2/src/sortedcache.c | 5 +- vendor/libgit2/src/stash.c | 31 +- vendor/libgit2/src/stransport_stream.c | 2 +- vendor/libgit2/src/stream.h | 3 + vendor/libgit2/src/submodule.c | 431 +- vendor/libgit2/src/sysdir.c | 49 +- vendor/libgit2/src/sysdir.h | 14 +- vendor/libgit2/src/tag.c | 2 +- vendor/libgit2/src/thread-utils.h | 2 +- vendor/libgit2/src/tls_stream.c | 13 + vendor/libgit2/src/transaction.c | 44 +- vendor/libgit2/src/transaction.h | 14 + vendor/libgit2/src/transport.c | 2 + vendor/libgit2/src/transports/cred.c | 8 + vendor/libgit2/src/transports/http.c | 19 +- vendor/libgit2/src/transports/smart.c | 95 + vendor/libgit2/src/transports/smart.h | 1 + vendor/libgit2/src/transports/smart_pkt.c | 35 +- .../libgit2/src/transports/smart_protocol.c | 80 +- vendor/libgit2/src/transports/ssh.c | 80 +- vendor/libgit2/src/transports/ssh.h | 12 + vendor/libgit2/src/transports/winhttp.c | 75 +- vendor/libgit2/src/tree.c | 232 +- vendor/libgit2/src/tree.h | 10 +- vendor/libgit2/src/unix/map.c | 7 +- vendor/libgit2/src/unix/posix.h | 16 +- vendor/libgit2/src/util.c | 48 + vendor/libgit2/src/util.h | 18 +- vendor/libgit2/src/vector.c | 7 + vendor/libgit2/src/vector.h | 1 + vendor/libgit2/src/win32/findfile.c | 10 + vendor/libgit2/src/win32/findfile.h | 1 + vendor/libgit2/src/win32/map.c | 29 +- vendor/libgit2/src/win32/mingw-compat.h | 6 - vendor/libgit2/src/win32/msvc-compat.h | 3 - vendor/libgit2/src/win32/posix.h | 10 +- vendor/libgit2/src/win32/posix_w32.c | 22 +- vendor/libgit2/src/win32/utf-conv.c | 21 +- .../libgit2/src/win32/w32_crtdbg_stacktrace.c | 343 ++ .../libgit2/src/win32/w32_crtdbg_stacktrace.h | 93 + vendor/libgit2/src/win32/w32_stack.c | 192 + vendor/libgit2/src/win32/w32_stack.h | 138 + vendor/libgit2/src/win32/w32_util.c | 34 +- vendor/libgit2/src/win32/w32_util.h | 87 +- vendor/libgit2/src/win32/win32-compat.h | 52 + vendor/libgit2/src/xdiff/xmerge.c | 9 +- vendor/libgit2/src/xdiff/xprepare.c | 3 +- vendor/libgit2/tests/attr/ignore.c | 13 + vendor/libgit2/tests/blame/blame_helpers.c | 4 +- vendor/libgit2/tests/blame/blame_helpers.h | 6 +- vendor/libgit2/tests/blame/simple.c | 12 + .../libgit2/tests/checkout/checkout_helpers.c | 12 +- vendor/libgit2/tests/checkout/crlf.c | 9 +- vendor/libgit2/tests/checkout/index.c | 4 +- vendor/libgit2/tests/cherrypick/workdir.c | 4 +- vendor/libgit2/tests/clar_libgit2.c | 62 +- vendor/libgit2/tests/clar_libgit2.h | 1 + vendor/libgit2/tests/clar_libgit2_trace.c | 19 + vendor/libgit2/tests/clone/nonetwork.c | 9 +- vendor/libgit2/tests/commit/commit.c | 47 +- vendor/libgit2/tests/commit/parse.c | 95 + vendor/libgit2/tests/commit/write.c | 113 +- vendor/libgit2/tests/config/global.c | 48 +- vendor/libgit2/tests/config/multivar.c | 2 +- vendor/libgit2/tests/config/stress.c | 23 + vendor/libgit2/tests/config/write.c | 98 +- vendor/libgit2/tests/core/array.c | 57 + vendor/libgit2/tests/core/buffer.c | 2 +- vendor/libgit2/tests/core/copy.c | 8 +- vendor/libgit2/tests/core/dirent.c | 29 + vendor/libgit2/tests/core/env.c | 20 +- vendor/libgit2/tests/core/errors.c | 52 +- vendor/libgit2/tests/core/features.c | 6 + vendor/libgit2/tests/core/filebuf.c | 35 + vendor/libgit2/tests/core/ftruncate.c | 2 +- vendor/libgit2/tests/core/futils.c | 68 + vendor/libgit2/tests/core/mkdir.c | 128 +- vendor/libgit2/tests/core/opts.c | 6 + vendor/libgit2/tests/core/pool.c | 88 +- vendor/libgit2/tests/core/posix.c | 2 +- vendor/libgit2/tests/core/stat.c | 2 +- vendor/libgit2/tests/core/stream.c | 51 + vendor/libgit2/tests/core/useragent.c | 11 + vendor/libgit2/tests/diff/format_email.c | 41 + vendor/libgit2/tests/diff/index.c | 40 +- vendor/libgit2/tests/diff/iterator.c | 62 +- vendor/libgit2/tests/diff/notify.c | 30 +- vendor/libgit2/tests/diff/tree.c | 2 +- vendor/libgit2/tests/diff/workdir.c | 326 +- vendor/libgit2/tests/filter/custom.c | 107 +- vendor/libgit2/tests/filter/custom_helpers.c | 108 + vendor/libgit2/tests/filter/custom_helpers.h | 18 + vendor/libgit2/tests/filter/stream.c | 2 +- vendor/libgit2/tests/filter/wildcard.c | 184 + vendor/libgit2/tests/index/add.c | 84 + vendor/libgit2/tests/index/addall.c | 35 + vendor/libgit2/tests/index/bypath.c | 314 ++ vendor/libgit2/tests/index/cache.c | 6 +- vendor/libgit2/tests/index/conflicts.c | 125 +- vendor/libgit2/tests/index/filemodes.c | 8 + vendor/libgit2/tests/index/nsec.c | 9 + vendor/libgit2/tests/index/racy.c | 243 +- vendor/libgit2/tests/index/rename.c | 36 + vendor/libgit2/tests/index/tests.c | 56 +- vendor/libgit2/tests/main.c | 19 - vendor/libgit2/tests/merge/conflict_data.h | 103 + vendor/libgit2/tests/merge/files.c | 1 + vendor/libgit2/tests/merge/merge_helpers.c | 12 +- vendor/libgit2/tests/merge/merge_helpers.h | 43 - vendor/libgit2/tests/merge/trees/automerge.c | 3 +- vendor/libgit2/tests/merge/trees/commits.c | 19 +- vendor/libgit2/tests/merge/trees/recursive.c | 410 ++ vendor/libgit2/tests/merge/trees/treediff.c | 14 +- vendor/libgit2/tests/merge/workdir/dirty.c | 13 +- .../libgit2/tests/merge/workdir/recursive.c | 84 + vendor/libgit2/tests/merge/workdir/renames.c | 6 +- vendor/libgit2/tests/merge/workdir/simple.c | 1 + vendor/libgit2/tests/network/fetchlocal.c | 39 +- .../tests/network/remote/defaultbranch.c | 6 +- vendor/libgit2/tests/network/remote/local.c | 8 +- vendor/libgit2/tests/network/remote/remotes.c | 6 +- vendor/libgit2/tests/object/tree/attributes.c | 2 + vendor/libgit2/tests/object/tree/write.c | 98 +- vendor/libgit2/tests/odb/alternates.c | 2 +- vendor/libgit2/tests/odb/sorting.c | 1 + vendor/libgit2/tests/online/badssl.c | 46 + vendor/libgit2/tests/online/clone.c | 130 +- vendor/libgit2/tests/online/fetch.c | 12 +- vendor/libgit2/tests/online/push.c | 28 +- vendor/libgit2/tests/online/push_util.c | 11 +- vendor/libgit2/tests/online/push_util.h | 4 +- vendor/libgit2/tests/path/core.c | 12 +- vendor/libgit2/tests/rebase/inmemory.c | 116 + vendor/libgit2/tests/rebase/iterator.c | 50 +- vendor/libgit2/tests/rebase/merge.c | 30 + vendor/libgit2/tests/refs/branches/delete.c | 2 + vendor/libgit2/tests/refs/create.c | 44 +- vendor/libgit2/tests/refs/lookup.c | 8 + vendor/libgit2/tests/refs/pack.c | 2 +- vendor/libgit2/tests/refs/reflog/reflog.c | 71 + vendor/libgit2/tests/repo/discover.c | 16 +- vendor/libgit2/tests/repo/init.c | 180 +- vendor/libgit2/tests/repo/iterator.c | 838 +++- vendor/libgit2/tests/repo/open.c | 4 +- vendor/libgit2/tests/repo/reservedname.c | 24 + vendor/libgit2/tests/repo/state.c | 18 + vendor/libgit2/tests/reset/hard.c | 58 +- .../37/681a80ca21064efd5c3bf2ef41eb3d05a1428b | Bin 0 -> 106 bytes .../4e/ecfea484f8005d101e547f6bfb07c99e2b114e | Bin 0 -> 163 bytes .../5a/572e2e94825f54b95417eacaa089d560c5a5e9 | Bin 0 -> 324 bytes .../66/53ff42313eb5c82806f145391b18a9699800c7 | Bin 0 -> 160 bytes .../ad/9cb4eac23df2fe5e1264287a5872ea2a1ff8b2 | Bin 0 -> 106 bytes .../de/9fe35f9906e1994e083cc59c87232bf418795b | Bin 0 -> 331 bytes .../resources/blametest.git/refs/heads/master | 2 +- .../resources/diff_format_email/.gitted/index | Bin 256 -> 289 bytes .../62/7e7e12d87e07a83fad5b6bfa25e86ead4a5270 | 1 + .../73/09653445ecf038d3e3dd9ed55edb6cb541a4ba | Bin 0 -> 28 bytes .../d5/ff67764c82f729b13c26a09576570d884d9687 | Bin 0 -> 121 bytes .../.gitted/refs/heads/master | 2 +- .../resources/diff_format_email/file3.txt | 1 + .../resources/merge-recursive/.gitted/HEAD | 1 + .../resources/merge-recursive/.gitted/config | 7 + .../resources/merge-recursive/.gitted/index | Bin 0 -> 619 bytes .../merge-recursive/.gitted/info/refs | 1 + .../00/6b298c5702b04c00370d0414959765b82fd722 | Bin 0 -> 207 bytes .../00/7f1ee2af8e5d99906867c4237510e1790a89b8 | 3 + .../01/6eef4a6fefd36bdcaa93ad773449ddc5c73cbb | Bin 0 -> 208 bytes .../05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd | Bin 0 -> 208 bytes .../06/db153c36829fc656e05cdf5a3bf7183f3c10aa | 2 + .../07/10c3c796e0704361472ecb904413fca0107a25 | Bin 0 -> 208 bytes .../07/2d89dcf3a7671ac34a8e875bb72fb39bcf14d7 | Bin 0 -> 208 bytes .../0b/b7ed583d7e9ad507e8b902594f5c9126ea456b | Bin 0 -> 161 bytes .../0e/8126647ec607f0a14122cec4b15315d790c8ff | Bin 0 -> 208 bytes .../0f/a6ead2731b9d138afe38c336c9727ea05027a7 | 1 + .../12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 | Bin 0 -> 208 bytes .../15/311229e70fa62653f73dde1d4deef1a8e47a11 | Bin 0 -> 710 bytes .../15/faa0c9991f2d65686e844651faa2ff9827887b | Bin 0 -> 665 bytes .../16/895aa5e13f8907d4adab81285557d938fad342 | Bin 0 -> 634 bytes .../1c/1bdb80c04233d1a9b9755913ee233987be6175 | Bin 0 -> 208 bytes .../1e/8dff96faaaa24f84943d2d9601dde61cb0398a | Bin 0 -> 268 bytes .../21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e | Bin 0 -> 670 bytes .../34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c | Bin 0 -> 208 bytes .../37/185b25a204309bf74817da1a607518f13ca3ed | Bin 0 -> 715 bytes .../37/a5054a9f9b4628e3924c5cb8f2147c6e2a3efc | Bin 0 -> 630 bytes .../38/55170cef875708da06ab9ad7fc6a73b531cda1 | Bin 0 -> 664 bytes .../3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 | 1 + .../3b/919b6e8a575b4779c8243ebea3e3beb436e88f | Bin 0 -> 208 bytes .../3f/d41804a7906db846af5e868444782e546af46a | Bin 0 -> 206 bytes .../41/71bb8d40e9fc830d79b757dc06ec6c14548b78 | Bin 0 -> 207 bytes .../42/1b392106e079df6d412babd5636697938269ec | 2 + .../42/44d13e2bbc38510320443bbb003f3967d12436 | Bin 0 -> 207 bytes .../42/cdad903aef3e7b614675e6584a8be417941911 | Bin 0 -> 208 bytes .../43/2faca0c62dc556ad71a22f23e541a46a8b0f6f | 2 + .../43/5424798e5e1b21dd4588d1c291ba4eb179a838 | Bin 0 -> 208 bytes .../43/6ea75c99f527e4b42fddb46abedf7726eb719d | 2 + .../48/3065df53c0f4a02cdc6b2910b05d388fc17ffb | Bin 0 -> 165 bytes .../4b/7c5650008b2e747fe1809eeb5a1dde0e80850a | Bin 0 -> 615 bytes .../4c/49317a0912ca559d2048bc329994eb7d10474f | Bin 0 -> 183 bytes .../4d/fc1be85a9d6c9898152444d32b238b4aecf8cc | Bin 0 -> 168 bytes .../4e/21d2d63357bde5027d1625f5ec6b430cdeb143 | Bin 0 -> 662 bytes .../4e/70a6b06fc62481f80fbb74327849e7170eebff | Bin 0 -> 207 bytes .../4f/4e85a0ab8515e34302721fbcec06fa9d9c1a9a | Bin 0 -> 631 bytes .../50/e4facaafb746cfed89287206274193c1417288 | 2 + .../53/9bd011c4822c560c1d17cab095006b7a10f707 | Bin 0 -> 163 bytes .../56/07a8c4601a737daadd1f470bde3142aff57026 | 1 + .../5a/ba269b3be41fc8db38068d3948c8af543fe609 | Bin 0 -> 208 bytes .../5b/8e1e56cb99e8b99ac22eec8aebf6422ecd08c0 | Bin 0 -> 208 bytes .../5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 | Bin 0 -> 672 bytes .../5f/18576d464946eb2338daeb8b4030019961f505 | Bin 0 -> 208 bytes .../63/e8773becdea9c3699c95a5740be5baa8be8d69 | Bin 0 -> 207 bytes .../65/bea8448ca5b3104628ffbca553c54bde54b0fc | 3 + .../66/6ffdfcf1eaa5641fa31064bf2607327e843c09 | Bin 0 -> 664 bytes .../68/a2e1ee61a23a4728fe6b35580fbbbf729df370 | Bin 0 -> 665 bytes .../68/af1fc7407fd9addf1701a87eb1c95c7494c598 | Bin 0 -> 443 bytes .../68/f6182f4c85d39e1309d97c7e456156dc9c0096 | Bin 0 -> 755 bytes .../6c/778edd0e4cf394f5a3df8b96db516024cc1bb8 | Bin 0 -> 636 bytes .../6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d | 1 + .../71/3e438567b28543235faf265c4c5b02b437c7fd | Bin 0 -> 207 bytes .../72/3181f1bfd30e47a6d1d36a4d874e31e7a0a1a4 | 2 + .../73/b20c8e09fa2726d69ff66969186014165da3c3 | Bin 0 -> 208 bytes .../74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 | Bin 0 -> 207 bytes .../75/c653822173a8e5795153ec3773dfe44bb9bb63 | 1 + .../78/3d6539dde96b8873c5b5da3e79cc14cd64830b | 4 + .../7a/9277e0c5ec75339f011c176d0c20e513c4de1c | 1 + .../7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f | 1 + .../7c/7e08f9559d9e1551b91e1cf68f1d0066109add | Bin 0 -> 443 bytes .../7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 | Bin 0 -> 208 bytes .../81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 | 5 + .../88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 | Bin 0 -> 208 bytes .../88/eb3f98849f4b8d0555395f514800900a01dc8f | Bin 0 -> 209 bytes .../89/8d12687fb35be271c27c795a6b32c8b51da79e | Bin 0 -> 663 bytes .../8a/bda8de114a93f2d3c5a975ee2960f31e24be58 | 2 + .../8f/35f30bfe09513f96cf8aa4df0834ae34e93bae | 1 + .../94/d2c01087f48213bd157222d54edfefd77c9bba | Bin 0 -> 621 bytes .../95/78b04e2087976e382622322ba476aa40398dc7 | Bin 0 -> 620 bytes .../96/23368f0fc562d6d840372ae17dc4cc32d51a80 | 2 + .../97/3b70322e758da87e1ce21d2195d86c5e4e9647 | 1 + .../98/1c79eb38518d3821e73bb159dc413bb42d6614 | Bin 0 -> 208 bytes .../9a/e63b4a8ce0f181b2d1d098971733a103226917 | Bin 0 -> 240 bytes .../9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 | Bin 0 -> 240 bytes .../9c/3f1c70db28c00ce74b22ba3edafe16d9cf03d4 | Bin 0 -> 208 bytes .../9e/12bce04446d097ae1782967a5888c2e2a0d35b | Bin 0 -> 268 bytes .../a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc | Bin 0 -> 649 bytes .../a0/65d3022e99a1943177c10a53cce38bc2127042 | Bin 0 -> 162 bytes .../a2/8c21c90aa36580641b345011869d1a899a6783 | 2 + .../a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 | 3 + .../a3/4e5a16feabbd0335a633aadb8217c9f3dba58d | Bin 0 -> 164 bytes .../a7/b066537e6be7109abfe4ff97b675d4e077da20 | Bin 0 -> 621 bytes .../a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 | Bin 0 -> 208 bytes .../aa/9e263294fd2f6f6fd9ceab23ca8ce3ea2ce707 | Bin 0 -> 175 bytes .../ad/1ea02c2cc4f55c1dff87b80a086206a73885eb | 2 + .../ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 | Bin 0 -> 170 bytes .../ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 | Bin 0 -> 208 bytes .../b2/a81ead9e722af0099fccfb478cea88eea749a2 | Bin 0 -> 664 bytes .../b4/cefb3c75770e57bb8bb44e4a50d9578009e847 | Bin 0 -> 639 bytes .../b9/1ef5ffa8612616c8e76051901caafd723f0e2c | Bin 0 -> 712 bytes .../bd/97980c22d122509cdd915fd9788d56c8d3ae20 | Bin 0 -> 163 bytes .../c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e | Bin 0 -> 207 bytes .../c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb | 1 + .../c4/e6cca3ec6ae0148ed231f97257df8c311e015f | 1 + .../ca/224bba0a8a24f1768804fe5f565b1014af7ef2 | Bin 0 -> 170 bytes .../ca/49d1a8b6116ffeba22667bba265fa5261df7ab | 2 + .../ca/7d316d6d9af99d2481e980d68b77e572d80fe7 | Bin 0 -> 207 bytes .../ca/fa936d25f0b397432a27201f6b3284c47df8be | Bin 0 -> 712 bytes .../cb/49ad76147f5f9439cbd6133708b76142660660 | Bin 0 -> 641 bytes .../d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a | Bin 0 -> 620 bytes .../d2/682aaf9594080ce877b5eeee110850fd6e3480 | 1 + .../d6/04c75019c282144bdbbf3fd3462ba74b240efc | Bin 0 -> 620 bytes .../d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 | Bin 0 -> 240 bytes .../d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41 | Bin 0 -> 277 bytes .../d8/e05a90b3c2240d71a20c2502c937d9b7d22777 | 2 + .../da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 | Bin 0 -> 208 bytes .../db/203155a789fb749aa3c14e93eea2c744a9c6c7 | 1 + .../de/a7215f259b2cced87d1bda6c72f8b4ce37a2ff | Bin 0 -> 357 bytes .../e1/512550f09d980214e46e6d3f5a2b20c3d75755 | Bin 0 -> 208 bytes .../e1/dcfc3038be54195a59817c89782b261e46cb05 | 1 + .../e2/93bfdddb81a853bbb16b8b58e68626f30841a4 | Bin 0 -> 207 bytes .../e2/c84bb33992a455b1a7a5019f0e38d883d3f475 | Bin 0 -> 208 bytes .../e2/d185fa827d58134cea20b9e1df893833c6560e | Bin 0 -> 208 bytes .../e5/0fbbd701458757bdfe9815f58ed717c588d1b5 | 3 + .../ef/1783444b61a8671beea4ce1f4d0202677dfbfb | 3 + .../f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 | Bin 0 -> 206 bytes .../f1/72517a8cf39e009ffff541ee52429b89e418f3 | Bin 0 -> 268 bytes .../f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e | Bin 0 -> 672 bytes .../f3/5f159ff5d44dfd9f52d63dd5b659f0521ff569 | Bin 0 -> 669 bytes .../f5/1658077d85f2264fa179b4d0848268cb3475c3 | 2 + .../f7/929c5a67a4bdc98247fb4b5098675723932a64 | Bin 0 -> 207 bytes .../fa/567f568ed72157c0c617438d077695b99d9aac | Bin 0 -> 662 bytes .../fd/8b5fe88cda995e70a22ed98701e65b843e05ec | Bin 0 -> 165 bytes .../fe/f01f3104c8047d05e8572e521c454f8fd4b8db | Bin 0 -> 207 bytes .../ff/b36e513f5fdf8a6ba850a20142676a2ac4807d | Bin 0 -> 355 bytes .../.gitted/refs/heads/branchA-1 | 1 + .../.gitted/refs/heads/branchA-2 | 1 + .../.gitted/refs/heads/branchB-1 | 1 + .../.gitted/refs/heads/branchB-2 | 1 + .../.gitted/refs/heads/branchC-1 | 1 + .../.gitted/refs/heads/branchC-2 | 1 + .../.gitted/refs/heads/branchD-1 | 1 + .../.gitted/refs/heads/branchD-2 | 1 + .../.gitted/refs/heads/branchE-1 | 1 + .../.gitted/refs/heads/branchE-2 | 1 + .../.gitted/refs/heads/branchE-3 | 1 + .../.gitted/refs/heads/branchF-1 | 1 + .../.gitted/refs/heads/branchF-2 | 1 + .../.gitted/refs/heads/branchG-1 | 1 + .../.gitted/refs/heads/branchG-2 | 1 + .../.gitted/refs/heads/branchH-1 | 1 + .../.gitted/refs/heads/branchH-2 | 1 + .../.gitted/refs/heads/branchI-1 | 1 + .../.gitted/refs/heads/branchI-2 | 1 + .../resources/merge-recursive/asparagus.txt | 10 + .../tests/resources/merge-recursive/beef.txt | 22 + .../resources/merge-recursive/bouilli.txt | 18 + .../tests/resources/merge-recursive/gravy.txt | 8 + .../resources/merge-recursive/oyster.txt | 13 + .../tests/resources/merge-recursive/veal.txt | 20 + .../2b/d0a343aeef7a2cf0d158478966a6e587ff3863 | Bin 0 -> 56 bytes .../d4/27e0b2e138501a3d15cc376077a3631e15bd46 | Bin 0 -> 38 bytes .../ee/3fa1b8c00aff7fe02065fdb50864bb0d932ccf | Bin 0 -> 64 bytes vendor/libgit2/tests/resources/sub.git/HEAD | 1 + vendor/libgit2/tests/resources/sub.git/config | 8 + vendor/libgit2/tests/resources/sub.git/index | Bin 0 -> 405 bytes .../libgit2/tests/resources/sub.git/logs/HEAD | 1 + .../resources/sub.git/logs/refs/heads/master | 1 + .../10/ddd6d257e01349d514541981aeecea6b2e741d | Bin 0 -> 22 bytes .../17/6a458f94e0ea5272ce67c36bf30b6be9caf623 | Bin 0 -> 28 bytes .../94/c7d78d85c933d1d95b56bc2de01833ba8559fb | Bin 0 -> 132 bytes .../b7/a59b3f4ea13b985f8a1e0d3757d5cd3331add8 | Bin 0 -> 139 bytes .../d0/ee23c41b28746d7e822511d7838bce784ae773 | Bin 0 -> 54 bytes .../tests/resources/sub.git/refs/heads/master | 1 + .../resources/submodule_with_path/.gitmodules | 3 + .../submodule_with_path/.gitted/HEAD | 1 + .../submodule_with_path/.gitted/config | 8 + .../submodule_with_path/.gitted/index | Bin 0 -> 253 bytes .../18/372280a56a54340fa600aa91315065c6c4c693 | Bin 0 -> 85 bytes .../36/683131578275f6a8fd1c539e0d5da0d8adff26 | Bin 0 -> 63 bytes .../89/ca686bb21bfb75dda99a02313831a0c418f921 | Bin 0 -> 161 bytes .../b1/620ef2628d10416a84d19c783e33dc4556c9c3 | Bin 0 -> 86 bytes .../ba/34c47dc9d3d0b1bb335b45c9d26ba1f0fc90c7 | Bin 0 -> 68 bytes .../c8/4bf57ba2254dba216ab5c6eb1a19fe8bd0e0d6 | Bin 0 -> 127 bytes .../d5/45fc6b40ec9e67332b6a1d2dedcbdb1bffeb6b | Bin 0 -> 51 bytes .../.gitted/refs/heads/master | 1 + .../resources/super/.gitted/COMMIT_EDITMSG | 1 + .../tests/resources/super/.gitted/HEAD | 1 + .../tests/resources/super/.gitted/config | 10 + .../tests/resources/super/.gitted/index | Bin 0 -> 217 bytes .../51/589c218bf77a8da9e9d8dbc097d76a742726c4 | Bin 0 -> 90 bytes .../79/d0d58ca6aa1688a073d280169908454cad5b91 | Bin 0 -> 132 bytes .../d7/57768b570a83e80d02edcc1032db14573e5034 | Bin 0 -> 87 bytes .../resources/super/.gitted/refs/heads/master | 1 + .../libgit2/tests/resources/super/gitmodules | 3 + .../ee/3fa1b8c00aff7fe02065fdb50864bb0d932ccf | Bin 0 -> 64 bytes .../resources/win32-forbidden/.gitted/HEAD | 1 + .../resources/win32-forbidden/.gitted/config | 7 + .../resources/win32-forbidden/.gitted/index | Bin 0 -> 577 bytes .../win32-forbidden/.gitted/info/exclude | 6 + .../10/68072702a28a82c78902cf5bf82c3864cf4356 | Bin 0 -> 143 bytes .../17/6a458f94e0ea5272ce67c36bf30b6be9caf623 | Bin 0 -> 28 bytes .../2d/7445a749d25269f32724aa621cb70b196bcc40 | Bin 0 -> 105 bytes .../34/96991d72d500af36edef68bbfcccd1661d88db | 3 + .../8f/45aad6f23b9509f8786c617e19c127ae76609a | 2 + .../da/623abd956bb2fd8052c708c7ed43f05d192d37 | Bin 0 -> 59 bytes .../ea/c7621a652e5261ef1c1d3e7ae31b0d84fcbaba | 3 + .../win32-forbidden/.gitted/refs/heads/master | 1 + vendor/libgit2/tests/revert/workdir.c | 4 +- vendor/libgit2/tests/revwalk/basic.c | 3 +- vendor/libgit2/tests/status/ignore.c | 29 +- vendor/libgit2/tests/status/worktree.c | 15 +- vendor/libgit2/tests/status/worktree_init.c | 4 +- vendor/libgit2/tests/submodule/lookup.c | 55 + vendor/libgit2/tests/submodule/status.c | 16 +- .../tests/submodule/submodule_helpers.c | 31 + .../tests/submodule/submodule_helpers.h | 2 + vendor/libgit2/tests/submodule/update.c | 48 + vendor/libgit2/tests/threads/iterator.c | 5 +- .../libgit2/tests/trace/windows/stacktrace.c | 151 + vendor/libgit2/tests/transport/register.c | 25 +- vendor/libgit2/tests/win32/forbidden.c | 183 + vendor/libgit2/tests/win32/longpath.c | 4 +- 505 files changed, 14813 insertions(+), 5170 deletions(-) create mode 100644 vendor/libgit2/CODE_OF_CONDUCT.md create mode 100644 vendor/libgit2/script/user_nodefs.h create mode 100644 vendor/libgit2/src/idxmap.h create mode 100644 vendor/libgit2/src/transaction.h create mode 100644 vendor/libgit2/src/transports/ssh.h create mode 100644 vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c create mode 100644 vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h create mode 100644 vendor/libgit2/src/win32/w32_stack.c create mode 100644 vendor/libgit2/src/win32/w32_stack.h create mode 100644 vendor/libgit2/src/win32/win32-compat.h create mode 100644 vendor/libgit2/tests/core/array.c create mode 100644 vendor/libgit2/tests/core/futils.c create mode 100644 vendor/libgit2/tests/core/stream.c create mode 100644 vendor/libgit2/tests/core/useragent.c create mode 100644 vendor/libgit2/tests/filter/custom_helpers.c create mode 100644 vendor/libgit2/tests/filter/custom_helpers.h create mode 100644 vendor/libgit2/tests/filter/wildcard.c create mode 100644 vendor/libgit2/tests/index/add.c create mode 100644 vendor/libgit2/tests/merge/conflict_data.h create mode 100644 vendor/libgit2/tests/merge/trees/recursive.c create mode 100644 vendor/libgit2/tests/merge/workdir/recursive.c create mode 100644 vendor/libgit2/tests/online/badssl.c create mode 100644 vendor/libgit2/tests/rebase/inmemory.c create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/37/681a80ca21064efd5c3bf2ef41eb3d05a1428b create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/4e/ecfea484f8005d101e547f6bfb07c99e2b114e create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/5a/572e2e94825f54b95417eacaa089d560c5a5e9 create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/66/53ff42313eb5c82806f145391b18a9699800c7 create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/ad/9cb4eac23df2fe5e1264287a5872ea2a1ff8b2 create mode 100644 vendor/libgit2/tests/resources/blametest.git/objects/de/9fe35f9906e1994e083cc59c87232bf418795b create mode 100644 vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/62/7e7e12d87e07a83fad5b6bfa25e86ead4a5270 create mode 100644 vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/73/09653445ecf038d3e3dd9ed55edb6cb541a4ba create mode 100644 vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/d5/ff67764c82f729b13c26a09576570d884d9687 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/HEAD create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/config create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/index create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/info/refs create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/00/6b298c5702b04c00370d0414959765b82fd722 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/01/6eef4a6fefd36bdcaa93ad773449ddc5c73cbb create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/07/2d89dcf3a7671ac34a8e875bb72fb39bcf14d7 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0b/b7ed583d7e9ad507e8b902594f5c9126ea456b create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/15/311229e70fa62653f73dde1d4deef1a8e47a11 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/15/faa0c9991f2d65686e844651faa2ff9827887b create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/16/895aa5e13f8907d4adab81285557d938fad342 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/1e/8dff96faaaa24f84943d2d9601dde61cb0398a create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/34/8f16ffaeb73f319a75cec5b16a0a47d2d5e27c create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/37/185b25a204309bf74817da1a607518f13ca3ed create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/37/a5054a9f9b4628e3924c5cb8f2147c6e2a3efc create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/38/55170cef875708da06ab9ad7fc6a73b531cda1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3f/d41804a7906db846af5e868444782e546af46a create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/44d13e2bbc38510320443bbb003f3967d12436 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/cdad903aef3e7b614675e6584a8be417941911 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/2faca0c62dc556ad71a22f23e541a46a8b0f6f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4b/7c5650008b2e747fe1809eeb5a1dde0e80850a create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4c/49317a0912ca559d2048bc329994eb7d10474f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4e/70a6b06fc62481f80fbb74327849e7170eebff create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4f/4e85a0ab8515e34302721fbcec06fa9d9c1a9a create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5b/8e1e56cb99e8b99ac22eec8aebf6422ecd08c0 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5f/18576d464946eb2338daeb8b4030019961f505 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/65/bea8448ca5b3104628ffbca553c54bde54b0fc create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/66/6ffdfcf1eaa5641fa31064bf2607327e843c09 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/f6182f4c85d39e1309d97c7e456156dc9c0096 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/6c/778edd0e4cf394f5a3df8b96db516024cc1bb8 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/72/3181f1bfd30e47a6d1d36a4d874e31e7a0a1a4 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/73/b20c8e09fa2726d69ff66969186014165da3c3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/78/3d6539dde96b8873c5b5da3e79cc14cd64830b create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7a/9277e0c5ec75339f011c176d0c20e513c4de1c create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7c/7e08f9559d9e1551b91e1cf68f1d0066109add create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/88/eb3f98849f4b8d0555395f514800900a01dc8f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/96/23368f0fc562d6d840372ae17dc4cc32d51a80 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9a/e63b4a8ce0f181b2d1d098971733a103226917 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9c/3f1c70db28c00ce74b22ba3edafe16d9cf03d4 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9e/12bce04446d097ae1782967a5888c2e2a0d35b create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a0/65d3022e99a1943177c10a53cce38bc2127042 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a2/8c21c90aa36580641b345011869d1a899a6783 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a7/b066537e6be7109abfe4ff97b675d4e077da20 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/aa/9e263294fd2f6f6fd9ceab23ca8ce3ea2ce707 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b9/1ef5ffa8612616c8e76051901caafd723f0e2c create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/bd/97980c22d122509cdd915fd9788d56c8d3ae20 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/fa936d25f0b397432a27201f6b3284c47df8be create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d8/dd349b78f19a4ebe3357bacb8138f00bf5ed41 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/de/a7215f259b2cced87d1bda6c72f8b4ce37a2ff create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e1/dcfc3038be54195a59817c89782b261e46cb05 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e2/c84bb33992a455b1a7a5019f0e38d883d3f475 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e2/d185fa827d58134cea20b9e1df893833c6560e create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/72517a8cf39e009ffff541ee52429b89e418f3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f3/5f159ff5d44dfd9f52d63dd5b659f0521ff569 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ff/b36e513f5fdf8a6ba850a20142676a2ac4807d create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2 create mode 100644 vendor/libgit2/tests/resources/merge-recursive/asparagus.txt create mode 100644 vendor/libgit2/tests/resources/merge-recursive/beef.txt create mode 100644 vendor/libgit2/tests/resources/merge-recursive/bouilli.txt create mode 100644 vendor/libgit2/tests/resources/merge-recursive/gravy.txt create mode 100644 vendor/libgit2/tests/resources/merge-recursive/oyster.txt create mode 100644 vendor/libgit2/tests/resources/merge-recursive/veal.txt create mode 100644 vendor/libgit2/tests/resources/status/.gitted/objects/2b/d0a343aeef7a2cf0d158478966a6e587ff3863 create mode 100644 vendor/libgit2/tests/resources/status/.gitted/objects/d4/27e0b2e138501a3d15cc376077a3631e15bd46 create mode 100644 vendor/libgit2/tests/resources/status/.gitted/objects/ee/3fa1b8c00aff7fe02065fdb50864bb0d932ccf create mode 100644 vendor/libgit2/tests/resources/sub.git/HEAD create mode 100644 vendor/libgit2/tests/resources/sub.git/config create mode 100644 vendor/libgit2/tests/resources/sub.git/index create mode 100644 vendor/libgit2/tests/resources/sub.git/logs/HEAD create mode 100644 vendor/libgit2/tests/resources/sub.git/logs/refs/heads/master create mode 100644 vendor/libgit2/tests/resources/sub.git/objects/10/ddd6d257e01349d514541981aeecea6b2e741d create mode 100644 vendor/libgit2/tests/resources/sub.git/objects/17/6a458f94e0ea5272ce67c36bf30b6be9caf623 create mode 100644 vendor/libgit2/tests/resources/sub.git/objects/94/c7d78d85c933d1d95b56bc2de01833ba8559fb create mode 100644 vendor/libgit2/tests/resources/sub.git/objects/b7/a59b3f4ea13b985f8a1e0d3757d5cd3331add8 create mode 100644 vendor/libgit2/tests/resources/sub.git/objects/d0/ee23c41b28746d7e822511d7838bce784ae773 create mode 100644 vendor/libgit2/tests/resources/sub.git/refs/heads/master create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitmodules create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/HEAD create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/config create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/index create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/18/372280a56a54340fa600aa91315065c6c4c693 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/36/683131578275f6a8fd1c539e0d5da0d8adff26 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/89/ca686bb21bfb75dda99a02313831a0c418f921 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/b1/620ef2628d10416a84d19c783e33dc4556c9c3 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/ba/34c47dc9d3d0b1bb335b45c9d26ba1f0fc90c7 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/c8/4bf57ba2254dba216ab5c6eb1a19fe8bd0e0d6 create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/d5/45fc6b40ec9e67332b6a1d2dedcbdb1bffeb6b create mode 100644 vendor/libgit2/tests/resources/submodule_with_path/.gitted/refs/heads/master create mode 100644 vendor/libgit2/tests/resources/super/.gitted/COMMIT_EDITMSG create mode 100644 vendor/libgit2/tests/resources/super/.gitted/HEAD create mode 100644 vendor/libgit2/tests/resources/super/.gitted/config create mode 100644 vendor/libgit2/tests/resources/super/.gitted/index create mode 100644 vendor/libgit2/tests/resources/super/.gitted/objects/51/589c218bf77a8da9e9d8dbc097d76a742726c4 create mode 100644 vendor/libgit2/tests/resources/super/.gitted/objects/79/d0d58ca6aa1688a073d280169908454cad5b91 create mode 100644 vendor/libgit2/tests/resources/super/.gitted/objects/d7/57768b570a83e80d02edcc1032db14573e5034 create mode 100644 vendor/libgit2/tests/resources/super/.gitted/refs/heads/master create mode 100644 vendor/libgit2/tests/resources/super/gitmodules create mode 100644 vendor/libgit2/tests/resources/testrepo/.gitted/objects/ee/3fa1b8c00aff7fe02065fdb50864bb0d932ccf create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/HEAD create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/config create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/index create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/info/exclude create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/10/68072702a28a82c78902cf5bf82c3864cf4356 create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/17/6a458f94e0ea5272ce67c36bf30b6be9caf623 create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/2d/7445a749d25269f32724aa621cb70b196bcc40 create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/34/96991d72d500af36edef68bbfcccd1661d88db create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/8f/45aad6f23b9509f8786c617e19c127ae76609a create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/da/623abd956bb2fd8052c708c7ed43f05d192d37 create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/ea/c7621a652e5261ef1c1d3e7ae31b0d84fcbaba create mode 100644 vendor/libgit2/tests/resources/win32-forbidden/.gitted/refs/heads/master create mode 100644 vendor/libgit2/tests/trace/windows/stacktrace.c create mode 100644 vendor/libgit2/tests/win32/forbidden.c diff --git a/generate/input/libgit2-docs.json b/generate/input/libgit2-docs.json index 71acf27a0..dec45be15 100644 --- a/generate/input/libgit2-docs.json +++ b/generate/input/libgit2-docs.json @@ -138,6 +138,7 @@ "git_commit_message", "git_commit_message_raw", "git_commit_summary", + "git_commit_body", "git_commit_time", "git_commit_time_offset", "git_commit_committer", @@ -150,12 +151,13 @@ "git_commit_parent_id", "git_commit_nth_gen_ancestor", "git_commit_header_field", + "git_commit_extract_signature", "git_commit_create", "git_commit_create_v", "git_commit_amend" ], "meta": {}, - "lines": 364 + "lines": 395 }, { "file": "common.h", @@ -165,7 +167,7 @@ "git_libgit2_opts" ], "meta": {}, - "lines": 245 + "lines": 282 }, { "file": "config.h", @@ -174,6 +176,7 @@ "git_config_find_global", "git_config_find_xdg", "git_config_find_system", + "git_config_find_programdata", "git_config_open_default", "git_config_new", "git_config_add_file_ondisk", @@ -210,10 +213,11 @@ "git_config_parse_int32", "git_config_parse_int64", "git_config_parse_path", - "git_config_backend_foreach_match" + "git_config_backend_foreach_match", + "git_config_lock" ], "meta": {}, - "lines": 691 + "lines": 724 }, { "file": "cred_helpers.h", @@ -238,6 +242,7 @@ "file": "diff.h", "functions": [ "git_diff_notify_cb", + "git_diff_progress_cb", "git_diff_init_options", "git_diff_file_cb", "git_diff_binary_cb", @@ -250,6 +255,7 @@ "git_diff_index_to_workdir", "git_diff_tree_to_workdir", "git_diff_tree_to_workdir_with_index", + "git_diff_index_to_index", "git_diff_merge", "git_diff_find_similar", "git_diff_num_deltas", @@ -273,19 +279,18 @@ "git_diff_format_email_init_options" ], "meta": {}, - "lines": 1301 + "lines": 1346 }, { "file": "errors.h", "functions": [ "giterr_last", "giterr_clear", - "giterr_detach", "giterr_set_str", "giterr_set_oom" ], "meta": {}, - "lines": 160 + "lines": 144 }, { "file": "filter.h", @@ -364,6 +369,7 @@ "git_index_remove_all", "git_index_update_all", "git_index_find", + "git_index_find_prefix", "git_index_conflict_add", "git_index_conflict_get", "git_index_conflict_remove", @@ -374,7 +380,7 @@ "git_index_conflict_iterator_free" ], "meta": {}, - "lines": 755 + "lines": 780 }, { "file": "indexer.h", @@ -408,7 +414,7 @@ "git_merge" ], "meta": {}, - "lines": 547 + "lines": 569 }, { "file": "message.h", @@ -623,13 +629,14 @@ "git_rebase_operation_current", "git_rebase_operation_byindex", "git_rebase_next", + "git_rebase_inmemory_index", "git_rebase_commit", "git_rebase_abort", "git_rebase_finish", "git_rebase_free" ], "meta": {}, - "lines": 286 + "lines": 316 }, { "file": "refdb.h", @@ -774,7 +781,7 @@ "git_remote_default_branch" ], "meta": {}, - "lines": 796 + "lines": 807 }, { "file": "repository.h", @@ -819,7 +826,7 @@ "git_repository_set_ident" ], "meta": {}, - "lines": 750 + "lines": 752 }, { "file": "reset.h", @@ -931,6 +938,7 @@ { "file": "submodule.h", "functions": [ + "git_submodule_cb", "git_submodule_update_init_options", "git_submodule_update", "git_submodule_lookup", @@ -965,12 +973,11 @@ "git_submodule_location" ], "meta": {}, - "lines": 622 + "lines": 633 }, { "file": "sys/commit.h", "functions": [ - "git_commit_create_from_ids", "git_commit_create_from_callback" ], "meta": {}, @@ -983,7 +990,7 @@ "git_config_add_backend" ], "meta": {}, - "lines": 109 + "lines": 123 }, { "file": "sys/diff.h", @@ -1002,7 +1009,6 @@ "git_filter_lookup", "git_filter_list_new", "git_filter_list_push", - "git_filter_list_length", "git_filter_source_repo", "git_filter_source_path", "git_filter_source_filemode", @@ -1018,12 +1024,11 @@ "git_filter_unregister" ], "meta": {}, - "lines": 305 + "lines": 317 }, { "file": "sys/hashsig.h", "functions": [ - "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free", "git_hashsig_compare" @@ -1046,7 +1051,7 @@ "git_odb_init_backend" ], "meta": {}, - "lines": 102 + "lines": 106 }, { "file": "sys/openssl.h", @@ -1064,7 +1069,7 @@ "git_refdb_set_backend" ], "meta": {}, - "lines": 213 + "lines": 214 }, { "file": "sys/refs.h", @@ -1092,9 +1097,11 @@ }, { "file": "sys/stream.h", - "functions": [], + "functions": [ + "git_stream_register_tls" + ], "meta": {}, - "lines": 40 + "lines": 53 }, { "file": "sys/transport.h", @@ -1106,12 +1113,13 @@ "git_transport_dummy", "git_transport_local", "git_transport_smart", + "git_transport_smart_certificate_check", "git_smart_subtransport_http", "git_smart_subtransport_git", "git_smart_subtransport_ssh" ], "meta": {}, - "lines": 349 + "lines": 377 }, { "file": "tag.h", @@ -1162,10 +1170,11 @@ "git_cred_default_new", "git_cred_username_new", "git_cred_ssh_key_memory_new", + "git_cred_free", "git_cred_acquire_cb" ], "meta": {}, - "lines": 334 + "lines": 338 }, { "file": "tree.h", @@ -1320,7 +1329,7 @@ "comment": " 0 on success or error code" }, "description": "

Creates a git_annotated_commit from the given commit id.\n The resulting git_annotated_commit must be freed with\n git_annotated_commit_free.

\n", - "comments": "

An annotated commit contains information about how it was\n looked up, which may be useful for functions like merge or\n rebase to provide context to the operation. For example,\n conflict files will include the name of the source or target\n branches being merged. It is therefore preferable to use the\n most specific function (eg git_annotated_commit_from_ref)\n instead of this one when that data is known.

\n", + "comments": "

An annotated commit contains information about how it was looked up, which may be useful for functions like merge or rebase to provide context to the operation. For example, conflict files will include the name of the source or target branches being merged. It is therefore preferable to use the most specific function (eg git_annotated_commit_from_ref) instead of this one when that data is known.

\n", "group": "annotated" }, "git_annotated_commit_from_revspec": { @@ -1352,7 +1361,7 @@ "comment": " 0 on success or error code" }, "description": "

Creates a git_annotated_comit from a revision string.

\n", - "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", "group": "annotated" }, "git_annotated_commit_id": { @@ -1418,7 +1427,7 @@ "comment": " the value type for the attribute" }, "description": "

Return the value type for a given attribute.

\n", - "comments": "

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute\n was not set at all), or VALUE, if the attribute was set to an\n actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally\n as a NULL-terminated C string.

\n", + "comments": "

This can be either TRUE, FALSE, UNSPECIFIED (if the attribute was not set at all), or VALUE, if the attribute was set to an actual string.

\n\n

If the attribute has a VALUE string, it can be accessed normally as a NULL-terminated C string.

\n", "group": "attr" }, "git_attr_get": { @@ -1507,7 +1516,7 @@ "comment": null }, "description": "

Look up a list of git attributes for path.

\n", - "comments": "

Use this if you have a known list of attributes that you want to\n look up in a single call. This is somewhat more efficient than\n calling git_attr_get() multiple times.

\n\n

For 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
\n\n

Then you could loop through the 3 values to get the settings for\n the three attributes you asked about.

\n", + "comments": "

Use this if you have a known list of attributes that you want to look up in a single call. This is somewhat more efficient than calling git_attr_get() multiple times.

\n\n

For example, you might write:

\n\n
 const char *attrs[] = { "crlf", "diff", "foo" };     const char **values[3];     git_attr_get_many(values, repo, 0, "my/fun/file.c", 3, attrs);\n
\n\n

Then you could loop through the 3 values to get the settings for the three attributes you asked about.

\n", "group": "attr" }, "git_attr_foreach": { @@ -1571,7 +1580,7 @@ "comment": null }, "description": "

Flush the gitattributes cache.

\n", - "comments": "

Call this if you have reason to believe that the attributes files on\n disk no longer match the cached contents of memory. This will cause\n the attributes files to be reloaded the next time that an attribute\n access function is called.

\n", + "comments": "

Call this if you have reason to believe that the attributes files on disk no longer match the cached contents of memory. This will cause the attributes files to be reloaded the next time that an attribute access function is called.

\n", "group": "attr" }, "git_attr_add_macro": { @@ -1603,7 +1612,7 @@ "comment": null }, "description": "

Add a macro definition.

\n", - "comments": "

Macros will automatically be loaded from the top level .gitattributes\n file of the repository (plus the build-in "binary" macro). This\n function allows you to add others. For example, to add the default\n macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", + "comments": "

Macros will automatically be loaded from the top level .gitattributes file of the repository (plus the build-in "binary" macro). This function allows you to add others. For example, to add the default macro, you would call:

\n\n
 git_attr_add_macro(repo, "binary", "-diff -crlf");\n
\n", "group": "attr" }, "git_blame_init_options": { @@ -1695,12 +1704,12 @@ }, { "name": "lineno", - "type": "uint32_t", + "type": "size_t", "comment": "the (1-based) line number to find a hunk for" } ], - "argline": "git_blame *blame, uint32_t lineno", - "sig": "git_blame *::uint32_t", + "argline": "git_blame *blame, size_t lineno", + "sig": "git_blame *::size_t", "return": { "type": "const git_blame_hunk *", "comment": " the hunk that contains the given line, or NULL on error" @@ -1710,7 +1719,7 @@ "group": "blame", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blame_get_hunk_byline-1" + "ex/v0.24.1/blame.html#git_blame_get_hunk_byline-1" ] } }, @@ -1752,7 +1761,7 @@ "group": "blame", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blame_file-2" + "ex/v0.24.1/blame.html#git_blame_file-2" ] } }, @@ -1790,7 +1799,7 @@ "comment": " 0 on success, or an error code. (use giterr_last for information\n about the error)" }, "description": "

Get blame data for a file that has been modified in memory. The reference\n parameter is a pre-calculated blame for the in-odb history of the file. This\n means that once a file blame is completed (which can be expensive), updating\n the buffer blame is very fast.

\n", - "comments": "

Lines that differ between the buffer and the committed version are marked as\n having a zero OID for their final_commit_id.

\n", + "comments": "

Lines that differ between the buffer and the committed version are marked as having a zero OID for their final_commit_id.

\n", "group": "blame" }, "git_blame_free": { @@ -1816,7 +1825,7 @@ "group": "blame", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blame_free-3" + "ex/v0.24.1/blame.html#git_blame_free-3" ] } }, @@ -1853,10 +1862,10 @@ "group": "blob", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blob_lookup-4" + "ex/v0.24.1/blame.html#git_blob_lookup-4" ], "general.c": [ - "ex/v0.23.2/general.html#git_blob_lookup-1" + "ex/v0.24.1/general.html#git_blob_lookup-1" ] } }, @@ -1916,11 +1925,11 @@ "comment": null }, "description": "

Close an open blob

\n", - "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a blob. Failure to do so will cause a memory leak.

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a blob. Failure to do so will cause a memory leak.

\n", "group": "blob", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blob_free-5" + "ex/v0.24.1/blame.html#git_blob_free-5" ] } }, @@ -1987,17 +1996,17 @@ "comment": " the pointer" }, "description": "

Get a read-only buffer with the raw content of a blob.

\n", - "comments": "

A pointer to the raw content of a blob is returned;\n this pointer is owned internally by the object and shall\n not be free'd. The pointer may be invalidated at a later\n time.

\n", + "comments": "

A pointer to the raw content of a blob is returned; this pointer is owned internally by the object and shall not be free'd. The pointer may be invalidated at a later time.

\n", "group": "blob", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blob_rawcontent-6" + "ex/v0.24.1/blame.html#git_blob_rawcontent-6" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_blob_rawcontent-1" + "ex/v0.24.1/cat-file.html#git_blob_rawcontent-1" ], "general.c": [ - "ex/v0.23.2/general.html#git_blob_rawcontent-2" + "ex/v0.24.1/general.html#git_blob_rawcontent-2" ] } }, @@ -2024,14 +2033,14 @@ "group": "blob", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_blob_rawsize-7" + "ex/v0.24.1/blame.html#git_blob_rawsize-7" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_blob_rawsize-2" + "ex/v0.24.1/cat-file.html#git_blob_rawsize-2" ], "general.c": [ - "ex/v0.23.2/general.html#git_blob_rawsize-3", - "ex/v0.23.2/general.html#git_blob_rawsize-4" + "ex/v0.24.1/general.html#git_blob_rawsize-3", + "ex/v0.24.1/general.html#git_blob_rawsize-4" ] } }, @@ -2069,7 +2078,7 @@ "comment": " 0 on success or an error code" }, "description": "

Get a buffer with the filtered content of a blob.

\n", - "comments": "

This applies filters as if the blob was being checked out to the\n working directory under the specified filename. This may apply\n CRLF filtering or other types of changes depending on the file\n attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free\n when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just\n be populated with a pointer to the raw content of the blob. In\n that case, be careful to not free the blob until done with the\n buffer or copy it into memory you own.

\n", + "comments": "

This applies filters as if the blob was being checked out to the working directory under the specified filename. This may apply CRLF filtering or other types of changes depending on the file attributes set for the blob and the content detected in it.

\n\n

The output is written into a git_buf which the caller must free when done (via git_buf_free).

\n\n

If no filters need to be applied, then the out buffer will just be populated with a pointer to the raw content of the blob. In that case, be careful to not free the blob until done with the buffer or copy it into memory you own.

\n", "group": "blob" }, "git_blob_create_fromworkdir": { @@ -2175,7 +2184,7 @@ "comment": " 0 or error code (from either libgit2 or callback function)" }, "description": "

Write a loose blob to the Object Database from a\n provider of chunks of data.

\n", - "comments": "

If the hintpath parameter is filled, it will be used to determine\n what git filters should be applied to the object before it is written\n to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n
    \n
  • content must be filled by the callback. The maximum number of\nbytes that the buffer can accept per call is defined by the\nmax_length parameter. Allocation and freeing of the buffer will\nbe taken care of by libgit2.

  • \n
  • The callback must return the number of bytes that have been\nwritten to the content buffer.

  • \n
  • When there is no more data to stream, callback should return

    \n\n
      \n
    1. This will prevent it from being invoked anymore.
    2. \n
  • \n
  • If an error occurs, the callback should return a negative value.\nThis value will be returned to the caller.

  • \n
\n", + "comments": "

If the hintpath parameter is filled, it will be used to determine what git filters should be applied to the object before it is written to the object database.

\n\n

The implementation of the callback MUST respect the following rules:

\n\n
    \n
  • content must be filled by the callback. The maximum number of bytes that the buffer can accept per call is defined by the max_length parameter. Allocation and freeing of the buffer will be taken care of by libgit2.

  • \n
  • The callback must return the number of bytes that have been written to the content buffer.

  • \n
  • When there is no more data to stream, callback should return 0. This will prevent it from being invoked anymore.

  • \n
  • If an error occurs, the callback should return a negative value. This value will be returned to the caller.

  • \n
\n", "group": "blob" }, "git_blob_create_frombuffer": { @@ -2234,7 +2243,7 @@ "comment": " 1 if the content of the blob is detected\n as binary; 0 otherwise." }, "description": "

Determine if the blob content is most certainly binary or not.

\n", - "comments": "

The heuristic used to guess if a file is binary is taken from core git:\n Searching for NUL bytes and looking for a reasonable ratio of printable\n to non-printable characters among the first 8000 bytes.

\n", + "comments": "

The heuristic used to guess if a file is binary is taken from core git: Searching for NUL bytes and looking for a reasonable ratio of printable to non-printable characters among the first 8000 bytes.

\n", "group": "blob" }, "git_branch_create": { @@ -2276,7 +2285,7 @@ "comment": " 0, GIT_EINVALIDSPEC or an error code.\n A proper reference is written in the refs/heads namespace\n pointing to the provided target commit." }, "description": "

Create a new branch pointing at a target commit

\n", - "comments": "

A new direct reference will be created pointing to\n this target commit. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

A new direct reference will be created pointing to this target commit. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The returned reference must be freed by the user.

\n\n

The branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "branch" }, "git_branch_create_from_annotated": { @@ -2318,7 +2327,7 @@ "comment": null }, "description": "

Create a new branch pointing at a target commit

\n", - "comments": "

This behaves like git_branch_create() but takes an annotated\n commit, which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_branch_create().

\n", + "comments": "

This behaves like git_branch_create() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_branch_create().

\n", "group": "branch" }, "git_branch_delete": { @@ -2340,7 +2349,7 @@ "comment": " 0 on success, or an error code." }, "description": "

Delete an existing branch reference.

\n", - "comments": "

If the branch is successfully deleted, the passed reference\n object will be invalidated. The reference must be freed manually\n by the user.

\n", + "comments": "

If the branch is successfully deleted, the passed reference object will be invalidated. The reference must be freed manually by the user.

\n", "group": "branch" }, "git_branch_iterator_new": { @@ -2463,7 +2472,7 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code." }, "description": "

Move/rename an existing local branch reference.

\n", - "comments": "

The new branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

The new branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "branch" }, "git_branch_lookup": { @@ -2500,7 +2509,7 @@ "comment": " 0 on success; GIT_ENOTFOUND when no matching branch\n exists, GIT_EINVALIDSPEC, otherwise an error code." }, "description": "

Lookup a branch by its name in a repository.

\n", - "comments": "

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

The generated reference must be freed by the user.

\n\n

The branch name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "branch" }, "git_branch_name": { @@ -2527,7 +2536,7 @@ "comment": " 0 on success; otherwise an error code (e.g., if the\n ref is no local or remote branch)." }, "description": "

Return the name of the given local or remote branch.

\n", - "comments": "

The name of the branch matches the definition of the name\n for git_branch_lookup. That is, if the returned name is given\n to git_branch_lookup() then the reference is returned that\n was given to this function.

\n", + "comments": "

The name of the branch matches the definition of the name for git_branch_lookup. That is, if the returned name is given to git_branch_lookup() then the reference is returned that was given to this function.

\n", "group": "branch" }, "git_branch_upstream": { @@ -2625,17 +2634,17 @@ "comment": null }, "description": "

Free the memory referred to by the git_buf.

\n", - "comments": "

Note that this does not free the git_buf itself, just the memory\n pointed to by buffer->ptr. This will not free the memory if it looks\n like it was not allocated internally, but it will clear the buffer back\n to the empty state.

\n", + "comments": "

Note that this does not free the git_buf itself, just the memory pointed to by buffer->ptr. This will not free the memory if it looks like it was not allocated internally, but it will clear the buffer back to the empty state.

\n", "group": "buf", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_buf_free-1" + "ex/v0.24.1/diff.html#git_buf_free-1" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_buf_free-1" + "ex/v0.24.1/remote.html#git_buf_free-1" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_buf_free-1" + "ex/v0.24.1/tag.html#git_buf_free-1" ] } }, @@ -2663,7 +2672,7 @@ "comment": " 0 on success, -1 on allocation failure" }, "description": "

Resize the buffer allocation to make more space.

\n", - "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e.\n the asize field is zero), then ptr will be replaced with a newly\n allocated block of data. Be careful so that memory allocated by the\n caller is not lost. As a special variant, if you pass target_size as\n 0 and the memory is not allocated by libgit2, this will allocate a new\n buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be\n marked as invalid for future operations, invaliding the contents.

\n", + "comments": "

This will attempt to grow the buffer to accommodate the target size.

\n\n

If the buffer refers to memory that was not allocated by libgit2 (i.e. the asize field is zero), then ptr will be replaced with a newly allocated block of data. Be careful so that memory allocated by the caller is not lost. As a special variant, if you pass target_size as 0 and the memory is not allocated by libgit2, this will allocate a new buffer of size size and copy the external data into it.

\n\n

Currently, this will never shrink a buffer, only expand it.

\n\n

If the allocation fails, this will return an error and the buffer will be marked as invalid for future operations, invaliding the contents.

\n", "group": "buf" }, "git_buf_set": { @@ -3027,11 +3036,11 @@ "comment": " 0 on success, any non-zero return value from a callback\n function, or a negative value to indicate an error (use\n `giterr_last` for a detailed error message)" }, "description": "

Clone a remote repository.

\n", - "comments": "

By default this creates its repository and initial remote to match\n git's defaults. You can use the options in the callback to\n customize how these are created.

\n", + "comments": "

By default this creates its repository and initial remote to match git's defaults. You can use the options in the callback to customize how these are created.

\n", "group": "clone", "examples": { "network/clone.c": [ - "ex/v0.23.2/network/clone.html#git_clone-1" + "ex/v0.24.1/network/clone.html#git_clone-1" ] } }, @@ -3064,16 +3073,16 @@ "comment": " 0 or an error code" }, "description": "

Lookup a commit object from a repository.

\n", - "comments": "

The returned object should be released with git_commit_free when no\n longer needed.

\n", + "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_lookup-5", - "ex/v0.23.2/general.html#git_commit_lookup-6", - "ex/v0.23.2/general.html#git_commit_lookup-7" + "ex/v0.24.1/general.html#git_commit_lookup-5", + "ex/v0.24.1/general.html#git_commit_lookup-6", + "ex/v0.24.1/general.html#git_commit_lookup-7" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_lookup-1" + "ex/v0.24.1/log.html#git_commit_lookup-1" ] } }, @@ -3111,7 +3120,7 @@ "comment": " 0 or an error code" }, "description": "

Lookup a commit object from a repository, given a prefix of its\n identifier (short id).

\n", - "comments": "

The returned object should be released with git_commit_free when no\n longer needed.

\n", + "comments": "

The returned object should be released with git_commit_free when no longer needed.

\n", "group": "commit" }, "git_commit_free": { @@ -3133,20 +3142,20 @@ "comment": null }, "description": "

Close an open commit

\n", - "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT:\n It is necessary to call this method when you stop\n using a commit. Failure to do so will cause a memory leak.

\n", + "comments": "

This is a wrapper around git_object_free()

\n\n

IMPORTANT: It is necessary to call this method when you stop using a commit. Failure to do so will cause a memory leak.

\n", "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_free-8", - "ex/v0.23.2/general.html#git_commit_free-9", - "ex/v0.23.2/general.html#git_commit_free-10", - "ex/v0.23.2/general.html#git_commit_free-11" + "ex/v0.24.1/general.html#git_commit_free-8", + "ex/v0.24.1/general.html#git_commit_free-9", + "ex/v0.24.1/general.html#git_commit_free-10", + "ex/v0.24.1/general.html#git_commit_free-11" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_free-2", - "ex/v0.23.2/log.html#git_commit_free-3", - "ex/v0.23.2/log.html#git_commit_free-4", - "ex/v0.23.2/log.html#git_commit_free-5" + "ex/v0.24.1/log.html#git_commit_free-2", + "ex/v0.24.1/log.html#git_commit_free-3", + "ex/v0.24.1/log.html#git_commit_free-4", + "ex/v0.24.1/log.html#git_commit_free-5" ] } }, @@ -3173,10 +3182,10 @@ "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_id-12" + "ex/v0.24.1/general.html#git_commit_id-12" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_id-6" + "ex/v0.24.1/log.html#git_commit_id-6" ] } }, @@ -3203,8 +3212,8 @@ "group": "commit", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_commit_owner-7", - "ex/v0.23.2/log.html#git_commit_owner-8" + "ex/v0.24.1/log.html#git_commit_owner-7", + "ex/v0.24.1/log.html#git_commit_owner-8" ] } }, @@ -3227,7 +3236,7 @@ "comment": " NULL, or the encoding" }, "description": "

Get the encoding for the message of a commit,\n as a string representing a standard encoding name.

\n", - "comments": "

The encoding may be NULL if the encoding header\n in the commit is missing; in that case UTF-8 is assumed.

\n", + "comments": "

The encoding may be NULL if the encoding header in the commit is missing; in that case UTF-8 is assumed.

\n", "group": "commit" }, "git_commit_message": { @@ -3249,24 +3258,24 @@ "comment": " the message of a commit" }, "description": "

Get the full message of a commit.

\n", - "comments": "

The returned message will be slightly prettified by removing any\n potential leading newlines.

\n", + "comments": "

The returned message will be slightly prettified by removing any potential leading newlines.

\n", "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_message-3", - "ex/v0.23.2/cat-file.html#git_commit_message-4" + "ex/v0.24.1/cat-file.html#git_commit_message-3", + "ex/v0.24.1/cat-file.html#git_commit_message-4" ], "general.c": [ - "ex/v0.23.2/general.html#git_commit_message-13", - "ex/v0.23.2/general.html#git_commit_message-14", - "ex/v0.23.2/general.html#git_commit_message-15" + "ex/v0.24.1/general.html#git_commit_message-13", + "ex/v0.24.1/general.html#git_commit_message-14", + "ex/v0.24.1/general.html#git_commit_message-15" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_message-9", - "ex/v0.23.2/log.html#git_commit_message-10" + "ex/v0.24.1/log.html#git_commit_message-9", + "ex/v0.24.1/log.html#git_commit_message-10" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_commit_message-2" + "ex/v0.24.1/tag.html#git_commit_message-2" ] } }, @@ -3311,14 +3320,36 @@ "comment": " the summary of a commit or NULL on error" }, "description": "

Get the short "summary" of the git commit message.

\n", - "comments": "

The returned message is the summary of the commit, comprising the\n first paragraph of the message with whitespace trimmed and squashed.

\n", + "comments": "

The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.

\n", + "group": "commit" + }, + "git_commit_body": { + "type": "function", + "file": "commit.h", + "line": 141, + "lineto": 141, + "args": [ + { + "name": "commit", + "type": "git_commit *", + "comment": "a previously loaded commit." + } + ], + "argline": "git_commit *commit", + "sig": "git_commit *", + "return": { + "type": "const char *", + "comment": " the body of a commit or NULL when no the message only\n consists of a summary" + }, + "description": "

Get the long "body" of the git commit message.

\n", + "comments": "

The returned message is the body of the commit, comprising everything but the first paragraph of the message. Leading and trailing whitespaces are trimmed.

\n", "group": "commit" }, "git_commit_time": { "type": "function", "file": "commit.h", - "line": 136, - "lineto": 136, + "line": 149, + "lineto": 149, "args": [ { "name": "commit", @@ -3337,16 +3368,16 @@ "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_time-16", - "ex/v0.23.2/general.html#git_commit_time-17" + "ex/v0.24.1/general.html#git_commit_time-16", + "ex/v0.24.1/general.html#git_commit_time-17" ] } }, "git_commit_time_offset": { "type": "function", "file": "commit.h", - "line": 144, - "lineto": 144, + "line": 157, + "lineto": 157, "args": [ { "name": "commit", @@ -3367,8 +3398,8 @@ "git_commit_committer": { "type": "function", "file": "commit.h", - "line": 152, - "lineto": 152, + "line": 165, + "lineto": 165, "args": [ { "name": "commit", @@ -3387,21 +3418,21 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_committer-5" + "ex/v0.24.1/cat-file.html#git_commit_committer-5" ], "general.c": [ - "ex/v0.23.2/general.html#git_commit_committer-18" + "ex/v0.24.1/general.html#git_commit_committer-18" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_committer-11" + "ex/v0.24.1/log.html#git_commit_committer-11" ] } }, "git_commit_author": { "type": "function", "file": "commit.h", - "line": 160, - "lineto": 160, + "line": 173, + "lineto": 173, "args": [ { "name": "commit", @@ -3420,23 +3451,23 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_author-6" + "ex/v0.24.1/cat-file.html#git_commit_author-6" ], "general.c": [ - "ex/v0.23.2/general.html#git_commit_author-19", - "ex/v0.23.2/general.html#git_commit_author-20" + "ex/v0.24.1/general.html#git_commit_author-19", + "ex/v0.24.1/general.html#git_commit_author-20" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_author-12", - "ex/v0.23.2/log.html#git_commit_author-13" + "ex/v0.24.1/log.html#git_commit_author-12", + "ex/v0.24.1/log.html#git_commit_author-13" ] } }, "git_commit_raw_header": { "type": "function", "file": "commit.h", - "line": 168, - "lineto": 168, + "line": 181, + "lineto": 181, "args": [ { "name": "commit", @@ -3457,8 +3488,8 @@ "git_commit_tree": { "type": "function", "file": "commit.h", - "line": 177, - "lineto": 177, + "line": 190, + "lineto": 190, "args": [ { "name": "tree_out", @@ -3482,19 +3513,19 @@ "group": "commit", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_commit_tree-14", - "ex/v0.23.2/log.html#git_commit_tree-15", - "ex/v0.23.2/log.html#git_commit_tree-16", - "ex/v0.23.2/log.html#git_commit_tree-17", - "ex/v0.23.2/log.html#git_commit_tree-18" + "ex/v0.24.1/log.html#git_commit_tree-14", + "ex/v0.24.1/log.html#git_commit_tree-15", + "ex/v0.24.1/log.html#git_commit_tree-16", + "ex/v0.24.1/log.html#git_commit_tree-17", + "ex/v0.24.1/log.html#git_commit_tree-18" ] } }, "git_commit_tree_id": { "type": "function", "file": "commit.h", - "line": 187, - "lineto": 187, + "line": 200, + "lineto": 200, "args": [ { "name": "commit", @@ -3513,15 +3544,15 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_tree_id-7" + "ex/v0.24.1/cat-file.html#git_commit_tree_id-7" ] } }, "git_commit_parentcount": { "type": "function", "file": "commit.h", - "line": 195, - "lineto": 195, + "line": 208, + "lineto": 208, "args": [ { "name": "commit", @@ -3540,22 +3571,22 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_parentcount-8" + "ex/v0.24.1/cat-file.html#git_commit_parentcount-8" ], "general.c": [ - "ex/v0.23.2/general.html#git_commit_parentcount-21" + "ex/v0.24.1/general.html#git_commit_parentcount-21" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_parentcount-19", - "ex/v0.23.2/log.html#git_commit_parentcount-20" + "ex/v0.24.1/log.html#git_commit_parentcount-19", + "ex/v0.24.1/log.html#git_commit_parentcount-20" ] } }, "git_commit_parent": { "type": "function", "file": "commit.h", - "line": 205, - "lineto": 208, + "line": 218, + "lineto": 221, "args": [ { "name": "out", @@ -3584,19 +3615,19 @@ "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_parent-22" + "ex/v0.24.1/general.html#git_commit_parent-22" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_parent-21", - "ex/v0.23.2/log.html#git_commit_parent-22" + "ex/v0.24.1/log.html#git_commit_parent-21", + "ex/v0.24.1/log.html#git_commit_parent-22" ] } }, "git_commit_parent_id": { "type": "function", "file": "commit.h", - "line": 219, - "lineto": 221, + "line": 232, + "lineto": 234, "args": [ { "name": "commit", @@ -3620,18 +3651,18 @@ "group": "commit", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_commit_parent_id-9" + "ex/v0.24.1/cat-file.html#git_commit_parent_id-9" ], "log.c": [ - "ex/v0.23.2/log.html#git_commit_parent_id-23" + "ex/v0.24.1/log.html#git_commit_parent_id-23" ] } }, "git_commit_nth_gen_ancestor": { "type": "function", "file": "commit.h", - "line": 237, - "lineto": 240, + "line": 250, + "lineto": 253, "args": [ { "name": "ancestor", @@ -3656,14 +3687,14 @@ "comment": " 0 on success; GIT_ENOTFOUND if no matching ancestor exists\n or an error code" }, "description": "

Get the commit object that is the \n<n

\n\n
\n

th generation ancestor\n of the named commit object, following only the first parents.\n The returned commit has to be freed by the caller.

\n
\n", - "comments": "

Passing 0 as the generation number returns another instance of the\n base commit itself.

\n", + "comments": "

Passing 0 as the generation number returns another instance of the base commit itself.

\n", "group": "commit" }, "git_commit_header_field": { "type": "function", "file": "commit.h", - "line": 251, - "lineto": 251, + "line": 264, + "lineto": 264, "args": [ { "name": "out", @@ -3691,11 +3722,53 @@ "comments": "", "group": "commit" }, + "git_commit_extract_signature": { + "type": "function", + "file": "commit.h", + "line": 282, + "lineto": 282, + "args": [ + { + "name": "signature", + "type": "git_buf *", + "comment": "the signature block" + }, + { + "name": "signed_data", + "type": "git_buf *", + "comment": "signed data; this is the commit contents minus the signature block" + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "the repository in which the commit exists" + }, + { + "name": "commit_id", + "type": "git_oid *", + "comment": "the commit from which to extract the data" + }, + { + "name": "field", + "type": "const char *", + "comment": "the name of the header field containing the signature\n block; pass `NULL` to extract the default 'gpgsig'" + } + ], + "argline": "git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, const char *field", + "sig": "git_buf *::git_buf *::git_repository *::git_oid *::const char *", + "return": { + "type": "int", + "comment": " 0 on success, GIT_ENOTFOUND if the id is not for a commit\n or the commit does not have a signature." + }, + "description": "

Extract the signature from a commit

\n", + "comments": "

If the id is not for a commit, the error class will be GITERR_INVALID. If the commit does not have a signature, the error class will be GITERR_OBJECT.

\n", + "group": "commit" + }, "git_commit_create": { "type": "function", "file": "commit.h", - "line": 297, - "lineto": 307, + "line": 328, + "lineto": 338, "args": [ { "name": "id", @@ -3755,14 +3828,14 @@ "comment": " 0 or an error code\n\tThe created commit will be written to the Object Database and\n\tthe given reference will be updated to point to it" }, "description": "

Create new commit in the repository from a list of git_object pointers

\n", - "comments": "

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n", + "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n", "group": "commit" }, "git_commit_create_v": { "type": "function", "file": "commit.h", - "line": 323, - "lineto": 333, + "line": 354, + "lineto": 364, "args": [ { "name": "id", @@ -3817,22 +3890,22 @@ "comment": null }, "description": "

Create new commit in the repository using a variable argument list.

\n", - "comments": "

The message will not be cleaned up automatically. You can do that\n with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers\n to const git_commit *. Note that this is a convenience method which may\n not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n", + "comments": "

The message will not be cleaned up automatically. You can do that with the git_message_prettify() function.

\n\n

The parents for the commit are specified as a variable list of pointers to const git_commit *. Note that this is a convenience method which may not be safe to export for certain languages or compilers

\n\n

All other parameters remain the same as git_commit_create().

\n", "group": "commit", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_commit_create_v-23" + "ex/v0.24.1/general.html#git_commit_create_v-23" ], "init.c": [ - "ex/v0.23.2/init.html#git_commit_create_v-1" + "ex/v0.24.1/init.html#git_commit_create_v-1" ] } }, "git_commit_amend": { "type": "function", "file": "commit.h", - "line": 356, - "lineto": 364, + "line": 387, + "lineto": 395, "args": [ { "name": "id", @@ -3882,14 +3955,14 @@ "comment": null }, "description": "

Amend an existing commit by replacing only non-NULL values.

\n", - "comments": "

This creates a new commit that is exactly the same as the old commit,\n except that any non-NULL values will be updated. The new commit has\n the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(),\n updating the ref to point to the newly rewritten commit. If you want\n to amend a commit that is not currently the tip of the branch and then\n rewrite the following commits to reach a ref, pass this as NULL and\n update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message,\n message_encoding, and tree parameters can be NULL in which case this\n will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n", + "comments": "

This creates a new commit that is exactly the same as the old commit, except that any non-NULL values will be updated. The new commit has the same parents as the old commit.

\n\n

The update_ref value works as in the regular git_commit_create(), updating the ref to point to the newly rewritten commit. If you want to amend a commit that is not currently the tip of the branch and then rewrite the following commits to reach a ref, pass this as NULL and update the rest of the commit chain and ref separately.

\n\n

Unlike git_commit_create(), the author, committer, message, message_encoding, and tree parameters can be NULL in which case this will use the values from the original commit_to_amend.

\n\n

All parameters have the same meanings as in git_commit_create().

\n", "group": "commit" }, "git_libgit2_version": { "type": "function", "file": "common.h", - "line": 94, - "lineto": 94, + "line": 105, + "lineto": 105, "args": [ { "name": "major", @@ -3920,8 +3993,8 @@ "git_libgit2_features": { "type": "function", "file": "common.h", - "line": 124, - "lineto": 124, + "line": 136, + "lineto": 136, "args": [], "argline": "", "sig": "", @@ -3930,14 +4003,14 @@ "comment": " A combination of GIT_FEATURE_* values." }, "description": "

Query compile time options for libgit2.

\n", - "comments": "
    \n
  • GIT_FEATURE_THREADS\nLibgit2 was compiled with thread support. Note that thread support is\nstill to be seen as a 'work in progress' - basic object lookups are\nbelieved to be threadsafe, but other operations may not be.

  • \n
  • GIT_FEATURE_HTTPS\nLibgit2 supports the https:// protocol. This requires the openssl\nlibrary to be found when compiling libgit2.

  • \n
  • GIT_FEATURE_SSH\nLibgit2 supports the SSH protocol for network operations. This requires\nthe libssh2 library to be found when compiling libgit2

  • \n
\n", + "comments": "
    \n
  • GIT_FEATURE_THREADS Libgit2 was compiled with thread support. Note that thread support is still to be seen as a 'work in progress' - basic object lookups are believed to be threadsafe, but other operations may not be.

  • \n
  • GIT_FEATURE_HTTPS Libgit2 supports the https:// protocol. This requires the openssl library to be found when compiling libgit2.

  • \n
  • GIT_FEATURE_SSH Libgit2 supports the SSH protocol for network operations. This requires the libssh2 library to be found when compiling libgit2

  • \n
\n", "group": "libgit2" }, "git_libgit2_opts": { "type": "function", "file": "common.h", - "line": 245, - "lineto": 245, + "line": 282, + "lineto": 282, "args": [ { "name": "option", @@ -3952,14 +4025,14 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set or query a library global option

\n", - "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time\n    by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must\n    > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, or\n    > `GIT_CONFIG_LEVEL_XDG`.  The search path is written to the `out`\n    > buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path\n    > applied to shared attributes and ignore files, too.\n    >\n    > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.\n    >   Pass NULL to reset to the default (generally based on environment\n    >   variables).  Use magic path `$PATH` to include the old value\n    >   of the path (if you want to prepend or append, for instance).\n    >\n    > - `level` must be GIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_GLOBAL,\n    >   or GIT_CONFIG_LEVEL_XDG.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be\n    > considered eligible for caching in memory.  Setting to value to\n    > zero means that that type of object will not be cached.\n    > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k\n    > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory\n    > across all repositories before libgit2 starts evicting objects\n    > from the cache.  This is a soft limit, in that the library might\n    > briefly exceed it, but will start aggressively evicting objects\n    > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.\n    >\n    > Because caches are repository-specific, disabling the cache\n    > cannot immediately clear all cached objects, but each cache will\n    > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be\n    > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.\n    > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.\n    >\n    > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.\n    >\n    > - `file` is the location of a file containing several\n    >   certificates concatenated together.\n    > - `path` is the location of a directory holding several\n    >   certificates, one per file.\n    >\n    > Either parameter may be `NULL`, but not both.\n
\n", + "comments": "

Available options:

\n\n
* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):\n\n    > Get the maximum mmap window size\n\n* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):\n\n    > Set the maximum mmap window size\n\n* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):\n\n    > Get the maximum memory that will be mapped in total by the library\n\n* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):\n\n    >Set the maximum amount of memory that can be mapped at any time        by the library\n\n* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)\n\n    > Get the search path for a given level of config data.  "level" must       > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,       > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.        > The search path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)\n\n    > Set the search path for a level of config data.  The search path      > applied to shared attributes and ignore files, too.       >       > - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.      >   Pass NULL to reset to the default (generally based on environment       >   variables).  Use magic path `$PATH` to include the old value        >   of the path (if you want to prepend or append, for instance).       >       > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,      >   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or       >   `GIT_CONFIG_LEVEL_PROGRAMDATA`.\n\n* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)\n\n    > Set the maximum data size for the given type of object to be      > considered eligible for caching in memory.  Setting to value to       > zero means that that type of object will not be cached.       > Defaults to 0 for GIT_OBJ_BLOB (i.e. won't cache blobs) and 4k        > for GIT_OBJ_COMMIT, GIT_OBJ_TREE, and GIT_OBJ_TAG.\n\n* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)\n\n    > Set the maximum total data size that will be cached in memory     > across all repositories before libgit2 starts evicting objects        > from the cache.  This is a soft limit, in that the library might      > briefly exceed it, but will start aggressively evicting objects       > from cache when that happens.  The default cache size is 256MB.\n\n* opts(GIT_OPT_ENABLE_CACHING, int enabled)\n\n    > Enable or disable caching completely.     >       > Because caches are repository-specific, disabling the cache       > cannot immediately clear all cached objects, but each cache will      > be cleared on the next attempt to update anything in it.\n\n* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)\n\n    > Get the current bytes in cache and the maximum that would be      > allowed in the cache.\n\n* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)\n\n    > Get the default template path.        > The path is written to the `out` buffer.\n\n* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)\n\n    > Set the default template path.        >       > - `path` directory of template.\n\n* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)\n\n    > Set the SSL certificate-authority locations.      >       > - `file` is the location of a file containing several     >   certificates concatenated together.     > - `path` is the location of a directory holding several       >   certificates, one per file.     >       > Either parameter may be `NULL`, but not both.\n\n* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)\n\n    > Set the value of the User-Agent header.  This value will be       > appended to "git/1.0", for compatibility with other git clients.      >       > - `user_agent` is the value that will be delivered as the     >   User-Agent header on HTTP requests.\n\n* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)\n\n    > Enable strict input validation when creating new objects      > to ensure that all inputs to the new objects are valid.  For      > example, when this is enabled, the parent(s) and tree inputs      > will be validated when creating a new commit.  This defaults      > to disabled.  * opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)\n\n    > Set the SSL ciphers use for HTTPS connections.        >       > - `ciphers` is the list of ciphers that are eanbled.\n
\n", "group": "libgit2" }, "git_config_entry_free": { "type": "function", "file": "config.h", - "line": 72, - "lineto": 72, + "line": 75, + "lineto": 75, "args": [ { "name": "", @@ -3980,8 +4053,8 @@ "git_config_find_global": { "type": "function", "file": "config.h", - "line": 113, - "lineto": 113, + "line": 116, + "lineto": 116, "args": [ { "name": "out", @@ -3996,14 +4069,14 @@ "comment": " 0 if a global configuration file has been found. Its path will be stored in `out`." }, "description": "

Locate the path to the global configuration file

\n", - "comments": "

The user or global configuration file is usually\n located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n global configuration file.

\n\n

This method will not guess the path to the xdg compatible\n config file (.config/git/config).

\n", + "comments": "

The user or global configuration file is usually located in $HOME/.gitconfig.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the global configuration file.

\n\n

This method will not guess the path to the xdg compatible config file (.config/git/config).

\n", "group": "config" }, "git_config_find_xdg": { "type": "function", "file": "config.h", - "line": 130, - "lineto": 130, + "line": 133, + "lineto": 133, "args": [ { "name": "out", @@ -4018,14 +4091,14 @@ "comment": " 0 if a xdg compatible configuration file has been\n\tfound. Its path will be stored in `out`." }, "description": "

Locate the path to the global xdg compatible configuration file

\n", - "comments": "

The xdg compatible configuration file is usually\n located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that\n file, if the file exists. The returned path\n may be used on any git_config call to load the\n xdg compatible configuration file.

\n", + "comments": "

The xdg compatible configuration file is usually located in $HOME/.config/git/config.

\n\n

This method will try to guess the full path to that file, if the file exists. The returned path may be used on any git_config call to load the xdg compatible configuration file.

\n", "group": "config" }, "git_config_find_system": { "type": "function", "file": "config.h", - "line": 142, - "lineto": 142, + "line": 145, + "lineto": 145, "args": [ { "name": "out", @@ -4040,14 +4113,36 @@ "comment": " 0 if a system configuration file has been\n\tfound. Its path will be stored in `out`." }, "description": "

Locate the path to the system configuration file

\n", - "comments": "

If /etc/gitconfig doesn't exist, it will look for\n %PROGRAMFILES%

\n\n

.

\n", + "comments": "

If /etc/gitconfig doesn't exist, it will look for %PROGRAMFILES%.

\n", + "group": "config" + }, + "git_config_find_programdata": { + "type": "function", + "file": "config.h", + "line": 156, + "lineto": 156, + "args": [ + { + "name": "out", + "type": "git_buf *", + "comment": "Pointer to a user-allocated git_buf in which to store the path" + } + ], + "argline": "git_buf *out", + "sig": "git_buf *", + "return": { + "type": "int", + "comment": " 0 if a ProgramData configuration file has been\n\tfound. Its path will be stored in `out`." + }, + "description": "

Locate the path to the configuration file in ProgramData

\n", + "comments": "

Look for the file in %PROGRAMDATA% used by portable git.

\n", "group": "config" }, "git_config_open_default": { "type": "function", "file": "config.h", - "line": 154, - "lineto": 154, + "line": 168, + "lineto": 168, "args": [ { "name": "out", @@ -4062,14 +4157,14 @@ "comment": " 0 or an error code" }, "description": "

Open the global, XDG and system configuration files

\n", - "comments": "

Utility wrapper that finds the global, XDG and system configuration files\n and opens them into a single prioritized config object that can be\n used when accessing default config data outside a repository.

\n", + "comments": "

Utility wrapper that finds the global, XDG and system configuration files and opens them into a single prioritized config object that can be used when accessing default config data outside a repository.

\n", "group": "config" }, "git_config_new": { "type": "function", "file": "config.h", - "line": 165, - "lineto": 165, + "line": 179, + "lineto": 179, "args": [ { "name": "out", @@ -4084,14 +4179,14 @@ "comment": " 0 or an error code" }, "description": "

Allocate a new configuration object

\n", - "comments": "

This object is empty, so you have to add a file to it before you\n can do anything with it.

\n", + "comments": "

This object is empty, so you have to add a file to it before you can do anything with it.

\n", "group": "config" }, "git_config_add_file_ondisk": { "type": "function", "file": "config.h", - "line": 192, - "lineto": 196, + "line": 206, + "lineto": 210, "args": [ { "name": "cfg", @@ -4121,14 +4216,14 @@ "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n for a given priority level (and force_replace set to 0),\n GIT_ENOTFOUND when the file doesn't exist or error code" }, "description": "

Add an on-disk config file instance to an existing config

\n", - "comments": "

The on-disk file pointed at by path will be opened and\n parsed; it's expected to be a native Git config file following\n the default Git config syntax (see man git-config).

\n\n

If the file does not exist, the file will still be added and it\n will be created the first time we write to it.

\n\n

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n", + "comments": "

The on-disk file pointed at by path will be opened and parsed; it's expected to be a native Git config file following the default Git config syntax (see man git-config).

\n\n

If the file does not exist, the file will still be added and it will be created the first time we write to it.

\n\n

Note that the configuration object will free the file automatically.

\n\n

Further queries on this config object will access each of the config file instances in order (instances with a higher priority level will be accessed first).

\n", "group": "config" }, "git_config_open_ondisk": { "type": "function", "file": "config.h", - "line": 210, - "lineto": 210, + "line": 224, + "lineto": 224, "args": [ { "name": "out", @@ -4148,19 +4243,19 @@ "comment": " 0 on success, or an error code" }, "description": "

Create a new config instance containing a single on-disk file

\n", - "comments": "

This method is a simple utility wrapper for the following sequence\n of calls:\n - git_config_new\n - git_config_add_file_ondisk

\n", + "comments": "

This method is a simple utility wrapper for the following sequence of calls: - git_config_new - git_config_add_file_ondisk

\n", "group": "config", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_config_open_ondisk-24" + "ex/v0.24.1/general.html#git_config_open_ondisk-24" ] } }, "git_config_open_level": { "type": "function", "file": "config.h", - "line": 228, - "lineto": 231, + "line": 242, + "lineto": 245, "args": [ { "name": "out", @@ -4185,14 +4280,14 @@ "comment": " 0, GIT_ENOTFOUND if the passed level cannot be found in the\n multi-level parent config, or an error code" }, "description": "

Build a single-level focused config object from a multi-level one.

\n", - "comments": "

The returned config object can be used to perform get/set/delete operations\n on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config\n will return different config instances, but containing the same config_file\n instance.

\n", + "comments": "

The returned config object can be used to perform get/set/delete operations on a single specific level.

\n\n

Getting several times the same level from the same parent multi-level config will return different config instances, but containing the same config_file instance.

\n", "group": "config" }, "git_config_open_global": { "type": "function", "file": "config.h", - "line": 245, - "lineto": 245, + "line": 259, + "lineto": 259, "args": [ { "name": "out", @@ -4212,14 +4307,14 @@ "comment": null }, "description": "

Open the global/XDG configuration file according to git's rules

\n", - "comments": "

Git allows you to store your global configuration at\n $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards\n compatability, the XDG file shouldn't be used unless the use has\n created it explicitly. With this function you'll open the correct\n one to write to.

\n", + "comments": "

Git allows you to store your global configuration at $HOME/.config or $XDG_CONFIG_HOME/git/config. For backwards compatability, the XDG file shouldn't be used unless the use has created it explicitly. With this function you'll open the correct one to write to.

\n", "group": "config" }, "git_config_snapshot": { "type": "function", "file": "config.h", - "line": 261, - "lineto": 261, + "line": 275, + "lineto": 275, "args": [ { "name": "out", @@ -4239,14 +4334,14 @@ "comment": " 0 or an error code" }, "description": "

Create a snapshot of the configuration

\n", - "comments": "

Create a snapshot of the current state of a configuration, which\n allows you to look into a consistent view of the configuration for\n looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid\n until it is freed.

\n", + "comments": "

Create a snapshot of the current state of a configuration, which allows you to look into a consistent view of the configuration for looking up complex values (e.g. a remote, submodule).

\n\n

The string returned when querying such a config object is valid until it is freed.

\n", "group": "config" }, "git_config_free": { "type": "function", "file": "config.h", - "line": 268, - "lineto": 268, + "line": 282, + "lineto": 282, "args": [ { "name": "cfg", @@ -4267,8 +4362,8 @@ "git_config_get_entry": { "type": "function", "file": "config.h", - "line": 280, - "lineto": 283, + "line": 294, + "lineto": 297, "args": [ { "name": "out", @@ -4299,8 +4394,8 @@ "git_config_get_int32": { "type": "function", "file": "config.h", - "line": 297, - "lineto": 297, + "line": 311, + "lineto": 311, "args": [ { "name": "out", @@ -4325,19 +4420,19 @@ "comment": " 0 or an error code" }, "description": "

Get the value of an integer config variable.

\n", - "comments": "

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_config_get_int32-25" + "ex/v0.24.1/general.html#git_config_get_int32-25" ] } }, "git_config_get_int64": { "type": "function", "file": "config.h", - "line": 311, - "lineto": 311, + "line": 325, + "lineto": 325, "args": [ { "name": "out", @@ -4362,14 +4457,14 @@ "comment": " 0 or an error code" }, "description": "

Get the value of a long integer config variable.

\n", - "comments": "

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_bool": { "type": "function", "file": "config.h", - "line": 328, - "lineto": 328, + "line": 342, + "lineto": 342, "args": [ { "name": "out", @@ -4394,14 +4489,14 @@ "comment": " 0 or an error code" }, "description": "

Get the value of a boolean config variable.

\n", - "comments": "

This function uses the usual C convention of 0 being false and\n anything else true.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

This function uses the usual C convention of 0 being false and anything else true.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_path": { "type": "function", "file": "config.h", - "line": 346, - "lineto": 346, + "line": 360, + "lineto": 360, "args": [ { "name": "out", @@ -4426,14 +4521,14 @@ "comment": " 0 or an error code" }, "description": "

Get the value of a path config variable.

\n", - "comments": "

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_string": { "type": "function", "file": "config.h", - "line": 364, - "lineto": 364, + "line": 378, + "lineto": 378, "args": [ { "name": "out", @@ -4458,19 +4553,19 @@ "comment": " 0 or an error code" }, "description": "

Get the value of a string config variable.

\n", - "comments": "

This function can only be used on snapshot config objects. The\n string is owned by the config and should not be freed by the\n user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

This function can only be used on snapshot config objects. The string is owned by the config and should not be freed by the user. The pointer will be valid until the config is freed.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_config_get_string-26" + "ex/v0.24.1/general.html#git_config_get_string-26" ] } }, "git_config_get_string_buf": { "type": "function", "file": "config.h", - "line": 380, - "lineto": 380, + "line": 394, + "lineto": 394, "args": [ { "name": "out", @@ -4495,14 +4590,14 @@ "comment": " 0 or an error code" }, "description": "

Get the value of a string config variable.

\n", - "comments": "

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their\n defined level. A higher level means a higher priority. The\n first occurrence of the variable will be returned here.

\n", + "comments": "

The value of the config will be copied into the buffer.

\n\n

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

\n", "group": "config" }, "git_config_get_multivar_foreach": { "type": "function", "file": "config.h", - "line": 394, - "lineto": 394, + "line": 408, + "lineto": 408, "args": [ { "name": "cfg", @@ -4543,8 +4638,8 @@ "git_config_multivar_iterator_new": { "type": "function", "file": "config.h", - "line": 405, - "lineto": 405, + "line": 419, + "lineto": 419, "args": [ { "name": "out", @@ -4580,8 +4675,8 @@ "git_config_next": { "type": "function", "file": "config.h", - "line": 417, - "lineto": 417, + "line": 431, + "lineto": 431, "args": [ { "name": "entry", @@ -4601,14 +4696,14 @@ "comment": " 0 or an error code. GIT_ITEROVER if the iteration has completed" }, "description": "

Return the current entry and advance the iterator

\n", - "comments": "

The pointers returned by this function are valid until the iterator\n is freed.

\n", + "comments": "

The pointers returned by this function are valid until the iterator is freed.

\n", "group": "config" }, "git_config_iterator_free": { "type": "function", "file": "config.h", - "line": 424, - "lineto": 424, + "line": 438, + "lineto": 438, "args": [ { "name": "iter", @@ -4629,8 +4724,8 @@ "git_config_set_int32": { "type": "function", "file": "config.h", - "line": 435, - "lineto": 435, + "line": 449, + "lineto": 449, "args": [ { "name": "cfg", @@ -4661,8 +4756,8 @@ "git_config_set_int64": { "type": "function", "file": "config.h", - "line": 446, - "lineto": 446, + "line": 460, + "lineto": 460, "args": [ { "name": "cfg", @@ -4693,8 +4788,8 @@ "git_config_set_bool": { "type": "function", "file": "config.h", - "line": 457, - "lineto": 457, + "line": 471, + "lineto": 471, "args": [ { "name": "cfg", @@ -4725,8 +4820,8 @@ "git_config_set_string": { "type": "function", "file": "config.h", - "line": 471, - "lineto": 471, + "line": 485, + "lineto": 485, "args": [ { "name": "cfg", @@ -4751,14 +4846,14 @@ "comment": " 0 or an error code" }, "description": "

Set the value of a string config variable in the config file\n with the highest level (usually the local one).

\n", - "comments": "

A copy of the string is made and the user is free to use it\n afterwards.

\n", + "comments": "

A copy of the string is made and the user is free to use it afterwards.

\n", "group": "config" }, "git_config_set_multivar": { "type": "function", "file": "config.h", - "line": 481, - "lineto": 481, + "line": 495, + "lineto": 495, "args": [ { "name": "cfg", @@ -4794,8 +4889,8 @@ "git_config_delete_entry": { "type": "function", "file": "config.h", - "line": 490, - "lineto": 490, + "line": 504, + "lineto": 504, "args": [ { "name": "cfg", @@ -4821,8 +4916,8 @@ "git_config_delete_multivar": { "type": "function", "file": "config.h", - "line": 501, - "lineto": 501, + "line": 515, + "lineto": 515, "args": [ { "name": "cfg", @@ -4853,8 +4948,8 @@ "git_config_foreach": { "type": "function", "file": "config.h", - "line": 519, - "lineto": 522, + "line": 533, + "lineto": 536, "args": [ { "name": "cfg", @@ -4879,14 +4974,14 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Perform an operation on each config variable.

\n", - "comments": "

The callback receives the normalized name and value of each variable\n in the config backend, and the data pointer passed to this function.\n If the callback returns a non-zero value, the function stops iterating\n and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n", + "comments": "

The callback receives the normalized name and value of each variable in the config backend, and the data pointer passed to this function. If the callback returns a non-zero value, the function stops iterating and returns that value to the caller.

\n\n

The pointers passed to the callback are only valid as long as the iteration is ongoing.

\n", "group": "config" }, "git_config_iterator_new": { "type": "function", "file": "config.h", - "line": 533, - "lineto": 533, + "line": 547, + "lineto": 547, "args": [ { "name": "out", @@ -4906,14 +5001,14 @@ "comment": null }, "description": "

Iterate over all the config variables

\n", - "comments": "

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n", + "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n", "group": "config" }, "git_config_iterator_glob_new": { "type": "function", "file": "config.h", - "line": 545, - "lineto": 545, + "line": 559, + "lineto": 559, "args": [ { "name": "out", @@ -4938,14 +5033,14 @@ "comment": null }, "description": "

Iterate over all the config variables whose name matches a pattern

\n", - "comments": "

Use git_config_next to advance the iteration and\n git_config_iterator_free when done.

\n", + "comments": "

Use git_config_next to advance the iteration and git_config_iterator_free when done.

\n", "group": "config" }, "git_config_foreach_match": { "type": "function", "file": "config.h", - "line": 563, - "lineto": 567, + "line": 577, + "lineto": 581, "args": [ { "name": "cfg", @@ -4975,14 +5070,14 @@ "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.

\n", - "comments": "

This behaviors like git_config_foreach with an additional filter of a\n regular expression that filters which config keys are passed to the\n callback.

\n\n

The pointers passed to the callback are only valid as long as the\n iteration is ongoing.

\n", + "comments": "

This behaviors like git_config_foreach with an additional filter of a regular expression that filters which config keys are passed to the callback.

\n\n

The pointers passed to the callback are only valid as long as the iteration is ongoing.

\n", "group": "config" }, "git_config_get_mapped": { "type": "function", "file": "config.h", - "line": 603, - "lineto": 608, + "line": 617, + "lineto": 622, "args": [ { "name": "out", @@ -5017,14 +5112,14 @@ "comment": " 0 on success, error code otherwise" }, "description": "

Query the value of a config variable and return it mapped to\n an integer constant.

\n", - "comments": "

This is a helper method to easily map different possible values\n to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {\n    {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},\n    {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},\n    {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},\n    {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the\n mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing\n the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison),\n the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be\n returned.

\n", + "comments": "

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

\n\n

A mapping array looks as follows:

\n\n
git_cvar_map autocrlf_mapping[] = {     {GIT_CVAR_FALSE, NULL, GIT_AUTO_CRLF_FALSE},        {GIT_CVAR_TRUE, NULL, GIT_AUTO_CRLF_TRUE},      {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT},        {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};\n
\n\n

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

\n\n

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

\n\n

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

\n\n

If not a single match can be made to store in out, an error code will be returned.

\n", "group": "config" }, "git_config_lookup_map_value": { "type": "function", "file": "config.h", - "line": 618, - "lineto": 622, + "line": 632, + "lineto": 636, "args": [ { "name": "out", @@ -5060,8 +5155,8 @@ "git_config_parse_bool": { "type": "function", "file": "config.h", - "line": 634, - "lineto": 634, + "line": 648, + "lineto": 648, "args": [ { "name": "out", @@ -5081,14 +5176,14 @@ "comment": null }, "description": "

Parse a string value as a bool.

\n", - "comments": "

Valid values for true are: 'true', 'yes', 'on', 1 or any\n number different from 0\n Valid values for false are: 'false', 'no', 'off', 0

\n", + "comments": "

Valid values for true are: 'true', 'yes', 'on', 1 or any number different from 0 Valid values for false are: 'false', 'no', 'off', 0

\n", "group": "config" }, "git_config_parse_int32": { "type": "function", "file": "config.h", - "line": 646, - "lineto": 646, + "line": 660, + "lineto": 660, "args": [ { "name": "out", @@ -5108,14 +5203,14 @@ "comment": null }, "description": "

Parse a string value as an int32.

\n", - "comments": "

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", "group": "config" }, "git_config_parse_int64": { "type": "function", "file": "config.h", - "line": 658, - "lineto": 658, + "line": 672, + "lineto": 672, "args": [ { "name": "out", @@ -5135,14 +5230,14 @@ "comment": null }, "description": "

Parse a string value as an int64.

\n", - "comments": "

An optional value suffix of 'k', 'm', or 'g' will\n cause the value to be multiplied by 1024, 1048576,\n or 1073741824 prior to output.

\n", + "comments": "

An optional value suffix of 'k', 'm', or 'g' will cause the value to be multiplied by 1024, 1048576, or 1073741824 prior to output.

\n", "group": "config" }, "git_config_parse_path": { "type": "function", "file": "config.h", - "line": 673, - "lineto": 673, + "line": 687, + "lineto": 687, "args": [ { "name": "out", @@ -5162,14 +5257,14 @@ "comment": null }, "description": "

Parse a string value as a path.

\n", - "comments": "

A leading '~' will be expanded to the global search path (which\n defaults to the user's home directory but can be overridden via\n git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be\n returned.

\n", + "comments": "

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

\n\n

If the value does not begin with a tilde, the input will be returned.

\n", "group": "config" }, "git_config_backend_foreach_match": { "type": "function", "file": "config.h", - "line": 687, - "lineto": 691, + "line": 701, + "lineto": 705, "args": [ { "name": "backend", @@ -5199,7 +5294,34 @@ "comment": null }, "description": "

Perform an operation on each config variable in given config backend\n matching a regular expression.

\n", - "comments": "

This behaviors like git_config_foreach_match except instead of all config\n entries it just enumerates through the given backend entry.

\n", + "comments": "

This behaviors like git_config_foreach_match except instead of all config entries it just enumerates through the given backend entry.

\n", + "group": "config" + }, + "git_config_lock": { + "type": "function", + "file": "config.h", + "line": 724, + "lineto": 724, + "args": [ + { + "name": "tx", + "type": "git_transaction **", + "comment": "the resulting transaction, use this to commit or undo the\n changes" + }, + { + "name": "cfg", + "type": "git_config *", + "comment": "the configuration in which to lock" + } + ], + "argline": "git_transaction **tx, git_config *cfg", + "sig": "git_transaction **::git_config *", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Lock the backend with the highest priority

\n", + "comments": "

Locking disallows anybody else from writing to that backend. Any updates made after locking will not be visible to a reader until the file is unlocked.

\n\n

You can apply the changes by calling git_transaction_commit() before freeing the transaction. Either of these actions will unlock the config.

\n", "group": "config" }, "git_cred_userpass": { @@ -5277,7 +5399,7 @@ "group": "describe", "examples": { "describe.c": [ - "ex/v0.23.2/describe.html#git_describe_commit-1" + "ex/v0.24.1/describe.html#git_describe_commit-1" ] } }, @@ -5310,11 +5432,11 @@ "comment": null }, "description": "

Describe a commit

\n", - "comments": "

Perform the describe operation on the current commit and the\n worktree. After peforming describe on HEAD, a status is run and the\n description is considered to be dirty if there are.

\n", + "comments": "

Perform the describe operation on the current commit and the worktree. After peforming describe on HEAD, a status is run and the description is considered to be dirty if there are.

\n", "group": "describe", "examples": { "describe.c": [ - "ex/v0.23.2/describe.html#git_describe_workdir-2" + "ex/v0.24.1/describe.html#git_describe_workdir-2" ] } }, @@ -5351,7 +5473,7 @@ "group": "describe", "examples": { "describe.c": [ - "ex/v0.23.2/describe.html#git_describe_format-3" + "ex/v0.24.1/describe.html#git_describe_format-3" ] } }, @@ -5380,8 +5502,8 @@ "git_diff_init_options": { "type": "function", "file": "diff.h", - "line": 412, - "lineto": 414, + "line": 435, + "lineto": 437, "args": [ { "name": "opts", @@ -5407,8 +5529,8 @@ "git_diff_find_init_options": { "type": "function", "file": "diff.h", - "line": 697, - "lineto": 699, + "line": 720, + "lineto": 722, "args": [ { "name": "opts", @@ -5434,8 +5556,8 @@ "git_diff_free": { "type": "function", "file": "diff.h", - "line": 713, - "lineto": 713, + "line": 736, + "lineto": 736, "args": [ { "name": "diff", @@ -5454,19 +5576,19 @@ "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_free-2" + "ex/v0.24.1/diff.html#git_diff_free-2" ], "log.c": [ - "ex/v0.23.2/log.html#git_diff_free-24", - "ex/v0.23.2/log.html#git_diff_free-25" + "ex/v0.24.1/log.html#git_diff_free-24", + "ex/v0.24.1/log.html#git_diff_free-25" ] } }, "git_diff_tree_to_tree": { "type": "function", "file": "diff.h", - "line": 731, - "lineto": 736, + "line": 754, + "lineto": 759, "args": [ { "name": "diff", @@ -5501,23 +5623,23 @@ "comment": null }, "description": "

Create a diff with the difference between two tree objects.

\n", - "comments": "

This is equivalent to git diff \n<old\n-tree> \n<new\n-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the\n second tree will be used for the "new_file" side of the delta. You can\n pass NULL to indicate an empty tree, although it is an error to pass\n NULL for both the old_tree and new_tree.

\n", + "comments": "

This is equivalent to git diff <old-tree> <new-tree>

\n\n

The first tree will be used for the "old_file" side of the delta and the second tree will be used for the "new_file" side of the delta. You can pass NULL to indicate an empty tree, although it is an error to pass NULL for both the old_tree and new_tree.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_tree_to_tree-3" + "ex/v0.24.1/diff.html#git_diff_tree_to_tree-3" ], "log.c": [ - "ex/v0.23.2/log.html#git_diff_tree_to_tree-26", - "ex/v0.23.2/log.html#git_diff_tree_to_tree-27" + "ex/v0.24.1/log.html#git_diff_tree_to_tree-26", + "ex/v0.24.1/log.html#git_diff_tree_to_tree-27" ] } }, "git_diff_tree_to_index": { "type": "function", "file": "diff.h", - "line": 757, - "lineto": 762, + "line": 780, + "lineto": 785, "args": [ { "name": "diff", @@ -5552,19 +5674,19 @@ "comment": null }, "description": "

Create a diff between a tree and repository index.

\n", - "comments": "

This is equivalent to `git diff --cached \n<treeish

\n\n
\n

or if you pass\n the HEAD tree, then likegit diff --cached`.

\n
\n\n

The tree you pass will be used for the "old_file" side of the delta, and\n the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n", + "comments": "

This is equivalent to git diff --cached <treeish> or if you pass the HEAD tree, then like git diff --cached.

\n\n

The tree you pass will be used for the "old_file" side of the delta, and the index will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_tree_to_index-4" + "ex/v0.24.1/diff.html#git_diff_tree_to_index-4" ] } }, "git_diff_index_to_workdir": { "type": "function", "file": "diff.h", - "line": 784, - "lineto": 788, + "line": 807, + "lineto": 811, "args": [ { "name": "diff", @@ -5594,19 +5716,19 @@ "comment": null }, "description": "

Create a diff between the repository index and the workdir directory.

\n", - "comments": "

This matches the git diff command. See the note below on\n git_diff_tree_to_workdir for a discussion of the difference between\n git diff and git diff HEAD and how to emulate a `git diff \n<treeish

\n\n
\n

`\n using libgit2.

\n
\n\n

The index will be used for the "old_file" side of the delta, and the\n working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo\n will be used. In this case, the index will be refreshed from disk\n (if it has changed) before the diff is generated.

\n", + "comments": "

This matches the git diff command. See the note below on git_diff_tree_to_workdir for a discussion of the difference between git diff and git diff HEAD and how to emulate a git diff <treeish> using libgit2.

\n\n

The index will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side of the delta.

\n\n

If you pass NULL for the index, then the existing index of the repo will be used. In this case, the index will be refreshed from disk (if it has changed) before the diff is generated.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_index_to_workdir-5" + "ex/v0.24.1/diff.html#git_diff_index_to_workdir-5" ] } }, "git_diff_tree_to_workdir": { "type": "function", "file": "diff.h", - "line": 813, - "lineto": 817, + "line": 836, + "lineto": 840, "args": [ { "name": "diff", @@ -5636,19 +5758,19 @@ "comment": null }, "description": "

Create a diff between a tree and the working directory.

\n", - "comments": "

The tree you provide will be used for the "old_file" side of the delta,\n and the working directory will be used for the "new_file" side.

\n\n

This is not the same as `git diff \n<treeish

\n\n
\n

orgit diff-index

\n
\n\n

<treeish

\n\n
\n

. Those commands use information from the index, whereas this\n function strictly returns the differences between the tree and the files\n in the working directory, regardless of the state of the index. Use\ngit_diff_tree_to_workdir_with_index` to emulate those commands.

\n
\n\n

To see difference between this and git_diff_tree_to_workdir_with_index,\n consider the example of a staged file deletion where the file has then\n been put back into the working dir and further modified. The\n tree-to-workdir diff for that file is 'modified', but git diff would\n show status 'deleted' since there is a staged delete.

\n", + "comments": "

The tree you provide will be used for the "old_file" side of the delta, and the working directory will be used for the "new_file" side.

\n\n

This is not the same as git diff <treeish> or git diff-index <treeish>. Those commands use information from the index, whereas this function strictly returns the differences between the tree and the files in the working directory, regardless of the state of the index. Use git_diff_tree_to_workdir_with_index to emulate those commands.

\n\n

To see difference between this and git_diff_tree_to_workdir_with_index, consider the example of a staged file deletion where the file has then been put back into the working dir and further modified. The tree-to-workdir diff for that file is 'modified', but git diff would show status 'deleted' since there is a staged delete.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_tree_to_workdir-6" + "ex/v0.24.1/diff.html#git_diff_tree_to_workdir-6" ] } }, "git_diff_tree_to_workdir_with_index": { "type": "function", "file": "diff.h", - "line": 832, - "lineto": 836, + "line": 855, + "lineto": 859, "args": [ { "name": "diff", @@ -5678,19 +5800,61 @@ "comment": null }, "description": "

Create a diff between a tree and the working directory using index data\n to account for staged deletes, tracked files, etc.

\n", - "comments": "

This emulates `git diff \n<tree

\n\n
\n

` by diffing the tree to the index and\n the index to the working directory and blending the results into a\n single diff that includes staged deleted, etc.

\n
\n", + "comments": "

This emulates git diff <tree> by diffing the tree to the index and the index to the working directory and blending the results into a single diff that includes staged deleted, etc.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_tree_to_workdir_with_index-7" + "ex/v0.24.1/diff.html#git_diff_tree_to_workdir_with_index-7" ] } }, + "git_diff_index_to_index": { + "type": "function", + "file": "diff.h", + "line": 873, + "lineto": 878, + "args": [ + { + "name": "diff", + "type": "git_diff **", + "comment": "Output pointer to a git_diff pointer to be allocated." + }, + { + "name": "repo", + "type": "git_repository *", + "comment": "The repository containing the indexes." + }, + { + "name": "old_index", + "type": "git_index *", + "comment": "A git_index object to diff from." + }, + { + "name": "new_index", + "type": "git_index *", + "comment": "A git_index object to diff to." + }, + { + "name": "opts", + "type": "const git_diff_options *", + "comment": "Structure with options to influence diff or NULL for defaults." + } + ], + "argline": "git_diff **diff, git_repository *repo, git_index *old_index, git_index *new_index, const git_diff_options *opts", + "sig": "git_diff **::git_repository *::git_index *::git_index *::const git_diff_options *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Create a diff with the difference between two index objects.

\n", + "comments": "

The first index will be used for the "old_file" side of the delta and the second index will be used for the "new_file" side of the delta.

\n", + "group": "diff" + }, "git_diff_merge": { "type": "function", "file": "diff.h", - "line": 851, - "lineto": 853, + "line": 893, + "lineto": 895, "args": [ { "name": "onto", @@ -5710,14 +5874,14 @@ "comment": null }, "description": "

Merge one diff into another.

\n", - "comments": "

This merges items from the "from" list into the "onto" list. The\n resulting diff will have all items that appear in either list.\n If an item appears in both lists, then it will be "merged" to appear\n as if the old version was from the "onto" list and the new version\n is from the "from" list (with the exception that if the item has a\n pending DELETE in the middle, then it will show as deleted).

\n", + "comments": "

This merges items from the "from" list into the "onto" list. The resulting diff will have all items that appear in either list. If an item appears in both lists, then it will be "merged" to appear as if the old version was from the "onto" list and the new version is from the "from" list (with the exception that if the item has a pending DELETE in the middle, then it will show as deleted).

\n", "group": "diff" }, "git_diff_find_similar": { "type": "function", "file": "diff.h", - "line": 867, - "lineto": 869, + "line": 909, + "lineto": 911, "args": [ { "name": "diff", @@ -5737,19 +5901,19 @@ "comment": " 0 on success, -1 on failure" }, "description": "

Transform a diff marking file renames, copies, etc.

\n", - "comments": "

This modifies a diff in place, replacing old entries that look\n like renames or copies with new entries reflecting those changes.\n This also will, if requested, break modified files into add/remove\n pairs if the amount of change is above a threshold.

\n", + "comments": "

This modifies a diff in place, replacing old entries that look like renames or copies with new entries reflecting those changes. This also will, if requested, break modified files into add/remove pairs if the amount of change is above a threshold.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_find_similar-8" + "ex/v0.24.1/diff.html#git_diff_find_similar-8" ] } }, "git_diff_num_deltas": { "type": "function", "file": "diff.h", - "line": 887, - "lineto": 887, + "line": 929, + "lineto": 929, "args": [ { "name": "diff", @@ -5768,15 +5932,15 @@ "group": "diff", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_diff_num_deltas-28" + "ex/v0.24.1/log.html#git_diff_num_deltas-28" ] } }, "git_diff_num_deltas_of_type": { "type": "function", "file": "diff.h", - "line": 900, - "lineto": 901, + "line": 942, + "lineto": 943, "args": [ { "name": "diff", @@ -5796,14 +5960,14 @@ "comment": " Count of number of deltas matching delta_t type" }, "description": "

Query how many diff deltas are there in a diff filtered by type.

\n", - "comments": "

This works just like git_diff_entrycount() with an extra parameter\n that is a git_delta_t and returns just the count of how many deltas\n match that particular type.

\n", + "comments": "

This works just like git_diff_entrycount() with an extra parameter that is a git_delta_t and returns just the count of how many deltas match that particular type.

\n", "group": "diff" }, "git_diff_get_delta": { "type": "function", "file": "diff.h", - "line": 920, - "lineto": 921, + "line": 962, + "lineto": 963, "args": [ { "name": "diff", @@ -5823,14 +5987,14 @@ "comment": " Pointer to git_diff_delta (or NULL if `idx` out of range)" }, "description": "

Return the diff delta for an entry in the diff list.

\n", - "comments": "

The git_diff_delta pointer points to internal data and you do not\n have to release it when you are done with it. It will go away when\n the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary\n content or not may not be set if there are no attributes set for the\n file and there has been no reason to load the file data at this point.\n For now, if you need those flags to be up to date, your only option is\n to either use git_diff_foreach or create a git_patch.

\n", + "comments": "

The git_diff_delta pointer points to internal data and you do not have to release it when you are done with it. It will go away when the * git_diff (or any associated git_patch) goes away.

\n\n

Note that the flags on the delta related to whether it has binary content or not may not be set if there are no attributes set for the file and there has been no reason to load the file data at this point. For now, if you need those flags to be up to date, your only option is to either use git_diff_foreach or create a git_patch.

\n", "group": "diff" }, "git_diff_is_sorted_icase": { "type": "function", "file": "diff.h", - "line": 929, - "lineto": 929, + "line": 971, + "lineto": 971, "args": [ { "name": "diff", @@ -5851,8 +6015,8 @@ "git_diff_foreach": { "type": "function", "file": "diff.h", - "line": 957, - "lineto": 963, + "line": 999, + "lineto": 1005, "args": [ { "name": "diff", @@ -5892,14 +6056,14 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Loop over all deltas in a diff issuing callbacks.

\n", - "comments": "

This will iterate through all of the files described in a diff. You\n should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the\n files will only be calculated if they are not NULL. Of course, these\n callbacks will not be invoked for binary files on the diff or for\n files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate\n the iteration and return the value to the user.

\n", + "comments": "

This will iterate through all of the files described in a diff. You should provide a file callback to learn about each file.

\n\n

The "hunk" and "line" callbacks are optional, and the text diff of the files will only be calculated if they are not NULL. Of course, these callbacks will not be invoked for binary files on the diff or for files whose only changed is a file mode change.

\n\n

Returning a non-zero value from any of the callbacks will terminate the iteration and return the value to the user.

\n", "group": "diff" }, "git_diff_status_char": { "type": "function", "file": "diff.h", - "line": 976, - "lineto": 976, + "line": 1018, + "lineto": 1018, "args": [ { "name": "status", @@ -5914,14 +6078,14 @@ "comment": " The single character label for that code" }, "description": "

Look up the single character abbreviation for a delta status code.

\n", - "comments": "

When you run git diff --name-status it uses single letter codes in\n the output such as 'A' for added, 'D' for deleted, 'M' for modified,\n etc. This function converts a git_delta_t value into these letters for\n your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", + "comments": "

When you run git diff --name-status it uses single letter codes in the output such as 'A' for added, 'D' for deleted, 'M' for modified, etc. This function converts a git_delta_t value into these letters for your own purposes. GIT_DELTA_UNTRACKED will return a space (i.e. ' ').

\n", "group": "diff" }, "git_diff_print": { "type": "function", "file": "diff.h", - "line": 1001, - "lineto": 1005, + "line": 1043, + "lineto": 1047, "args": [ { "name": "diff", @@ -5951,22 +6115,22 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Iterate over a diff generating formatted text output.

\n", - "comments": "

Returning a non-zero value from the callbacks will terminate the\n iteration and return the non-zero value to the caller.

\n", + "comments": "

Returning a non-zero value from the callbacks will terminate the iteration and return the non-zero value to the caller.

\n", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_print-9" + "ex/v0.24.1/diff.html#git_diff_print-9" ], "log.c": [ - "ex/v0.23.2/log.html#git_diff_print-29" + "ex/v0.24.1/log.html#git_diff_print-29" ] } }, "git_diff_blobs": { "type": "function", "file": "diff.h", - "line": 1042, - "lineto": 1052, + "line": 1084, + "lineto": 1094, "args": [ { "name": "old_blob", @@ -6026,14 +6190,14 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Directly run a diff on two blobs.

\n", - "comments": "

Compared to a file, a blob lacks some contextual information. As such,\n the git_diff_file given to the callback will have some fake data; i.e.\n mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated\n as an empty blob, with the oid set to NULL in the git_diff_file data.\n Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob\n looks like binary data, the git_diff_delta binary attribute will be set\n to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass\n GIT_DIFF_FORCE_TEXT of course).

\n", + "comments": "

Compared to a file, a blob lacks some contextual information. As such, the git_diff_file given to the callback will have some fake data; i.e. mode will be 0 and path will be NULL.

\n\n

NULL is allowed for either old_blob or new_blob and will be treated as an empty blob, with the oid set to NULL in the git_diff_file data. Passing NULL for both blobs is a noop; no callbacks will be made at all.

\n\n

We do run a binary content check on the blob content and if either blob looks like binary data, the git_diff_delta binary attribute will be set to 1 and no call to the hunk_cb nor line_cb will be made (unless you pass GIT_DIFF_FORCE_TEXT of course).

\n", "group": "diff" }, "git_diff_blob_to_buffer": { "type": "function", "file": "diff.h", - "line": 1079, - "lineto": 1090, + "line": 1121, + "lineto": 1132, "args": [ { "name": "old_blob", @@ -6098,14 +6262,14 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Directly run a diff between a blob and a buffer.

\n", - "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context,\n so the git_diff_file parameters to the callbacks will be faked a la the\n rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the\n file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the\n entire content of the buffer added). Passing NULL to the buffer will do\n the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", + "comments": "

As with git_diff_blobs, comparing a blob and buffer lacks some context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n\n

Passing NULL for old_blob will be treated as an empty blob (i.e. the file_cb will be invoked with GIT_DELTA_ADDED and the diff will be the entire content of the buffer added). Passing NULL to the buffer will do the reverse, with GIT_DELTA_REMOVED and blob content removed.

\n", "group": "diff" }, "git_diff_buffers": { "type": "function", "file": "diff.h", - "line": 1113, - "lineto": 1125, + "line": 1155, + "lineto": 1167, "args": [ { "name": "old_buffer", @@ -6175,14 +6339,14 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Directly run a diff between two buffers.

\n", - "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks\n context, so the git_diff_file parameters to the callbacks will be\n faked a la the rules for git_diff_blobs().

\n", + "comments": "

Even more than with git_diff_blobs, comparing two buffer lacks context, so the git_diff_file parameters to the callbacks will be faked a la the rules for git_diff_blobs().

\n", "group": "diff" }, "git_diff_get_stats": { "type": "function", "file": "diff.h", - "line": 1161, - "lineto": 1163, + "line": 1203, + "lineto": 1205, "args": [ { "name": "out", @@ -6201,20 +6365,20 @@ "type": "int", "comment": " 0 on success; non-zero on error" }, - "description": "

Accumlate diff statistics for all patches.

\n", + "description": "

Accumulate diff statistics for all patches.

\n", "comments": "", "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_get_stats-10" + "ex/v0.24.1/diff.html#git_diff_get_stats-10" ] } }, "git_diff_stats_files_changed": { "type": "function", "file": "diff.h", - "line": 1171, - "lineto": 1172, + "line": 1213, + "lineto": 1214, "args": [ { "name": "stats", @@ -6235,8 +6399,8 @@ "git_diff_stats_insertions": { "type": "function", "file": "diff.h", - "line": 1180, - "lineto": 1181, + "line": 1222, + "lineto": 1223, "args": [ { "name": "stats", @@ -6257,8 +6421,8 @@ "git_diff_stats_deletions": { "type": "function", "file": "diff.h", - "line": 1189, - "lineto": 1190, + "line": 1231, + "lineto": 1232, "args": [ { "name": "stats", @@ -6279,8 +6443,8 @@ "git_diff_stats_to_buf": { "type": "function", "file": "diff.h", - "line": 1201, - "lineto": 1205, + "line": 1243, + "lineto": 1247, "args": [ { "name": "out", @@ -6314,15 +6478,15 @@ "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_stats_to_buf-11" + "ex/v0.24.1/diff.html#git_diff_stats_to_buf-11" ] } }, "git_diff_stats_free": { "type": "function", "file": "diff.h", - "line": 1213, - "lineto": 1213, + "line": 1255, + "lineto": 1255, "args": [ { "name": "stats", @@ -6341,15 +6505,15 @@ "group": "diff", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_diff_stats_free-12" + "ex/v0.24.1/diff.html#git_diff_stats_free-12" ] } }, "git_diff_format_email": { "type": "function", "file": "diff.h", - "line": 1262, - "lineto": 1265, + "line": 1307, + "lineto": 1310, "args": [ { "name": "out", @@ -6380,8 +6544,8 @@ "git_diff_commit_as_email": { "type": "function", "file": "diff.h", - "line": 1281, - "lineto": 1288, + "line": 1326, + "lineto": 1333, "args": [ { "name": "out", @@ -6432,8 +6596,8 @@ "git_diff_format_email_init_options": { "type": "function", "file": "diff.h", - "line": 1299, - "lineto": 1301, + "line": 1344, + "lineto": 1346, "args": [ { "name": "opts", @@ -6459,8 +6623,8 @@ "giterr_last": { "type": "function", "file": "errors.h", - "line": 109, - "lineto": 109, + "line": 110, + "lineto": 110, "args": [], "argline": "", "sig": "", @@ -6473,22 +6637,22 @@ "group": "giterr", "examples": { "general.c": [ - "ex/v0.23.2/general.html#giterr_last-27" + "ex/v0.24.1/general.html#giterr_last-27" ], "network/clone.c": [ - "ex/v0.23.2/network/clone.html#giterr_last-2" + "ex/v0.24.1/network/clone.html#giterr_last-2" ], "network/git2.c": [ - "ex/v0.23.2/network/git2.html#giterr_last-1", - "ex/v0.23.2/network/git2.html#giterr_last-2" + "ex/v0.24.1/network/git2.html#giterr_last-1", + "ex/v0.24.1/network/git2.html#giterr_last-2" ] } }, "giterr_clear": { "type": "function", "file": "errors.h", - "line": 114, - "lineto": 114, + "line": 115, + "lineto": 115, "args": [], "argline": "", "sig": "", @@ -6500,33 +6664,11 @@ "comments": "", "group": "giterr" }, - "giterr_detach": { - "type": "function", - "file": "errors.h", - "line": 126, - "lineto": 126, - "args": [ - { - "name": "cpy", - "type": "git_error *", - "comment": null - } - ], - "argline": "git_error *cpy", - "sig": "git_error *", - "return": { - "type": "int", - "comment": null - }, - "description": "

Get the last error data and clear it.

\n", - "comments": "

This copies the last error into the given git_error struct\n and returns 0 if the copy was successful, leaving the error\n cleared as if giterr_clear had been called.

\n\n

If there was no existing error in the library, -1 will be returned\n and the contents of cpy will be left unmodified.

\n", - "group": "giterr" - }, "giterr_set_str": { "type": "function", "file": "errors.h", - "line": 149, - "lineto": 149, + "line": 133, + "lineto": 133, "args": [ { "name": "error_class", @@ -6546,14 +6688,14 @@ "comment": null }, "description": "

Set the error message string for this thread.

\n", - "comments": "

This function is public so that custom ODB backends and the like can\n relay an error message through libgit2. Most regular users of libgit2\n will never need to call this function -- actually, calling it in most\n circumstances (for example, calling from within a callback function)\n will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies\n to the particular thread that this libgit2 call is made from.

\n\n

NOTE: Passing the error_class as GITERR_OS has a special behavior: we\n attempt to append the system default error message for the last OS error\n that occurred and then clear the last error. The specific implementation\n of looking up and clearing this last OS error will vary by platform.

\n", + "comments": "

This function is public so that custom ODB backends and the like can relay an error message through libgit2. Most regular users of libgit2 will never need to call this function -- actually, calling it in most circumstances (for example, calling from within a callback function) will just end up having the value overwritten by libgit2 internals.

\n\n

This error message is stored in thread-local storage and only applies to the particular thread that this libgit2 call is made from.

\n", "group": "giterr" }, "giterr_set_oom": { "type": "function", "file": "errors.h", - "line": 160, - "lineto": 160, + "line": 144, + "lineto": 144, "args": [], "argline": "", "sig": "", @@ -6562,7 +6704,7 @@ "comment": null }, "description": "

Set the error message to a special value for memory allocation failure.

\n", - "comments": "

The normal giterr_set_str() function attempts to strdup() the string\n that is passed in. This is not a good idea when the error in question\n is a memory allocation failure. That circumstance has a special setter\n function that sets the error string to a known and statically allocated\n internal value.

\n", + "comments": "

The normal giterr_set_str() function attempts to strdup() the string that is passed in. This is not a good idea when the error in question is a memory allocation failure. That circumstance has a special setter function that sets the error string to a known and statically allocated internal value.

\n", "group": "giterr" }, "git_filter_list_load": { @@ -6609,7 +6751,7 @@ "comment": " 0 on success (which could still return NULL if no filters are\n needed for the requested file), \n<\n0 on error" }, "description": "

Load the filter list for a given path.

\n", - "comments": "

This will return 0 (success) but set the output git_filter_list to NULL\n if no filters are requested for the given file.

\n", + "comments": "

This will return 0 (success) but set the output git_filter_list to NULL if no filters are requested for the given file.

\n", "group": "filter" }, "git_filter_list_contains": { @@ -6636,7 +6778,7 @@ "comment": " 1 if the filter is in the list, 0 otherwise" }, "description": "

Query the filter list to see if a given filter (by name) will run.\n The built-in filters "crlf" and "ident" can be queried, otherwise this\n is the name of the filter specified by the filter attribute.

\n", - "comments": "

This will return 0 if the given filter is not in the list, or 1 if\n the filter will be applied.

\n", + "comments": "

This will return 0 if the given filter is not in the list, or 1 if the filter will be applied.

\n", "group": "filter" }, "git_filter_list_apply_to_data": { @@ -6668,7 +6810,7 @@ "comment": " 0 on success, an error code otherwise" }, "description": "

Apply filter list to a data buffer.

\n", - "comments": "

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is\n not zero), then it will be overwritten when applying the filters. If\n not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out\n buffer will reference the in buffer data (with asize set to zero)\n instead of allocating data. This keeps allocations to a minimum, but\n it means you have to be careful about freeing the in data since out\n may be pointing to it!

\n", + "comments": "

See git2/buffer.h for background on git_buf objects.

\n\n

If the in buffer holds data allocated by libgit2 (i.e. in->asize is not zero), then it will be overwritten when applying the filters. If not, then it will be left untouched.

\n\n

If there are no filters to apply (or filters is NULL), then the out buffer will reference the in buffer data (with asize set to zero) instead of allocating data. This keeps allocations to a minimum, but it means you have to be careful about freeing the in data since out may be pointing to it!

\n", "group": "filter" }, "git_filter_list_apply_to_file": { @@ -6876,44 +7018,44 @@ "comment": " the number of initializations of the library, or an error code." }, "description": "

Init the global state

\n", - "comments": "

This function must the called before any other libgit2 function in\n order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number\n of times the initialization has been called (including this one) that have\n not subsequently been shutdown.

\n", + "comments": "

This function must the called before any other libgit2 function in order to set up global state and threading.

\n\n

This function may be called multiple times - it will return the number of times the initialization has been called (including this one) that have not subsequently been shutdown.

\n", "group": "libgit2", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_libgit2_init-8" + "ex/v0.24.1/blame.html#git_libgit2_init-8" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_libgit2_init-10" + "ex/v0.24.1/cat-file.html#git_libgit2_init-10" ], "describe.c": [ - "ex/v0.23.2/describe.html#git_libgit2_init-4" + "ex/v0.24.1/describe.html#git_libgit2_init-4" ], "diff.c": [ - "ex/v0.23.2/diff.html#git_libgit2_init-13" + "ex/v0.24.1/diff.html#git_libgit2_init-13" ], "general.c": [ - "ex/v0.23.2/general.html#git_libgit2_init-28" + "ex/v0.24.1/general.html#git_libgit2_init-28" ], "init.c": [ - "ex/v0.23.2/init.html#git_libgit2_init-2" + "ex/v0.24.1/init.html#git_libgit2_init-2" ], "log.c": [ - "ex/v0.23.2/log.html#git_libgit2_init-30" + "ex/v0.24.1/log.html#git_libgit2_init-30" ], "network/git2.c": [ - "ex/v0.23.2/network/git2.html#git_libgit2_init-3" + "ex/v0.24.1/network/git2.html#git_libgit2_init-3" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_libgit2_init-2" + "ex/v0.24.1/remote.html#git_libgit2_init-2" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_libgit2_init-1" + "ex/v0.24.1/rev-parse.html#git_libgit2_init-1" ], "status.c": [ - "ex/v0.23.2/status.html#git_libgit2_init-1" + "ex/v0.24.1/status.html#git_libgit2_init-1" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_libgit2_init-3" + "ex/v0.24.1/tag.html#git_libgit2_init-3" ] } }, @@ -6930,41 +7072,41 @@ "comment": " the number of remaining initializations of the library, or an\n error code." }, "description": "

Shutdown the global state

\n", - "comments": "

Clean up the global state and threading context after calling it as\n many times as git_libgit2_init() was called - it will return the\n number of remainining initializations that have not been shutdown\n (after this one).

\n", + "comments": "

Clean up the global state and threading context after calling it as many times as git_libgit2_init() was called - it will return the number of remainining initializations that have not been shutdown (after this one).

\n", "group": "libgit2", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_libgit2_shutdown-9" + "ex/v0.24.1/blame.html#git_libgit2_shutdown-9" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_libgit2_shutdown-11" + "ex/v0.24.1/cat-file.html#git_libgit2_shutdown-11" ], "describe.c": [ - "ex/v0.23.2/describe.html#git_libgit2_shutdown-5" + "ex/v0.24.1/describe.html#git_libgit2_shutdown-5" ], "diff.c": [ - "ex/v0.23.2/diff.html#git_libgit2_shutdown-14" + "ex/v0.24.1/diff.html#git_libgit2_shutdown-14" ], "init.c": [ - "ex/v0.23.2/init.html#git_libgit2_shutdown-3" + "ex/v0.24.1/init.html#git_libgit2_shutdown-3" ], "log.c": [ - "ex/v0.23.2/log.html#git_libgit2_shutdown-31" + "ex/v0.24.1/log.html#git_libgit2_shutdown-31" ], "network/git2.c": [ - "ex/v0.23.2/network/git2.html#git_libgit2_shutdown-4" + "ex/v0.24.1/network/git2.html#git_libgit2_shutdown-4" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_libgit2_shutdown-3" + "ex/v0.24.1/remote.html#git_libgit2_shutdown-3" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_libgit2_shutdown-2" + "ex/v0.24.1/rev-parse.html#git_libgit2_shutdown-2" ], "status.c": [ - "ex/v0.23.2/status.html#git_libgit2_shutdown-2" + "ex/v0.24.1/status.html#git_libgit2_shutdown-2" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_libgit2_shutdown-4" + "ex/v0.24.1/tag.html#git_libgit2_shutdown-4" ] } }, @@ -7007,7 +7149,7 @@ "comment": null }, "description": "

Count the number of unique commits between two commit objects

\n", - "comments": "

There is no need for branches containing the commits to have any\n upstream relationship, but it helps to think of one as a branch and\n the other as its upstream, the ahead and behind values will be\n what git would report for the branches.

\n", + "comments": "

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

\n", "group": "graph" }, "git_graph_descendant_of": { @@ -7066,7 +7208,7 @@ "comment": " 0 on success" }, "description": "

Add ignore rules for a repository.

\n", - "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from\n .gitignore files in the repository tree or from a shared system file\n only if a "core.excludesfile" config value is set. The library also\n keeps a set of per-repository internal ignores that can be configured\n in-memory and will not persist. This function allows you to add to\n that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c\n
\n\n

/

\n\n

with space

\n\n

");

\n\n

This would add three rules to the ignores.

\n", + "comments": "

Excludesfile rules (i.e. .gitignore rules) are generally read from .gitignore files in the repository tree or from a shared system file only if a "core.excludesfile" config value is set. The library also keeps a set of per-repository internal ignores that can be configured in-memory and will not persist. This function allows you to add to that internal rules list.

\n\n

Example usage:

\n\n
 error = git_ignore_add_rule(myrepo, "*.c/ with space");\n
\n\n

This would add three rules to the ignores.

\n", "group": "ignore" }, "git_ignore_clear_internal_rules": { @@ -7088,7 +7230,7 @@ "comment": " 0 on success" }, "description": "

Clear ignore rules that were explicitly added.

\n", - "comments": "

Resets to the default internal ignore rules. This will not turn off\n rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", + "comments": "

Resets to the default internal ignore rules. This will not turn off rules in .gitignore files that actually exist in the filesystem.

\n\n

The default internal ignores ignore ".", ".." and ".git" entries.

\n", "group": "ignore" }, "git_ignore_path_is_ignored": { @@ -7120,14 +7262,14 @@ "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." }, "description": "

Test if the ignore rules apply to a given path.

\n", - "comments": "

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", "group": "ignore" }, "git_index_open": { "type": "function", "file": "index.h", - "line": 189, - "lineto": 189, + "line": 203, + "lineto": 203, "args": [ { "name": "out", @@ -7147,14 +7289,14 @@ "comment": " 0 or an error code" }, "description": "

Create a new bare Git index object as a memory representation\n of the Git index file in 'index_path', without a repository\n to back it.

\n", - "comments": "

Since there is no ODB or working directory behind this index,\n any Index methods which rely on these (e.g. index_add_bypath)\n will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository,\n use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", + "comments": "

Since there is no ODB or working directory behind this index, any Index methods which rely on these (e.g. index_add_bypath) will fail with the GIT_ERROR error code.

\n\n

If you need to access the index of an actual repository, use the git_repository_index wrapper.

\n\n

The index must be freed once it's no longer in use.

\n", "group": "index" }, "git_index_new": { "type": "function", "file": "index.h", - "line": 202, - "lineto": 202, + "line": 216, + "lineto": 216, "args": [ { "name": "out", @@ -7169,14 +7311,14 @@ "comment": " 0 or an error code" }, "description": "

Create an in-memory index object.

\n", - "comments": "

This index object cannot be read/written to the filesystem,\n but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", + "comments": "

This index object cannot be read/written to the filesystem, but may be used to perform in-memory index operations.

\n\n

The index must be freed once it's no longer in use.

\n", "group": "index" }, "git_index_free": { "type": "function", "file": "index.h", - "line": 209, - "lineto": 209, + "line": 223, + "lineto": 223, "args": [ { "name": "index", @@ -7195,18 +7337,18 @@ "group": "index", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_index_free-29" + "ex/v0.24.1/general.html#git_index_free-29" ], "init.c": [ - "ex/v0.23.2/init.html#git_index_free-4" + "ex/v0.24.1/init.html#git_index_free-4" ] } }, "git_index_owner": { "type": "function", "file": "index.h", - "line": 217, - "lineto": 217, + "line": 231, + "lineto": 231, "args": [ { "name": "index", @@ -7227,8 +7369,8 @@ "git_index_caps": { "type": "function", "file": "index.h", - "line": 225, - "lineto": 225, + "line": 239, + "lineto": 239, "args": [ { "name": "index", @@ -7249,8 +7391,8 @@ "git_index_set_caps": { "type": "function", "file": "index.h", - "line": 238, - "lineto": 238, + "line": 252, + "lineto": 252, "args": [ { "name": "index", @@ -7270,14 +7412,14 @@ "comment": " 0 on success, -1 on failure" }, "description": "

Set index capabilities flags.

\n", - "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the\n capabilities will be read from the config of the owner object,\n looking at core.ignorecase, core.filemode, core.symlinks.

\n", + "comments": "

If you pass GIT_INDEXCAP_FROM_OWNER for the caps, then the capabilities will be read from the config of the owner object, looking at core.ignorecase, core.filemode, core.symlinks.

\n", "group": "index" }, "git_index_read": { "type": "function", "file": "index.h", - "line": 257, - "lineto": 257, + "line": 271, + "lineto": 271, "args": [ { "name": "index", @@ -7297,14 +7439,14 @@ "comment": " 0 or an error code" }, "description": "

Update the contents of an existing index object in memory by reading\n from the hard disk.

\n", - "comments": "

If force is true, this performs a "hard" read that discards in-memory\n changes and always reloads the on-disk index data. If there is no\n on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index\n data from disk only if it has changed since the last time it was\n loaded. Purely in-memory index data will be untouched. Be aware: if\n there are changes on disk, unwritten in-memory changes are discarded.

\n", + "comments": "

If force is true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared.

\n\n

If force is false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched. Be aware: if there are changes on disk, unwritten in-memory changes are discarded.

\n", "group": "index" }, "git_index_write": { "type": "function", "file": "index.h", - "line": 266, - "lineto": 266, + "line": 280, + "lineto": 280, "args": [ { "name": "index", @@ -7325,8 +7467,8 @@ "git_index_path": { "type": "function", "file": "index.h", - "line": 274, - "lineto": 274, + "line": 288, + "lineto": 288, "args": [ { "name": "index", @@ -7347,8 +7489,8 @@ "git_index_checksum": { "type": "function", "file": "index.h", - "line": 286, - "lineto": 286, + "line": 300, + "lineto": 300, "args": [ { "name": "index", @@ -7363,14 +7505,14 @@ "comment": " a pointer to the checksum of the index" }, "description": "

Get the checksum of the index

\n", - "comments": "

This checksum is the SHA-1 hash over the index file (except the\n last 20 bytes which are the checksum itself). In cases where the\n index does not exist on-disk, it will be zeroed out.

\n", + "comments": "

This checksum is the SHA-1 hash over the index file (except the last 20 bytes which are the checksum itself). In cases where the index does not exist on-disk, it will be zeroed out.

\n", "group": "index" }, "git_index_read_tree": { "type": "function", "file": "index.h", - "line": 297, - "lineto": 297, + "line": 311, + "lineto": 311, "args": [ { "name": "index", @@ -7396,8 +7538,8 @@ "git_index_write_tree": { "type": "function", "file": "index.h", - "line": 318, - "lineto": 318, + "line": 332, + "lineto": 332, "args": [ { "name": "out", @@ -7417,19 +7559,19 @@ "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" }, "description": "

Write the index as a tree

\n", - "comments": "

This method will scan the index and write a representation\n of its current state back to disk; it recursively creates\n tree objects for each of the subtrees stored in the index,\n but only returns the OID of the root tree. This is the OID\n that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated\n to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", + "comments": "

This method will scan the index and write a representation of its current state back to disk; it recursively creates tree objects for each of the subtrees stored in the index, but only returns the OID of the root tree. This is the OID that can be used e.g. to create a commit.

\n\n

The index instance cannot be bare, and needs to be associated to an existing repository.

\n\n

The index must not contain any file in conflict.

\n", "group": "index", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_index_write_tree-5" + "ex/v0.24.1/init.html#git_index_write_tree-5" ] } }, "git_index_write_tree_to": { "type": "function", "file": "index.h", - "line": 335, - "lineto": 335, + "line": 349, + "lineto": 349, "args": [ { "name": "out", @@ -7454,14 +7596,14 @@ "comment": " 0 on success, GIT_EUNMERGED when the index is not clean\n or an error code" }, "description": "

Write the index as a tree to the given repository

\n", - "comments": "

This method will do the same as git_index_write_tree, but\n letting the user choose the repository where the tree will\n be written.

\n\n

The index must not contain any file in conflict.

\n", + "comments": "

This method will do the same as git_index_write_tree, but letting the user choose the repository where the tree will be written.

\n\n

The index must not contain any file in conflict.

\n", "group": "index" }, "git_index_entrycount": { "type": "function", "file": "index.h", - "line": 354, - "lineto": 354, + "line": 368, + "lineto": 368, "args": [ { "name": "index", @@ -7480,15 +7622,15 @@ "group": "index", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_index_entrycount-30" + "ex/v0.24.1/general.html#git_index_entrycount-30" ] } }, "git_index_clear": { "type": "function", "file": "index.h", - "line": 365, - "lineto": 365, + "line": 379, + "lineto": 379, "args": [ { "name": "index", @@ -7503,14 +7645,14 @@ "comment": " 0 on success, error code \n<\n 0 on failure" }, "description": "

Clear the contents (all the entries) of an index object.

\n", - "comments": "

This clears the index object in memory; changes must be explicitly\n written to disk for them to take effect persistently.

\n", + "comments": "

This clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently.

\n", "group": "index" }, "git_index_get_byindex": { "type": "function", "file": "index.h", - "line": 378, - "lineto": 379, + "line": 392, + "lineto": 393, "args": [ { "name": "index", @@ -7530,19 +7672,19 @@ "comment": " a pointer to the entry; NULL if out of bounds" }, "description": "

Get a pointer to one of the entries in the index

\n", - "comments": "

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", "group": "index", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_index_get_byindex-31" + "ex/v0.24.1/general.html#git_index_get_byindex-31" ] } }, "git_index_get_bypath": { "type": "function", "file": "index.h", - "line": 393, - "lineto": 394, + "line": 407, + "lineto": 408, "args": [ { "name": "index", @@ -7567,14 +7709,14 @@ "comment": " a pointer to the entry; NULL if it was not found" }, "description": "

Get a pointer to one of the entries in the index

\n", - "comments": "

The entry is not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "comments": "

The entry is not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", "group": "index" }, "git_index_remove": { "type": "function", "file": "index.h", - "line": 404, - "lineto": 404, + "line": 418, + "lineto": 418, "args": [ { "name": "index", @@ -7605,8 +7747,8 @@ "git_index_remove_directory": { "type": "function", "file": "index.h", - "line": 414, - "lineto": 415, + "line": 428, + "lineto": 429, "args": [ { "name": "index", @@ -7637,8 +7779,8 @@ "git_index_add": { "type": "function", "file": "index.h", - "line": 431, - "lineto": 431, + "line": 445, + "lineto": 445, "args": [ { "name": "index", @@ -7658,14 +7800,14 @@ "comment": " 0 or an error code" }, "description": "

Add or update an index entry from an in-memory struct

\n", - "comments": "

If a previous index entry exists that has the same path and stage\n as the given 'source_entry', it will be replaced. Otherwise, the\n 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given\n 'source_entry' will be inserted on the index.

\n", + "comments": "

If a previous index entry exists that has the same path and stage as the given 'source_entry', it will be replaced. Otherwise, the 'source_entry' will be added.

\n\n

A full copy (including the 'path' string) of the given 'source_entry' will be inserted on the index.

\n", "group": "index" }, "git_index_entry_stage": { "type": "function", "file": "index.h", - "line": 443, - "lineto": 443, + "line": 457, + "lineto": 457, "args": [ { "name": "entry", @@ -7680,14 +7822,14 @@ "comment": " the stage number" }, "description": "

Return the stage number from a git index entry

\n", - "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags \n
\n\n

&\n GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT

\n", + "comments": "

This entry is calculated from the entry's flag attribute like this:

\n\n
(entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT\n
\n", "group": "index" }, "git_index_entry_is_conflict": { "type": "function", "file": "index.h", - "line": 452, - "lineto": 452, + "line": 466, + "lineto": 466, "args": [ { "name": "entry", @@ -7708,8 +7850,8 @@ "git_index_add_bypath": { "type": "function", "file": "index.h", - "line": 483, - "lineto": 483, + "line": 497, + "lineto": 497, "args": [ { "name": "index", @@ -7729,14 +7871,14 @@ "comment": " 0 or an error code" }, "description": "

Add or update an index entry from a file on disk

\n", - "comments": "

The file path must be relative to the repository's\n working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "comments": "

The file path must be relative to the repository's working folder and must be readable.

\n\n

This method will fail in bare index instances.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", "group": "index" }, "git_index_add_frombuffer": { "type": "function", "file": "index.h", - "line": 512, - "lineto": 515, + "line": 526, + "lineto": 529, "args": [ { "name": "index", @@ -7766,14 +7908,14 @@ "comment": " 0 or an error code" }, "description": "

Add or update an index entry from a buffer in memory

\n", - "comments": "

This method will create a blob in the repository that owns the\n index and then add the index entry to the index. The path of the\n entry represents the position of the blob relative to the\n repository's root folder.

\n\n

If a previous index entry exists that has the same path as the\n given 'entry', it will be replaced. Otherwise, the 'entry' will be\n added. The id and the file_size of the 'entry' are updated with the\n real value of the blob.

\n\n

This forces the file to be added to the index, not looking\n at gitignore rules. Those rules can be evaluated through\n the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "comments": "

This method will create a blob in the repository that owns the index and then add the index entry to the index. The path of the entry represents the position of the blob relative to the repository's root folder.

\n\n

If a previous index entry exists that has the same path as the given 'entry', it will be replaced. Otherwise, the 'entry' will be added. The id and the file_size of the 'entry' are updated with the real value of the blob.

\n\n

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", "group": "index" }, "git_index_remove_bypath": { "type": "function", "file": "index.h", - "line": 531, - "lineto": 531, + "line": 545, + "lineto": 545, "args": [ { "name": "index", @@ -7793,14 +7935,14 @@ "comment": " 0 or an error code" }, "description": "

Remove an index entry corresponding to a file on disk

\n", - "comments": "

The file path must be relative to the repository's\n working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this\n file will no longer be marked as conflicting. The data about\n the conflict will be moved to the "resolve undo" (REUC) section.

\n", + "comments": "

The file path must be relative to the repository's working folder. It may exist.

\n\n

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

\n", "group": "index" }, "git_index_add_all": { "type": "function", "file": "index.h", - "line": 578, - "lineto": 583, + "line": 592, + "lineto": 597, "args": [ { "name": "index", @@ -7835,14 +7977,14 @@ "comment": " 0 on success, negative callback return value, or error code" }, "description": "

Add or update index entries matching files in the working directory.

\n", - "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will\n matched against files in the repository's working directory. Each file\n that matches will be added to the index (either updating an existing\n entry or adding a new entry). You can disable glob expansion and force\n exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath).\n If a file is already tracked in the index, then it will be updated\n even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to\n skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains\n the exact path of an ignored file (when not using FORCE), add the\n GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry\n in the pathspec that is an exact match to a filename on disk is\n either not ignored or already in the index. If this check fails, the\n function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback\n function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files\n will no longer be marked as conflicting. The data about the conflicts\n will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the working directory immediately before it is added to /\n updated in the index. Returning zero will add the item to the index,\n greater than zero will skip the item, and less than zero will abort the\n scan and return that value to the caller.

\n", + "comments": "

This method will fail in bare index instances.

\n\n

The pathspec is a list of file names or shell glob patterns that will matched against files in the repository's working directory. Each file that matches will be added to the index (either updating an existing entry or adding a new entry). You can disable glob expansion and force exact matching with the GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH flag.

\n\n

Files that are ignored will be skipped (unlike git_index_add_bypath). If a file is already tracked in the index, then it will be updated even if it is ignored. Pass the GIT_INDEX_ADD_FORCE flag to skip the checking of ignore rules.

\n\n

To emulate git add -A and generate an error if the pathspec contains the exact path of an ignored file (when not using FORCE), add the GIT_INDEX_ADD_CHECK_PATHSPEC flag. This checks that each entry in the pathspec that is an exact match to a filename on disk is either not ignored or already in the index. If this check fails, the function will return GIT_EINVALIDSPEC.

\n\n

To emulate git add -A with the "dry-run" option, just use a callback function that always returns a positive value. See below for details.

\n\n

If any files are currently the result of a merge conflict, those files will no longer be marked as conflicting. The data about the conflicts will be moved to the "resolve undo" (REUC) section.

\n\n

If you provide a callback function, it will be invoked on each matching item in the working directory immediately before it is added to / updated in the index. Returning zero will add the item to the index, greater than zero will skip the item, and less than zero will abort the scan and return that value to the caller.

\n", "group": "index" }, "git_index_remove_all": { "type": "function", "file": "index.h", - "line": 600, - "lineto": 604, + "line": 614, + "lineto": 618, "args": [ { "name": "index", @@ -7872,14 +8014,14 @@ "comment": " 0 on success, negative callback return value, or error code" }, "description": "

Remove all matching index entries.

\n", - "comments": "

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is removed. Return 0 to\n remove the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n", + "comments": "

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is removed. Return 0 to remove the item, > 0 to skip the item, and < 0 to abort the scan.

\n", "group": "index" }, "git_index_update_all": { "type": "function", "file": "index.h", - "line": 629, - "lineto": 633, + "line": 643, + "lineto": 647, "args": [ { "name": "index", @@ -7909,14 +8051,14 @@ "comment": " 0 on success, negative callback return value, or error code" }, "description": "

Update all index entries to match the working directory

\n", - "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the\n working directory, deleting them if the corresponding working directory\n file no longer exists otherwise updating the information (including\n adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching\n item in the index immediately before it is updated (either refreshed\n or removed depending on working directory state). Return 0 to proceed\n with updating the item, > 0 to skip the item, and \n<\n 0 to abort the scan.

\n", + "comments": "

This method will fail in bare index instances.

\n\n

This scans the existing index entries and synchronizes them with the working directory, deleting them if the corresponding working directory file no longer exists otherwise updating the information (including adding the latest version of file to the ODB if needed).

\n\n

If you provide a callback function, it will be invoked on each matching item in the index immediately before it is updated (either refreshed or removed depending on working directory state). Return 0 to proceed with updating the item, > 0 to skip the item, and < 0 to abort the scan.

\n", "group": "index" }, "git_index_find": { "type": "function", "file": "index.h", - "line": 644, - "lineto": 644, + "line": 658, + "lineto": 658, "args": [ { "name": "at_pos", @@ -7944,11 +8086,43 @@ "comments": "", "group": "index" }, - "git_index_conflict_add": { + "git_index_find_prefix": { "type": "function", "file": "index.h", "line": 669, - "lineto": 673, + "lineto": 669, + "args": [ + { + "name": "at_pos", + "type": "size_t *", + "comment": "the address to which the position of the index entry is written (optional)" + }, + { + "name": "index", + "type": "git_index *", + "comment": "an existing index object" + }, + { + "name": "prefix", + "type": "const char *", + "comment": "the prefix to search for" + } + ], + "argline": "size_t *at_pos, git_index *index, const char *prefix", + "sig": "size_t *::git_index *::const char *", + "return": { + "type": "int", + "comment": " 0 with valid value in at_pos; an error code otherwise" + }, + "description": "

Find the first position of any entries matching a prefix. To find the first position\n of a path inside a given folder, suffix the prefix with a '/'.

\n", + "comments": "", + "group": "index" + }, + "git_index_conflict_add": { + "type": "function", + "file": "index.h", + "line": 694, + "lineto": 698, "args": [ { "name": "index", @@ -7978,14 +8152,14 @@ "comment": " 0 or an error code" }, "description": "

Add or update index entries to represent a conflict. Any staged\n entries that exist at the given paths will be removed.

\n", - "comments": "

The entries are the entries from the tree included in the merge. Any\n entry may be null to indicate that that file was not present in the\n trees during the merge. For example, ancestor_entry may be NULL to\n indicate that a file was added in both branches and must be resolved.

\n", + "comments": "

The entries are the entries from the tree included in the merge. Any entry may be null to indicate that that file was not present in the trees during the merge. For example, ancestor_entry may be NULL to indicate 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": 689, - "lineto": 694, + "line": 714, + "lineto": 719, "args": [ { "name": "ancestor_out", @@ -8020,14 +8194,14 @@ "comment": " 0 or an error code" }, "description": "

Get the index entries that represent a conflict of a single file.

\n", - "comments": "

The entries are not modifiable and should not be freed. Because the\n git_index_entry struct is a publicly defined struct, you should\n be able to make your own permanent copy of the data if necessary.

\n", + "comments": "

The entries are not modifiable and should not be freed. Because the git_index_entry struct is a publicly defined struct, you should be able to make your own permanent copy of the data if necessary.

\n", "group": "index" }, "git_index_conflict_remove": { "type": "function", "file": "index.h", - "line": 703, - "lineto": 703, + "line": 728, + "lineto": 728, "args": [ { "name": "index", @@ -8053,8 +8227,8 @@ "git_index_conflict_cleanup": { "type": "function", "file": "index.h", - "line": 711, - "lineto": 711, + "line": 736, + "lineto": 736, "args": [ { "name": "index", @@ -8075,8 +8249,8 @@ "git_index_has_conflicts": { "type": "function", "file": "index.h", - "line": 718, - "lineto": 718, + "line": 743, + "lineto": 743, "args": [ { "name": "index", @@ -8097,8 +8271,8 @@ "git_index_conflict_iterator_new": { "type": "function", "file": "index.h", - "line": 729, - "lineto": 731, + "line": 754, + "lineto": 756, "args": [ { "name": "iterator_out", @@ -8124,8 +8298,8 @@ "git_index_conflict_next": { "type": "function", "file": "index.h", - "line": 743, - "lineto": 747, + "line": 768, + "lineto": 772, "args": [ { "name": "ancestor_out", @@ -8161,8 +8335,8 @@ "git_index_conflict_iterator_free": { "type": "function", "file": "index.h", - "line": 754, - "lineto": 755, + "line": 779, + "lineto": 780, "args": [ { "name": "iterator", @@ -8228,7 +8402,7 @@ "group": "indexer", "examples": { "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_indexer_new-1" + "ex/v0.24.1/network/index-pack.html#git_indexer_new-1" ] } }, @@ -8270,7 +8444,7 @@ "group": "indexer", "examples": { "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_indexer_append-2" + "ex/v0.24.1/network/index-pack.html#git_indexer_append-2" ] } }, @@ -8302,7 +8476,7 @@ "group": "indexer", "examples": { "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_indexer_commit-3" + "ex/v0.24.1/network/index-pack.html#git_indexer_commit-3" ] } }, @@ -8325,11 +8499,11 @@ "comment": null }, "description": "

Get the packfile's hash

\n", - "comments": "

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the index has been finalized.

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the index has been finalized.

\n", "group": "indexer", "examples": { "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_indexer_hash-4" + "ex/v0.24.1/network/index-pack.html#git_indexer_hash-4" ] } }, @@ -8356,7 +8530,7 @@ "group": "indexer", "examples": { "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_indexer_free-5" + "ex/v0.24.1/network/index-pack.html#git_indexer_free-5" ] } }, @@ -8390,8 +8564,8 @@ "git_merge_file_init_options": { "type": "function", "file": "merge.h", - "line": 188, - "lineto": 190, + "line": 208, + "lineto": 210, "args": [ { "name": "opts", @@ -8417,8 +8591,8 @@ "git_merge_init_options": { "type": "function", "file": "merge.h", - "line": 265, - "lineto": 267, + "line": 295, + "lineto": 297, "args": [ { "name": "opts", @@ -8444,8 +8618,8 @@ "git_merge_analysis": { "type": "function", "file": "merge.h", - "line": 336, - "lineto": 341, + "line": 366, + "lineto": 371, "args": [ { "name": "analysis_out", @@ -8486,8 +8660,8 @@ "git_merge_base": { "type": "function", "file": "merge.h", - "line": 352, - "lineto": 356, + "line": 382, + "lineto": 386, "args": [ { "name": "out", @@ -8521,18 +8695,18 @@ "group": "merge", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_merge_base-32" + "ex/v0.24.1/log.html#git_merge_base-32" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_merge_base-3" + "ex/v0.24.1/rev-parse.html#git_merge_base-3" ] } }, "git_merge_bases": { "type": "function", "file": "merge.h", - "line": 367, - "lineto": 371, + "line": 397, + "lineto": 401, "args": [ { "name": "out", @@ -8568,8 +8742,8 @@ "git_merge_base_many": { "type": "function", "file": "merge.h", - "line": 382, - "lineto": 386, + "line": 412, + "lineto": 416, "args": [ { "name": "out", @@ -8605,8 +8779,8 @@ "git_merge_bases_many": { "type": "function", "file": "merge.h", - "line": 397, - "lineto": 401, + "line": 427, + "lineto": 431, "args": [ { "name": "out", @@ -8642,8 +8816,8 @@ "git_merge_base_octopus": { "type": "function", "file": "merge.h", - "line": 412, - "lineto": 416, + "line": 442, + "lineto": 446, "args": [ { "name": "out", @@ -8679,8 +8853,8 @@ "git_merge_file": { "type": "function", "file": "merge.h", - "line": 434, - "lineto": 439, + "line": 464, + "lineto": 469, "args": [ { "name": "out", @@ -8715,14 +8889,14 @@ "comment": " 0 on success or error code" }, "description": "

Merge two files as they exist in the in-memory data structures, using\n the given common ancestor as the baseline, producing a\n git_merge_file_result that reflects the merge result. The\n git_merge_file_result must be freed with git_merge_file_result_free.

\n", - "comments": "

Note that this function does not reference a repository and any\n configuration must be passed as git_merge_file_options.

\n", + "comments": "

Note that this function does not reference a repository and any configuration must be passed as git_merge_file_options.

\n", "group": "merge" }, "git_merge_file_from_index": { "type": "function", "file": "merge.h", - "line": 455, - "lineto": 461, + "line": 485, + "lineto": 491, "args": [ { "name": "out", @@ -8768,8 +8942,8 @@ "git_merge_file_result_free": { "type": "function", "file": "merge.h", - "line": 468, - "lineto": 468, + "line": 498, + "lineto": 498, "args": [ { "name": "result", @@ -8790,8 +8964,8 @@ "git_merge_trees": { "type": "function", "file": "merge.h", - "line": 486, - "lineto": 492, + "line": 516, + "lineto": 522, "args": [ { "name": "out", @@ -8837,8 +9011,8 @@ "git_merge_commits": { "type": "function", "file": "merge.h", - "line": 513, - "lineto": 518, + "line": 539, + "lineto": 544, "args": [ { "name": "out", @@ -8873,14 +9047,14 @@ "comment": " 0 on success or error code" }, "description": "

Merge two commits, producing a git_index that reflects the result of\n the merge. The index may be written as-is to the working directory\n or checked out. If the index is to be converted to a tree, the caller\n should resolve any conflicts that arose as part of the merge.

\n", - "comments": "

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

The returned index must be freed explicitly with git_index_free.

\n", + "comments": "

The returned index must be freed explicitly with git_index_free.

\n", "group": "merge" }, "git_merge": { "type": "function", "file": "merge.h", - "line": 542, - "lineto": 547, + "line": 564, + "lineto": 569, "args": [ { "name": "repo", @@ -8915,7 +9089,7 @@ "comment": " 0 on success or error code" }, "description": "

Merges the given commit(s) into HEAD, writing the results into the working\n directory. Any changes are staged for commit and any conflicts are written\n to the index. Callers should inspect the repository's index after this\n completes, resolve any conflicts and prepare a commit.

\n", - "comments": "

The merge performed uses the first common ancestor, unlike the\n git-merge-recursive strategy, which may produce an artificial common\n ancestor tree when there are multiple ancestors.

\n\n

For compatibility with git, the repository is put into a merging\n state. Once the commit is done (or if the uses wishes to abort),\n you should clear this state by calling\n git_repository_state_cleanup().

\n", + "comments": "

For compatibility with git, the repository is put into a merging state. Once the commit is done (or if the uses wishes to abort), you should clear this state by calling git_repository_state_cleanup().

\n", "group": "merge" }, "git_message_prettify": { @@ -9358,11 +9532,11 @@ "comment": " 0 or an error code" }, "description": "

Lookup a reference to one of the objects in a repository.

\n", - "comments": "

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n", + "comments": "

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", "group": "object", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_object_lookup-33" + "ex/v0.24.1/log.html#git_object_lookup-33" ] } }, @@ -9405,7 +9579,7 @@ "comment": " 0 or an error code" }, "description": "

Lookup a reference to one of the objects in a repository,\n given a prefix of its identifier (short id).

\n", - "comments": "

The object obtained will be so that its identifier\n matches the first 'len' hexadecimal characters\n (packets of 4 bits) of the given 'id'.\n 'len' must be at least GIT_OID_MINPREFIXLEN, and\n long enough to identify a unique object matching\n the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and\n should be closed with the git_object_free method\n instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object\n in the odb; the method will fail otherwise.\n The special value 'GIT_OBJ_ANY' may be passed to let\n the method guess the object's type.

\n", + "comments": "

The object obtained will be so that its identifier matches the first 'len' hexadecimal characters (packets of 4 bits) of the given 'id'. 'len' must be at least GIT_OID_MINPREFIXLEN, and long enough to identify a unique object matching the prefix; otherwise the method will fail.

\n\n

The generated reference is owned by the repository and should be closed with the git_object_free method instead of free'd manually.

\n\n

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

\n", "group": "object" }, "git_object_lookup_bypath": { @@ -9468,27 +9642,27 @@ "group": "object", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_object_id-10", - "ex/v0.23.2/blame.html#git_object_id-11", - "ex/v0.23.2/blame.html#git_object_id-12", - "ex/v0.23.2/blame.html#git_object_id-13" + "ex/v0.24.1/blame.html#git_object_id-10", + "ex/v0.24.1/blame.html#git_object_id-11", + "ex/v0.24.1/blame.html#git_object_id-12", + "ex/v0.24.1/blame.html#git_object_id-13" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_object_id-12", - "ex/v0.23.2/cat-file.html#git_object_id-13" + "ex/v0.24.1/cat-file.html#git_object_id-12", + "ex/v0.24.1/cat-file.html#git_object_id-13" ], "log.c": [ - "ex/v0.23.2/log.html#git_object_id-34", - "ex/v0.23.2/log.html#git_object_id-35", - "ex/v0.23.2/log.html#git_object_id-36", - "ex/v0.23.2/log.html#git_object_id-37" + "ex/v0.24.1/log.html#git_object_id-34", + "ex/v0.24.1/log.html#git_object_id-35", + "ex/v0.24.1/log.html#git_object_id-36", + "ex/v0.24.1/log.html#git_object_id-37" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_object_id-4", - "ex/v0.23.2/rev-parse.html#git_object_id-5", - "ex/v0.23.2/rev-parse.html#git_object_id-6", - "ex/v0.23.2/rev-parse.html#git_object_id-7", - "ex/v0.23.2/rev-parse.html#git_object_id-8" + "ex/v0.24.1/rev-parse.html#git_object_id-4", + "ex/v0.24.1/rev-parse.html#git_object_id-5", + "ex/v0.24.1/rev-parse.html#git_object_id-6", + "ex/v0.24.1/rev-parse.html#git_object_id-7", + "ex/v0.24.1/rev-parse.html#git_object_id-8" ] } }, @@ -9516,11 +9690,11 @@ "comment": " 0 on success, \n<\n0 for error" }, "description": "

Get a short abbreviated OID string for the object

\n", - "comments": "

This starts at the "core.abbrev" length (default 7 characters) and\n iteratively extends to a longer string if that length is ambiguous.\n The result will be unambiguous (at least until new objects are added to\n the repository).

\n", + "comments": "

This starts at the "core.abbrev" length (default 7 characters) and iteratively extends to a longer string if that length is ambiguous. The result will be unambiguous (at least until new objects are added to the repository).

\n", "group": "object", "examples": { "tag.c": [ - "ex/v0.23.2/tag.html#git_object_short_id-5" + "ex/v0.24.1/tag.html#git_object_short_id-5" ] } }, @@ -9547,12 +9721,12 @@ "group": "object", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_object_type-14", - "ex/v0.23.2/cat-file.html#git_object_type-15", - "ex/v0.23.2/cat-file.html#git_object_type-16" + "ex/v0.24.1/cat-file.html#git_object_type-14", + "ex/v0.24.1/cat-file.html#git_object_type-15", + "ex/v0.24.1/cat-file.html#git_object_type-16" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_object_type-6" + "ex/v0.24.1/tag.html#git_object_type-6" ] } }, @@ -9575,7 +9749,7 @@ "comment": " the repository who owns this object" }, "description": "

Get the repository that owns this object

\n", - "comments": "

Freeing or calling git_repository_close on the\n returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without\n affecting the object.

\n", + "comments": "

Freeing or calling git_repository_close on the returned pointer will invalidate the actual object.

\n\n

Any other operation may be run on the repository without affecting the object.

\n", "group": "object" }, "git_object_free": { @@ -9597,34 +9771,34 @@ "comment": null }, "description": "

Close an open object

\n", - "comments": "

This method instructs the library to close an existing\n object; note that git_objects are owned and cached by the repository\n so the object may or may not be freed after this library call,\n depending on how aggressive is the caching mechanism used\n by the repository.

\n\n

IMPORTANT:\n It is necessary to call this method when you stop using\n an object. Failure to do so will cause a memory leak.

\n", + "comments": "

This method instructs the library to close an existing object; note that git_objects are owned and cached by the repository so the object may or may not be freed after this library call, depending on how aggressive is the caching mechanism used by the repository.

\n\n

IMPORTANT: It is necessary to call this method when you stop using an object. Failure to do so will cause a memory leak.

\n", "group": "object", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_object_free-14", - "ex/v0.23.2/blame.html#git_object_free-15", - "ex/v0.23.2/blame.html#git_object_free-16", - "ex/v0.23.2/blame.html#git_object_free-17" + "ex/v0.24.1/blame.html#git_object_free-14", + "ex/v0.24.1/blame.html#git_object_free-15", + "ex/v0.24.1/blame.html#git_object_free-16", + "ex/v0.24.1/blame.html#git_object_free-17" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_object_free-17" + "ex/v0.24.1/cat-file.html#git_object_free-17" ], "general.c": [ - "ex/v0.23.2/general.html#git_object_free-32" + "ex/v0.24.1/general.html#git_object_free-32" ], "log.c": [ - "ex/v0.23.2/log.html#git_object_free-38" + "ex/v0.24.1/log.html#git_object_free-38" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_object_free-9", - "ex/v0.23.2/rev-parse.html#git_object_free-10", - "ex/v0.23.2/rev-parse.html#git_object_free-11" + "ex/v0.24.1/rev-parse.html#git_object_free-9", + "ex/v0.24.1/rev-parse.html#git_object_free-10", + "ex/v0.24.1/rev-parse.html#git_object_free-11" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_object_free-7", - "ex/v0.23.2/tag.html#git_object_free-8", - "ex/v0.23.2/tag.html#git_object_free-9", - "ex/v0.23.2/tag.html#git_object_free-10" + "ex/v0.24.1/tag.html#git_object_free-7", + "ex/v0.24.1/tag.html#git_object_free-8", + "ex/v0.24.1/tag.html#git_object_free-9", + "ex/v0.24.1/tag.html#git_object_free-10" ] } }, @@ -9647,17 +9821,17 @@ "comment": " the corresponding string representation." }, "description": "

Convert an object type to its string representation.

\n", - "comments": "

The result is a pointer to a string in static memory and\n should not be free()'ed.

\n", + "comments": "

The result is a pointer to a string in static memory and should not be free()'ed.

\n", "group": "object", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_object_type2string-18", - "ex/v0.23.2/cat-file.html#git_object_type2string-19", - "ex/v0.23.2/cat-file.html#git_object_type2string-20", - "ex/v0.23.2/cat-file.html#git_object_type2string-21" + "ex/v0.24.1/cat-file.html#git_object_type2string-18", + "ex/v0.24.1/cat-file.html#git_object_type2string-19", + "ex/v0.24.1/cat-file.html#git_object_type2string-20", + "ex/v0.24.1/cat-file.html#git_object_type2string-21" ], "general.c": [ - "ex/v0.23.2/general.html#git_object_type2string-33" + "ex/v0.24.1/general.html#git_object_type2string-33" ] } }, @@ -9724,7 +9898,7 @@ "comment": " size in bytes of the object" }, "description": "

Get the size in bytes for the structure which\n acts as an in-memory representation of any given\n object type.

\n", - "comments": "

For all the core types, this would the equivalent\n of calling sizeof(git_commit) if the core types\n were not opaque on the external API.

\n", + "comments": "

For all the core types, this would the equivalent of calling sizeof(git_commit) if the core types were not opaque on the external API.

\n", "group": "object" }, "git_object_peel": { @@ -9756,7 +9930,7 @@ "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code" }, "description": "

Recursively peel an object until an object of the specified type is met.

\n", - "comments": "

If the query cannot be satisfied due to the object model,\n GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a\n tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will\n be peeled until the type changes. A tag will be peeled until the\n referenced object is no longer a tag, and a commit will be peeled\n to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to\n the target type due to the object model, GIT_EPEEL will be\n returned.

\n\n

You must free the returned object.

\n", + "comments": "

If the query cannot be satisfied due to the object model, GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return GIT_EINVALIDSPEC.

\n\n

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, GIT_EPEEL will be returned.

\n\n

You must free the returned object.

\n", "group": "object" }, "git_object_dup": { @@ -9805,7 +9979,7 @@ "comment": " 0 or an error code" }, "description": "

Create a new object database with no backends.

\n", - "comments": "

Before the ODB can be used for read/writing, a custom database\n backend must be manually added using git_odb_add_backend()

\n", + "comments": "

Before the ODB can be used for read/writing, a custom database backend must be manually added using git_odb_add_backend()

\n", "group": "odb" }, "git_odb_open": { @@ -9832,7 +10006,7 @@ "comment": " 0 or an error code" }, "description": "

Create a new object database and automatically add\n the two default backends:

\n", - "comments": "
- git_odb_backend_loose: read and write loose object files\n    from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,\n    assuming `objects_dir` as the Objects folder which\n    contains a 'pack/' folder with the corresponding data\n
\n", + "comments": "
- git_odb_backend_loose: read and write loose object files      from disk, assuming `objects_dir` as the Objects folder\n\n- git_odb_backend_pack: read objects from packfiles,        assuming `objects_dir` as the Objects folder which      contains a 'pack/' folder with the corresponding data\n
\n", "group": "odb" }, "git_odb_add_disk_alternate": { @@ -9859,7 +10033,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "

Add an on-disk alternate to an existing Object DB.

\n", - "comments": "

Note that the added path must point to an objects, not\n to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", + "comments": "

Note that the added path must point to an objects, not to a full repository, to use it as an alternate store.

\n\n

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

Writing is disabled on alternate backends.

\n", "group": "odb" }, "git_odb_free": { @@ -9885,7 +10059,7 @@ "group": "odb", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_odb_free-22" + "ex/v0.24.1/cat-file.html#git_odb_free-22" ] } }, @@ -9918,14 +10092,14 @@ "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database." }, "description": "

Read an object from the database.

\n", - "comments": "

This method queries all available ODB backends\n trying to read the given OID.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n", + "comments": "

This method queries all available ODB backends trying to read the given OID.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", "group": "odb", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_odb_read-23" + "ex/v0.24.1/cat-file.html#git_odb_read-23" ], "general.c": [ - "ex/v0.23.2/general.html#git_odb_read-34" + "ex/v0.24.1/general.html#git_odb_read-34" ] } }, @@ -9963,7 +10137,7 @@ "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database.\n - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)" }, "description": "

Read an object from the database, given a prefix\n of its identifier.

\n", - "comments": "

This method queries all available ODB backends\n trying to match the 'len' first hexadecimal\n characters of the 'short_id'.\n The remaining (GIT_OID_HEXSZ-len)*4 bits of\n 'short_id' must be 0s.\n 'len' must be at least GIT_OID_MINPREFIXLEN,\n and the prefix must be long enough to identify\n a unique object in all the backends; the\n method will fail otherwise.

\n\n

The returned object is reference counted and\n internally cached, so it should be closed\n by the user once it's no longer in use.

\n", + "comments": "

This method queries all available ODB backends trying to match the 'len' first hexadecimal characters of the 'short_id'. The remaining (GIT_OID_HEXSZ-len)*4 bits of 'short_id' must be 0s. 'len' must be at least GIT_OID_MINPREFIXLEN, and the prefix must be long enough to identify a unique object in all the backends; the method will fail otherwise.

\n\n

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

\n", "group": "odb" }, "git_odb_read_header": { @@ -10000,7 +10174,7 @@ "comment": " - 0 if the object was read;\n - GIT_ENOTFOUND if the object is not in the database." }, "description": "

Read the header of an object from the database, without\n reading its full contents.

\n", - "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header\n of an object, so the whole object will be read and then the\n header will be returned.

\n", + "comments": "

The header includes the length and the type of an object.

\n\n

Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.

\n", "group": "odb" }, "git_odb_exists": { @@ -10086,7 +10260,7 @@ "comment": " 0 on success, error code otherwise" }, "description": "

Refresh the object database to load newly added files.

\n", - "comments": "

If the object databases have changed on disk while the library\n is running, this function will force a reload of the underlying\n indexes.

\n\n

Use this function when you're confident that an external\n application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The\n library will automatically attempt to refresh the ODB\n when a lookup fails, to see if the looked up object exists\n on disk but hasn't been loaded yet.

\n", + "comments": "

If the object databases have changed on disk while the library is running, this function will force a reload of the underlying indexes.

\n\n

Use this function when you're confident that an external application has tampered with the ODB.

\n\n

NOTE that it is not necessary to call this function at all. The library will automatically attempt to refresh the ODB when a lookup fails, to see if the looked up object exists on disk but hasn't been loaded yet.

\n", "group": "odb" }, "git_odb_foreach": { @@ -10118,7 +10292,7 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

List all objects available in the database

\n", - "comments": "

The callback will be called for each object available in the\n database. Note that the objects are likely to be returned in the index\n order, which would make accessing the objects in that order inefficient.\n Return a non-zero value from the callback to stop looping.

\n", + "comments": "

The callback will be called for each object available in the database. Note that the objects are likely to be returned in the index order, which would make accessing the objects in that order inefficient. Return a non-zero value from the callback to stop looping.

\n", "group": "odb" }, "git_odb_write": { @@ -10160,11 +10334,11 @@ "comment": " 0 or an error code" }, "description": "

Write an object directly into the ODB

\n", - "comments": "

This method writes a full object straight into the ODB.\n For most cases, it is preferred to write objects through a write\n stream, which is both faster and less memory intensive, specially\n for big objects.

\n\n

This method is provided for compatibility with custom backends\n which are not able to support streaming writes

\n", + "comments": "

This method writes a full object straight into the ODB. For most cases, it is preferred to write objects through a write stream, which is both faster and less memory intensive, specially for big objects.

\n\n

This method is provided for compatibility with custom backends which are not able to support streaming writes

\n", "group": "odb", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_odb_write-35" + "ex/v0.24.1/general.html#git_odb_write-35" ] } }, @@ -10202,7 +10376,7 @@ "comment": " 0 if the stream was created; error code otherwise" }, "description": "

Open a stream to write an object into the ODB

\n", - "comments": "

The type and final length of the object must be specified\n when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it\n won't be effective until git_odb_stream_finalize_write is called\n and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or\n will leak memory.

\n", + "comments": "

The type and final length of the object must be specified when opening the stream.

\n\n

The returned stream will be of type GIT_STREAM_WRONLY, and it won't be effective until git_odb_stream_finalize_write is called and returns without an error

\n\n

The stream must always be freed when done with git_odb_stream_free or will leak memory.

\n", "group": "odb" }, "git_odb_stream_write": { @@ -10234,7 +10408,7 @@ "comment": " 0 if the write succeeded; error code otherwise" }, "description": "

Write to an odb stream

\n", - "comments": "

This method will fail if the total number of received bytes exceeds the\n size declared with git_odb_open_wstream()

\n", + "comments": "

This method will fail if the total number of received bytes exceeds the size declared with git_odb_open_wstream()

\n", "group": "odb" }, "git_odb_stream_finalize_write": { @@ -10261,7 +10435,7 @@ "comment": " 0 on success; an error code otherwise" }, "description": "

Finish writing to an odb stream

\n", - "comments": "

The object will take its final name and will be available to the\n odb.

\n\n

This method will fail if the total number of received bytes\n differs from the size declared with git_odb_open_wstream()

\n", + "comments": "

The object will take its final name and will be available to the odb.

\n\n

This method will fail if the total number of received bytes differs from the size declared with git_odb_open_wstream()

\n", "group": "odb" }, "git_odb_stream_read": { @@ -10347,7 +10521,7 @@ "comment": " 0 if the stream was created; error code otherwise" }, "description": "

Open a stream to read an object from the ODB

\n", - "comments": "

Note that most backends do not support streaming reads\n because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is\n assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and\n will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream\n    - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", + "comments": "

Note that most backends do not support streaming reads because they store their objects as compressed/delta'ed blobs.

\n\n

It's recommended to use git_odb_read instead, which is assured to work on all backends.

\n\n

The returned stream will be of type GIT_STREAM_RDONLY and will have the following methods:

\n\n
    - stream->read: read `n` bytes from the stream      - stream->free: free the stream\n
\n\n

The stream must always be free'd or will leak memory.

\n", "group": "odb" }, "git_odb_write_pack": { @@ -10384,7 +10558,7 @@ "comment": null }, "description": "

Open a stream for writing a pack file to the ODB.

\n", - "comments": "

If the ODB layer understands pack files, then the given\n packfile will likely be streamed directly to disk (and a\n corresponding index created). If the ODB layer does not\n understand pack files, the objects will be stored in whatever\n format the ODB layer uses.

\n", + "comments": "

If the ODB layer understands pack files, then the given packfile will likely be streamed directly to disk (and a corresponding index created). If the ODB layer does not understand pack files, the objects will be stored in whatever format the ODB layer uses.

\n", "group": "odb" }, "git_odb_hash": { @@ -10421,7 +10595,7 @@ "comment": " 0 or an error code" }, "description": "

Determine the object-ID (sha1 hash) of a data buffer

\n", - "comments": "

The resulting SHA-1 OID will be the identifier for the data\n buffer as if the data buffer it were to written to the ODB.

\n", + "comments": "

The resulting SHA-1 OID will be the identifier for the data buffer as if the data buffer it were to written to the ODB.

\n", "group": "odb" }, "git_odb_hashfile": { @@ -10480,7 +10654,7 @@ "comment": " 0 or an error code" }, "description": "

Create a copy of an odb_object

\n", - "comments": "

The returned copy must be manually freed with git_odb_object_free.\n Note that because of an implementation detail, the returned copy will be\n the same pointer as source: the object is internally refcounted, so the\n copy still needs to be freed twice.

\n", + "comments": "

The returned copy must be manually freed with git_odb_object_free. Note that because of an implementation detail, the returned copy will be the same pointer as source: the object is internally refcounted, so the copy still needs to be freed twice.

\n", "group": "odb" }, "git_odb_object_free": { @@ -10502,14 +10676,14 @@ "comment": null }, "description": "

Close an ODB object

\n", - "comments": "

This method must always be called once a git_odb_object is no\n longer needed, otherwise memory will leak.

\n", + "comments": "

This method must always be called once a git_odb_object is no longer needed, otherwise memory will leak.

\n", "group": "odb", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_odb_object_free-24" + "ex/v0.24.1/cat-file.html#git_odb_object_free-24" ], "general.c": [ - "ex/v0.23.2/general.html#git_odb_object_free-36" + "ex/v0.24.1/general.html#git_odb_object_free-36" ] } }, @@ -10554,11 +10728,11 @@ "comment": " a pointer to the data" }, "description": "

Return the data of an ODB object

\n", - "comments": "

This is the uncompressed, raw data as read from the ODB,\n without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", + "comments": "

This is the uncompressed, raw data as read from the ODB, without the leading header.

\n\n

This pointer is owned by the object and shall not be free'd.

\n", "group": "odb", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_odb_object_data-37" + "ex/v0.24.1/general.html#git_odb_object_data-37" ] } }, @@ -10581,14 +10755,14 @@ "comment": " the size" }, "description": "

Return the size of an ODB object

\n", - "comments": "

This is the real size of the data buffer, not the\n actual size of the object.

\n", + "comments": "

This is the real size of the data buffer, not the actual size of the object.

\n", "group": "odb", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_odb_object_size-25" + "ex/v0.24.1/cat-file.html#git_odb_object_size-25" ], "general.c": [ - "ex/v0.23.2/general.html#git_odb_object_size-38" + "ex/v0.24.1/general.html#git_odb_object_size-38" ] } }, @@ -10615,7 +10789,7 @@ "group": "odb", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_odb_object_type-39" + "ex/v0.24.1/general.html#git_odb_object_type-39" ] } }, @@ -10648,7 +10822,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "

Add a custom backend to an existing Object DB

\n", - "comments": "

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Read \n for more information.

\n", + "comments": "

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Read for more information.

\n", "group": "odb" }, "git_odb_add_alternate": { @@ -10680,7 +10854,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "

Add a custom backend to an existing Object DB; this\n backend will work as an alternate.

\n", - "comments": "

Alternate backends are always checked for objects after\n all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the\n value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read \n for more information.

\n", + "comments": "

Alternate backends are always checked for objects after all the main backends have been exhausted.

\n\n

The backends are checked in relative ordering, based on the value of the priority parameter.

\n\n

Writing is disabled on alternate backends.

\n\n

Read for more information.

\n", "group": "odb" }, "git_odb_num_backends": { @@ -10835,7 +11009,7 @@ "comment": " 0 or an error code" }, "description": "

Create a backend out of a single packfile

\n", - "comments": "

This can be useful for inspecting the contents of a single\n packfile.

\n", + "comments": "

This can be useful for inspecting the contents of a single packfile.

\n", "group": "odb" }, "git_oid_fromstr": { @@ -10866,14 +11040,14 @@ "group": "oid", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_oid_fromstr-40", - "ex/v0.23.2/general.html#git_oid_fromstr-41", - "ex/v0.23.2/general.html#git_oid_fromstr-42", - "ex/v0.23.2/general.html#git_oid_fromstr-43", - "ex/v0.23.2/general.html#git_oid_fromstr-44", - "ex/v0.23.2/general.html#git_oid_fromstr-45", - "ex/v0.23.2/general.html#git_oid_fromstr-46", - "ex/v0.23.2/general.html#git_oid_fromstr-47" + "ex/v0.24.1/general.html#git_oid_fromstr-40", + "ex/v0.24.1/general.html#git_oid_fromstr-41", + "ex/v0.24.1/general.html#git_oid_fromstr-42", + "ex/v0.24.1/general.html#git_oid_fromstr-43", + "ex/v0.24.1/general.html#git_oid_fromstr-44", + "ex/v0.24.1/general.html#git_oid_fromstr-45", + "ex/v0.24.1/general.html#git_oid_fromstr-46", + "ex/v0.24.1/general.html#git_oid_fromstr-47" ] } }, @@ -10933,7 +11107,7 @@ "comment": " 0 or an error code" }, "description": "

Parse N characters of a hex formatted object id into a git_oid

\n", - "comments": "

If N is odd, N-1 characters will be parsed instead.\n The remaining space in the git_oid will be set to zero.

\n", + "comments": "

If N is odd, N-1 characters will be parsed instead. The remaining space in the git_oid will be set to zero.

\n", "group": "oid" }, "git_oid_fromraw": { @@ -10991,21 +11165,21 @@ "group": "oid", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_oid_fmt-48", - "ex/v0.23.2/general.html#git_oid_fmt-49", - "ex/v0.23.2/general.html#git_oid_fmt-50", - "ex/v0.23.2/general.html#git_oid_fmt-51", - "ex/v0.23.2/general.html#git_oid_fmt-52" + "ex/v0.24.1/general.html#git_oid_fmt-48", + "ex/v0.24.1/general.html#git_oid_fmt-49", + "ex/v0.24.1/general.html#git_oid_fmt-50", + "ex/v0.24.1/general.html#git_oid_fmt-51", + "ex/v0.24.1/general.html#git_oid_fmt-52" ], "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_oid_fmt-1", - "ex/v0.23.2/network/fetch.html#git_oid_fmt-2" + "ex/v0.24.1/network/fetch.html#git_oid_fmt-1", + "ex/v0.24.1/network/fetch.html#git_oid_fmt-2" ], "network/index-pack.c": [ - "ex/v0.23.2/network/index-pack.html#git_oid_fmt-6" + "ex/v0.24.1/network/index-pack.html#git_oid_fmt-6" ], "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_oid_fmt-1" + "ex/v0.24.1/network/ls-remote.html#git_oid_fmt-1" ] } }, @@ -11065,7 +11239,7 @@ "comment": null }, "description": "

Format a git_oid into a loose-object path string.

\n", - "comments": "

The resulting string is "aa/...", where "aa" is the first two\n hex digits of the oid and "..." is the remaining 38 digits.

\n", + "comments": "

The resulting string is "aa/...", where "aa" is the first two hex digits of the oid and "..." is the remaining 38 digits.

\n", "group": "oid" }, "git_oid_tostr_s": { @@ -11087,7 +11261,7 @@ "comment": " the c-string" }, "description": "

Format a git_oid into a statically allocated c-string.

\n", - "comments": "

The c-string is owned by the library and should not be freed\n by the user. If libgit2 is built with thread support, the string\n will be stored in TLS (i.e. one buffer per thread) to allow for\n concurrent calls of the function.

\n", + "comments": "

The c-string is owned by the library and should not be freed by the user. If libgit2 is built with thread support, the string will be stored in TLS (i.e. one buffer per thread) to allow for concurrent calls of the function.

\n", "group": "oid" }, "git_oid_tostr": { @@ -11119,29 +11293,29 @@ "comment": " the out buffer pointer, assuming no input parameter\n\t\t\terrors, otherwise a pointer to an empty string." }, "description": "

Format a git_oid into a buffer as a hex format c-string.

\n", - "comments": "

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting\n oid c-string will be truncated to n-1 characters (but will still be\n NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid ==\n NULL), then a pointer to an empty string is returned, so that the\n return value can always be printed.

\n", + "comments": "

If the buffer is smaller than GIT_OID_HEXSZ+1, then the resulting oid c-string will be truncated to n-1 characters (but will still be NUL-byte terminated).

\n\n

If there are any input parameter errors (out == NULL, n == 0, oid == NULL), then a pointer to an empty string is returned, so that the return value can always be printed.

\n", "group": "oid", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_oid_tostr-18", - "ex/v0.23.2/blame.html#git_oid_tostr-19" + "ex/v0.24.1/blame.html#git_oid_tostr-18", + "ex/v0.24.1/blame.html#git_oid_tostr-19" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_oid_tostr-26", - "ex/v0.23.2/cat-file.html#git_oid_tostr-27", - "ex/v0.23.2/cat-file.html#git_oid_tostr-28", - "ex/v0.23.2/cat-file.html#git_oid_tostr-29", - "ex/v0.23.2/cat-file.html#git_oid_tostr-30" + "ex/v0.24.1/cat-file.html#git_oid_tostr-26", + "ex/v0.24.1/cat-file.html#git_oid_tostr-27", + "ex/v0.24.1/cat-file.html#git_oid_tostr-28", + "ex/v0.24.1/cat-file.html#git_oid_tostr-29", + "ex/v0.24.1/cat-file.html#git_oid_tostr-30" ], "log.c": [ - "ex/v0.23.2/log.html#git_oid_tostr-39", - "ex/v0.23.2/log.html#git_oid_tostr-40" + "ex/v0.24.1/log.html#git_oid_tostr-39", + "ex/v0.24.1/log.html#git_oid_tostr-40" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_oid_tostr-12", - "ex/v0.23.2/rev-parse.html#git_oid_tostr-13", - "ex/v0.23.2/rev-parse.html#git_oid_tostr-14", - "ex/v0.23.2/rev-parse.html#git_oid_tostr-15" + "ex/v0.24.1/rev-parse.html#git_oid_tostr-12", + "ex/v0.24.1/rev-parse.html#git_oid_tostr-13", + "ex/v0.24.1/rev-parse.html#git_oid_tostr-14", + "ex/v0.24.1/rev-parse.html#git_oid_tostr-15" ] } }, @@ -11173,9 +11347,9 @@ "group": "oid", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_oid_cpy-20", - "ex/v0.23.2/blame.html#git_oid_cpy-21", - "ex/v0.23.2/blame.html#git_oid_cpy-22" + "ex/v0.24.1/blame.html#git_oid_cpy-20", + "ex/v0.24.1/blame.html#git_oid_cpy-21", + "ex/v0.24.1/blame.html#git_oid_cpy-22" ] } }, @@ -11342,10 +11516,10 @@ "group": "oid", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_oid_iszero-23" + "ex/v0.24.1/blame.html#git_oid_iszero-23" ], "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_oid_iszero-3" + "ex/v0.24.1/network/fetch.html#git_oid_iszero-3" ] } }, @@ -11368,7 +11542,7 @@ "comment": " a `git_oid_shorten` instance, NULL if OOM" }, "description": "

Create a new OID shortener.

\n", - "comments": "

The OID shortener is used to process a list of OIDs\n in text form and return the shortest length that would\n uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", + "comments": "

The OID shortener is used to process a list of OIDs in text form and return the shortest length that would uniquely identify all of them.

\n\n

E.g. look at the result of git log --abbrev.

\n", "group": "oid" }, "git_oid_shorten_add": { @@ -11395,7 +11569,7 @@ "comment": " the minimal length to uniquely identify all OIDs\n\t\tadded so far to the set; or an error code (\n<\n0) if an\n\t\terror occurs." }, "description": "

Add a new OID to set of shortened OIDs and calculate\n the minimal length to uniquely identify all the OIDs in\n the set.

\n", - "comments": "

The OID is expected to be a 40-char hexadecimal string.\n The OID is owned by the user and will not be modified\n or freed.

\n\n

For performance reasons, there is a hard-limit of how many\n OIDs can be added to a single set (around ~32000, assuming\n a mostly randomized distribution), which should be enough\n for any kind of program, and keeps the algorithm fast and\n memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a\n GITERR_INVALID error

\n", + "comments": "

The OID is expected to be a 40-char hexadecimal string. The OID is owned by the user and will not be modified or freed.

\n\n

For performance reasons, there is a hard-limit of how many OIDs can be added to a single set (around ~32000, assuming a mostly randomized distribution), which should be enough for any kind of program, and keeps the algorithm fast and memory-efficient.

\n\n

Attempting to add more than those OIDs will result in a GITERR_INVALID error

\n", "group": "oid" }, "git_oid_shorten_free": { @@ -11439,7 +11613,7 @@ "comment": null }, "description": "

Free the OID array

\n", - "comments": "

This method must (and must only) be called on git_oidarray\n objects where the array is allocated by the library. Not doing so,\n will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n", + "comments": "

This method must (and must only) be called on git_oidarray objects where the array is allocated by the library. Not doing so, will result in a memory leak.

\n\n

This does not free the git_oidarray itself, since the library will never allocate that object directly itself (it is more commonly embedded inside another struct or created on the stack).

\n", "group": "oidarray" }, "git_packbuilder_new": { @@ -11493,7 +11667,7 @@ "comment": " number of actual threads to be used" }, "description": "

Set number of threads to spawn

\n", - "comments": "

By default, libgit2 won't spawn any threads at all;\n when set to 0, libgit2 will autodetect the number of\n CPUs.

\n", + "comments": "

By default, libgit2 won't spawn any threads at all; when set to 0, libgit2 will autodetect the number of CPUs.

\n", "group": "packbuilder" }, "git_packbuilder_insert": { @@ -11525,7 +11699,7 @@ "comment": " 0 or an error code" }, "description": "

Insert a single object

\n", - "comments": "

For an optimal pack it's mandatory to insert objects in recency order,\n commits followed by trees and blobs.

\n", + "comments": "

For an optimal pack it's mandatory to insert objects in recency order, commits followed by trees and blobs.

\n", "group": "packbuilder" }, "git_packbuilder_insert_tree": { @@ -11606,7 +11780,7 @@ "comment": " 0 or an error code" }, "description": "

Insert objects as given by the walk

\n", - "comments": "

Those commits and all objects they reference will be inserted into\n the packbuilder.

\n", + "comments": "

Those commits and all objects they reference will be inserted into the packbuilder.

\n", "group": "packbuilder" }, "git_packbuilder_insert_recur": { @@ -11702,7 +11876,7 @@ "comment": null }, "description": "

Get the packfile's hash

\n", - "comments": "

A packfile's name is derived from the sorted hashing of all object\n names. This is only correct after the packfile has been written.

\n", + "comments": "

A packfile's name is derived from the sorted hashing of all object names. This is only correct after the packfile has been written.

\n", "group": "packbuilder" }, "git_packbuilder_foreach": { @@ -11864,7 +12038,7 @@ "comment": " 0 on success, other value \n<\n 0 on error" }, "description": "

Return a patch for an entry in the diff list.

\n", - "comments": "

The git_patch is a newly created object contains the text diffs\n for the delta. You have to call git_patch_free() when you are\n done with it. You can use the patch object to loop over all the hunks\n and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be\n created, the output will be set to NULL, and the binary flag will be\n set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass\n NULL for the git_patch, then the text diff will not be calculated.

\n", + "comments": "

The git_patch is a newly created object contains the text diffs for the delta. You have to call git_patch_free() when you are done with it. You can use the patch object to loop over all the hunks and lines in the diff of the one delta.

\n\n

For an unchanged file or a binary file, no git_patch will be created, the output will be set to NULL, and the binary flag will be set true in the git_diff_delta structure.

\n\n

It is okay to pass NULL for either of the output parameters; if you pass NULL for the git_patch, then the text diff will not be calculated.

\n", "group": "patch" }, "git_patch_from_blobs": { @@ -11911,7 +12085,7 @@ "comment": " 0 on success or error code \n<\n 0" }, "description": "

Directly generate a patch from the difference between two blobs.

\n", - "comments": "

This is just like git_diff_blobs() except it generates a patch object\n for the difference instead of directly making callbacks. You can use the\n standard git_patch accessor functions to read the patch data, and\n you must call git_patch_free() on the patch when done.

\n", + "comments": "

This is just like git_diff_blobs() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", "group": "patch" }, "git_patch_from_blob_and_buffer": { @@ -11963,7 +12137,7 @@ "comment": " 0 on success or error code \n<\n 0" }, "description": "

Directly generate a patch from the difference between a blob and a buffer.

\n", - "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n", + "comments": "

This is just like git_diff_blob_to_buffer() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", "group": "patch" }, "git_patch_from_buffers": { @@ -12020,7 +12194,7 @@ "comment": " 0 on success or error code \n<\n 0" }, "description": "

Directly generate a patch from the difference between two buffers.

\n", - "comments": "

This is just like git_diff_buffers() except it generates a patch\n object for the difference instead of directly making callbacks. You can\n use the standard git_patch accessor functions to read the patch\n data, and you must call git_patch_free() on the patch when done.

\n", + "comments": "

This is just like git_diff_buffers() except it generates a patch object for the difference instead of directly making callbacks. You can use the standard git_patch accessor functions to read the patch data, and you must call git_patch_free() on the patch when done.

\n", "group": "patch" }, "git_patch_free": { @@ -12123,7 +12297,7 @@ "comment": " 0 on success, \n<\n0 on error" }, "description": "

Get line counts of each type in a patch.

\n", - "comments": "

This helps imitate a diff --numstat type of output. For that purpose,\n you only need the total_additions and total_deletions values, but we\n include the total_context line count in case you want the total number\n of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", + "comments": "

This helps imitate a diff --numstat type of output. For that purpose, you only need the total_additions and total_deletions values, but we include the total_context line count in case you want the total number of lines of diff output that will be generated.

\n\n

All outputs are optional. Pass NULL if you don't need a particular count.

\n", "group": "patch" }, "git_patch_get_hunk": { @@ -12160,7 +12334,7 @@ "comment": " 0 on success, GIT_ENOTFOUND if hunk_idx out of range, \n<\n0 on error" }, "description": "

Get the information about a hunk in a patch

\n", - "comments": "

Given a patch and a hunk index into the patch, this returns detailed\n information about that hunk. Any of the output pointers can be passed\n as NULL if you don't care about that particular piece of information.

\n", + "comments": "

Given a patch and a hunk index into the patch, this returns detailed information about that hunk. Any of the output pointers can be passed as NULL if you don't care about that particular piece of information.

\n", "group": "patch" }, "git_patch_num_lines_in_hunk": { @@ -12224,7 +12398,7 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Get data about a line in a hunk of a patch.

\n", - "comments": "

Given a patch, a hunk index, and a line index in the hunk, this\n will return a lot of details about that line. If you pass a hunk\n index larger than the number of hunks or a line index larger than\n the number of lines in the hunk, this will return -1.

\n", + "comments": "

Given a patch, a hunk index, and a line index in the hunk, this will return a lot of details about that line. If you pass a hunk index larger than the number of hunks or a line index larger than the number of lines in the hunk, this will return -1.

\n", "group": "patch" }, "git_patch_size": { @@ -12261,7 +12435,7 @@ "comment": " The number of bytes of data" }, "description": "

Look up size of patch diff data in bytes

\n", - "comments": "

This returns the raw size of the patch data. This only includes the\n actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size\n of all of the diff output; if you pass it as false (zero), this will\n only include the actual changed lines (as if context_lines was 0).

\n", + "comments": "

This returns the raw size of the patch data. This only includes the actual data from the lines of the diff, not the file or hunk headers.

\n\n

If you pass include_context as true (non-zero), this will be the size of all of the diff output; if you pass it as false (zero), this will only include the actual changed lines (as if context_lines was 0).

\n", "group": "patch" }, "git_patch_print": { @@ -12293,7 +12467,7 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Serialize the patch to text via callback.

\n", - "comments": "

Returning a non-zero value from the callback will terminate the iteration\n and return that value to the caller.

\n", + "comments": "

Returning a non-zero value from the callback will terminate the iteration and return that value to the caller.

\n", "group": "patch" }, "git_patch_to_buf": { @@ -12351,7 +12525,7 @@ "group": "pathspec", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_pathspec_new-41" + "ex/v0.24.1/log.html#git_pathspec_new-41" ] } }, @@ -12378,7 +12552,7 @@ "group": "pathspec", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_pathspec_free-42" + "ex/v0.24.1/log.html#git_pathspec_free-42" ] } }, @@ -12411,7 +12585,7 @@ "comment": " 1 is path matches spec, 0 if it does not" }, "description": "

Try to match a path against a pathspec

\n", - "comments": "

Unlike most of the other pathspec matching functions, this will not\n fall back on the native case-sensitivity for your platform. You must\n explicitly pass flags to control case sensitivity or else this will\n fall back on being case sensitive.

\n", + "comments": "

Unlike most of the other pathspec matching functions, this will not fall back on the native case-sensitivity for your platform. You must explicitly pass flags to control case sensitivity or else this will fall back on being case sensitive.

\n", "group": "pathspec" }, "git_pathspec_match_workdir": { @@ -12448,7 +12622,7 @@ "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag was given" }, "description": "

Match a pathspec against the working directory of a repository.

\n", - "comments": "

This matches the pathspec against the current files in the working\n directory of the repository. It is an error to invoke this on a bare\n repo. This handles git ignores (i.e. ignored files will not be\n considered to match the pathspec unless the file is tracked in the\n index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "comments": "

This matches the pathspec against the current files in the working directory of the repository. It is an error to invoke this on a bare repo. This handles git ignores (i.e. ignored files will not be considered to match the pathspec unless the file is tracked in the index).

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", "group": "pathspec" }, "git_pathspec_match_index": { @@ -12485,7 +12659,7 @@ "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, "description": "

Match a pathspec against entries in an index.

\n", - "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled\n by the current case-sensitivity of the index object itself and the\n USE_CASE and IGNORE_CASE flags will have no effect. This behavior will\n be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "comments": "

This matches the pathspec against the files in the repository index.

\n\n

NOTE: At the moment, the case sensitivity of this match is controlled by the current case-sensitivity of the index object itself and the USE_CASE and IGNORE_CASE flags will have no effect. This behavior will be corrected in a future release.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", "group": "pathspec" }, "git_pathspec_match_tree": { @@ -12522,11 +12696,11 @@ "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, "description": "

Match a pathspec against files in a tree.

\n", - "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "comments": "

This matches the pathspec against the files in the given tree.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", "group": "pathspec", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_pathspec_match_tree-43" + "ex/v0.24.1/log.html#git_pathspec_match_tree-43" ] } }, @@ -12564,7 +12738,7 @@ "comment": " 0 on success, -1 on error, GIT_ENOTFOUND if no matches and\n the GIT_PATHSPEC_NO_MATCH_ERROR flag is used" }, "description": "

Match a pathspec against files in a diff list.

\n", - "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That\n contains the list of all matched filenames (unless you pass the\n GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of\n pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES\n flag). You must call git_pathspec_match_list_free() on this object.

\n", + "comments": "

This matches the pathspec against the files in the given diff list.

\n\n

If out is not NULL, this returns a git_patchspec_match_list. That contains the list of all matched filenames (unless you pass the GIT_PATHSPEC_FAILURES_ONLY flag) and may also contain the list of pathspecs with no match (if you used the GIT_PATHSPEC_FIND_FAILURES flag). You must call git_pathspec_match_list_free() on this object.

\n", "group": "pathspec" }, "git_pathspec_match_list_free": { @@ -12635,7 +12809,7 @@ "comment": " The filename of the match" }, "description": "

Get a matching filename by position.

\n", - "comments": "

This routine cannot be used if the match list was generated by\n git_pathspec_match_diff. If so, it will always return NULL.

\n", + "comments": "

This routine cannot be used if the match list was generated by git_pathspec_match_diff. If so, it will always return NULL.

\n", "group": "pathspec" }, "git_pathspec_match_list_diff_entry": { @@ -12662,7 +12836,7 @@ "comment": " The filename of the match" }, "description": "

Get a matching diff delta by position.

\n", - "comments": "

This routine can only be used if the match list was generated by\n git_pathspec_match_diff. Otherwise it will always return NULL.

\n", + "comments": "

This routine can only be used if the match list was generated by git_pathspec_match_diff. Otherwise it will always return NULL.

\n", "group": "pathspec" }, "git_pathspec_match_list_failed_entrycount": { @@ -12684,7 +12858,7 @@ "comment": " Number of items in original pathspec that had no matches" }, "description": "

Get the number of pathspec items that did not match.

\n", - "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when\n generating the git_pathspec_match_list.

\n", + "comments": "

This will be zero unless you passed GIT_PATHSPEC_FIND_FAILURES when generating the git_pathspec_match_list.

\n", "group": "pathspec" }, "git_pathspec_match_list_failed_entry": { @@ -12717,8 +12891,8 @@ "git_rebase_init_options": { "type": "function", "file": "rebase.h", - "line": 141, - "lineto": 143, + "line": 156, + "lineto": 158, "args": [ { "name": "opts", @@ -12744,8 +12918,8 @@ "git_rebase_init": { "type": "function", "file": "rebase.h", - "line": 162, - "lineto": 168, + "line": 177, + "lineto": 183, "args": [ { "name": "out", @@ -12791,8 +12965,8 @@ "git_rebase_open": { "type": "function", "file": "rebase.h", - "line": 179, - "lineto": 182, + "line": 194, + "lineto": 197, "args": [ { "name": "out", @@ -12823,8 +12997,8 @@ "git_rebase_operation_entrycount": { "type": "function", "file": "rebase.h", - "line": 190, - "lineto": 190, + "line": 205, + "lineto": 205, "args": [ { "name": "rebase", @@ -12845,8 +13019,8 @@ "git_rebase_operation_current": { "type": "function", "file": "rebase.h", - "line": 201, - "lineto": 201, + "line": 216, + "lineto": 216, "args": [ { "name": "rebase", @@ -12867,8 +13041,8 @@ "git_rebase_operation_byindex": { "type": "function", "file": "rebase.h", - "line": 210, - "lineto": 212, + "line": 225, + "lineto": 227, "args": [ { "name": "rebase", @@ -12894,8 +13068,8 @@ "git_rebase_next": { "type": "function", "file": "rebase.h", - "line": 225, - "lineto": 227, + "line": 240, + "lineto": 242, "args": [ { "name": "operation", @@ -12918,11 +13092,38 @@ "comments": "", "group": "rebase" }, - "git_rebase_commit": { + "git_rebase_inmemory_index": { "type": "function", "file": "rebase.h", - "line": 251, + "line": 255, "lineto": 257, + "args": [ + { + "name": "index", + "type": "git_index **", + "comment": null + }, + { + "name": "rebase", + "type": "git_rebase *", + "comment": null + } + ], + "argline": "git_index **index, git_rebase *rebase", + "sig": "git_index **::git_rebase *", + "return": { + "type": "int", + "comment": null + }, + "description": "

Gets the index produced by the last operation, which is the result\n of git_rebase_next and which will be committed by the next\n invocation of git_rebase_commit. This is useful for resolving\n conflicts in an in-memory rebase before committing them. You must\n call git_index_free when you are finished with this.

\n", + "comments": "

This is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.

\n", + "group": "rebase" + }, + "git_rebase_commit": { + "type": "function", + "file": "rebase.h", + "line": 281, + "lineto": 287, "args": [ { "name": "id", @@ -12968,8 +13169,8 @@ "git_rebase_abort": { "type": "function", "file": "rebase.h", - "line": 267, - "lineto": 267, + "line": 297, + "lineto": 297, "args": [ { "name": "rebase", @@ -12990,8 +13191,8 @@ "git_rebase_finish": { "type": "function", "file": "rebase.h", - "line": 277, - "lineto": 279, + "line": 307, + "lineto": 309, "args": [ { "name": "rebase", @@ -13017,8 +13218,8 @@ "git_rebase_free": { "type": "function", "file": "rebase.h", - "line": 286, - "lineto": 286, + "line": 316, + "lineto": 316, "args": [ { "name": "rebase", @@ -13060,7 +13261,7 @@ "comment": " 0 or an error code" }, "description": "

Create a new reference database with no backends.

\n", - "comments": "

Before the Ref DB can be used for read/writing, a custom database\n backend must be manually set using git_refdb_set_backend()

\n", + "comments": "

Before the Ref DB can be used for read/writing, a custom database backend must be manually set using git_refdb_set_backend()

\n", "group": "refdb" }, "git_refdb_open": { @@ -13087,7 +13288,7 @@ "comment": " 0 or an error code" }, "description": "

Create a new reference database and automatically add\n the default backends:

\n", - "comments": "
    \n
  • git_refdb_dir: read and write loose and packed refs\n from disk, assuming the repository dir as the folder
  • \n
\n", + "comments": "
    \n
  • git_refdb_dir: read and write loose and packed refs from disk, assuming the repository dir as the folder
  • \n
\n", "group": "refdb" }, "git_refdb_compress": { @@ -13163,7 +13364,7 @@ "comment": " 0 or an error code" }, "description": "

Read the reflog for the given reference

\n", - "comments": "

If there is no reflog file for the given\n reference yet, an empty reflog object will\n be returned.

\n\n

The reflog must be freed manually by using\n git_reflog_free().

\n", + "comments": "

If there is no reflog file for the given reference yet, an empty reflog object will be returned.

\n\n

The reflog must be freed manually by using git_reflog_free().

\n", "group": "reflog" }, "git_reflog_write": { @@ -13254,7 +13455,7 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, "description": "

Rename a reflog

\n", - "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity.\n See git_reference_create_symbolic() for rules about valid names.

\n", + "comments": "

The reflog to be renamed is expected to already exist

\n\n

The new name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

\n", "group": "reflog" }, "git_reflog_delete": { @@ -13330,7 +13531,7 @@ "comment": " the entry; NULL if not found" }, "description": "

Lookup an entry by its index

\n", - "comments": "

Requesting the reflog entry with an index of 0 (zero) will\n return the most recently created entry.

\n", + "comments": "

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

\n", "group": "reflog" }, "git_reflog_drop": { @@ -13362,7 +13563,7 @@ "comment": " 0 on success, GIT_ENOTFOUND if the entry doesn't exist\n or an error code." }, "description": "

Remove an entry from the reflog by its index

\n", - "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry\n param 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", + "comments": "

To ensure there's no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

\n", "group": "reflog" }, "git_reflog_entry_id_old": { @@ -13504,11 +13705,11 @@ "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." }, "description": "

Lookup a reference by name in a repository.

\n", - "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n", + "comments": "

The returned reference must be freed by the user.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", "group": "reference", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_reference_lookup-53" + "ex/v0.24.1/general.html#git_reference_lookup-53" ] } }, @@ -13541,7 +13742,7 @@ "comment": " 0 on success, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code." }, "description": "

Lookup a reference by name and resolve immediately to OID.

\n", - "comments": "

This function provides a quick way to resolve a reference name straight\n through to the object id that it refers to. This avoids having to\n allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n", + "comments": "

This function provides a quick way to resolve a reference name straight through to the object id that it refers to. This avoids having to allocate or free any git_reference objects for simple situations.

\n\n

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n", "group": "reference" }, "git_reference_dwim": { @@ -13573,7 +13774,7 @@ "comment": " 0 or an error code" }, "description": "

Lookup a reference by DWIMing its short name

\n", - "comments": "

Apply the git precendence rules to the given shorthand to determine\n which reference the user is referring to.

\n", + "comments": "

Apply the git precendence rules to the given shorthand to determine which reference the user is referring to.

\n", "group": "reference" }, "git_reference_symbolic_create_matching": { @@ -13625,7 +13826,7 @@ "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code" }, "description": "

Conditionally create a new symbolic reference.

\n", - "comments": "

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_value\n (i.e. if the ref has changed since the user read it).

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_value (i.e. if the ref has changed since the user read it).

\n", "group": "reference" }, "git_reference_symbolic_create": { @@ -13672,7 +13873,7 @@ "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, "description": "

Create a new symbolic reference.

\n", - "comments": "

A symbolic reference is a reference name that refers to another\n reference name. If the other name moves, the symbolic name will move,\n too. As a simple example, the "HEAD" reference might refer to\n "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and it does not have a reflog.

\n", + "comments": "

A symbolic reference is a reference name that refers to another reference name. If the other name moves, the symbolic name will move, too. As a simple example, the "HEAD" reference might refer to "refs/heads/master" while on the "master" branch of a repository.

\n\n

The symbolic reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and it does not have a reflog.

\n", "group": "reference" }, "git_reference_create": { @@ -13719,7 +13920,7 @@ "comment": " 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, "description": "

Create a new direct reference.

\n", - "comments": "

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n", "group": "reference" }, "git_reference_create_matching": { @@ -13771,7 +13972,7 @@ "comment": " 0 on success, GIT_EMODIFIED if the value of the reference\n has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code" }, "description": "

Conditionally create new direct reference

\n", - "comments": "

A direct reference (also called an object id reference) refers directly\n to a specific object id (a.k.a. OID or SHA) in the repository. The id\n permanently refers to the object (although the reference itself can be\n moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0"\n refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to\n the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n\n

This function will return an error if a reference already exists with the\n given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time\n of updating does not match the one passed through current_id\n (i.e. if the ref has changed since the user read it).

\n", + "comments": "

A direct reference (also called an object id reference) refers directly to a specific object id (a.k.a. OID or SHA) in the repository. The id permanently refers to the object (although the reference itself can be moved). For example, in libgit2 the direct ref "refs/tags/v0.17.0" refers to OID 5b9fac39d8a76b9139667c26a63e6b3f204b3977.

\n\n

The direct reference will be created in the repository and written to the disk. The generated reference object must be freed by the user.

\n\n

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n\n

This function will return an error if a reference already exists with the given name unless force is true, in which case it will be overwritten.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n\n

It will return GIT_EMODIFIED if the reference's value at the time of updating does not match the one passed through current_id (i.e. if the ref has changed since the user read it).

\n", "group": "reference" }, "git_reference_target": { @@ -13793,11 +13994,11 @@ "comment": " a pointer to the oid if available, NULL otherwise" }, "description": "

Get the OID pointed to by a direct reference.

\n", - "comments": "

Only available if the reference is direct (i.e. an object id reference,\n not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and\n then this function (or maybe use git_reference_name_to_id() to\n directly resolve a reference name all the way through to an OID).

\n", + "comments": "

Only available if the reference is direct (i.e. an object id reference, not a symbolic one).

\n\n

To find the OID of a symbolic ref, call git_reference_resolve() and then this function (or maybe use git_reference_name_to_id() to directly resolve a reference name all the way through to an OID).

\n", "group": "reference", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_reference_target-54" + "ex/v0.24.1/general.html#git_reference_target-54" ] } }, @@ -13820,7 +14021,7 @@ "comment": " a pointer to the oid if available, NULL otherwise" }, "description": "

Return the peeled OID target of this reference.

\n", - "comments": "

This peeled OID only applies to direct references that point to\n a hard Tag object: it is the result of peeling such Tag.

\n", + "comments": "

This peeled OID only applies to direct references that point to a hard Tag object: it is the result of peeling such Tag.

\n", "group": "reference" }, "git_reference_symbolic_target": { @@ -13846,7 +14047,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_reference_symbolic_target-55" + "ex/v0.24.1/general.html#git_reference_symbolic_target-55" ] } }, @@ -13873,7 +14074,7 @@ "group": "reference", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_reference_type-56" + "ex/v0.24.1/general.html#git_reference_type-56" ] } }, @@ -13923,7 +14124,7 @@ "comment": " 0 or an error code" }, "description": "

Resolve a symbolic reference to a direct reference.

\n", - "comments": "

This method iteratively peels a symbolic reference until it resolves to\n a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and\n must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that\n reference is returned. This copy must be manually freed too.

\n", + "comments": "

This method iteratively peels a symbolic reference until it resolves to a direct reference to an OID.

\n\n

The peeled reference is returned in the resolved_ref argument, and must be freed manually once it's no longer needed.

\n\n

If a direct reference is passed as an argument, a copy of that reference is returned. This copy must be manually freed too.

\n", "group": "reference" }, "git_reference_owner": { @@ -13982,7 +14183,7 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, "description": "

Create a new reference with the same name as the given reference but a\n different symbolic target. The reference must be a symbolic reference,\n otherwise this will fail.

\n", - "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does\n not belong in the standard set (HEAD, branches and remote-tracking\n branches) and and it does not have a reflog.

\n", + "comments": "

The new reference will be written to disk, overwriting the given reference.

\n\n

The target name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

The message for the reflog will be ignored if the reference does not belong in the standard set (HEAD, branches and remote-tracking branches) and and it does not have a reflog.

\n", "group": "reference" }, "git_reference_set_target": { @@ -14061,7 +14262,7 @@ "comment": " 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" }, "description": "

Rename an existing reference.

\n", - "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity.\n See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already\n a reference with the given name, the renaming will fail.

\n\n

IMPORTANT:\n The user needs to write a proper reflog entry if the\n reflog is enabled for the repository. We only rename\n the reflog if it exists.

\n", + "comments": "

This method works for both direct and symbolic references.

\n\n

The new name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

\n\n

If the force flag is not enabled, and there's already a reference with the given name, the renaming will fail.

\n\n

IMPORTANT: The user needs to write a proper reflog entry if the reflog is enabled for the repository. We only rename the reflog if it exists.

\n", "group": "reference" }, "git_reference_delete": { @@ -14083,7 +14284,7 @@ "comment": " 0, GIT_EMODIFIED or an error code" }, "description": "

Delete an existing reference.

\n", - "comments": "

This method works for both direct and symbolic references. The reference\n will be immediately removed on disk but the memory will not be freed.\n Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed\n from the time it was looked up.

\n", + "comments": "

This method works for both direct and symbolic references. The reference will be immediately removed on disk but the memory will not be freed. Callers must call git_reference_free.

\n\n

This function will return an error if the reference has changed from the time it was looked up.

\n", "group": "reference" }, "git_reference_remove": { @@ -14110,7 +14311,7 @@ "comment": " 0 or an error code" }, "description": "

Delete an existing reference by name

\n", - "comments": "

This method removes the named reference from the repository without\n looking at its old value.

\n", + "comments": "

This method removes the named reference from the repository without looking at its old value.

\n", "group": "reference" }, "git_reference_list": { @@ -14137,11 +14338,11 @@ "comment": " 0 or an error code" }, "description": "

Fill a list with all the references that can be found in a repository.

\n", - "comments": "

The string array will be filled with the names of all references; these\n values are owned by the user and should be free'd manually when no\n longer needed, using git_strarray_free().

\n", + "comments": "

The string array will be filled with the names of all references; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free().

\n", "group": "reference", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_reference_list-57" + "ex/v0.24.1/general.html#git_reference_list-57" ] } }, @@ -14174,7 +14375,7 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Perform a callback on each reference in the repository.

\n", - "comments": "

The callback function will be called for each reference in the\n repository, receiving the reference object and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the reference object and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", "group": "reference" }, "git_reference_foreach_name": { @@ -14206,7 +14407,7 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Perform a callback on the fully-qualified name of each reference.

\n", - "comments": "

The callback function will be called for each reference in the\n repository, receiving the name of the reference and the payload value\n passed to this method. Returning a non-zero value from the callback\n will terminate the iteration.

\n", + "comments": "

The callback function will be called for each reference in the repository, receiving the name of the reference and the payload value passed to this method. Returning a non-zero value from the callback will terminate the iteration.

\n", "group": "reference" }, "git_reference_free": { @@ -14232,7 +14433,7 @@ "group": "reference", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_reference_free-3" + "ex/v0.24.1/status.html#git_reference_free-3" ] } }, @@ -14373,7 +14574,7 @@ "comment": " 0, GIT_ITEROVER if there are no more; or an error code" }, "description": "

Get the next reference's name

\n", - "comments": "

This function is provided for convenience in case only the names\n are interesting as it avoids the allocation of the git_reference\n object which git_reference_next() needs.

\n", + "comments": "

This function is provided for convenience in case only the names are interesting as it avoids the allocation of the git_reference object which git_reference_next() needs.

\n", "group": "reference" }, "git_reference_iterator_free": { @@ -14432,7 +14633,7 @@ "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\n matches the given pattern.

\n", - "comments": "

This function acts like git_reference_foreach() with an additional\n pattern match being applied to the reference name before issuing the\n callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches\n any sequence of letters, a '?' matches any letter, and square brackets\n can be used to define character ranges (such as "[0-9]" for digits).

\n", + "comments": "

This function acts like git_reference_foreach() with an additional pattern match being applied to the reference name before issuing the callback function. See that function for more information.

\n\n

The pattern is matched using fnmatch or "glob" style where a '*' matches any sequence of letters, a '?' matches any letter, and square brackets can be used to define character ranges (such as "[0-9]" for digits).

\n", "group": "reference" }, "git_reference_has_log": { @@ -14486,7 +14687,7 @@ "comment": " 0 or an error code." }, "description": "

Ensure there is a reflog for a particular reference.

\n", - "comments": "

Make sure that successive updates to the reference will append to\n its log.

\n", + "comments": "

Make sure that successive updates to the reference will append to its log.

\n", "group": "reference" }, "git_reference_is_branch": { @@ -14611,7 +14812,7 @@ "comment": " 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC\n or an error code." }, "description": "

Normalize reference name and check validity.

\n", - "comments": "

This will normalize the reference name by removing any leading slash\n '/' characters and collapsing runs of adjacent slashes between name\n components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in\n the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n", + "comments": "

This will normalize the reference name by removing any leading slash '/' characters and collapsing runs of adjacent slashes between name components into a single slash.

\n\n

Once normalized, if the reference name is valid, it will be returned in the user allocated buffer.

\n\n

See git_reference_symbolic_create() for rules about valid names.

\n", "group": "reference" }, "git_reference_peel": { @@ -14643,7 +14844,7 @@ "comment": " 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code" }, "description": "

Recursively peel reference until object of the specified type is found.

\n", - "comments": "

The retrieved peeled object is owned by the repository\n and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object\n will be peeled until a non-tag object is met.

\n", + "comments": "

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

\n\n

If you pass GIT_OBJ_ANY as the target type, then the object will be peeled until a non-tag object is met.

\n", "group": "reference" }, "git_reference_is_valid_name": { @@ -14665,7 +14866,7 @@ "comment": " 1 if the reference name is acceptable; 0 if it isn't" }, "description": "

Ensure the reference name is well-formed.

\n", - "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores,\nand must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
  2. \n
  3. Names prefixed with "refs/" can be almost anything. You must avoid\nthe characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\nsequences ".." and "\n@\n{" which have special meaning to revparse.
  4. \n
\n", + "comments": "

Valid reference names must follow one of two patterns:

\n\n
    \n
  1. Top-level names must contain only capital letters and underscores, and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 2. Names prefixed with "refs/" can be almost anything. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.
  2. \n
\n", "group": "reference" }, "git_reference_shorthand": { @@ -14687,11 +14888,11 @@ "comment": " the human-readable version of the name" }, "description": "

Get the reference's short name

\n", - "comments": "

This will transform the reference name into a name "human-readable"\n version. If no shortname is appropriate, it will return the full\n name.

\n\n

The memory is owned by the reference and must not be freed.

\n", + "comments": "

This will transform the reference name into a name "human-readable" version. If no shortname is appropriate, it will return the full name.

\n\n

The memory is owned by the reference and must not be freed.

\n", "group": "reference", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_reference_shorthand-4" + "ex/v0.24.1/status.html#git_reference_shorthand-4" ] } }, @@ -14961,7 +15162,7 @@ "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_create-4" + "ex/v0.24.1/remote.html#git_remote_create-4" ] } }, @@ -15036,14 +15237,14 @@ "comment": " 0 or an error code" }, "description": "

Create an anonymous remote

\n", - "comments": "

Create a remote with the given url in-memory. You can use this when\n you have a URL instead of a remote's name.

\n", + "comments": "

Create a remote with the given url in-memory. You can use this when you have a URL instead of a remote's name.

\n", "group": "remote", "examples": { "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_create_anonymous-4" + "ex/v0.24.1/network/fetch.html#git_remote_create_anonymous-4" ], "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_remote_create_anonymous-2" + "ex/v0.24.1/network/ls-remote.html#git_remote_create_anonymous-2" ] } }, @@ -15076,17 +15277,17 @@ "comment": " 0, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code" }, "description": "

Get the information for a particular remote

\n", - "comments": "

The name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

The name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "remote", "examples": { "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_lookup-5" + "ex/v0.24.1/network/fetch.html#git_remote_lookup-5" ], "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_remote_lookup-3" + "ex/v0.24.1/network/ls-remote.html#git_remote_lookup-3" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_lookup-5" + "ex/v0.24.1/remote.html#git_remote_lookup-5" ] } }, @@ -15180,11 +15381,11 @@ "comment": " a pointer to the url" }, "description": "

Get the remote's url

\n", - "comments": "

If url.*.insteadOf has been configured for this URL, it will\n return the modified URL.

\n", + "comments": "

If url.*.insteadOf has been configured for this URL, it will return the modified URL.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_url-6" + "ex/v0.24.1/remote.html#git_remote_url-6" ] } }, @@ -15207,11 +15408,11 @@ "comment": " a pointer to the url or NULL if no special url for pushing is set" }, "description": "

Get the remote's url for pushing

\n", - "comments": "

If url.*.pushInsteadOf has been configured for this URL, it\n will return the modified URL.

\n", + "comments": "

If url.*.pushInsteadOf has been configured for this URL, it will return the modified URL.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_pushurl-7" + "ex/v0.24.1/remote.html#git_remote_pushurl-7" ] } }, @@ -15244,11 +15445,11 @@ "comment": " 0 or an error value" }, "description": "

Set the remote's url in the configuration

\n", - "comments": "

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_set_url-8" + "ex/v0.24.1/remote.html#git_remote_set_url-8" ] } }, @@ -15281,11 +15482,11 @@ "comment": null }, "description": "

Set the remote's url for pushing in the configuration.

\n", - "comments": "

Remote objects already in memory will not be affected. This assumes\n the common case of a single-url remote and will otherwise return an error.

\n", + "comments": "

Remote objects already in memory will not be affected. This assumes the common case of a single-url remote and will otherwise return an error.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_set_pushurl-9" + "ex/v0.24.1/remote.html#git_remote_set_pushurl-9" ] } }, @@ -15318,7 +15519,7 @@ "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" }, "description": "

Add a fetch refspec to the remote's configuration

\n", - "comments": "

Add the given refspec to the fetch list in the configuration. No\n loaded remote instances will be affected.

\n", + "comments": "

Add the given refspec to the fetch list in the configuration. No loaded remote instances will be affected.

\n", "group": "remote" }, "git_remote_get_fetch_refspecs": { @@ -15345,7 +15546,7 @@ "comment": null }, "description": "

Get the remote's list of fetch refspecs

\n", - "comments": "

The memory is owned by the user and should be freed with\n git_strarray_free.

\n", + "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", "group": "remote" }, "git_remote_add_push": { @@ -15377,7 +15578,7 @@ "comment": " 0, GIT_EINVALIDSPEC if refspec is invalid or an error value" }, "description": "

Add a push refspec to the remote's configuration

\n", - "comments": "

Add the given refspec to the push list in the configuration. No\n loaded remote instances will be affected.

\n", + "comments": "

Add the given refspec to the push list in the configuration. No loaded remote instances will be affected.

\n", "group": "remote" }, "git_remote_get_push_refspecs": { @@ -15404,7 +15605,7 @@ "comment": null }, "description": "

Get the remote's list of push refspecs

\n", - "comments": "

The memory is owned by the user and should be freed with\n git_strarray_free.

\n", + "comments": "

The memory is owned by the user and should be freed with git_strarray_free.

\n", "group": "remote" }, "git_remote_refspec_count": { @@ -15459,8 +15660,8 @@ "git_remote_connect": { "type": "function", "file": "remote.h", - "line": 246, - "lineto": 246, + "line": 247, + "lineto": 247, "args": [ { "name": "remote", @@ -15476,31 +15677,33 @@ "name": "callbacks", "type": "const git_remote_callbacks *", "comment": "the callbacks to use for this connection" + }, + { + "name": "custom_headers", + "type": "const git_strarray *", + "comment": "extra HTTP headers to use in this connection" } ], - "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks", - "sig": "git_remote *::git_direction::const git_remote_callbacks *", + "argline": "git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers", + "sig": "git_remote *::git_direction::const git_remote_callbacks *::const git_strarray *", "return": { "type": "int", "comment": " 0 or an error code" }, "description": "

Open a connection to a remote

\n", - "comments": "

The transport is selected based on the URL. The direction argument\n is due to a limitation of the git protocol (over TCP or SSH) which\n starts up a specific binary which can only do the one or the other.

\n", + "comments": "

The transport is selected based on the URL. The direction argument is due to a limitation of the git protocol (over TCP or SSH) which starts up a specific binary which can only do the one or the other.

\n", "group": "remote", "examples": { - "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_connect-6" - ], "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_remote_connect-4" + "ex/v0.24.1/network/ls-remote.html#git_remote_connect-4" ] } }, "git_remote_ls": { "type": "function", "file": "remote.h", - "line": 268, - "lineto": 268, + "line": 269, + "lineto": 269, "args": [ { "name": "out", @@ -15525,19 +15728,19 @@ "comment": " 0 on success, or an error code" }, "description": "

Get the remote repository's reference advertisement list

\n", - "comments": "

Get the list of references with which the server responds to a new\n connection.

\n\n

The remote (or more exactly its transport) must have connected to\n the remote repository. This list is available as soon as the\n connection to the remote is initiated and it remains available\n after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long\n as a new connection is not initiated, but it is recommended that\n you make a copy in order to make use of the data.

\n", + "comments": "

Get the list of references with which the server responds to a new connection.

\n\n

The remote (or more exactly its transport) must have connected to the remote repository. This list is available as soon as the connection to the remote is initiated and it remains available after disconnecting.

\n\n

The memory belongs to the remote. The pointer will be valid as long as a new connection is not initiated, but it is recommended that you make a copy in order to make use of the data.

\n", "group": "remote", "examples": { "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_remote_ls-5" + "ex/v0.24.1/network/ls-remote.html#git_remote_ls-5" ] } }, "git_remote_connected": { "type": "function", "file": "remote.h", - "line": 279, - "lineto": 279, + "line": 280, + "lineto": 280, "args": [ { "name": "remote", @@ -15552,14 +15755,14 @@ "comment": " 1 if it's connected, 0 otherwise." }, "description": "

Check whether the remote is connected

\n", - "comments": "

Check whether the remote's underlying transport is connected to the\n remote host.

\n", + "comments": "

Check whether the remote's underlying transport is connected to the remote host.

\n", "group": "remote" }, "git_remote_stop": { "type": "function", "file": "remote.h", - "line": 289, - "lineto": 289, + "line": 290, + "lineto": 290, "args": [ { "name": "remote", @@ -15574,14 +15777,14 @@ "comment": null }, "description": "

Cancel the operation

\n", - "comments": "

At certain points in its operation, the network code checks whether\n the operation has been cancelled and if so stops the operation.

\n", + "comments": "

At certain points in its operation, the network code checks whether the operation has been cancelled and if so stops the operation.

\n", "group": "remote" }, "git_remote_disconnect": { "type": "function", "file": "remote.h", - "line": 298, - "lineto": 298, + "line": 299, + "lineto": 299, "args": [ { "name": "remote", @@ -15597,18 +15800,13 @@ }, "description": "

Disconnect from the remote

\n", "comments": "

Close the connection to the remote.

\n", - "group": "remote", - "examples": { - "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_disconnect-7" - ] - } + "group": "remote" }, "git_remote_free": { "type": "function", "file": "remote.h", - "line": 308, - "lineto": 308, + "line": 309, + "lineto": 309, "args": [ { "name": "remote", @@ -15623,26 +15821,26 @@ "comment": null }, "description": "

Free the memory associated with a remote

\n", - "comments": "

This also disconnects from the remote, if the connection\n has not been closed yet (using git_remote_disconnect).

\n", + "comments": "

This also disconnects from the remote, if the connection has not been closed yet (using git_remote_disconnect).

\n", "group": "remote", "examples": { "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_free-8", - "ex/v0.23.2/network/fetch.html#git_remote_free-9" + "ex/v0.24.1/network/fetch.html#git_remote_free-6", + "ex/v0.24.1/network/fetch.html#git_remote_free-7" ], "network/ls-remote.c": [ - "ex/v0.23.2/network/ls-remote.html#git_remote_free-6" + "ex/v0.24.1/network/ls-remote.html#git_remote_free-6" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_free-10" + "ex/v0.24.1/remote.html#git_remote_free-10" ] } }, "git_remote_list": { "type": "function", "file": "remote.h", - "line": 319, - "lineto": 319, + "line": 320, + "lineto": 320, "args": [ { "name": "out", @@ -15666,15 +15864,15 @@ "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_list-11" + "ex/v0.24.1/remote.html#git_remote_list-11" ] } }, "git_remote_init_callbacks": { "type": "function", "file": "remote.h", - "line": 470, - "lineto": 472, + "line": 471, + "lineto": 473, "args": [ { "name": "opts", @@ -15700,8 +15898,8 @@ "git_fetch_init_options": { "type": "function", "file": "remote.h", - "line": 563, - "lineto": 565, + "line": 569, + "lineto": 571, "args": [ { "name": "opts", @@ -15727,8 +15925,8 @@ "git_push_init_options": { "type": "function", "file": "remote.h", - "line": 602, - "lineto": 604, + "line": 613, + "lineto": 615, "args": [ { "name": "opts", @@ -15754,8 +15952,8 @@ "git_remote_download": { "type": "function", "file": "remote.h", - "line": 622, - "lineto": 622, + "line": 633, + "lineto": 633, "args": [ { "name": "remote", @@ -15780,19 +15978,14 @@ "comment": " 0 or an error code" }, "description": "

Download and index the packfile

\n", - "comments": "

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, download and index the\n packfile.

\n\n

The .idx file will be created and both it and the packfile with be\n renamed to their final name.

\n", - "group": "remote", - "examples": { - "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_download-10" - ] - } + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, download and index the packfile.

\n\n

The .idx file will be created and both it and the packfile with be renamed to their final name.

\n", + "group": "remote" }, "git_remote_upload": { "type": "function", "file": "remote.h", - "line": 636, - "lineto": 636, + "line": 647, + "lineto": 647, "args": [ { "name": "remote", @@ -15817,14 +16010,14 @@ "comment": " 0 or an error code" }, "description": "

Create a packfile and send it to the server

\n", - "comments": "

Connect to the remote if it hasn't been done yet, negotiate with\n the remote git which objects are missing, create a packfile with the missing objects and send it.

\n", + "comments": "

Connect to the remote if it hasn't been done yet, negotiate with the remote git which objects are missing, create a packfile with the missing objects and send it.

\n", "group": "remote" }, "git_remote_update_tips": { "type": "function", "file": "remote.h", - "line": 652, - "lineto": 657, + "line": 663, + "lineto": 668, "args": [ { "name": "remote", @@ -15860,18 +16053,13 @@ }, "description": "

Update the tips to the new state

\n", "comments": "", - "group": "remote", - "examples": { - "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_update_tips-11" - ] - } + "group": "remote" }, "git_remote_fetch": { "type": "function", "file": "remote.h", - "line": 673, - "lineto": 677, + "line": 684, + "lineto": 688, "args": [ { "name": "remote", @@ -15901,14 +16089,19 @@ "comment": " 0 or an error code" }, "description": "

Download new data and update tips

\n", - "comments": "

Convenience function to connect to a remote, download the data,\n disconnect and update the remote-tracking branches.

\n", - "group": "remote" + "comments": "

Convenience function to connect to a remote, download the data, disconnect and update the remote-tracking branches.

\n", + "group": "remote", + "examples": { + "network/fetch.c": [ + "ex/v0.24.1/network/fetch.html#git_remote_fetch-8" + ] + } }, "git_remote_prune": { "type": "function", "file": "remote.h", - "line": 686, - "lineto": 686, + "line": 697, + "lineto": 697, "args": [ { "name": "remote", @@ -15934,8 +16127,8 @@ "git_remote_push": { "type": "function", "file": "remote.h", - "line": 698, - "lineto": 700, + "line": 709, + "lineto": 711, "args": [ { "name": "remote", @@ -15966,8 +16159,8 @@ "git_remote_stats": { "type": "function", "file": "remote.h", - "line": 705, - "lineto": 705, + "line": 716, + "lineto": 716, "args": [ { "name": "remote", @@ -15986,15 +16179,15 @@ "group": "remote", "examples": { "network/fetch.c": [ - "ex/v0.23.2/network/fetch.html#git_remote_stats-12" + "ex/v0.24.1/network/fetch.html#git_remote_stats-9" ] } }, "git_remote_autotag": { "type": "function", "file": "remote.h", - "line": 713, - "lineto": 713, + "line": 724, + "lineto": 724, "args": [ { "name": "remote", @@ -16015,8 +16208,8 @@ "git_remote_set_autotag": { "type": "function", "file": "remote.h", - "line": 725, - "lineto": 725, + "line": 736, + "lineto": 736, "args": [ { "name": "repo", @@ -16041,14 +16234,14 @@ "comment": null }, "description": "

Set the remote's tag following setting.

\n", - "comments": "

The change will be made in the configuration. No loaded remotes\n will be affected.

\n", + "comments": "

The change will be made in the configuration. No loaded remotes will be affected.

\n", "group": "remote" }, "git_remote_prune_refs": { "type": "function", "file": "remote.h", - "line": 732, - "lineto": 732, + "line": 743, + "lineto": 743, "args": [ { "name": "remote", @@ -16069,8 +16262,8 @@ "git_remote_rename": { "type": "function", "file": "remote.h", - "line": 754, - "lineto": 758, + "line": 765, + "lineto": 769, "args": [ { "name": "problems", @@ -16100,19 +16293,19 @@ "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" }, "description": "

Give the remote a new name

\n", - "comments": "

All remote-tracking branches and configuration settings\n for the remote are updated.

\n\n

The new name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change\n their name or their list of refspecs.

\n", + "comments": "

All remote-tracking branches and configuration settings for the remote are updated.

\n\n

The new name will be checked for validity. See git_tag_create() for rules about valid names.

\n\n

No loaded instances of a the remote with the old name will change their name or their list of refspecs.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_rename-12" + "ex/v0.24.1/remote.html#git_remote_rename-12" ] } }, "git_remote_is_valid_name": { "type": "function", "file": "remote.h", - "line": 766, - "lineto": 766, + "line": 777, + "lineto": 777, "args": [ { "name": "remote_name", @@ -16133,8 +16326,8 @@ "git_remote_delete": { "type": "function", "file": "remote.h", - "line": 778, - "lineto": 778, + "line": 789, + "lineto": 789, "args": [ { "name": "repo", @@ -16154,19 +16347,19 @@ "comment": " 0 on success, or an error code." }, "description": "

Delete an existing persisted remote.

\n", - "comments": "

All remote-tracking branches and configuration settings\n for the remote will be removed.

\n", + "comments": "

All remote-tracking branches and configuration settings for the remote will be removed.

\n", "group": "remote", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_remote_delete-13" + "ex/v0.24.1/remote.html#git_remote_delete-13" ] } }, "git_remote_default_branch": { "type": "function", "file": "remote.h", - "line": 796, - "lineto": 796, + "line": 807, + "lineto": 807, "args": [ { "name": "out", @@ -16186,7 +16379,7 @@ "comment": " 0, GIT_ENOTFOUND if the remote does not have any references\n or none of them point to HEAD's commit, or an error message." }, "description": "

Retrieve the name of the remote's default branch

\n", - "comments": "

The default branch of a repository is the branch which HEAD points\n to. If the remote does not support reporting this information\n directly, it performs the guess as git does; that is, if there are\n multiple branches which point to the same commit, the first one is\n chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n", + "comments": "

The default branch of a repository is the branch which HEAD points to. If the remote does not support reporting this information directly, it performs the guess as git does; that is, if there are multiple branches which point to the same commit, the first one is chosen. If the master branch is a candidate, it wins.

\n\n

This function must only be called after connecting.

\n", "group": "remote" }, "git_repository_open": { @@ -16213,17 +16406,17 @@ "comment": " 0 or an error code" }, "description": "

Open a git repository.

\n", - "comments": "

The 'path' argument must point to either a git repository\n folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal\n or bare repository or fail is 'path' is neither.

\n", + "comments": "

The 'path' argument must point to either a git repository folder, or an existing work dir.

\n\n

The method will automatically detect if 'path' is a normal or bare repository or fail is 'path' is neither.

\n", "group": "repository", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_repository_open-58" + "ex/v0.24.1/general.html#git_repository_open-58" ], "network/git2.c": [ - "ex/v0.23.2/network/git2.html#git_repository_open-5" + "ex/v0.24.1/network/git2.html#git_repository_open-5" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_repository_open-14" + "ex/v0.24.1/remote.html#git_repository_open-14" ] } }, @@ -16251,7 +16444,7 @@ "comment": " 0 or an error code" }, "description": "

Create a "fake" repository to wrap an object database

\n", - "comments": "

Create a repository object to wrap an object database to be used\n with the API when all you have is an object database. This doesn't\n have any paths associated with it, so use with care.

\n", + "comments": "

Create a repository object to wrap an object database to be used with the API when all you have is an object database. This doesn't have any paths associated with it, so use with care.

\n", "group": "repository" }, "git_repository_discover": { @@ -16288,11 +16481,11 @@ "comment": " 0 or an error code" }, "description": "

Look for a git repository and copy its path in the given buffer.\n The lookup start from base_path and walk across parent directories\n if nothing has been found. The lookup ends when the first repository\n is found, or when reaching a directory referenced in ceiling_dirs\n or when the filesystem changes (in case across_fs is true).

\n", - "comments": "

The method will automatically detect if the repository is bare\n (if there is a repository).

\n", + "comments": "

The method will automatically detect if the repository is bare (if there is a repository).

\n", "group": "repository", "examples": { "remote.c": [ - "ex/v0.23.2/remote.html#git_repository_discover-15" + "ex/v0.24.1/remote.html#git_repository_discover-15" ] } }, @@ -16334,29 +16527,29 @@ "group": "repository", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_repository_open_ext-24" + "ex/v0.24.1/blame.html#git_repository_open_ext-24" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_repository_open_ext-31" + "ex/v0.24.1/cat-file.html#git_repository_open_ext-31" ], "describe.c": [ - "ex/v0.23.2/describe.html#git_repository_open_ext-6" + "ex/v0.24.1/describe.html#git_repository_open_ext-6" ], "diff.c": [ - "ex/v0.23.2/diff.html#git_repository_open_ext-15" + "ex/v0.24.1/diff.html#git_repository_open_ext-15" ], "log.c": [ - "ex/v0.23.2/log.html#git_repository_open_ext-44", - "ex/v0.23.2/log.html#git_repository_open_ext-45" + "ex/v0.24.1/log.html#git_repository_open_ext-44", + "ex/v0.24.1/log.html#git_repository_open_ext-45" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_repository_open_ext-16" + "ex/v0.24.1/rev-parse.html#git_repository_open_ext-16" ], "status.c": [ - "ex/v0.23.2/status.html#git_repository_open_ext-5" + "ex/v0.24.1/status.html#git_repository_open_ext-5" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_repository_open_ext-11" + "ex/v0.24.1/tag.html#git_repository_open_ext-11" ] } }, @@ -16384,7 +16577,7 @@ "comment": " 0 on success, or an error code" }, "description": "

Open a bare repository on the serverside.

\n", - "comments": "

This is a fast open for bare repositories that will come in handy\n if you're e.g. hosting git repositories and need to access them\n efficiently

\n", + "comments": "

This is a fast open for bare repositories that will come in handy if you're e.g. hosting git repositories and need to access them efficiently

\n", "group": "repository" }, "git_repository_free": { @@ -16406,44 +16599,44 @@ "comment": null }, "description": "

Free a previously allocated repository

\n", - "comments": "

Note that after a repository is free'd, all the objects it has spawned\n will still exist until they are manually closed by the user\n with git_object_free, but accessing any of the attributes of\n an object without a backing repository will result in undefined\n behavior

\n", + "comments": "

Note that after a repository is free'd, all the objects it has spawned will still exist until they are manually closed by the user with git_object_free, but accessing any of the attributes of an object without a backing repository will result in undefined behavior

\n", "group": "repository", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_repository_free-25" + "ex/v0.24.1/blame.html#git_repository_free-25" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_repository_free-32" + "ex/v0.24.1/cat-file.html#git_repository_free-32" ], "describe.c": [ - "ex/v0.23.2/describe.html#git_repository_free-7" + "ex/v0.24.1/describe.html#git_repository_free-7" ], "diff.c": [ - "ex/v0.23.2/diff.html#git_repository_free-16" + "ex/v0.24.1/diff.html#git_repository_free-16" ], "general.c": [ - "ex/v0.23.2/general.html#git_repository_free-59" + "ex/v0.24.1/general.html#git_repository_free-59" ], "init.c": [ - "ex/v0.23.2/init.html#git_repository_free-6" + "ex/v0.24.1/init.html#git_repository_free-6" ], "log.c": [ - "ex/v0.23.2/log.html#git_repository_free-46" + "ex/v0.24.1/log.html#git_repository_free-46" ], "network/clone.c": [ - "ex/v0.23.2/network/clone.html#git_repository_free-3" + "ex/v0.24.1/network/clone.html#git_repository_free-3" ], "network/git2.c": [ - "ex/v0.23.2/network/git2.html#git_repository_free-6" + "ex/v0.24.1/network/git2.html#git_repository_free-6" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_repository_free-17" + "ex/v0.24.1/rev-parse.html#git_repository_free-17" ], "status.c": [ - "ex/v0.23.2/status.html#git_repository_free-6" + "ex/v0.24.1/status.html#git_repository_free-6" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_repository_free-12" + "ex/v0.24.1/tag.html#git_repository_free-12" ] } }, @@ -16476,11 +16669,11 @@ "comment": " 0 or an error code" }, "description": "

Creates a new Git repository in the given folder.

\n", - "comments": "

TODO:\n - Reinit the repository

\n", + "comments": "

TODO: - Reinit the repository

\n", "group": "repository", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_repository_init-7" + "ex/v0.24.1/init.html#git_repository_init-7" ] } }, @@ -16540,11 +16733,11 @@ "comment": " 0 or an error code on failure." }, "description": "

Create a new Git repository in the given folder with extended controls.

\n", - "comments": "

This will initialize a new git repository (creating the repo_path\n if requested by flags) and working directory as needed. It will\n auto-detect the case sensitivity of the file system and if the\n file system supports file mode bits correctly.

\n", + "comments": "

This will initialize a new git repository (creating the repo_path if requested by flags) and working directory as needed. It will auto-detect the case sensitivity of the file system and if the file system supports file mode bits correctly.

\n", "group": "repository", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_repository_init_ext-8" + "ex/v0.24.1/init.html#git_repository_init_ext-8" ] } }, @@ -16572,11 +16765,11 @@ "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch, GIT_ENOTFOUND when HEAD is missing; an error code otherwise" }, "description": "

Retrieve and resolve the reference pointed at by HEAD.

\n", - "comments": "

The returned git_reference will be owned by caller and\n git_reference_free() must be called when done with it to release the\n allocated memory and prevent a leak.

\n", + "comments": "

The returned git_reference will be owned by caller and git_reference_free() must be called when done with it to release the allocated memory and prevent a leak.

\n", "group": "repository", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_repository_head-7" + "ex/v0.24.1/status.html#git_repository_head-7" ] } }, @@ -16599,7 +16792,7 @@ "comment": " 1 if HEAD is detached, 0 if it's not; error code if there\n was an error." }, "description": "

Check if a repository's HEAD is detached

\n", - "comments": "

A repository's HEAD is detached when it points directly to a commit\n instead of a branch.

\n", + "comments": "

A repository's HEAD is detached when it points directly to a commit instead of a branch.

\n", "group": "repository" }, "git_repository_head_unborn": { @@ -16621,7 +16814,7 @@ "comment": " 1 if the current branch is unborn, 0 if it's not; error\n code if there was an error" }, "description": "

Check if the current branch is unborn

\n", - "comments": "

An unborn branch is one named from HEAD but which doesn't exist in\n the refs namespace, because it doesn't have any commit to point to.

\n", + "comments": "

An unborn branch is one named from HEAD but which doesn't exist in the refs namespace, because it doesn't have any commit to point to.

\n", "group": "repository" }, "git_repository_is_empty": { @@ -16643,7 +16836,7 @@ "comment": " 1 if the repository is empty, 0 if it isn't, error code\n if the repository is corrupted" }, "description": "

Check if a repository is empty

\n", - "comments": "

An empty repository has just been initialized and contains no references\n apart from HEAD, which must be pointing to the unborn master branch.

\n", + "comments": "

An empty repository has just been initialized and contains no references apart from HEAD, which must be pointing to the unborn master branch.

\n", "group": "repository" }, "git_repository_path": { @@ -16665,14 +16858,14 @@ "comment": " the path to the repository" }, "description": "

Get the path of this repository

\n", - "comments": "

This is the path of the .git folder for normal repositories,\n or of the repository itself for bare repositories.

\n", + "comments": "

This is the path of the .git folder for normal repositories, or of the repository itself for bare repositories.

\n", "group": "repository", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_repository_path-9" + "ex/v0.24.1/init.html#git_repository_path-9" ], "status.c": [ - "ex/v0.23.2/status.html#git_repository_path-8" + "ex/v0.24.1/status.html#git_repository_path-8" ] } }, @@ -16695,11 +16888,11 @@ "comment": " the path to the working dir, if it exists" }, "description": "

Get the path of the working directory for this repository

\n", - "comments": "

If the repository is bare, this function will always return\n NULL.

\n", + "comments": "

If the repository is bare, this function will always return NULL.

\n", "group": "repository", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_repository_workdir-10" + "ex/v0.24.1/init.html#git_repository_workdir-10" ] } }, @@ -16732,7 +16925,7 @@ "comment": " 0, or an error code" }, "description": "

Set the path to the working directory for this repository

\n", - "comments": "

The working directory doesn't need to be the same one\n that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory\n will turn it into a normal repository, capable of performing\n all the common workdir operations (checkout, status, index\n manipulation, etc).

\n", + "comments": "

The working directory doesn't need to be the same one that contains the .git folder for this repository.

\n\n

If this repository is bare, setting its working directory will turn it into a normal repository, capable of performing all the common workdir operations (checkout, status, index manipulation, etc).

\n", "group": "repository" }, "git_repository_is_bare": { @@ -16758,7 +16951,7 @@ "group": "repository", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_repository_is_bare-9" + "ex/v0.24.1/status.html#git_repository_is_bare-9" ] } }, @@ -16786,7 +16979,7 @@ "comment": " 0, or an error code" }, "description": "

Get the configuration file for this repository.

\n", - "comments": "

If a configuration file has not been set, the default\n config set for the repository will be returned, including\n global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n", + "comments": "

If a configuration file has not been set, the default config set for the repository will be returned, including global and system configurations (if they are available).

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", "group": "repository" }, "git_repository_config_snapshot": { @@ -16813,7 +17006,7 @@ "comment": " 0, or an error code" }, "description": "

Get a snapshot of the repository's configuration

\n", - "comments": "

Convenience function to take a snapshot from the repository's\n configuration. The contents of this snapshot will not change,\n even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer\n being used by the user.

\n", + "comments": "

Convenience function to take a snapshot from the repository's configuration. The contents of this snapshot will not change, even if the underlying config files are modified.

\n\n

The configuration file must be freed once it's no longer being used by the user.

\n", "group": "repository" }, "git_repository_odb": { @@ -16840,14 +17033,14 @@ "comment": " 0, or an error code" }, "description": "

Get the Object Database for this repository.

\n", - "comments": "

If a custom ODB has not been set, the default\n database for the repository will be returned (the one\n located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by\n the user.

\n", + "comments": "

If a custom ODB has not been set, the default database for the repository will be returned (the one located in .git/objects).

\n\n

The ODB must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_repository_odb-33" + "ex/v0.24.1/cat-file.html#git_repository_odb-33" ], "general.c": [ - "ex/v0.23.2/general.html#git_repository_odb-60" + "ex/v0.24.1/general.html#git_repository_odb-60" ] } }, @@ -16875,7 +17068,7 @@ "comment": " 0, or an error code" }, "description": "

Get the Reference Database Backend for this repository.

\n", - "comments": "

If a custom refsdb has not been set, the default database for\n the repository will be returned (the one that manipulates loose\n and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by\n the user.

\n", + "comments": "

If a custom refsdb has not been set, the default database for the repository will be returned (the one that manipulates loose and packed references in the .git directory).

\n\n

The refdb must be freed once it's no longer being used by the user.

\n", "group": "repository" }, "git_repository_index": { @@ -16902,14 +17095,14 @@ "comment": " 0, or an error code" }, "description": "

Get the Index file for this repository.

\n", - "comments": "

If a custom index has not been set, the default\n index for the repository will be returned (the one\n located in .git/index).

\n\n

The index must be freed once it's no longer being used by\n the user.

\n", + "comments": "

If a custom index has not been set, the default index for the repository will be returned (the one located in .git/index).

\n\n

The index must be freed once it's no longer being used by the user.

\n", "group": "repository", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_repository_index-61" + "ex/v0.24.1/general.html#git_repository_index-61" ], "init.c": [ - "ex/v0.23.2/init.html#git_repository_index-11" + "ex/v0.24.1/init.html#git_repository_index-11" ] } }, @@ -16937,7 +17130,7 @@ "comment": " 0, GIT_ENOTFOUND if no message exists or an error code" }, "description": "

Retrieve git's prepared message

\n", - "comments": "

Operations such as git revert/cherry-pick/merge with the -n option\n stop just short of creating a commit with the changes and save\n their prepared message in .git/MERGE_MSG so the next git-commit\n execution can present it to the user for them to amend if they\n wish.

\n\n

Use this function to get the contents of this file. Don't forget to\n remove the file after you create the commit.

\n", + "comments": "

Operations such as git revert/cherry-pick/merge with the -n option stop just short of creating a commit with the changes and save their prepared message in .git/MERGE_MSG so the next git-commit execution can present it to the user for them to amend if they wish.

\n\n

Use this function to get the contents of this file. Don't forget to remove the file after you create the commit.

\n", "group": "repository" }, "git_repository_message_remove": { @@ -17087,7 +17280,7 @@ "comment": " 0 on success, or an error code" }, "description": "

Calculate hash of file using repository filtering rules.

\n", - "comments": "

If you simply want to calculate the hash of a file on disk with no filters,\n you can just use the git_odb_hashfile() API. However, if you want to\n hash a file in the repository and you want to apply filtering rules (e.g.\n crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the\n filtering triggers that failure, then this function will return an\n error and not calculate the hash of the file.

\n", + "comments": "

If you simply want to calculate the hash of a file on disk with no filters, you can just use the git_odb_hashfile() API. However, if you want to hash a file in the repository and you want to apply filtering rules (e.g. crlf filters) before generating the SHA, then use this function.

\n\n

Note: if the repository has core.safecrlf set to fail and the filtering triggers that failure, then this function will return an error and not calculate the hash of the file.

\n", "group": "repository" }, "git_repository_set_head": { @@ -17114,7 +17307,7 @@ "comment": " 0 on success, or an error code" }, "description": "

Make the repository HEAD point to the specified reference.

\n", - "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is\n unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point\n to that branch, staying attached, or become attached if it isn't yet.\n If the branch doesn't exist yet, no error will be return. The HEAD\n will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to\n the Commit.

\n", + "comments": "

If the provided reference points to a Tree or a Blob, the HEAD is unaltered and -1 is returned.

\n\n

If the provided reference points to a branch, the HEAD will point to that branch, staying attached, or become attached if it isn't yet. If the branch doesn't exist yet, no error will be return. The HEAD will then be attached to an unborn branch.

\n\n

Otherwise, the HEAD will be detached and will directly point to the Commit.

\n", "group": "repository" }, "git_repository_set_head_detached": { @@ -17141,7 +17334,7 @@ "comment": " 0 on success, or an error code" }, "description": "

Make the repository HEAD directly point to the Commit.

\n", - "comments": "

If the provided committish cannot be found in the repository, the HEAD\n is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD\n is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to\n the peeled Commit.

\n", + "comments": "

If the provided committish cannot be found in the repository, the HEAD is unaltered and GIT_ENOTFOUND is returned.

\n\n

If the provided commitish cannot be peeled into a commit, the HEAD is unaltered and -1 is returned.

\n\n

Otherwise, the HEAD will eventually be detached and will directly point to the peeled Commit.

\n", "group": "repository" }, "git_repository_set_head_detached_from_annotated": { @@ -17168,7 +17361,7 @@ "comment": null }, "description": "

Make the repository HEAD directly point to the Commit.

\n", - "comments": "

This behaves like git_repository_set_head_detached() but takes an\n annotated commit, which lets you specify which extended sha syntax\n string was specified by a user, allowing for more exact reflog\n messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", + "comments": "

This behaves like git_repository_set_head_detached() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_repository_set_head_detached().

\n", "group": "repository" }, "git_repository_detach_head": { @@ -17190,14 +17383,14 @@ "comment": " 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing\n branch or an error code" }, "description": "

Detach the HEAD.

\n", - "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is\n updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is\n unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", + "comments": "

If the HEAD is already detached and points to a Commit, 0 is returned.

\n\n

If the HEAD is already detached and points to a Tag, the HEAD is updated into making it point to the peeled Commit, and 0 is returned.

\n\n

If the HEAD is already detached and points to a non commitish, the HEAD is unaltered, and -1 is returned.

\n\n

Otherwise, the HEAD will be detached and point to the peeled Commit.

\n", "group": "repository" }, "git_repository_state": { "type": "function", "file": "repository.h", - "line": 694, - "lineto": 694, + "line": 696, + "lineto": 696, "args": [ { "name": "repo", @@ -17218,8 +17411,8 @@ "git_repository_set_namespace": { "type": "function", "file": "repository.h", - "line": 708, - "lineto": 708, + "line": 710, + "lineto": 710, "args": [ { "name": "repo", @@ -17239,14 +17432,14 @@ "comment": " 0 on success, -1 on error" }, "description": "

Sets the active namespace for this Git Repository

\n", - "comments": "

This namespace affects all reference operations for the repo.\n See man gitnamespaces

\n", + "comments": "

This namespace affects all reference operations for the repo. See man gitnamespaces

\n", "group": "repository" }, "git_repository_get_namespace": { "type": "function", "file": "repository.h", - "line": 716, - "lineto": 716, + "line": 718, + "lineto": 718, "args": [ { "name": "repo", @@ -17267,8 +17460,8 @@ "git_repository_is_shallow": { "type": "function", "file": "repository.h", - "line": 725, - "lineto": 725, + "line": 727, + "lineto": 727, "args": [ { "name": "repo", @@ -17289,8 +17482,8 @@ "git_repository_ident": { "type": "function", "file": "repository.h", - "line": 737, - "lineto": 737, + "line": 739, + "lineto": 739, "args": [ { "name": "name", @@ -17315,14 +17508,14 @@ "comment": null }, "description": "

Retrieve the configured identity to use for reflogs

\n", - "comments": "

The memory is owned by the repository and must not be freed by the\n user.

\n", + "comments": "

The memory is owned by the repository and must not be freed by the user.

\n", "group": "repository" }, "git_repository_set_ident": { "type": "function", "file": "repository.h", - "line": 750, - "lineto": 750, + "line": 752, + "lineto": 752, "args": [ { "name": "repo", @@ -17347,7 +17540,7 @@ "comment": null }, "description": "

Set the identity to be used for writing reflogs

\n", - "comments": "

If both are set, this name and email will be used to write to the\n reflog. Pass NULL to unset. When unset, the identity will be taken\n from the repository's configuration.

\n", + "comments": "

If both are set, this name and email will be used to write to the reflog. Pass NULL to unset. When unset, the identity will be taken from the repository's configuration.

\n", "group": "repository" }, "git_reset": { @@ -17384,7 +17577,7 @@ "comment": " 0 on success or an error code" }, "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", - "comments": "

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced\n with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be\n replaced with the content of the index. (Untracked and ignored files\n will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n", + "comments": "

SOFT reset means the Head will be moved to the commit.

\n\n

MIXED reset will trigger a SOFT reset, plus the index will be replaced with the content of the commit tree.

\n\n

HARD reset will trigger a MIXED reset and the working directory will be replaced with the content of the index. (Untracked and ignored files will be left alone, however.)

\n\n

TODO: Implement remaining kinds of resets.

\n", "group": "reset" }, "git_reset_from_annotated": { @@ -17421,7 +17614,7 @@ "comment": null }, "description": "

Sets the current head to the specified commit oid and optionally\n resets the index and working tree to match.

\n", - "comments": "

This behaves like git_reset() but takes an annotated commit,\n which lets you specify which extended sha syntax string was\n specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n", + "comments": "

This behaves like git_reset() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.

\n\n

See the documentation for git_reset().

\n", "group": "reset" }, "git_reset_default": { @@ -17453,7 +17646,7 @@ "comment": " 0 on success or an error code \n<\n 0" }, "description": "

Updates some entries in the index from the target commit tree.

\n", - "comments": "

The scope of the updated entries is determined by the paths\n being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing\n entries in the index matching the provided pathspecs.

\n", + "comments": "

The scope of the updated entries is determined by the paths being passed in the pathspec parameters.

\n\n

Passing a NULL target will result in removing entries in the index matching the provided pathspecs.

\n", "group": "reset" }, "git_revert_init_options": { @@ -17591,26 +17784,26 @@ "comment": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code" }, "description": "

Find a single object, as specified by a revision string.

\n", - "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no\n longer needed.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

The returned object should be released with git_object_free when no longer needed.

\n", "group": "revparse", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_revparse_single-26" + "ex/v0.24.1/blame.html#git_revparse_single-26" ], "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_revparse_single-34" + "ex/v0.24.1/cat-file.html#git_revparse_single-34" ], "describe.c": [ - "ex/v0.23.2/describe.html#git_revparse_single-8" + "ex/v0.24.1/describe.html#git_revparse_single-8" ], "log.c": [ - "ex/v0.23.2/log.html#git_revparse_single-47" + "ex/v0.24.1/log.html#git_revparse_single-47" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_revparse_single-13", - "ex/v0.23.2/tag.html#git_revparse_single-14", - "ex/v0.23.2/tag.html#git_revparse_single-15", - "ex/v0.23.2/tag.html#git_revparse_single-16" + "ex/v0.24.1/tag.html#git_revparse_single-13", + "ex/v0.24.1/tag.html#git_revparse_single-14", + "ex/v0.24.1/tag.html#git_revparse_single-15", + "ex/v0.24.1/tag.html#git_revparse_single-16" ] } }, @@ -17648,7 +17841,7 @@ "comment": " 0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC\n or an error code" }, "description": "

Find a single object and intermediate reference by a revision string.

\n", - "comments": "

See man gitrevisions, or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n\n

In some cases (\n@\n{\n<\n-n>} or `\n<branchname

\n\n
\n

@\n{upstream}), the expression may\n point to an intermediate reference. When such expressions are being passed\n in,reference_out` will be valued as well.

\n
\n\n

The returned object should be released with git_object_free and the\n returned reference with git_reference_free when no longer needed.

\n", + "comments": "

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n\n

In some cases (@{<-n>} or <branchname>@{upstream}), the expression may point to an intermediate reference. When such expressions are being passed in, reference_out will be valued as well.

\n\n

The returned object should be released with git_object_free and the returned reference with git_reference_free when no longer needed.

\n", "group": "revparse" }, "git_revparse": { @@ -17680,18 +17873,18 @@ "comment": " 0 on success, GIT_INVALIDSPEC, GIT_ENOTFOUND, GIT_EAMBIGUOUS or an error code" }, "description": "

Parse a revision string for from, to, and intent.

\n", - "comments": "

See man gitrevisions or\n http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for\n information on the syntax accepted.

\n", + "comments": "

See man gitrevisions or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

\n", "group": "revparse", "examples": { "blame.c": [ - "ex/v0.23.2/blame.html#git_revparse-27" + "ex/v0.24.1/blame.html#git_revparse-27" ], "log.c": [ - "ex/v0.23.2/log.html#git_revparse-48" + "ex/v0.24.1/log.html#git_revparse-48" ], "rev-parse.c": [ - "ex/v0.23.2/rev-parse.html#git_revparse-18", - "ex/v0.23.2/rev-parse.html#git_revparse-19" + "ex/v0.24.1/rev-parse.html#git_revparse-18", + "ex/v0.24.1/rev-parse.html#git_revparse-19" ] } }, @@ -17719,15 +17912,15 @@ "comment": " 0 or an error code" }, "description": "

Allocate a new revision walker to iterate through a repo.

\n", - "comments": "

This revision walker uses a custom memory pool and an internal\n commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be\n reused for different walks.

\n\n

This revision walker is not thread safe: it may only be\n used to walk a repository on a single thread; however,\n it is possible to have several revision walkers in\n several different threads walking the same repository.

\n", + "comments": "

This revision walker uses a custom memory pool and an internal commit cache, so it is relatively expensive to allocate.

\n\n

For maximum performance, this revision walker should be reused for different walks.

\n\n

This revision walker is not thread safe: it may only be used to walk a repository on a single thread; however, it is possible to have several revision walkers in several different threads walking the same repository.

\n", "group": "revwalk", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_revwalk_new-62" + "ex/v0.24.1/general.html#git_revwalk_new-62" ], "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_new-49", - "ex/v0.23.2/log.html#git_revwalk_new-50" + "ex/v0.24.1/log.html#git_revwalk_new-49", + "ex/v0.24.1/log.html#git_revwalk_new-50" ] } }, @@ -17750,7 +17943,7 @@ "comment": null }, "description": "

Reset the revision walker for reuse.

\n", - "comments": "

This will clear all the pushed and hidden commits, and\n leave the walker in a blank state (just like at\n creation) ready to receive new commit pushes and\n start a new walk.

\n\n

The revision walk is automatically reset when a walk\n is over.

\n", + "comments": "

This will clear all the pushed and hidden commits, and leave the walker in a blank state (just like at creation) ready to receive new commit pushes and start a new walk.

\n\n

The revision walk is automatically reset when a walk is over.

\n", "group": "revwalk" }, "git_revwalk_push": { @@ -17777,14 +17970,14 @@ "comment": " 0 or an error code" }, "description": "

Add a new root for the traversal

\n", - "comments": "

The pushed commit will be marked as one of the roots from which to\n start the walk. This commit may not be walked if it or a child is\n hidden.

\n\n

At least one commit must be pushed onto the walker before a walk\n can be started.

\n\n

The given id must belong to a committish on the walked\n repository.

\n", + "comments": "

The pushed commit will be marked as one of the roots from which to start the walk. This commit may not be walked if it or a child is hidden.

\n\n

At least one commit must be pushed onto the walker before a walk can be started.

\n\n

The given id must belong to a committish on the walked repository.

\n", "group": "revwalk", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_revwalk_push-63" + "ex/v0.24.1/general.html#git_revwalk_push-63" ], "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_push-51" + "ex/v0.24.1/log.html#git_revwalk_push-51" ] } }, @@ -17812,7 +18005,7 @@ "comment": " 0 or an error code" }, "description": "

Push matching references

\n", - "comments": "

The OIDs pointed to by the references that match the given glob\n pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n", + "comments": "

The OIDs pointed to by the references that match the given glob pattern will be pushed to the revision walker.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", "group": "revwalk" }, "git_revwalk_push_head": { @@ -17838,7 +18031,7 @@ "group": "revwalk", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_push_head-52" + "ex/v0.24.1/log.html#git_revwalk_push_head-52" ] } }, @@ -17866,11 +18059,11 @@ "comment": " 0 or an error code" }, "description": "

Mark a commit (and its ancestors) uninteresting for the output.

\n", - "comments": "

The given id must belong to a committish on the walked\n repository.

\n\n

The resolved commit and all its parents will be hidden from the\n output on the revision walk.

\n", + "comments": "

The given id must belong to a committish on the walked repository.

\n\n

The resolved commit and all its parents will be hidden from the output on the revision walk.

\n", "group": "revwalk", "examples": { "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_hide-53" + "ex/v0.24.1/log.html#git_revwalk_hide-53" ] } }, @@ -17898,7 +18091,7 @@ "comment": " 0 or an error code" }, "description": "

Hide matching references.

\n", - "comments": "

The OIDs pointed to by the references that match the given glob\n pattern and their ancestors will be hidden from the output on the\n revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing\n '/\n\\\n*' if the glob lacks '?', '\n\\\n*' or '['.

\n\n

Any references matching this glob which do not point to a\n committish will be ignored.

\n", + "comments": "

The OIDs pointed to by the references that match the given glob pattern and their ancestors will be hidden from the output on the revision walk.

\n\n

A leading 'refs/' is implied if not present as well as a trailing '/*' if the glob lacks '?', '*' or '['.

\n\n

Any references matching this glob which do not point to a committish will be ignored.

\n", "group": "revwalk" }, "git_revwalk_hide_head": { @@ -18001,14 +18194,14 @@ "comment": " 0 if the next commit was found;\n\tGIT_ITEROVER if there are no commits left to iterate" }, "description": "

Get the next commit from the revision walk.

\n", - "comments": "

The initial call to this method is not blocking when\n iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial\n call blocking to preprocess the commit list, but this block should be\n mostly unnoticeable on most repositories (topological preprocessing\n times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n", + "comments": "

The initial call to this method is not blocking when iterating through a repo with a time-sorting mode.

\n\n

Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).

\n\n

The revision walker is reset when the walk is over.

\n", "group": "revwalk", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_revwalk_next-64" + "ex/v0.24.1/general.html#git_revwalk_next-64" ], "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_next-54" + "ex/v0.24.1/log.html#git_revwalk_next-54" ] } }, @@ -18040,11 +18233,11 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_revwalk_sorting-65" + "ex/v0.24.1/general.html#git_revwalk_sorting-65" ], "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_sorting-55", - "ex/v0.23.2/log.html#git_revwalk_sorting-56" + "ex/v0.24.1/log.html#git_revwalk_sorting-55", + "ex/v0.24.1/log.html#git_revwalk_sorting-56" ] } }, @@ -18072,7 +18265,7 @@ "comment": " 0 or an error code" }, "description": "

Push and hide the respective endpoints of the given range.

\n", - "comments": "

The range should be of the form

\n\n

<commit

\n\n
\n

..\n<commit

\n\n

where each \n<commit\nis in the form accepted by 'git_revparse_single'.\n The left-hand commit will be hidden and the right-hand commit pushed.

\n
\n", + "comments": "

The range should be of the form .. where each is in the form accepted by 'git_revparse_single'. The left-hand commit will be hidden and the right-hand commit pushed.

\n", "group": "revwalk" }, "git_revwalk_simplify_first_parent": { @@ -18120,10 +18313,10 @@ "group": "revwalk", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_revwalk_free-66" + "ex/v0.24.1/general.html#git_revwalk_free-66" ], "log.c": [ - "ex/v0.23.2/log.html#git_revwalk_free-57" + "ex/v0.24.1/log.html#git_revwalk_free-57" ] } }, @@ -18220,12 +18413,12 @@ "comment": " 0 or an error code" }, "description": "

Create a new action signature.

\n", - "comments": "

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('\n<\n' and '>') characters are not allowed\n to be used in either the name or the email parameter.

\n", + "comments": "

Call git_signature_free() to free the data.

\n\n

Note: angle brackets ('<' and '>') characters are not allowed to be used in either the name or the email parameter.

\n", "group": "signature", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_signature_new-67", - "ex/v0.23.2/general.html#git_signature_new-68" + "ex/v0.24.1/general.html#git_signature_new-67", + "ex/v0.24.1/general.html#git_signature_new-68" ] } }, @@ -18285,14 +18478,14 @@ "comment": " 0 on success, GIT_ENOTFOUND if config is missing, or error code" }, "description": "

Create a new action signature with default user and now timestamp.

\n", - "comments": "

This looks up the user.name and user.email from the configuration and\n uses the current time as the timestamp, and creates a new signature\n based on that information. It will return GIT_ENOTFOUND if either the\n user.name or user.email are not set.

\n", + "comments": "

This looks up the user.name and user.email from the configuration and uses the current time as the timestamp, and creates a new signature based on that information. It will return GIT_ENOTFOUND if either the user.name or user.email are not set.

\n", "group": "signature", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_signature_default-12" + "ex/v0.24.1/init.html#git_signature_default-12" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_signature_default-17" + "ex/v0.24.1/tag.html#git_signature_default-17" ] } }, @@ -18342,14 +18535,14 @@ "comment": null }, "description": "

Free an existing signature.

\n", - "comments": "

Because the signature is not an opaque structure, it is legal to free it\n manually, but be sure to free the "name" and "email" strings in addition\n to the structure itself.

\n", + "comments": "

Because the signature is not an opaque structure, it is legal to free it manually, but be sure to free the "name" and "email" strings in addition to the structure itself.

\n", "group": "signature", "examples": { "init.c": [ - "ex/v0.23.2/init.html#git_signature_free-13" + "ex/v0.24.1/init.html#git_signature_free-13" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_signature_free-18" + "ex/v0.24.1/tag.html#git_signature_free-18" ] } }, @@ -18409,7 +18602,7 @@ "comment": " 0 on success, GIT_ENOTFOUND if there's no stashed state for the\n given index, GIT_EMERGECONFLICT if changes exist in the working\n directory, or an error code" }, "description": "

Apply a single stashed state from the stash list.

\n", - "comments": "

If local changes in the working directory conflict with changes in the\n stash then GIT_EMERGECONFLICT will be returned. In this case, the index\n will always remain unmodified and all files in the working directory will\n remain unmodified. However, if you are restoring untracked files or\n ignored files and there is a conflict when applying the modified files,\n then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be\n conflicts when reinstating the index, the function will return\n GIT_EMERGECONFLICT and both the working directory and index will be left\n unmodified.

\n\n

Note that a minimum checkout strategy of GIT_CHECKOUT_SAFE is implied.

\n", + "comments": "

If local changes in the working directory conflict with changes in the stash then GIT_EMERGECONFLICT will be returned. In this case, the index will always remain unmodified and all files in the working directory will remain unmodified. However, if you are restoring untracked files or ignored files and there is a conflict when applying the modified files, then those files will remain in the working directory.

\n\n

If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be conflicts when reinstating the index, the function will return GIT_EMERGECONFLICT and both the working directory and index will be left unmodified.

\n\n

Note that a minimum checkout strategy of GIT_CHECKOUT_SAFE is implied.

\n", "group": "stash" }, "git_stash_foreach": { @@ -18559,11 +18752,11 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Gather file statuses and run a callback for each one.

\n", - "comments": "

The callback is passed the path of the file, the status (a combination of\n the git_status_t values above) and the payload data pointer passed\n into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping\n and return that value to caller.

\n", + "comments": "

The callback is passed the path of the file, the status (a combination of the git_status_t values above) and the payload data pointer passed into this function.

\n\n

If the callback returns a non-zero value, this function will stop looping and return that value to caller.

\n", "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_foreach-10" + "ex/v0.24.1/status.html#git_status_foreach-10" ] } }, @@ -18601,11 +18794,11 @@ "comment": " 0 on success, non-zero callback return value, or error code" }, "description": "

Gather file status information and run callbacks as requested.

\n", - "comments": "

This is an extended version of the git_status_foreach() API that\n allows for more granular control over which paths will be processed and\n in what order. See the git_status_options structure for details\n about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n", + "comments": "

This is an extended version of the git_status_foreach() API that allows for more granular control over which paths will be processed and in what order. See the git_status_options structure for details about the additional controls that this makes available.

\n\n

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_foreach_ext-11" + "ex/v0.24.1/status.html#git_status_foreach_ext-11" ] } }, @@ -18638,7 +18831,7 @@ "comment": " 0 on success, GIT_ENOTFOUND if the file is not found in the HEAD,\n index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files\n or if it refers to a folder, and -1 on other errors." }, "description": "

Get file status for a single file.

\n", - "comments": "

This tries to get status for the filename that you give. If no files\n match that name (in either the HEAD, index, or working directory), this\n returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a\n directory or if running on a case- insensitive filesystem and yet the\n HEAD has two entries that both match the path), then this returns\n GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of\n targets and because of the path filtering, there is not enough\n information to check renames correctly. To check file status with rename\n detection, there is no choice but to do a full git_status_list_new and\n scan through looking for the path that you are interested in.

\n", + "comments": "

This tries to get status for the filename that you give. If no files match that name (in either the HEAD, index, or working directory), this returns GIT_ENOTFOUND.

\n\n

If the name matches multiple files (for example, if the path names a directory or if running on a case- insensitive filesystem and yet the HEAD has two entries that both match the path), then this returns GIT_EAMBIGUOUS because it cannot give correct results.

\n\n

This does not do any sort of rename detection. Renames require a set of targets and because of the path filtering, there is not enough information to check renames correctly. To check file status with rename detection, there is no choice but to do a full git_status_list_new and scan through looking for the path that you are interested in.

\n", "group": "status" }, "git_status_list_new": { @@ -18670,12 +18863,12 @@ "comment": " 0 on success or error code" }, "description": "

Gather file status information and populate the git_status_list.

\n", - "comments": "

Note that if a pathspec is given in the git_status_options to filter\n the status, then the results from rename detection (if you enable it) may\n not be accurate. To do rename detection properly, this must be called\n with no pathspec so that all files can be considered.

\n", + "comments": "

Note that if a pathspec is given in the git_status_options to filter the status, then the results from rename detection (if you enable it) may not be accurate. To do rename detection properly, this must be called with no pathspec so that all files can be considered.

\n", "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_list_new-12", - "ex/v0.23.2/status.html#git_status_list_new-13" + "ex/v0.24.1/status.html#git_status_list_new-12", + "ex/v0.24.1/status.html#git_status_list_new-13" ] } }, @@ -18698,12 +18891,12 @@ "comment": " the number of status entries" }, "description": "

Gets the count of status entries in this list.

\n", - "comments": "

If there are no changes in status (at least according the options given\n when the status list was created), this can return 0.

\n", + "comments": "

If there are no changes in status (at least according the options given when the status list was created), this can return 0.

\n", "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_list_entrycount-14", - "ex/v0.23.2/status.html#git_status_list_entrycount-15" + "ex/v0.24.1/status.html#git_status_list_entrycount-14", + "ex/v0.24.1/status.html#git_status_list_entrycount-15" ] } }, @@ -18735,12 +18928,12 @@ "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_byindex-16", - "ex/v0.23.2/status.html#git_status_byindex-17", - "ex/v0.23.2/status.html#git_status_byindex-18", - "ex/v0.23.2/status.html#git_status_byindex-19", - "ex/v0.23.2/status.html#git_status_byindex-20", - "ex/v0.23.2/status.html#git_status_byindex-21" + "ex/v0.24.1/status.html#git_status_byindex-16", + "ex/v0.24.1/status.html#git_status_byindex-17", + "ex/v0.24.1/status.html#git_status_byindex-18", + "ex/v0.24.1/status.html#git_status_byindex-19", + "ex/v0.24.1/status.html#git_status_byindex-20", + "ex/v0.24.1/status.html#git_status_byindex-21" ] } }, @@ -18767,7 +18960,7 @@ "group": "status", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_status_list_free-22" + "ex/v0.24.1/status.html#git_status_list_free-22" ] } }, @@ -18800,7 +18993,7 @@ "comment": " 0 if ignore rules could be processed for the file (regardless\n of whether it exists or not), or an error \n<\n 0 if they could not." }, "description": "

Test if the ignore rules apply to a given file.

\n", - "comments": "

This function checks the ignore rules to see if they would apply to the\n given file. This indicates if the file would be ignored regardless of\n whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the\n directory containing the file, would it be added or not?

\n", + "comments": "

This function checks the ignore rules to see if they would apply to the given file. This indicates if the file would be ignored regardless of whether the file is already in the index or committed to the repository.

\n\n

One way to think of this is if you were to do "git add ." on the directory containing the file, would it be added or not?

\n", "group": "status" }, "git_strarray_free": { @@ -18822,18 +19015,18 @@ "comment": null }, "description": "

Close a string array object

\n", - "comments": "

This method should be called on git_strarray objects where the strings\n array is allocated and contains allocated strings, such as what you\n would get from git_strarray_copy(). Not doing so, will result in a\n memory leak.

\n\n

This does not free the git_strarray itself, since the library will\n never allocate that object directly itself (it is more commonly embedded\n inside another struct or created on the stack).

\n", + "comments": "

This method should be called on git_strarray objects where the strings array is allocated and contains allocated strings, such as what you would get from git_strarray_copy(). Not doing so, will result in a memory leak.

\n\n

This does not free the git_strarray itself, since the library will never allocate that object directly itself (it is more commonly embedded inside another struct or created on the stack).

\n", "group": "strarray", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_strarray_free-69" + "ex/v0.24.1/general.html#git_strarray_free-69" ], "remote.c": [ - "ex/v0.23.2/remote.html#git_strarray_free-16", - "ex/v0.23.2/remote.html#git_strarray_free-17" + "ex/v0.24.1/remote.html#git_strarray_free-16", + "ex/v0.24.1/remote.html#git_strarray_free-17" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_strarray_free-19" + "ex/v0.24.1/tag.html#git_strarray_free-19" ] } }, @@ -18861,14 +19054,14 @@ "comment": " 0 on success, \n<\n 0 on allocation failure" }, "description": "

Copy a string array object from source to target.

\n", - "comments": "

Note: target is overwritten and hence should be empty, otherwise its\n contents are leaked. Call git_strarray_free() if necessary.

\n", + "comments": "

Note: target is overwritten and hence should be empty, otherwise its contents are leaked. Call git_strarray_free() if necessary.

\n", "group": "strarray" }, "git_submodule_update_init_options": { "type": "function", "file": "submodule.h", - "line": 162, - "lineto": 163, + "line": 173, + "lineto": 174, "args": [ { "name": "opts", @@ -18894,8 +19087,8 @@ "git_submodule_update": { "type": "function", "file": "submodule.h", - "line": 181, - "lineto": 181, + "line": 192, + "lineto": 192, "args": [ { "name": "submodule", @@ -18926,8 +19119,8 @@ "git_submodule_lookup": { "type": "function", "file": "submodule.h", - "line": 210, - "lineto": 213, + "line": 221, + "lineto": 224, "args": [ { "name": "out", @@ -18952,14 +19145,14 @@ "comment": " 0 on success, GIT_ENOTFOUND if submodule does not exist,\n GIT_EEXISTS if a repository is found in working directory only,\n -1 on other errors." }, "description": "

Lookup submodule information by name or path.

\n", - "comments": "

Given either the submodule name or path (they are usually the same), this\n returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n
    \n
  • The submodule is not mentioned in the HEAD, the index, and the config,\nbut does "exist" in the working directory (i.e. there is a subdirectory\nthat appears to be a Git repository). In this case, this function\nreturns GIT_EEXISTS to indicate a sub-repository exists but not in a\nstate where a git_submodule can be instantiated.
  • \n
  • The submodule is not mentioned in the HEAD, index, or config and the\nworking directory doesn't contain a value git repo at that path.\nThere may or may not be anything else at that path, but nothing that\nlooks like a submodule. In this case, this returns GIT_ENOTFOUND.
  • \n
\n\n

You must call git_submodule_free when done with the submodule.

\n", + "comments": "

Given either the submodule name or path (they are usually the same), this returns a structure describing the submodule.

\n\n

There are two expected error scenarios:

\n\n
    \n
  • The submodule is not mentioned in the HEAD, the index, and the config, but does "exist" in the working directory (i.e. there is a subdirectory that appears to be a Git repository). In this case, this function returns GIT_EEXISTS to indicate a sub-repository exists but not in a state where a git_submodule can be instantiated. - The submodule is not mentioned in the HEAD, index, or config and the working directory doesn't contain a value git repo at that path. There may or may not be anything else at that path, but nothing that looks like a submodule. In this case, this returns GIT_ENOTFOUND.
  • \n
\n\n

You must call git_submodule_free when done with the submodule.

\n", "group": "submodule" }, "git_submodule_free": { "type": "function", "file": "submodule.h", - "line": 220, - "lineto": 220, + "line": 231, + "lineto": 231, "args": [ { "name": "submodule", @@ -18980,8 +19173,8 @@ "git_submodule_foreach": { "type": "function", "file": "submodule.h", - "line": 240, - "lineto": 243, + "line": 251, + "lineto": 254, "args": [ { "name": "repo", @@ -18990,7 +19183,7 @@ }, { "name": "callback", - "type": "int (*)(git_submodule *, const char *, void *)", + "type": "git_submodule_cb", "comment": "Function to be called with the name of each submodule.\n Return a non-zero value to terminate the iteration." }, { @@ -18999,26 +19192,26 @@ "comment": "Extra data to pass to callback" } ], - "argline": "git_repository *repo, int (*)(git_submodule *, const char *, void *) callback, void *payload", - "sig": "git_repository *::int (*)(git_submodule *, const char *, void *)::void *", + "argline": "git_repository *repo, git_submodule_cb callback, void *payload", + "sig": "git_repository *::git_submodule_cb::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.

\n", - "comments": "

See the note on git_submodule above. This iterates over the tracked\n submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like\n submodules but are not tracked, the diff API will generate a diff record\n for workdir items that look like submodules but are not tracked, showing\n them as added in the workdir. Also, the status API will treat the entire\n subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n", + "comments": "

See the note on git_submodule above. This iterates over the tracked submodules as described therein.

\n\n

If you are concerned about items in the working directory that look like submodules but are not tracked, the diff API will generate a diff record for workdir items that look like submodules but are not tracked, showing them as added in the workdir. Also, the status API will treat the entire subdirectory of a contained git repo as a single GIT_STATUS_WT_NEW item.

\n", "group": "submodule", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_submodule_foreach-23" + "ex/v0.24.1/status.html#git_submodule_foreach-23" ] } }, "git_submodule_add_setup": { "type": "function", "file": "submodule.h", - "line": 270, - "lineto": 275, + "line": 281, + "lineto": 286, "args": [ { "name": "out", @@ -19053,14 +19246,14 @@ "comment": " 0 on success, GIT_EEXISTS if submodule already exists,\n -1 on other errors." }, "description": "

Set up a new git submodule for checkout.

\n", - "comments": "

This does "git submodule add" up to the fetch and checkout of the\n submodule contents. It preps a new submodule, creates an entry in\n .gitmodules and creates an empty initialized repository either at the\n given path in the working directory or in .git/modules with a gitlink\n from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the\n submodule 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\n

You must call git_submodule_free on the submodule object when done.

\n", + "comments": "

This does "git submodule add" up to the fetch and checkout of the submodule contents. It preps a new submodule, creates an entry in .gitmodules and creates an empty initialized repository either at the given path in the working directory or in .git/modules with a gitlink from the working directory to the new repo.

\n\n

To fully emulate "git submodule add" call this function, then open the submodule repo and perform the clone step as needed. Lastly, call git_submodule_add_finalize() to wrap up adding the new submodule and .gitmodules to the index to be ready to commit.

\n\n

You must call git_submodule_free on the submodule object when done.

\n", "group": "submodule" }, "git_submodule_add_finalize": { "type": "function", "file": "submodule.h", - "line": 287, - "lineto": 287, + "line": 298, + "lineto": 298, "args": [ { "name": "submodule", @@ -19075,14 +19268,14 @@ "comment": null }, "description": "

Resolve the setup of a new git submodule.

\n", - "comments": "

This should be called on a submodule once you have called add setup\n and done the clone of the submodule. This adds the .gitmodules file\n and the newly cloned submodule to the index to be ready to be committed\n (but doesn't actually do the commit).

\n", + "comments": "

This should be called on a submodule once you have called add setup and done the clone of the submodule. This adds the .gitmodules file and the newly cloned submodule to the index to be ready to be committed (but doesn't actually do the commit).

\n", "group": "submodule" }, "git_submodule_add_to_index": { "type": "function", "file": "submodule.h", - "line": 299, - "lineto": 301, + "line": 310, + "lineto": 312, "args": [ { "name": "submodule", @@ -19108,8 +19301,8 @@ "git_submodule_owner": { "type": "function", "file": "submodule.h", - "line": 314, - "lineto": 314, + "line": 325, + "lineto": 325, "args": [ { "name": "submodule", @@ -19124,14 +19317,14 @@ "comment": " Pointer to `git_repository`" }, "description": "

Get the containing repository for a submodule.

\n", - "comments": "

This returns a pointer to the repository that contains the submodule.\n This is a just a reference to the repository that was passed to the\n original git_submodule_lookup() call, so if that repository has been\n freed, then this may be a dangling reference.

\n", + "comments": "

This returns a pointer to the repository that contains the submodule. This is a just a reference to the repository that was passed to the original git_submodule_lookup() call, so if that repository has been freed, then this may be a dangling reference.

\n", "group": "submodule" }, "git_submodule_name": { "type": "function", "file": "submodule.h", - "line": 322, - "lineto": 322, + "line": 333, + "lineto": 333, "args": [ { "name": "submodule", @@ -19150,15 +19343,15 @@ "group": "submodule", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_submodule_name-24" + "ex/v0.24.1/status.html#git_submodule_name-24" ] } }, "git_submodule_path": { "type": "function", "file": "submodule.h", - "line": 333, - "lineto": 333, + "line": 344, + "lineto": 344, "args": [ { "name": "submodule", @@ -19173,19 +19366,19 @@ "comment": " Pointer to the submodule path" }, "description": "

Get the path to the submodule.

\n", - "comments": "

The path is almost always the same as the submodule name, but the\n two are actually not required to match.

\n", + "comments": "

The path is almost always the same as the submodule name, but the two are actually not required to match.

\n", "group": "submodule", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_submodule_path-25" + "ex/v0.24.1/status.html#git_submodule_path-25" ] } }, "git_submodule_url": { "type": "function", "file": "submodule.h", - "line": 341, - "lineto": 341, + "line": 352, + "lineto": 352, "args": [ { "name": "submodule", @@ -19206,8 +19399,8 @@ "git_submodule_resolve_url": { "type": "function", "file": "submodule.h", - "line": 351, - "lineto": 351, + "line": 362, + "lineto": 362, "args": [ { "name": "out", @@ -19238,8 +19431,8 @@ "git_submodule_branch": { "type": "function", "file": "submodule.h", - "line": 359, - "lineto": 359, + "line": 370, + "lineto": 370, "args": [ { "name": "submodule", @@ -19260,8 +19453,8 @@ "git_submodule_set_branch": { "type": "function", "file": "submodule.h", - "line": 372, - "lineto": 372, + "line": 383, + "lineto": 383, "args": [ { "name": "repo", @@ -19286,14 +19479,14 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set the branch for the submodule in the configuration

\n", - "comments": "

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to write the changes to the checked out submodule repository.

\n", "group": "submodule" }, "git_submodule_set_url": { "type": "function", "file": "submodule.h", - "line": 386, - "lineto": 386, + "line": 397, + "lineto": 397, "args": [ { "name": "repo", @@ -19318,14 +19511,14 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set the URL for the submodule in the configuration

\n", - "comments": "

After calling this, you may wish to call git_submodule_sync() to\n write the changes to the checked out submodule repository.

\n", + "comments": "

After calling this, you may wish to call git_submodule_sync() to write the changes to the checked out submodule repository.

\n", "group": "submodule" }, "git_submodule_index_id": { "type": "function", "file": "submodule.h", - "line": 394, - "lineto": 394, + "line": 405, + "lineto": 405, "args": [ { "name": "submodule", @@ -19346,8 +19539,8 @@ "git_submodule_head_id": { "type": "function", "file": "submodule.h", - "line": 402, - "lineto": 402, + "line": 413, + "lineto": 413, "args": [ { "name": "submodule", @@ -19368,8 +19561,8 @@ "git_submodule_wd_id": { "type": "function", "file": "submodule.h", - "line": 415, - "lineto": 415, + "line": 426, + "lineto": 426, "args": [ { "name": "submodule", @@ -19384,14 +19577,14 @@ "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.

\n", - "comments": "

This returns the OID that corresponds to looking up 'HEAD' in the checked\n out submodule. If there are pending changes in the index or anything\n else, this won't notice that. You should call git_submodule_status()\n for a more complete picture about the state of the working directory.

\n", + "comments": "

This returns the OID that corresponds to looking up 'HEAD' in the checked out submodule. If there are pending changes in the index or anything else, this won't notice that. You should call git_submodule_status() for a more complete picture about the state of the working directory.

\n", "group": "submodule" }, "git_submodule_ignore": { "type": "function", "file": "submodule.h", - "line": 440, - "lineto": 441, + "line": 451, + "lineto": 452, "args": [ { "name": "submodule", @@ -19406,14 +19599,14 @@ "comment": " The current git_submodule_ignore_t valyue what will be used for\n this submodule." }, "description": "

Get the ignore rule that will be used for the submodule.

\n", - "comments": "

These values control the behavior of git_submodule_status() for this\n submodule. There are four ignore values:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_NONE will consider any change to the contents\nof the submodule from a clean checkout to be dirty, including the\naddition of untracked files. This is the default if unspecified.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED examines the contents of the\nworking tree (i.e. call git_status_foreach() on the submodule) but\nUNTRACKED files will not count as making the submodule dirty.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY means to only check if the HEAD of the\nsubmodule has moved for status. This is fast since it does not need to\nscan the working tree of the submodule at all.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL means not to open the submodule repo.\nThe working directory will be consider clean so long as there is a\nchecked out version present.
  • \n
\n", + "comments": "

These values control the behavior of git_submodule_status() for this submodule. There are four ignore values:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_NONE will consider any change to the contents of the submodule from a clean checkout to be dirty, including the addition of untracked files. This is the default if unspecified. - GIT_SUBMODULE_IGNORE_UNTRACKED examines the contents of the working tree (i.e. call git_status_foreach() on the submodule) but UNTRACKED files will not count as making the submodule dirty. - GIT_SUBMODULE_IGNORE_DIRTY means to only check if the HEAD of the submodule has moved for status. This is fast since it does not need to scan the working tree of the submodule at all. - GIT_SUBMODULE_IGNORE_ALL means not to open the submodule repo. The working directory will be consider clean so long as there is a checked out version present.
  • \n
\n", "group": "submodule" }, "git_submodule_set_ignore": { "type": "function", "file": "submodule.h", - "line": 453, - "lineto": 456, + "line": 464, + "lineto": 467, "args": [ { "name": "repo", @@ -19444,8 +19637,8 @@ "git_submodule_update_strategy": { "type": "function", "file": "submodule.h", - "line": 468, - "lineto": 469, + "line": 479, + "lineto": 480, "args": [ { "name": "submodule", @@ -19460,14 +19653,14 @@ "comment": " The current git_submodule_update_t value that will be used\n for this submodule." }, "description": "

Get the update rule that will be used for the submodule.

\n", - "comments": "

This value controls the behavior of the git submodule update command.\n There are four useful values documented with git_submodule_update_t.

\n", + "comments": "

This value controls the behavior of the git submodule update command. There are four useful values documented with git_submodule_update_t.

\n", "group": "submodule" }, "git_submodule_set_update": { "type": "function", "file": "submodule.h", - "line": 481, - "lineto": 484, + "line": 492, + "lineto": 495, "args": [ { "name": "repo", @@ -19498,8 +19691,8 @@ "git_submodule_fetch_recurse_submodules": { "type": "function", "file": "submodule.h", - "line": 497, - "lineto": 498, + "line": 508, + "lineto": 509, "args": [ { "name": "submodule", @@ -19514,14 +19707,14 @@ "comment": " 0 if fetchRecurseSubmodules is false, 1 if true" }, "description": "

Read the fetchRecurseSubmodules rule for a submodule.

\n", - "comments": "

This accesses the submodule.\n<name

\n\n
\n

.fetchRecurseSubmodules value for\n the submodule that controls fetching behavior for the submodule.

\n
\n\n

Note that at this time, libgit2 does not honor this setting and the\n fetch functionality current ignores submodules.

\n", + "comments": "

This accesses the submodule..fetchRecurseSubmodules value for the submodule that controls fetching behavior for the submodule.

\n\n

Note that at this time, libgit2 does not honor this setting and the fetch functionality current ignores submodules.

\n", "group": "submodule" }, "git_submodule_set_fetch_recurse_submodules": { "type": "function", "file": "submodule.h", - "line": 510, - "lineto": 513, + "line": 521, + "lineto": 524, "args": [ { "name": "repo", @@ -19552,8 +19745,8 @@ "git_submodule_init": { "type": "function", "file": "submodule.h", - "line": 528, - "lineto": 528, + "line": 539, + "lineto": 539, "args": [ { "name": "submodule", @@ -19573,14 +19766,14 @@ "comment": " 0 on success, \n<\n0 on failure." }, "description": "

Copy submodule info into ".git/config" file.

\n", - "comments": "

Just like "git submodule init", this copies information about the\n submodule into ".git/config". You can use the accessor functions\n above to alter the in-memory git_submodule object and control what\n is written to the config, overriding what is in .gitmodules.

\n", + "comments": "

Just like "git submodule init", this copies information about the submodule into ".git/config". You can use the accessor functions above to alter the in-memory git_submodule object and control what is written to the config, overriding what is in .gitmodules.

\n", "group": "submodule" }, "git_submodule_repo_init": { "type": "function", "file": "submodule.h", - "line": 543, - "lineto": 546, + "line": 554, + "lineto": 557, "args": [ { "name": "out", @@ -19605,14 +19798,14 @@ "comment": " 0 on success, \n<\n0 on failure." }, "description": "

Set up the subrepository for a submodule in preparation for clone.

\n", - "comments": "

This function can be called to init and set up a submodule\n repository from a submodule in preparation to clone it from\n its remote.

\n", + "comments": "

This function can be called to init and set up a submodule repository from a submodule in preparation to clone it from its remote.

\n", "group": "submodule" }, "git_submodule_sync": { "type": "function", "file": "submodule.h", - "line": 556, - "lineto": 556, + "line": 567, + "lineto": 567, "args": [ { "name": "submodule", @@ -19627,14 +19820,14 @@ "comment": null }, "description": "

Copy submodule remote info into submodule repo.

\n", - "comments": "

This copies the information about the submodules URL into the checked out\n submodule config, acting like "git submodule sync". This is useful if\n you have altered the URL for the submodule (or it has been altered by a\n fetch of upstream changes) and you need to update your local repo.

\n", + "comments": "

This copies the information about the submodules URL into the checked out submodule config, acting like "git submodule sync". This is useful if you have altered the URL for the submodule (or it has been altered by a fetch of upstream changes) and you need to update your local repo.

\n", "group": "submodule" }, "git_submodule_open": { "type": "function", "file": "submodule.h", - "line": 570, - "lineto": 572, + "line": 581, + "lineto": 583, "args": [ { "name": "repo", @@ -19654,14 +19847,14 @@ "comment": " 0 on success, \n<\n0 if submodule repo could not be opened." }, "description": "

Open the repository for a submodule.

\n", - "comments": "

This is a newly opened repository object. The caller is responsible for\n calling git_repository_free() on it when done. Multiple calls to this\n function will return distinct git_repository objects. This will only\n work if the submodule is checked out into the working directory.

\n", + "comments": "

This is a newly opened repository object. The caller is responsible for calling git_repository_free() on it when done. Multiple calls to this function will return distinct git_repository objects. This will only work if the submodule is checked out into the working directory.

\n", "group": "submodule" }, "git_submodule_reload": { "type": "function", "file": "submodule.h", - "line": 584, - "lineto": 584, + "line": 595, + "lineto": 595, "args": [ { "name": "submodule", @@ -19681,14 +19874,14 @@ "comment": " 0 on success, \n<\n0 on error" }, "description": "

Reread submodule info from config, index, and HEAD.

\n", - "comments": "

Call this to reread cached submodule information for this submodule if\n you have reason to believe that it has changed.

\n", + "comments": "

Call this to reread cached submodule information for this submodule if you have reason to believe that it has changed.

\n", "group": "submodule" }, "git_submodule_status": { "type": "function", "file": "submodule.h", - "line": 600, - "lineto": 604, + "line": 611, + "lineto": 615, "args": [ { "name": "status", @@ -19718,19 +19911,19 @@ "comment": " 0 on success, \n<\n0 on error" }, "description": "

Get the status for a submodule.

\n", - "comments": "

This looks at a submodule and tries to determine the status. It\n will return a combination of the GIT_SUBMODULE_STATUS values above.\n How deeply it examines the working directory to do this will depend\n on the git_submodule_ignore_t value for the submodule.

\n", + "comments": "

This looks at a submodule and tries to determine the status. It will return a combination of the GIT_SUBMODULE_STATUS values above. How deeply it examines the working directory to do this will depend on the git_submodule_ignore_t value for the submodule.

\n", "group": "submodule", "examples": { "status.c": [ - "ex/v0.23.2/status.html#git_submodule_status-26" + "ex/v0.24.1/status.html#git_submodule_status-26" ] } }, "git_submodule_location": { "type": "function", "file": "submodule.h", - "line": 620, - "lineto": 622, + "line": 631, + "lineto": 633, "args": [ { "name": "location_status", @@ -19750,76 +19943,9 @@ "comment": " 0 on success, \n<\n0 on error" }, "description": "

Get the locations of submodule information.

\n", - "comments": "

This is a bit like a very lightweight version of git_submodule_status.\n It just returns a made of the first four submodule status values (i.e.\n the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the\n submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.).\n This can be useful if you want to know if the submodule is present in the\n working directory at this point in time, etc.

\n", + "comments": "

This is a bit like a very lightweight version of git_submodule_status. It just returns a made of the first four submodule status values (i.e. the ones like GIT_SUBMODULE_STATUS_IN_HEAD, etc) that tell you where the submodule data comes from (i.e. the HEAD commit, gitmodules file, etc.). This can be useful if you want to know if the submodule is present in the working directory at this point in time, etc.

\n", "group": "submodule" }, - "git_commit_create_from_ids": { - "type": "function", - "file": "sys/commit.h", - "line": 34, - "lineto": 44, - "args": [ - { - "name": "id", - "type": "git_oid *", - "comment": null - }, - { - "name": "repo", - "type": "git_repository *", - "comment": null - }, - { - "name": "update_ref", - "type": "const char *", - "comment": null - }, - { - "name": "author", - "type": "const git_signature *", - "comment": null - }, - { - "name": "committer", - "type": "const git_signature *", - "comment": null - }, - { - "name": "message_encoding", - "type": "const char *", - "comment": null - }, - { - "name": "message", - "type": "const char *", - "comment": null - }, - { - "name": "tree", - "type": "const git_oid *", - "comment": null - }, - { - "name": "parent_count", - "type": "size_t", - "comment": null - }, - { - "name": "parents", - "type": "const git_oid *[]", - "comment": null - } - ], - "argline": "git_oid *id, git_repository *repo, const char *update_ref, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message, const git_oid *tree, size_t parent_count, const git_oid *[] parents", - "sig": "git_oid *::git_repository *::const char *::const git_signature *::const git_signature *::const char *::const char *::const git_oid *::size_t::const git_oid *[]", - "return": { - "type": "int", - "comment": null - }, - "description": "

Create new commit in the repository from a list of git_oid values.

\n", - "comments": "

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree and\n parents now take git_oid. This is a dangerous API in that nor\n the tree, neither the parents list of git_oids are checked for\n validity.

\n", - "group": "commit" - }, "git_commit_create_from_callback": { "type": "function", "file": "sys/commit.h", @@ -19884,14 +20010,14 @@ "comment": null }, "description": "

Create a new commit in the repository with an callback to supply parents.

\n", - "comments": "

See documentation for git_commit_create() for information about the\n parameters, as the meaning is identical excepting that tree takes a\n git_oid and doesn't check for validity, and parent_cb is invoked\n with parent_payload and should return git_oid values or NULL to\n indicate that all parents are accounted for.

\n", + "comments": "

See documentation for git_commit_create() for information about the parameters, as the meaning is identical excepting that tree takes a git_oid and doesn't check for validity, and parent_cb is invoked with parent_payload and should return git_oid values or NULL to indicate that all parents are accounted for.

\n", "group": "commit" }, "git_config_init_backend": { "type": "function", "file": "sys/config.h", - "line": 83, - "lineto": 85, + "line": 97, + "lineto": 99, "args": [ { "name": "backend", @@ -19917,8 +20043,8 @@ "git_config_add_backend": { "type": "function", "file": "sys/config.h", - "line": 105, - "lineto": 109, + "line": 119, + "lineto": 123, "args": [ { "name": "cfg", @@ -19948,7 +20074,7 @@ "comment": " 0 on success, GIT_EEXISTS when adding more than one file\n 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

\n", - "comments": "

Note that the configuration object will free the file\n automatically.

\n\n

Further queries on this config object will access each\n of the config file instances in order (instances with\n a higher priority level will be accessed first).

\n", + "comments": "

Note that the configuration object will free the file automatically.

\n\n

Further queries on this config object will access each of the config file instances in order (instances with a higher priority level will be accessed first).

\n", "group": "config" }, "git_diff_print_callback__to_buf": { @@ -19985,7 +20111,7 @@ "comment": null }, "description": "

Diff print callback that writes to a git_buf.

\n", - "comments": "

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You\n must pass a git_buf * value as the payload to the git_diff_print\n and/or git_patch_print function. The data will be appended to the\n buffer (after any existing content).

\n", + "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a git_buf buffer. You must pass a git_buf * value as the payload to the git_diff_print and/or git_patch_print function. The data will be appended to the buffer (after any existing content).

\n", "group": "diff" }, "git_diff_print_callback__to_file_handle": { @@ -20022,7 +20148,7 @@ "comment": null }, "description": "

Diff print callback that writes to stdio FILE handle.

\n", - "comments": "

This function is provided not for you to call it directly, but instead\n so you can use it as a function pointer to the git_diff_print or\n git_patch_print APIs. When using those APIs, you specify a callback\n to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You\n must pass a FILE * value (such as stdout or stderr or the return\n value from fopen()) as the payload to the git_diff_print\n and/or git_patch_print function. If you pass NULL, this will write\n data to stdout.

\n", + "comments": "

This function is provided not for you to call it directly, but instead so you can use it as a function pointer to the git_diff_print or git_patch_print APIs. When using those APIs, you specify a callback to actually handle the diff and/or patch data.

\n\n

Use this callback to easily write that data to a stdio FILE handle. You must pass a FILE * value (such as stdout or stderr or the return value from fopen()) as the payload to the git_diff_print and/or git_patch_print function. If you pass NULL, this will write data to stdout.

\n", "group": "diff" }, "git_diff_get_perfdata": { @@ -20135,7 +20261,7 @@ "comment": null }, "description": "

Create a new empty filter list

\n", - "comments": "

Normally you won't use this because git_filter_list_load will create\n the filter list for you, but you can use this in combination with the\n git_filter_lookup and git_filter_list_push functions to assemble\n your own chains of filters.

\n", + "comments": "

Normally you won't use this because git_filter_list_load will create the filter list for you, but you can use this in combination with the git_filter_lookup and git_filter_list_push functions to assemble your own chains of filters.

\n", "group": "filter" }, "git_filter_list_push": { @@ -20167,29 +20293,7 @@ "comment": null }, "description": "

Add a filter to a filter list with the given payload.

\n", - "comments": "

Normally you won't have to do this because the filter list is created\n by calling the "check" function on registered filters when the filter\n attributes are set, but this does allow more direct manipulation of\n filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the\n filter. Using this function, you can either pass in a payload if you\n know the expected payload format, or you can pass NULL. Some filters\n may fail with a NULL payload. Good luck!

\n", - "group": "filter" - }, - "git_filter_list_length": { - "type": "function", - "file": "sys/filter.h", - "line": 90, - "lineto": 90, - "args": [ - { - "name": "fl", - "type": "const git_filter_list *", - "comment": "A filter list" - } - ], - "argline": "const git_filter_list *fl", - "sig": "const git_filter_list *", - "return": { - "type": "size_t", - "comment": " The number of filters in the list" - }, - "description": "

Look up how many filters are in the list

\n", - "comments": "

We will attempt to apply all of these filters to any data passed in,\n but note that the filter apply action still has the option of skipping\n data that is passed in (for example, the CRLF filter will skip data\n that appears to be binary).

\n", + "comments": "

Normally you won't have to do this because the filter list is created by calling the "check" function on registered filters when the filter attributes are set, but this does allow more direct manipulation of filter lists when desired.

\n\n

Note that normally the "check" function can set up a payload for the filter. Using this function, you can either pass in a payload if you know the expected payload format, or you can pass NULL. Some filters may fail with a NULL payload. Good luck!

\n", "group": "filter" }, "git_filter_source_repo": { @@ -20327,8 +20431,8 @@ "git_filter_register": { "type": "function", "file": "sys/filter.h", - "line": 289, - "lineto": 290, + "line": 301, + "lineto": 302, "args": [ { "name": "name", @@ -20353,14 +20457,14 @@ "comment": " 0 on successful registry, error code \n<\n0 on failure" }, "description": "

Register a filter under a given name with a given priority.

\n", - "comments": "

As mentioned elsewhere, the initialize callback will not be invoked\n immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be\n issued in order of priority on smudge (to workdir), and in reverse\n order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2:\n - GIT_FILTER_CRLF with priority 0\n - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n", + "comments": "

As mentioned elsewhere, the initialize callback will not be invoked immediately. It is deferred until the filter is used in some way.

\n\n

A filter's attribute checks and check and apply callbacks will be issued in order of priority on smudge (to workdir), and in reverse order of priority on clean (to odb).

\n\n

Two filters are preregistered with libgit2: - GIT_FILTER_CRLF with priority 0 - GIT_FILTER_IDENT with priority 100

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", "group": "filter" }, "git_filter_unregister": { "type": "function", "file": "sys/filter.h", - "line": 305, - "lineto": 305, + "line": 317, + "lineto": 317, "args": [ { "name": "name", @@ -20375,46 +20479,9 @@ "comment": " 0 on success, error code \n<\n0 on failure" }, "description": "

Remove the filter with the given name

\n", - "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and\n will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or\n deregistering of filters must be done outside of any possible usage of\n the filters (i.e. during application setup or shutdown).

\n", + "comments": "

Attempting to remove the builtin libgit2 filters is not permitted and will return an error.

\n\n

Currently the filter registry is not thread safe, so any registering or deregistering of filters must be done outside of any possible usage of the filters (i.e. during application setup or shutdown).

\n", "group": "filter" }, - "git_hashsig_create": { - "type": "function", - "file": "sys/hashsig.h", - "line": 62, - "lineto": 66, - "args": [ - { - "name": "out", - "type": "git_hashsig **", - "comment": "The computed similarity signature." - }, - { - "name": "buf", - "type": "const char *", - "comment": "The input buffer." - }, - { - "name": "buflen", - "type": "size_t", - "comment": "The input buffer size." - }, - { - "name": "opts", - "type": "git_hashsig_option_t", - "comment": "The signature computation options (see above)." - } - ], - "argline": "git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts", - "sig": "git_hashsig **::const char *::size_t::git_hashsig_option_t", - "return": { - "type": "int", - "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." - }, - "description": "

Compute a similarity signature for a text buffer

\n", - "comments": "

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the\n whitespace will be removed from the buffer while it is being processed,\n modifying the buffer in place. Sorry about that!

\n", - "group": "hashsig" - }, "git_hashsig_create_fromfile": { "type": "function", "file": "sys/hashsig.h", @@ -20444,7 +20511,7 @@ "comment": " 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to\n compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or\n error code." }, "description": "

Compute a similarity signature for a text file

\n", - "comments": "

This walks through the file, only loading a maximum of 4K of file data at\n a time. Otherwise, it acts just like git_hashsig_create.

\n", + "comments": "

This walks through the file, only loading a maximum of 4K of file data at a time. Otherwise, it acts just like git_hashsig_create.

\n", "group": "hashsig" }, "git_hashsig_free": { @@ -20515,7 +20582,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "
Instantiate a new mempack backend.\n
\n", - "comments": "
The backend must be added to an existing ODB with the highest\npriority.\n\n    git_mempack_new(\n
\n\n

&mempacker\n);\n git_repository_odb(\n&odb\n, repository);\n git_odb_add_backend(odb, mempacker, 999);

\n\n
Once the backend has been loaded, all writes to the ODB will\ninstead be queued in memory, and can be finalized with\n`git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store\nto ensure consistency, until the memory store is dumped.\n
\n", + "comments": "
The backend must be added to an existing ODB with the highest   priority.\n\n    git_mempack_new(&mempacker);        git_repository_odb(&odb, repository);       git_odb_add_backend(odb, mempacker, 999);\n\nOnce the backend has been loaded, all writes to the ODB will    instead be queued in memory, and can be finalized with  `git_mempack_dump`.\n\nSubsequent reads will also be served from the in-memory store   to ensure consistency, until the memory store is dumped.\n
\n", "group": "mempack" }, "git_mempack_reset": { @@ -20537,14 +20604,14 @@ "comment": null }, "description": "
Reset the memory packer by clearing all the queued objects.\n
\n", - "comments": "
This assumes that `git_mempack_dump` has been called before to\nstore all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"\nall the recently written objects, giving transaction-like\nsemantics to the Git repository.\n
\n", + "comments": "
This assumes that `git_mempack_dump` has been called before to  store all the queued objects into a single packfile.\n\nAlternatively, call `reset` without a previous dump to "undo"   all the recently written objects, giving transaction-like   semantics to the Git repository.\n
\n", "group": "mempack" }, "git_odb_init_backend": { "type": "function", "file": "sys/odb_backend.h", - "line": 100, - "lineto": 102, + "line": 104, + "lineto": 106, "args": [ { "name": "backend", @@ -20580,14 +20647,14 @@ "comment": " 0 on success, -1 if there are errors or if libgit2 was not\n built with OpenSSL and threading support." }, "description": "

Initialize the OpenSSL locks

\n", - "comments": "

OpenSSL requires the application to determine how it performs\n locking.

\n\n

This is a last-resort convenience function which libgit2 provides for\n allocating and initializing the locks as well as setting the\n locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed\n when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it\n likely sets up locking. You should very strongly prefer that over\n this function.

\n", + "comments": "

OpenSSL requires the application to determine how it performs locking.

\n\n

This is a last-resort convenience function which libgit2 provides for allocating and initializing the locks as well as setting the locking function to use the system's native locking functions.

\n\n

The locking function will be cleared and the memory will be freed when you call git_threads_sutdown().

\n\n

If your programming language has an OpenSSL package/bindings, it likely sets up locking. You should very strongly prefer that over this function.

\n", "group": "openssl" }, "git_refdb_init_backend": { "type": "function", "file": "sys/refdb_backend.h", - "line": 182, - "lineto": 184, + "line": 183, + "lineto": 185, "args": [ { "name": "backend", @@ -20613,8 +20680,8 @@ "git_refdb_backend_fs": { "type": "function", "file": "sys/refdb_backend.h", - "line": 197, - "lineto": 199, + "line": 198, + "lineto": 200, "args": [ { "name": "backend_out", @@ -20634,14 +20701,14 @@ "comment": " 0 on success, \n<\n0 error code on failure" }, "description": "

Constructors for default filesystem-based refdb backend

\n", - "comments": "

Under normal usage, this is called for you when the repository is\n opened / created, but you can use this to explicitly construct a\n filesystem refdb backend for a repository.

\n", + "comments": "

Under normal usage, this is called for you when the repository is opened / created, but you can use this to explicitly construct a filesystem refdb backend for a repository.

\n", "group": "refdb" }, "git_refdb_set_backend": { "type": "function", "file": "sys/refdb_backend.h", - "line": 211, - "lineto": 213, + "line": 212, + "lineto": 214, "args": [ { "name": "refdb", @@ -20661,7 +20728,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "

Sets the custom backend to an existing reference DB

\n", - "comments": "

The git_refdb will take ownership of the git_refdb_backend so you\n should NOT free it after calling this function.

\n", + "comments": "

The git_refdb will take ownership of the git_refdb_backend so you should NOT free it after calling this function.

\n", "group": "refdb" }, "git_reference__alloc": { @@ -20742,7 +20809,7 @@ "comment": " 0 on success, or an error code" }, "description": "

Create a new repository with neither backends nor config object

\n", - "comments": "

Note that this is only useful if you wish to associate the repository\n with a non-filesystem-backed object database and config store.

\n", + "comments": "

Note that this is only useful if you wish to associate the repository with a non-filesystem-backed object database and config store.

\n", "group": "repository" }, "git_repository__cleanup": { @@ -20764,7 +20831,7 @@ "comment": null }, "description": "

Reset all the internal state in a repository.

\n", - "comments": "

This will free all the mapped memory and internal objects\n of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're\n trying to aggressively cleanup the repo before its\n deallocation. git_repository_free already performs this operation\n before deallocation the repo.

\n", + "comments": "

This will free all the mapped memory and internal objects of the repository and leave it in a "blank" state.

\n\n

There's no need to call this function directly unless you're trying to aggressively cleanup the repo before its deallocation. git_repository_free already performs this operation before deallocation the repo.

\n", "group": "repository" }, "git_repository_reinit_filesystem": { @@ -20791,7 +20858,7 @@ "comment": " 0 on success, \n<\n 0 on error" }, "description": "

Update the filesystem config settings for an open repository

\n", - "comments": "

When a repository is initialized, config values are set based on the\n properties of the filesystem that the repository is on, such as\n "core.ignorecase", "core.filemode", "core.symlinks", etc. If the\n repository is moved to a new filesystem, these properties may no\n longer be correct and API calls may not behave as expected. This\n call reruns the phase of repository initialization that sets those\n properties to compensate for the current filesystem of the repo.

\n", + "comments": "

When a repository is initialized, config values are set based on the properties of the filesystem that the repository is on, such as "core.ignorecase", "core.filemode", "core.symlinks", etc. If the repository is moved to a new filesystem, these properties may no longer be correct and API calls may not behave as expected. This call reruns the phase of repository initialization that sets those properties to compensate for the current filesystem of the repo.

\n", "group": "repository" }, "git_repository_set_config": { @@ -20818,7 +20885,7 @@ "comment": null }, "description": "

Set the configuration file for this repository

\n", - "comments": "

This configuration file will be used for all configuration\n queries involving this repository.

\n\n

The repository will keep a reference to the config file;\n the user must still free the config after setting it\n to the repository, or it will leak.

\n", + "comments": "

This configuration file will be used for all configuration queries involving this repository.

\n\n

The repository will keep a reference to the config file; the user must still free the config after setting it to the repository, or it will leak.

\n", "group": "repository" }, "git_repository_set_odb": { @@ -20845,7 +20912,7 @@ "comment": null }, "description": "

Set the Object Database for this repository

\n", - "comments": "

The ODB will be used for all object-related operations\n involving this repository.

\n\n

The repository will keep a reference to the ODB; the user\n must still free the ODB object after setting it to the\n repository, or it will leak.

\n", + "comments": "

The ODB will be used for all object-related operations involving this repository.

\n\n

The repository will keep a reference to the ODB; the user must still free the ODB object after setting it to the repository, or it will leak.

\n", "group": "repository" }, "git_repository_set_refdb": { @@ -20872,7 +20939,7 @@ "comment": null }, "description": "

Set the Reference Database Backend for this repository

\n", - "comments": "

The refdb will be used for all reference related operations\n involving this repository.

\n\n

The repository will keep a reference to the refdb; the user\n must still free the refdb object after setting it to the\n repository, or it will leak.

\n", + "comments": "

The refdb will be used for all reference related operations involving this repository.

\n\n

The repository will keep a reference to the refdb; the user must still free the refdb object after setting it to the repository, or it will leak.

\n", "group": "repository" }, "git_repository_set_index": { @@ -20899,7 +20966,7 @@ "comment": null }, "description": "

Set the index file for this repository

\n", - "comments": "

This index will be used for all index-related operations\n involving this repository.

\n\n

The repository will keep a reference to the index file;\n the user must still free the index after setting it\n to the repository, or it will leak.

\n", + "comments": "

This index will be used for all index-related operations involving this repository.

\n\n

The repository will keep a reference to the index file; the user must still free the index after setting it to the repository, or it will leak.

\n", "group": "repository" }, "git_repository_set_bare": { @@ -20921,14 +20988,36 @@ "comment": " 0 on success, \n<\n0 on failure" }, "description": "

Set a repository to be bare.

\n", - "comments": "

Clear the working directory and set core.bare to true. You may also\n want to call git_repository_set_index(repo, NULL) since a bare repo\n typically does not have an index, but this function will not do that\n for you.

\n", + "comments": "

Clear the working directory and set core.bare to true. You may also want to call git_repository_set_index(repo, NULL) since a bare repo typically does not have an index, but this function will not do that for you.

\n", "group": "repository" }, + "git_stream_register_tls": { + "type": "function", + "file": "sys/stream.h", + "line": 53, + "lineto": 53, + "args": [ + { + "name": "ctor", + "type": "git_stream_cb", + "comment": "the constructor to use" + } + ], + "argline": "git_stream_cb ctor", + "sig": "git_stream_cb", + "return": { + "type": "int", + "comment": " 0 or an error code" + }, + "description": "

Register a TLS stream constructor for the library to use

\n", + "comments": "

If a constructor is already set, it will be overwritten. Pass NULL in order to deregister the current constructor.

\n", + "group": "stream" + }, "git_transport_init": { "type": "function", "file": "sys/transport.h", - "line": 111, - "lineto": 113, + "line": 117, + "lineto": 119, "args": [ { "name": "opts", @@ -20954,8 +21043,8 @@ "git_transport_new": { "type": "function", "file": "sys/transport.h", - "line": 125, - "lineto": 125, + "line": 131, + "lineto": 131, "args": [ { "name": "out", @@ -20986,8 +21075,8 @@ "git_transport_ssh_with_paths": { "type": "function", "file": "sys/transport.h", - "line": 141, - "lineto": 141, + "line": 147, + "lineto": 147, "args": [ { "name": "out", @@ -21012,14 +21101,14 @@ "comment": " 0 or an error code" }, "description": "

Create an ssh transport with custom git command paths

\n", - "comments": "

This is a factory function suitable for setting as the transport\n callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for\n the git-upload-pack and git-receive-pack at index 0 and 1.

\n", + "comments": "

This is a factory function suitable for setting as the transport callback in a remote (or for a clone in the options).

\n\n

The payload argument must be a strarray pointer with the paths for the git-upload-pack and git-receive-pack at index 0 and 1.

\n", "group": "transport" }, "git_transport_unregister": { "type": "function", "file": "sys/transport.h", - "line": 169, - "lineto": 170, + "line": 175, + "lineto": 176, "args": [ { "name": "prefix", @@ -21040,8 +21129,8 @@ "git_transport_dummy": { "type": "function", "file": "sys/transport.h", - "line": 183, - "lineto": 186, + "line": 189, + "lineto": 192, "args": [ { "name": "out", @@ -21072,8 +21161,8 @@ "git_transport_local": { "type": "function", "file": "sys/transport.h", - "line": 196, - "lineto": 199, + "line": 202, + "lineto": 205, "args": [ { "name": "out", @@ -21104,8 +21193,8 @@ "git_transport_smart": { "type": "function", "file": "sys/transport.h", - "line": 209, - "lineto": 212, + "line": 215, + "lineto": 218, "args": [ { "name": "out", @@ -21133,11 +21222,48 @@ "comments": "", "group": "transport" }, + "git_transport_smart_certificate_check": { + "type": "function", + "file": "sys/transport.h", + "line": 229, + "lineto": 229, + "args": [ + { + "name": "transport", + "type": "git_transport *", + "comment": "a smart transport" + }, + { + "name": "cert", + "type": "git_cert *", + "comment": "the certificate to pass to the caller" + }, + { + "name": "valid", + "type": "int", + "comment": "whether we believe the certificate is valid" + }, + { + "name": "hostname", + "type": "const char *", + "comment": "the hostname we connected to" + } + ], + "argline": "git_transport *transport, git_cert *cert, int valid, const char *hostname", + "sig": "git_transport *::git_cert *::int::const char *", + "return": { + "type": "int", + "comment": " the return value of the callback" + }, + "description": "

Call the certificate check for this transport.

\n", + "comments": "", + "group": "transport" + }, "git_smart_subtransport_http": { "type": "function", "file": "sys/transport.h", - "line": 322, - "lineto": 325, + "line": 350, + "lineto": 353, "args": [ { "name": "out", @@ -21168,8 +21294,8 @@ "git_smart_subtransport_git": { "type": "function", "file": "sys/transport.h", - "line": 334, - "lineto": 337, + "line": 362, + "lineto": 365, "args": [ { "name": "out", @@ -21200,8 +21326,8 @@ "git_smart_subtransport_ssh": { "type": "function", "file": "sys/transport.h", - "line": 346, - "lineto": 349, + "line": 374, + "lineto": 377, "args": [ { "name": "out", @@ -21262,7 +21388,7 @@ "group": "tag", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_tag_lookup-70" + "ex/v0.24.1/general.html#git_tag_lookup-70" ] } }, @@ -21322,7 +21448,7 @@ "comment": null }, "description": "

Close an open tag

\n", - "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to\n release memory. Failure to do so will cause a memory leak.

\n", + "comments": "

You can no longer use the git_tag pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you are through with a tag to release memory. Failure to do so will cause a memory leak.

\n", "group": "tag" }, "git_tag_id": { @@ -21393,11 +21519,11 @@ "comment": " 0 or an error code" }, "description": "

Get the tagged object of a tag

\n", - "comments": "

This method performs a repository lookup for the\n given object and returns it

\n", + "comments": "

This method performs a repository lookup for the given object and returns it

\n", "group": "tag", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_tag_target-71" + "ex/v0.24.1/general.html#git_tag_target-71" ] } }, @@ -21424,7 +21550,7 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tag_target_id-35" + "ex/v0.24.1/cat-file.html#git_tag_target_id-35" ] } }, @@ -21451,10 +21577,10 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tag_target_type-36" + "ex/v0.24.1/cat-file.html#git_tag_target_type-36" ], "general.c": [ - "ex/v0.23.2/general.html#git_tag_target_type-72" + "ex/v0.24.1/general.html#git_tag_target_type-72" ] } }, @@ -21481,13 +21607,13 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tag_name-37" + "ex/v0.24.1/cat-file.html#git_tag_name-37" ], "general.c": [ - "ex/v0.23.2/general.html#git_tag_name-73" + "ex/v0.24.1/general.html#git_tag_name-73" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_name-20" + "ex/v0.24.1/tag.html#git_tag_name-20" ] } }, @@ -21514,7 +21640,7 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tag_tagger-38" + "ex/v0.24.1/cat-file.html#git_tag_tagger-38" ] } }, @@ -21541,14 +21667,14 @@ "group": "tag", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tag_message-39", - "ex/v0.23.2/cat-file.html#git_tag_message-40" + "ex/v0.24.1/cat-file.html#git_tag_message-39", + "ex/v0.24.1/cat-file.html#git_tag_message-40" ], "general.c": [ - "ex/v0.23.2/general.html#git_tag_message-74" + "ex/v0.24.1/general.html#git_tag_message-74" ], "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_message-21" + "ex/v0.24.1/tag.html#git_tag_message-21" ] } }, @@ -21601,11 +21727,11 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA tag object is written to the ODB, and a proper reference\n\tis written in the /refs/tags folder, pointing to it" }, "description": "

Create a new tag in the repository from an object

\n", - "comments": "

A new reference will also be created pointing to\n this tag object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid\n the characters '~', '^', ':', '\n\\\n', '?', '[', and '*', and the\n sequences ".." and "\n@\n{" which have special meaning to revparse.

\n", + "comments": "

A new reference will also be created pointing to this tag object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n\n

The tag name will be checked for validity. You must avoid the characters '~', '^', ':', '\\', '?', '[', and '*', and the sequences ".." and "@{" which have special meaning to revparse.

\n", "group": "tag", "examples": { "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_create-22" + "ex/v0.24.1/tag.html#git_tag_create-22" ] } }, @@ -21653,7 +21779,7 @@ "comment": " 0 on success or an error code" }, "description": "

Create a new tag in the object database pointing to a git_object

\n", - "comments": "

The message will not be cleaned up. This can be achieved\n through git_message_prettify().

\n", + "comments": "

The message will not be cleaned up. This can be achieved through git_message_prettify().

\n", "group": "tag" }, "git_tag_create_frombuffer": { @@ -21732,11 +21858,11 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code\n\tA proper reference is written in the /refs/tags folder,\n pointing to the provided target object" }, "description": "

Create a new lightweight tag pointing at a target object

\n", - "comments": "

A new direct reference will be created pointing to\n this target object. If force is true and a reference\n already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

A new direct reference will be created pointing to this target object. If force is true and a reference already exists with the given name, it'll be replaced.

\n\n

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "tag", "examples": { "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_create_lightweight-23" + "ex/v0.24.1/tag.html#git_tag_create_lightweight-23" ] } }, @@ -21764,11 +21890,11 @@ "comment": " 0 on success, GIT_EINVALIDSPEC or an error code" }, "description": "

Delete an existing tag reference.

\n", - "comments": "

The tag name will be checked for validity.\n See git_tag_create() for rules about valid names.

\n", + "comments": "

The tag name will be checked for validity. See git_tag_create() for rules about valid names.

\n", "group": "tag", "examples": { "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_delete-24" + "ex/v0.24.1/tag.html#git_tag_delete-24" ] } }, @@ -21796,7 +21922,7 @@ "comment": " 0 or an error code" }, "description": "

Fill a list with all the tags in the Repository

\n", - "comments": "

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n", + "comments": "

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", "group": "tag" }, "git_tag_list_match": { @@ -21828,11 +21954,11 @@ "comment": " 0 or an error code" }, "description": "

Fill a list with all the tags in the Repository\n which name match a defined pattern

\n", - "comments": "

If an empty pattern is provided, all the tags\n will be returned.

\n\n

The string array will be filled with the names of the\n matching tags; these values are owned by the user and\n should be free'd manually when no longer needed, using\n git_strarray_free.

\n", + "comments": "

If an empty pattern is provided, all the tags will be returned.

\n\n

The string array will be filled with the names of the matching tags; these values are owned by the user and should be free'd manually when no longer needed, using git_strarray_free.

\n", "group": "tag", "examples": { "tag.c": [ - "ex/v0.23.2/tag.html#git_tag_list_match-25" + "ex/v0.24.1/tag.html#git_tag_list_match-25" ] } }, @@ -21892,7 +22018,7 @@ "comment": " 0 or an error code" }, "description": "

Recursively peel a tag until a non tag git_object is found

\n", - "comments": "

The retrieved tag_target object is owned by the repository\n and should be closed with the git_object_free method.

\n", + "comments": "

The retrieved tag_target object is owned by the repository and should be closed with the git_object_free method.

\n", "group": "tag" }, "git_trace_set": { @@ -21925,8 +22051,8 @@ "git_cred_has_username": { "type": "function", "file": "transport.h", - "line": 197, - "lineto": 197, + "line": 190, + "lineto": 190, "args": [ { "name": "cred", @@ -21947,8 +22073,8 @@ "git_cred_userpass_plaintext_new": { "type": "function", "file": "transport.h", - "line": 208, - "lineto": 211, + "line": 201, + "lineto": 204, "args": [ { "name": "out", @@ -21979,8 +22105,8 @@ "git_cred_ssh_key_new": { "type": "function", "file": "transport.h", - "line": 224, - "lineto": 229, + "line": 217, + "lineto": 222, "args": [ { "name": "out", @@ -22021,8 +22147,8 @@ "git_cred_ssh_interactive_new": { "type": "function", "file": "transport.h", - "line": 240, - "lineto": 244, + "line": 233, + "lineto": 237, "args": [ { "name": "out", @@ -22058,8 +22184,8 @@ "git_cred_ssh_key_from_agent": { "type": "function", "file": "transport.h", - "line": 254, - "lineto": 256, + "line": 247, + "lineto": 249, "args": [ { "name": "out", @@ -22085,8 +22211,8 @@ "git_cred_ssh_custom_new": { "type": "function", "file": "transport.h", - "line": 276, - "lineto": 282, + "line": 269, + "lineto": 275, "args": [ { "name": "out", @@ -22126,14 +22252,14 @@ "comment": " 0 for success or an error code for failure" }, "description": "

Create an ssh key credential with a custom signing function.

\n", - "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness\n and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", + "comments": "

This lets you use your own function to sign the challenge.

\n\n

This function and its credential type is provided for completeness and wraps libssh2_userauth_publickey(), which is undocumented.

\n\n

The supplied credential parameter will be internally duplicated.

\n", "group": "cred" }, "git_cred_default_new": { "type": "function", "file": "transport.h", - "line": 290, - "lineto": 290, + "line": 283, + "lineto": 283, "args": [ { "name": "out", @@ -22154,8 +22280,8 @@ "git_cred_username_new": { "type": "function", "file": "transport.h", - "line": 298, - "lineto": 298, + "line": 291, + "lineto": 291, "args": [ { "name": "cred", @@ -22175,14 +22301,14 @@ "comment": null }, "description": "

Create a credential to specify a username.

\n", - "comments": "

This is used with ssh authentication to query for the username if\n none is specified in the url.

\n", + "comments": "

This is used with ssh authentication to query for the username if none is specified in the url.

\n", "group": "cred" }, "git_cred_ssh_key_memory_new": { "type": "function", "file": "transport.h", - "line": 310, - "lineto": 315, + "line": 303, + "lineto": 308, "args": [ { "name": "out", @@ -22220,6 +22346,28 @@ "comments": "", "group": "cred" }, + "git_cred_free": { + "type": "function", + "file": "transport.h", + "line": 319, + "lineto": 319, + "args": [ + { + "name": "cred", + "type": "git_cred *", + "comment": "the object to free" + } + ], + "argline": "git_cred *cred", + "sig": "git_cred *", + "return": { + "type": "void", + "comment": null + }, + "description": "

Free a credential.

\n", + "comments": "

This is only necessary if you own the object; that is, if you are a transport.

\n", + "group": "cred" + }, "git_tree_lookup": { "type": "function", "file": "tree.h", @@ -22253,11 +22401,11 @@ "group": "tree", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_tree_lookup-75", - "ex/v0.23.2/general.html#git_tree_lookup-76" + "ex/v0.24.1/general.html#git_tree_lookup-75", + "ex/v0.24.1/general.html#git_tree_lookup-76" ], "init.c": [ - "ex/v0.23.2/init.html#git_tree_lookup-14" + "ex/v0.24.1/init.html#git_tree_lookup-14" ] } }, @@ -22317,22 +22465,22 @@ "comment": null }, "description": "

Close an open tree

\n", - "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to\n release memory. Failure to do so will cause a memory leak.

\n", + "comments": "

You can no longer use the git_tree pointer after this call.

\n\n

IMPORTANT: You MUST call this method when you stop using a tree to release memory. Failure to do so will cause a memory leak.

\n", "group": "tree", "examples": { "diff.c": [ - "ex/v0.23.2/diff.html#git_tree_free-17", - "ex/v0.23.2/diff.html#git_tree_free-18" + "ex/v0.24.1/diff.html#git_tree_free-17", + "ex/v0.24.1/diff.html#git_tree_free-18" ], "init.c": [ - "ex/v0.23.2/init.html#git_tree_free-15" + "ex/v0.24.1/init.html#git_tree_free-15" ], "log.c": [ - "ex/v0.23.2/log.html#git_tree_free-58", - "ex/v0.23.2/log.html#git_tree_free-59", - "ex/v0.23.2/log.html#git_tree_free-60", - "ex/v0.23.2/log.html#git_tree_free-61", - "ex/v0.23.2/log.html#git_tree_free-62" + "ex/v0.24.1/log.html#git_tree_free-58", + "ex/v0.24.1/log.html#git_tree_free-59", + "ex/v0.24.1/log.html#git_tree_free-60", + "ex/v0.24.1/log.html#git_tree_free-61", + "ex/v0.24.1/log.html#git_tree_free-62" ] } }, @@ -22403,10 +22551,10 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entrycount-41" + "ex/v0.24.1/cat-file.html#git_tree_entrycount-41" ], "general.c": [ - "ex/v0.23.2/general.html#git_tree_entrycount-77" + "ex/v0.24.1/general.html#git_tree_entrycount-77" ] } }, @@ -22434,11 +22582,11 @@ "comment": " the tree entry; NULL if not found" }, "description": "

Lookup a tree entry by its filename

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", "group": "tree", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_tree_entry_byname-78" + "ex/v0.24.1/general.html#git_tree_entry_byname-78" ] } }, @@ -22466,14 +22614,14 @@ "comment": " the tree entry; NULL if not found" }, "description": "

Lookup a tree entry by its position in the tree

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n", "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entry_byindex-42" + "ex/v0.24.1/cat-file.html#git_tree_entry_byindex-42" ], "general.c": [ - "ex/v0.23.2/general.html#git_tree_entry_byindex-79" + "ex/v0.24.1/general.html#git_tree_entry_byindex-79" ] } }, @@ -22501,7 +22649,7 @@ "comment": " the tree entry; NULL if not found" }, "description": "

Lookup a tree entry by SHA value.

\n", - "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't\n have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", + "comments": "

This returns a git_tree_entry that is owned by the git_tree. You don't have to free it, but you must not use it after the git_tree is released.

\n\n

Warning: this must examine every entry in the tree, so it is not fast.

\n", "group": "tree" }, "git_tree_entry_bypath": { @@ -22533,7 +22681,7 @@ "comment": " 0 on success; GIT_ENOTFOUND if the path does not exist" }, "description": "

Retrieve a tree entry contained in a tree or in any of its subtrees,\n given its relative path.

\n", - "comments": "

Unlike the other lookup functions, the returned tree entry is owned by\n the user and must be freed explicitly with git_tree_entry_free().

\n", + "comments": "

Unlike the other lookup functions, the returned tree entry is owned by the user and must be freed explicitly with git_tree_entry_free().

\n", "group": "tree" }, "git_tree_entry_dup": { @@ -22560,7 +22708,7 @@ "comment": " 0 or an error code" }, "description": "

Duplicate a tree entry

\n", - "comments": "

Create a copy of a tree entry. The returned copy is owned by the user,\n and must be freed explicitly with git_tree_entry_free().

\n", + "comments": "

Create a copy of a tree entry. The returned copy is owned by the user, and must be freed explicitly with git_tree_entry_free().

\n", "group": "tree" }, "git_tree_entry_free": { @@ -22582,7 +22730,7 @@ "comment": null }, "description": "

Free a user-owned tree entry

\n", - "comments": "

IMPORTANT: This function is only needed for tree entries owned by the\n user, such as the ones returned by git_tree_entry_dup() or\n git_tree_entry_bypath().

\n", + "comments": "

IMPORTANT: This function is only needed for tree entries owned by the user, such as the ones returned by git_tree_entry_dup() or git_tree_entry_bypath().

\n", "group": "tree" }, "git_tree_entry_name": { @@ -22608,11 +22756,11 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entry_name-43" + "ex/v0.24.1/cat-file.html#git_tree_entry_name-43" ], "general.c": [ - "ex/v0.23.2/general.html#git_tree_entry_name-80", - "ex/v0.23.2/general.html#git_tree_entry_name-81" + "ex/v0.24.1/general.html#git_tree_entry_name-80", + "ex/v0.24.1/general.html#git_tree_entry_name-81" ] } }, @@ -22639,7 +22787,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entry_id-44" + "ex/v0.24.1/cat-file.html#git_tree_entry_id-44" ] } }, @@ -22666,7 +22814,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entry_type-45" + "ex/v0.24.1/cat-file.html#git_tree_entry_type-45" ] } }, @@ -22693,7 +22841,7 @@ "group": "tree", "examples": { "cat-file.c": [ - "ex/v0.23.2/cat-file.html#git_tree_entry_filemode-46" + "ex/v0.24.1/cat-file.html#git_tree_entry_filemode-46" ] } }, @@ -22716,7 +22864,7 @@ "comment": " filemode as an integer" }, "description": "

Get the raw UNIX file attributes of a tree entry

\n", - "comments": "

This function does not perform any normalization and is only useful\n if you need to be able to recreate the original tree object.

\n", + "comments": "

This function does not perform any normalization and is only useful if you need to be able to recreate the original tree object.

\n", "group": "tree" }, "git_tree_entry_cmp": { @@ -22779,7 +22927,7 @@ "group": "tree", "examples": { "general.c": [ - "ex/v0.23.2/general.html#git_tree_entry_to_object-82" + "ex/v0.24.1/general.html#git_tree_entry_to_object-82" ] } }, @@ -22812,7 +22960,7 @@ "comment": " 0 on success; error code otherwise" }, "description": "

Create a new tree builder.

\n", - "comments": "

The tree builder can be used to create or modify trees in memory and\n write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be\n initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no\n entries and will have to be filled manually.

\n", + "comments": "

The tree builder can be used to create or modify trees in memory and write them as tree objects to the database.

\n\n

If the source parameter is not NULL, the tree builder will be initialized with the entries of the given tree.

\n\n

If the source parameter is NULL, the tree builder will start with no entries and will have to be filled manually.

\n", "group": "treebuilder" }, "git_treebuilder_clear": { @@ -22878,7 +23026,7 @@ "comment": null }, "description": "

Free a tree builder

\n", - "comments": "

This will clear all the entries and free to builder.\n Failing to free the builder after you're done using it\n will result in a memory leak

\n", + "comments": "

This will clear all the entries and free to builder. Failing to free the builder after you're done using it will result in a memory leak

\n", "group": "treebuilder" }, "git_treebuilder_get": { @@ -22905,7 +23053,7 @@ "comment": " pointer to the entry; NULL if not found" }, "description": "

Get an entry from the builder from its filename

\n", - "comments": "

The returned entry is owned by the builder and should\n not be freed manually.

\n", + "comments": "

The returned entry is owned by the builder and should not be freed manually.

\n", "group": "treebuilder" }, "git_treebuilder_insert": { @@ -22947,7 +23095,7 @@ "comment": " 0 or an error code" }, "description": "

Add or update an entry to the builder

\n", - "comments": "

Insert a new entry for filename in the builder with the\n given attributes.

\n\n

If an entry named filename already exists, its attributes\n will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the\n newly created/updated entry. Pass NULL if you do not need it. The\n pointer may not be valid past the next operation in this\n builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points\n to an existing git object in the object database, nor that the\n attributes make sense regarding the type of the pointed at object.

\n", + "comments": "

Insert a new entry for filename in the builder with the given attributes.

\n\n

If an entry named filename already exists, its attributes will be updated with the given ones.

\n\n

The optional pointer out can be used to retrieve a pointer to the newly created/updated entry. Pass NULL if you do not need it. The pointer may not be valid past the next operation in this builder. Duplicate the entry if you want to keep it.

\n\n

No attempt is being made to ensure that the provided oid points to an existing git object in the object database, nor that the attributes make sense regarding the type of the pointed at object.

\n", "group": "treebuilder" }, "git_treebuilder_remove": { @@ -23006,7 +23154,7 @@ "comment": null }, "description": "

Selectively remove entries in the tree

\n", - "comments": "

The filter callback will be called for each entry in the tree with a\n pointer to the entry and the provided payload; if the callback returns\n non-zero, the entry will be filtered (removed from the builder).

\n", + "comments": "

The filter callback will be called for each entry in the tree with a pointer to the entry and the provided payload; if the callback returns non-zero, the entry will be filtered (removed from the builder).

\n", "group": "treebuilder" }, "git_treebuilder_write": { @@ -23033,7 +23181,7 @@ "comment": " 0 or an error code" }, "description": "

Write the contents of the tree builder as a tree object

\n", - "comments": "

The tree builder will be written to the given repo, and its\n identifying SHA1 hash will be stored in the id pointer.

\n", + "comments": "

The tree builder will be written to the given repo, and its identifying SHA1 hash will be stored in the id pointer.

\n", "group": "treebuilder" }, "git_tree_walk": { @@ -23070,7 +23218,7 @@ "comment": " 0 or an error code" }, "description": "

Traverse the entries in a tree and its subtrees in post or pre order.

\n", - "comments": "

The entries will be traversed in the specified order, children subtrees\n will be automatically loaded as required, and the callback will be\n called once per entry with the current (relative) root for the entry and\n the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be\n skipped on the traversal (in pre mode). A negative value stops the walk.

\n", + "comments": "

The entries will be traversed in the specified order, children subtrees will be automatically loaded as required, and the callback will be called once per entry with the current (relative) root for the entry and the entry data itself.

\n\n

If the callback returns a positive value, the passed entry will be skipped on the traversal (in pre mode). A negative value stops the walk.

\n", "group": "tree" } }, @@ -23222,7 +23370,7 @@ "comment": " 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code" }, "description": "

The signature of a function matching git_remote_create, with an additional\n void* as a callback payload.

\n", - "comments": "

Callers of git_clone may provide a function matching this signature to override\n the remote creation and customization process during a clone operation.

\n" + "comments": "

Callers of git_clone may provide a function matching this signature to override the remote creation and customization process during a clone operation.

\n" }, "git_repository_create_cb": { "type": "callback", @@ -23258,13 +23406,13 @@ "comment": " 0, or a negative value to indicate error" }, "description": "

The signature of a function matchin git_repository_init, with an\n aditional void * as callback payload.

\n", - "comments": "

Callers of git_clone my provide a function matching this signature\n to override the repository creation and customization process\n during a clone operation.

\n" + "comments": "

Callers of git_clone my provide a function matching this signature to override the repository creation and customization process during a clone operation.

\n" }, "git_diff_notify_cb": { "type": "callback", "file": "diff.h", - "line": 343, - "lineto": 347, + "line": 347, + "lineto": 351, "args": [ { "name": "diff_so_far", @@ -23294,13 +23442,49 @@ "comment": null }, "description": "

Diff notification callback function.

\n", - "comments": "

The callback will be called for each file, just before the git_delta_t\n gets inserted into the diff.

\n\n

When the callback:\n - returns \n<\n 0, the diff process will be aborted.\n - returns > 0, the delta will not be inserted into the diff, but the\n diff process continues.\n - returns 0, the delta is inserted into the diff, and the diff process\n continues.

\n" + "comments": "

The callback will be called for each file, just before the git_delta_t gets inserted into the diff.

\n\n

When the callback: - returns < 0, the diff process will be aborted. - returns > 0, the delta will not be inserted into the diff, but the diff process continues. - returns 0, the delta is inserted into the diff, and the diff process continues.

\n" + }, + "git_diff_progress_cb": { + "type": "callback", + "file": "diff.h", + "line": 363, + "lineto": 367, + "args": [ + { + "name": "diff_so_far", + "type": "const git_diff *", + "comment": "The diff being generated." + }, + { + "name": "old_path", + "type": "const char *", + "comment": "The path to the old file or NULL." + }, + { + "name": "new_path", + "type": "const char *", + "comment": "The path to the new file or NULL." + }, + { + "name": "payload", + "type": "void *", + "comment": null + } + ], + "argline": "const git_diff *diff_so_far, const char *old_path, const char *new_path, void *payload", + "sig": "const git_diff *::const char *::const char *::void *", + "return": { + "type": "int", + "comment": " Non-zero to abort the diff." + }, + "description": "

Diff progress callback.

\n", + "comments": "

Called before each file comparison.

\n" }, "git_diff_file_cb": { "type": "callback", "file": "diff.h", - "line": 423, - "lineto": 426, + "line": 446, + "lineto": 449, "args": [ { "name": "delta", @@ -23330,8 +23514,8 @@ "git_diff_binary_cb": { "type": "callback", "file": "diff.h", - "line": 470, - "lineto": 473, + "line": 493, + "lineto": 496, "args": [ { "name": "delta", @@ -23361,8 +23545,8 @@ "git_diff_hunk_cb": { "type": "callback", "file": "diff.h", - "line": 490, - "lineto": 493, + "line": 513, + "lineto": 516, "args": [ { "name": "delta", @@ -23392,8 +23576,8 @@ "git_diff_line_cb": { "type": "callback", "file": "diff.h", - "line": 543, - "lineto": 547, + "line": 566, + "lineto": 570, "args": [ { "name": "delta", @@ -23423,7 +23607,7 @@ "comment": null }, "description": "

When iterating over a diff, callback that will be made per text diff\n line. In this context, the provided range will be NULL.

\n", - "comments": "

When printing a diff, callback that will be made to output each line\n of text. This uses some extra GIT_DIFF_LINE_... constants for output\n of lines of file and hunk headers.

\n" + "comments": "

When printing a diff, callback that will be made to output each line of text. This uses some extra GIT_DIFF_LINE_... constants for output of lines of file and hunk headers.

\n" }, "git_index_matched_path_cb": { "type": "callback", @@ -23511,7 +23695,7 @@ "comment": null }, "description": "

Callback for git_note_foreach.

\n", - "comments": "

Receives:\n - blob_id: Oid of the blob containing the message\n - annotated_object_id: Oid of the git object being annotated\n - payload: Payload data passed to git_note_foreach

\n" + "comments": "

Receives: - blob_id: Oid of the blob containing the message - annotated_object_id: Oid of the git object being annotated - payload: Payload data passed to git_note_foreach

\n" }, "git_odb_foreach_cb": { "type": "callback", @@ -23599,13 +23783,13 @@ "comment": null }, "description": "

git2/remote.h

\n", - "comments": "

@\n{

\n" + "comments": "

@{

\n" }, "git_push_transfer_progress": { "type": "callback", "file": "remote.h", - "line": 332, - "lineto": 336, + "line": 333, + "lineto": 337, "args": [ { "name": "current", @@ -23640,8 +23824,8 @@ "git_push_negotiation": { "type": "callback", "file": "remote.h", - "line": 365, - "lineto": 365, + "line": 366, + "lineto": 366, "args": [ { "name": "updates", @@ -23787,11 +23971,42 @@ "description": "

Function pointer to receive status on individual files

\n", "comments": "

path is the relative path to the file from the root of the repository.

\n\n

status_flags is a combination of git_status_t values that apply.

\n\n

payload is the value you passed to the foreach function as payload.

\n" }, + "git_submodule_cb": { + "type": "callback", + "file": "submodule.h", + "line": 118, + "lineto": 119, + "args": [ + { + "name": "sm", + "type": "git_submodule *", + "comment": "git_submodule currently being visited" + }, + { + "name": "name", + "type": "const char *", + "comment": "name of the submodule" + }, + { + "name": "payload", + "type": "void *", + "comment": "value you passed to the foreach function as payload" + } + ], + "argline": "git_submodule *sm, const char *name, void *payload", + "sig": "git_submodule *::const char *::void *", + "return": { + "type": "int", + "comment": " 0 on success or error code" + }, + "description": "

Function pointer to receive each submodule

\n", + "comments": "" + }, "git_filter_init_fn": { "type": "callback", "file": "sys/filter.h", - "line": 152, - "lineto": 152, + "line": 141, + "lineto": 141, "args": [ { "name": "self", @@ -23806,13 +24021,13 @@ "comment": null }, "description": "

Initialize callback on filter

\n", - "comments": "

Specified as filter.initialize, this is an optional callback invoked\n before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right\n before the first use of the filter, so you can defer expensive\n initialization operations (in case libgit2 is being used in a way that\n doesn't need the filter).

\n" + "comments": "

Specified as filter.initialize, this is an optional callback invoked before a filter is first used. It will be called once at most.

\n\n

If non-NULL, the filter's initialize callback will be invoked right before the first use of the filter, so you can defer expensive initialization operations (in case libgit2 is being used in a way that doesn't need the filter).

\n" }, "git_filter_shutdown_fn": { "type": "callback", "file": "sys/filter.h", - "line": 164, - "lineto": 164, + "line": 153, + "lineto": 153, "args": [ { "name": "self", @@ -23827,13 +24042,13 @@ "comment": null }, "description": "

Shutdown callback on filter

\n", - "comments": "

Specified as filter.shutdown, this is an optional callback invoked\n when the filter is unregistered or when libgit2 is shutting down. It\n will be called once at most and should release resources as needed.\n This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n" + "comments": "

Specified as filter.shutdown, this is an optional callback invoked when the filter is unregistered or when libgit2 is shutting down. It will be called once at most and should release resources as needed. This may be called even if the initialize callback was not made.

\n\n

Typically this function will free the git_filter object itself.

\n" }, "git_filter_check_fn": { "type": "callback", "file": "sys/filter.h", - "line": 186, - "lineto": 190, + "line": 175, + "lineto": 179, "args": [ { "name": "self", @@ -23863,13 +24078,13 @@ "comment": null }, "description": "

Callback to decide if a given source needs this filter

\n", - "comments": "

Specified as filter.check, this is an optional callback that checks\n if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success),\n GIT_PASSTHROUGH if the filter should not be applied, or an error code\n to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in\n the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter.\n This will start as NULL, but check can assign to this pointer for\n later use by the apply callback. Note that the value should be heap\n allocated (not stack), so that it doesn't go away before the apply\n callback can use it. If a filter allocates and assigns a value to the\n payload, it will need a cleanup callback to free the payload.

\n" + "comments": "

Specified as filter.check, this is an optional callback that checks if filtering is needed for a given source.

\n\n

It should return 0 if the filter should be applied (i.e. success), GIT_PASSTHROUGH if the filter should not be applied, or an error code to fail out of the filter processing pipeline and return to the caller.

\n\n

The attr_values will be set to the values of any attributes given in the filter definition. See git_filter below for more detail.

\n\n

The payload will be a pointer to a reference payload for the filter. This will start as NULL, but check can assign to this pointer for later use by the apply callback. Note that the value should be heap allocated (not stack), so that it doesn't go away before the apply callback can use it. If a filter allocates and assigns a value to the payload, it will need a cleanup callback to free the payload.

\n" }, "git_filter_apply_fn": { "type": "callback", "file": "sys/filter.h", - "line": 204, - "lineto": 209, + "line": 193, + "lineto": 198, "args": [ { "name": "self", @@ -23904,13 +24119,13 @@ "comment": null }, "description": "

Callback to actually perform the data filtering

\n", - "comments": "

Specified as filter.apply, this is the callback that actually filters\n data. If it successfully writes the output, it should return 0. Like\n check, it can return GIT_PASSTHROUGH to indicate that the filter\n doesn't want to run. Other error codes will stop filter processing and\n return to the caller.

\n\n

The payload value will refer to any payload that was set by the\n check callback. It may be read from or written to as needed.

\n" + "comments": "

Specified as filter.apply, this is the callback that actually filters data. If it successfully writes the output, it should return 0. Like check, it can return GIT_PASSTHROUGH to indicate that the filter doesn't want to run. Other error codes will stop filter processing and return to the caller.

\n\n

The payload value will refer to any payload that was set by the check callback. It may be read from or written to as needed.

\n" }, "git_filter_cleanup_fn": { "type": "callback", "file": "sys/filter.h", - "line": 226, - "lineto": 228, + "line": 215, + "lineto": 217, "args": [ { "name": "self", @@ -23930,7 +24145,7 @@ "comment": null }, "description": "

Callback to clean up after filtering has been applied

\n", - "comments": "

Specified as filter.cleanup, this is an optional callback invoked\n after the filter has been applied. If the check or apply callbacks\n allocated a payload to keep per-source filter state, use this\n callback to free that payload and release resources as required.

\n" + "comments": "

Specified as filter.cleanup, this is an optional callback invoked after the filter has been applied. If the check or apply callbacks allocated a payload to keep per-source filter state, use this callback to free that payload and release resources as required.

\n" }, "git_trace_callback": { "type": "callback", @@ -23992,8 +24207,8 @@ "git_cred_acquire_cb": { "type": "callback", "file": "transport.h", - "line": 329, - "lineto": 334, + "line": 333, + "lineto": 338, "args": [ { "name": "cred", @@ -24028,7 +24243,7 @@ "comment": null }, "description": "

Signature of a function which acquires a credential object.

\n", - "comments": "
    \n
  • cred: The newly created credential object.
  • \n
  • url: The resource for which we are demanding a credential.
  • \n
  • username_from_url: The username that was embedded in a "user\n@\nhost"\n remote url, or NULL if not included.
  • \n
  • allowed_types: A bitmask stating which cred types are OK to return.
  • \n
  • payload: The payload provided when specifying this callback.
  • \n
  • returns 0 for success, \n<\n0 to indicate an error, > 0 to indicate\n no credential was acquired
  • \n
\n" + "comments": "
    \n
  • cred: The newly created credential object. - url: The resource for which we are demanding a credential. - username_from_url: The username that was embedded in a "user@host" remote url, or NULL if not included. - allowed_types: A bitmask stating which cred types are OK to return. - payload: The payload provided when specifying this callback. - returns 0 for success, < 0 to indicate an error, > 0 to indicate no credential was acquired
  • \n
\n" }, "git_treebuilder_filter_cb": { "type": "callback", @@ -24054,7 +24269,7 @@ "comment": null }, "description": "

Callback for git_treebuilder_filter

\n", - "comments": "

The return value is treated as a boolean, with zero indicating that the\n entry should be left alone and any non-zero value meaning that the\n entry should be removed from the treebuilder list (i.e. filtered out).

\n" + "comments": "

The return value is treated as a boolean, with zero indicating that the entry should be left alone and any non-zero value meaning that the entry should be removed from the treebuilder list (i.e. filtered out).

\n" }, "git_treewalk_cb": { "type": "callback", @@ -24258,7 +24473,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_attr_value" + ], "needs": [] } } @@ -24330,13 +24547,13 @@ "git_blame_hunk", { "decl": [ - "uint16_t lines_in_hunk", + "size_t lines_in_hunk", "git_oid final_commit_id", - "uint16_t final_start_line_number", + "size_t final_start_line_number", "git_signature * final_signature", "git_oid orig_commit_id", "const char * orig_path", - "uint16_t orig_start_line_number", + "size_t orig_start_line_number", "git_signature * orig_signature", "char boundary" ], @@ -24345,13 +24562,13 @@ "file": "blame.h", "line": 115, "lineto": 128, - "block": "uint16_t lines_in_hunk\ngit_oid final_commit_id\nuint16_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nuint16_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary", + "block": "size_t lines_in_hunk\ngit_oid final_commit_id\nsize_t final_start_line_number\ngit_signature * final_signature\ngit_oid orig_commit_id\nconst char * orig_path\nsize_t orig_start_line_number\ngit_signature * orig_signature\nchar boundary", "tdef": "typedef", "description": " Structure that represents a blame hunk.", - "comments": "
    \n
  • lines_in_hunk is the number of lines in this hunk
  • \n
  • final_commit_id is the OID of the commit where this line was last\nchanged.
  • \n
  • final_start_line_number is the 1-based line number where this hunk\nbegins, in the final version of the file
  • \n
  • orig_commit_id is the OID of the commit where this hunk was found. This\nwill usually be the same as final_commit_id, except when\nGIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES has been specified.
  • \n
  • orig_path is the path to the file where this hunk originated, as of the\ncommit specified by orig_commit_id.
  • \n
  • orig_start_line_number is the 1-based line number where this hunk begins\nin the file named by orig_path in the commit specified by\norig_commit_id.
  • \n
  • boundary is 1 iff the hunk has been tracked to a boundary commit (the\nroot, or the commit specified in git_blame_options.oldest_commit)
  • \n
\n", + "comments": "
    \n
  • lines_in_hunk is the number of lines in this hunk - final_commit_id is the OID of the commit where this line was last changed. - final_start_line_number is the 1-based line number where this hunk begins, in the final version of the file - orig_commit_id is the OID of the commit where this hunk was found. This will usually be the same as final_commit_id, except when GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES has been specified. - orig_path is the path to the file where this hunk originated, as of the commit specified by orig_commit_id. - orig_start_line_number is the 1-based line number where this hunk begins in the file named by orig_path in the commit specified by orig_commit_id. - boundary is 1 iff the hunk has been tracked to a boundary commit (the root, or the commit specified in git_blame_options.oldest_commit)
  • \n
\n", "fields": [ { - "type": "uint16_t", + "type": "size_t", "name": "lines_in_hunk", "comments": "" }, @@ -24361,7 +24578,7 @@ "comments": "" }, { - "type": "uint16_t", + "type": "size_t", "name": "final_start_line_number", "comments": "" }, @@ -24381,7 +24598,7 @@ "comments": "" }, { - "type": "uint16_t", + "type": "size_t", "name": "orig_start_line_number", "comments": "" }, @@ -24414,18 +24631,18 @@ "uint16_t min_match_characters", "git_oid newest_commit", "git_oid oldest_commit", - "uint32_t min_line", - "uint32_t max_line" + "size_t min_line", + "size_t max_line" ], "type": "struct", "value": "git_blame_options", "file": "blame.h", "line": 70, "lineto": 79, - "block": "unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nuint32_t min_line\nuint32_t max_line", + "block": "unsigned int version\nuint32_t flags\nuint16_t min_match_characters\ngit_oid newest_commit\ngit_oid oldest_commit\nsize_t min_line\nsize_t max_line", "tdef": "typedef", "description": " Blame options structure", - "comments": "

Use zeros to indicate default settings. It's easiest to use the\n GIT_BLAME_OPTIONS_INIT macro:\n git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n
    \n
  • flags is a combination of the git_blame_flag_t values above.
  • \n
  • min_match_characters is the lower bound on the number of alphanumeric\ncharacters that must be detected as moving/copying within a file for it to\nassociate those lines with the parent commit. The default value is 20.\nThis value only takes effect if any of the GIT_BLAME_TRACK_COPIES_*\nflags are specified.
  • \n
  • newest_commit is the id of the newest commit to consider. The default\n is HEAD.
  • \n
  • oldest_commit is the id of the oldest commit to consider. The default\n is the first commit encountered with a NULL parent.\n\n
      \n
    • min_line is the first line in the file to blame. The default is 1 (line\n numbers start with 1).
    • \n
    • max_line is the last line in the file to blame. The default is the last\n line of the file.
    • \n
  • \n
\n", + "comments": "

Use zeros to indicate default settings. It's easiest to use the GIT_BLAME_OPTIONS_INIT macro: git_blame_options opts = GIT_BLAME_OPTIONS_INIT;

\n\n
    \n
  • flags is a combination of the git_blame_flag_t values above. - min_match_characters is the lower bound on the number of alphanumeric characters that must be detected as moving/copying within a file for it to associate those lines with the parent commit. The default value is 20. This value only takes effect if any of the GIT_BLAME_TRACK_COPIES_* flags are specified. - newest_commit is the id of the newest commit to consider. The default is HEAD. - oldest_commit is the id of the oldest commit to consider. The default is the first commit encountered with a NULL parent. - min_line is the first line in the file to blame. The default is 1 (line numbers start with 1). - max_line is the last line in the file to blame. The default is the last line of the file.
  • \n
\n", "fields": [ { "type": "unsigned int", @@ -24453,12 +24670,12 @@ "comments": "" }, { - "type": "uint32_t", + "type": "size_t", "name": "min_line", "comments": "" }, { - "type": "uint32_t", + "type": "size_t", "name": "max_line", "comments": "" } @@ -24487,6 +24704,7 @@ "used": { "returns": [], "needs": [ + "git_blob_create_fromchunks", "git_blob_filtered_content", "git_blob_free", "git_blob_id", @@ -24591,7 +24809,7 @@ "block": "char * ptr\nsize_t asize\nsize_t size", "tdef": "typedef", "description": " A data buffer for exporting data from libgit2", - "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the\n caller and have the caller take responsibility for freeing that memory.\n This can be awkward if the caller does not have easy access to the same\n allocation functions that libgit2 is using. In those cases, libgit2\n will fill in a git_buf and the caller can use git_buf_free() to\n release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to\n a block of memory they hold. In this case, libgit2 will not resize or\n free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n
    \n
  • ptr points to the start of the allocated memory. If it is NULL,\nthen the git_buf is considered empty and libgit2 will feel free\nto overwrite it with new data.

  • \n
  • size holds the size (in bytes) of the data that is actually used.

  • \n
  • asize holds the known total amount of allocated memory if the ptr\nwas allocated by libgit2. It may be larger than size. If ptr\nwas not allocated by libgit2 and should not be resized and/or freed,\nthen asize will be set to zero.

  • \n
\n\n

Some APIs may occasionally do something slightly unusual with a buffer,\n such as setting ptr to a value that was passed in by the user. In\n those cases, the behavior will be clearly documented by the API.

\n", + "comments": "

Sometimes libgit2 wants to return an allocated data buffer to the caller and have the caller take responsibility for freeing that memory. This can be awkward if the caller does not have easy access to the same allocation functions that libgit2 is using. In those cases, libgit2 will fill in a git_buf and the caller can use git_buf_free() to release it when they are done.

\n\n

A git_buf may also be used for the caller to pass in a reference to a block of memory they hold. In this case, libgit2 will not resize or free the memory, but will read from it as needed.

\n\n

A git_buf is a public structure with three fields:

\n\n
    \n
  • ptr points to the start of the allocated memory. If it is NULL, then the git_buf is considered empty and libgit2 will feel free to overwrite it with new data.

  • \n
  • size holds the size (in bytes) of the data that is actually used.

  • \n
  • asize holds the known total amount of allocated memory if the ptr was allocated by libgit2. It may be larger than size. If ptr was not allocated by libgit2 and should not be resized and/or freed, then asize will be set to zero.

  • \n
\n\n

Some APIs may occasionally do something slightly unusual with a buffer, such as setting ptr to a value that was passed in by the user. In those cases, the behavior will be clearly documented by the API.

\n", "fields": [ { "type": "char *", @@ -24618,8 +24836,10 @@ "git_buf_grow", "git_buf_is_binary", "git_buf_set", + "git_commit_extract_signature", "git_commit_header_field", "git_config_find_global", + "git_config_find_programdata", "git_config_find_system", "git_config_find_xdg", "git_config_get_path", @@ -24629,6 +24849,7 @@ "git_diff_commit_as_email", "git_diff_format_email", "git_diff_stats_to_buf", + "git_filter_apply_fn", "git_filter_list_apply_to_blob", "git_filter_list_apply_to_data", "git_filter_list_apply_to_file", @@ -24670,7 +24891,10 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_transport_certificate_check_cb", + "git_transport_smart_certificate_check" + ] } } ], @@ -24678,7 +24902,7 @@ "git_cert_hostkey", { "decl": [ - "git_cert_t cert_type", + "git_cert parent", "git_cert_ssh_t type", "unsigned char [16] hash_md5", "unsigned char [20] hash_sha1" @@ -24687,16 +24911,16 @@ "value": "git_cert_hostkey", "file": "transport.h", "line": 39, - "lineto": 62, - "block": "git_cert_t cert_type\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1", + "lineto": 59, + "block": "git_cert parent\ngit_cert_ssh_t type\nunsigned char [16] hash_md5\nunsigned char [20] hash_sha1", "tdef": "typedef", "description": " Hostkey information taken from libssh2", "comments": "", "fields": [ { - "type": "git_cert_t", - "name": "cert_type", - "comments": " Type of certificate. Here to share the header with\n `git_cert`." + "type": "git_cert", + "name": "parent", + "comments": "" }, { "type": "git_cert_ssh_t", @@ -24808,24 +25032,24 @@ "git_cert_x509", { "decl": [ - "git_cert_t cert_type", + "git_cert parent", "void * data", "size_t len" ], "type": "struct", "value": "git_cert_x509", "file": "transport.h", - "line": 67, - "lineto": 81, - "block": "git_cert_t cert_type\nvoid * data\nsize_t len", + "line": 64, + "lineto": 74, + "block": "git_cert parent\nvoid * data\nsize_t len", "tdef": "typedef", "description": " X.509 certificate information", "comments": "", "fields": [ { - "type": "git_cert_t", - "name": "cert_type", - "comments": " Type of certificate. Here to share the header with\n `git_cert`." + "type": "git_cert", + "name": "parent", + "comments": "" }, { "type": "void *", @@ -24863,7 +25087,7 @@ "block": "GIT_CHECKOUT_NOTIFY_NONE\nGIT_CHECKOUT_NOTIFY_CONFLICT\nGIT_CHECKOUT_NOTIFY_DIRTY\nGIT_CHECKOUT_NOTIFY_UPDATED\nGIT_CHECKOUT_NOTIFY_UNTRACKED\nGIT_CHECKOUT_NOTIFY_IGNORED\nGIT_CHECKOUT_NOTIFY_ALL", "tdef": "typedef", "description": " Checkout notification flags", - "comments": "

Checkout will invoke an options notification callback (notify_cb) for\n certain cases - you pick which ones via notify_flags:

\n\n
    \n
  • GIT_CHECKOUT_NOTIFY_CONFLICT invokes checkout on conflicting paths.

  • \n
  • GIT_CHECKOUT_NOTIFY_DIRTY notifies about "dirty" files, i.e. those that\ndo not need an update but no longer match the baseline. Core git\ndisplays these files when checkout runs, but won't stop the checkout.

  • \n
  • GIT_CHECKOUT_NOTIFY_UPDATED sends notification for any file changed.

  • \n
  • GIT_CHECKOUT_NOTIFY_UNTRACKED notifies about untracked files.

  • \n
  • GIT_CHECKOUT_NOTIFY_IGNORED notifies about ignored files.

  • \n
\n\n

Returning a non-zero value from this callback will cancel the checkout.\n The non-zero return value will be propagated back and returned by the\n git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk,\n so canceling on any notification will still happen prior to any files\n being modified.

\n", + "comments": "

Checkout will invoke an options notification callback (notify_cb) for certain cases - you pick which ones via notify_flags:

\n\n
    \n
  • GIT_CHECKOUT_NOTIFY_CONFLICT invokes checkout on conflicting paths.

  • \n
  • GIT_CHECKOUT_NOTIFY_DIRTY notifies about "dirty" files, i.e. those that do not need an update but no longer match the baseline. Core git displays these files when checkout runs, but won't stop the checkout.

  • \n
  • GIT_CHECKOUT_NOTIFY_UPDATED sends notification for any file changed.

  • \n
  • GIT_CHECKOUT_NOTIFY_UNTRACKED notifies about untracked files.

  • \n
  • GIT_CHECKOUT_NOTIFY_IGNORED notifies about ignored files.

  • \n
\n\n

Returning a non-zero value from this callback will cancel the checkout. The non-zero return value will be propagated back and returned by the git_checkout_... call.

\n\n

Notification callbacks are made prior to modifying any files on disk, so canceling on any notification will still happen prior to any files being modified.

\n", "fields": [ { "type": "int", @@ -24910,7 +25134,9 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_checkout_notify_cb" + ] } } ], @@ -24947,7 +25173,7 @@ "block": "unsigned int version\nunsigned int checkout_strategy\nint disable_filters\nunsigned int dir_mode\nunsigned int file_mode\nint file_open_flags\nunsigned int notify_flags\ngit_checkout_notify_cb notify_cb\nvoid * notify_payload\ngit_checkout_progress_cb progress_cb\nvoid * progress_payload\ngit_strarray paths\ngit_tree * baseline\ngit_index * baseline_index\nconst char * target_directory\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_checkout_perfdata_cb perfdata_cb\nvoid * perfdata_payload", "tdef": "typedef", "description": " Checkout options structure", - "comments": "

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n", + "comments": "

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;\n
\n", "fields": [ { "type": "unsigned int", @@ -25098,7 +25324,7 @@ "block": "GIT_CHECKOUT_NONE\nGIT_CHECKOUT_SAFE\nGIT_CHECKOUT_FORCE\nGIT_CHECKOUT_RECREATE_MISSING\nGIT_CHECKOUT_ALLOW_CONFLICTS\nGIT_CHECKOUT_REMOVE_UNTRACKED\nGIT_CHECKOUT_REMOVE_IGNORED\nGIT_CHECKOUT_UPDATE_ONLY\nGIT_CHECKOUT_DONT_UPDATE_INDEX\nGIT_CHECKOUT_NO_REFRESH\nGIT_CHECKOUT_SKIP_UNMERGED\nGIT_CHECKOUT_USE_OURS\nGIT_CHECKOUT_USE_THEIRS\nGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH\nGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES\nGIT_CHECKOUT_DONT_OVERWRITE_IGNORED\nGIT_CHECKOUT_CONFLICT_STYLE_MERGE\nGIT_CHECKOUT_CONFLICT_STYLE_DIFF3\nGIT_CHECKOUT_DONT_REMOVE_EXISTING\nGIT_CHECKOUT_DONT_WRITE_INDEX\nGIT_CHECKOUT_UPDATE_SUBMODULES\nGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED", "tdef": "typedef", "description": " Checkout behavior flags", - "comments": "

In libgit2, checkout is used to update the working directory and index\n to match a target tree. Unlike git checkout, it does not move the HEAD\n commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to\n check out, the "baseline" tree of what was checked out previously, the\n working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n
    \n
  • GIT_CHECKOUT_NONE is a dry-run strategy that checks for conflicts,\netc., but doesn't make any actual changes.

  • \n
  • GIT_CHECKOUT_FORCE is at the opposite extreme, taking any action to\nmake the working directory match the target (including potentially\ndiscarding modified files).

  • \n
  • GIT_CHECKOUT_SAFE is between these two options, it will only make\nmodifications that will not lose changes.

    \n\n
                     |  target == baseline   |  target != baseline  |\n
    \n\n

    ---------------------|-----------------------|----------------------|\n workdir == baseline | no action | create, update, or |\n | | delete file |\n---------------------|-----------------------|----------------------|\n workdir exists and | no action | conflict (notify |\n is != baseline | notify dirty MODIFIED | and cancel checkout) |\n---------------------|-----------------------|----------------------|\n workdir missing, | notify dirty DELETED | create file |\n baseline present | | |\n---------------------|-----------------------|----------------------|

  • \n
\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout\n notification callback (see below) that displays information about dirty\n files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a\n notification callback that cancels the operation if a dirty-but-existing\n file is found in the working directory. This core git command isn't\n quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n
    \n
  • GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates\neven if there are conflicts (instead of cancelling the checkout).

  • \n
  • GIT_CHECKOUT_REMOVE_UNTRACKED means remove untracked files (i.e. not\nin target, baseline, or index, and not ignored) from the working dir.

  • \n
  • GIT_CHECKOUT_REMOVE_IGNORED means remove ignored files (that are also\nuntracked) from the working directory as well.

  • \n
  • GIT_CHECKOUT_UPDATE_ONLY means to only update the content of files that\nalready exist. Files will not be created nor deleted. This just skips\napplying adds, deletes, and typechanges.

  • \n
  • GIT_CHECKOUT_DONT_UPDATE_INDEX prevents checkout from writing the\nupdated files' information to the index.

  • \n
  • Normally, checkout will reload the index and git attributes from disk\nbefore any operations. GIT_CHECKOUT_NO_REFRESH prevents this reload.

  • \n
  • Unmerged index entries are conflicts. GIT_CHECKOUT_SKIP_UNMERGED skips\nfiles with unmerged index entries instead. GIT_CHECKOUT_USE_OURS and\nGIT_CHECKOUT_USE_THEIRS to proceed with the checkout using either the\nstage 2 ("ours") or stage 3 ("theirs") version of files in the index.

  • \n
  • GIT_CHECKOUT_DONT_OVERWRITE_IGNORED prevents ignored files from being\noverwritten. Normally, files that are ignored in the working directory\nare not considered "precious" and may be overwritten if the checkout\ntarget contains that file.

  • \n
  • GIT_CHECKOUT_DONT_REMOVE_EXISTING prevents checkout from removing\nfiles or folders that fold to the same name on case insensitive\nfilesystems. This can cause files to retain their existing names\nand write through existing symbolic links.

  • \n
\n", + "comments": "

In libgit2, checkout is used to update the working directory and index to match a target tree. Unlike git checkout, it does not move the HEAD commit for you - use git_repository_set_head or the like to do that.

\n\n

Checkout looks at (up to) four things: the "target" tree you want to check out, the "baseline" tree of what was checked out previously, the working directory for actual files, and the index for staged changes.

\n\n

You give checkout one of three strategies for update:

\n\n
    \n
  • GIT_CHECKOUT_NONE is a dry-run strategy that checks for conflicts, etc., but doesn't make any actual changes.

  • \n
  • GIT_CHECKOUT_FORCE is at the opposite extreme, taking any action to make the working directory match the target (including potentially discarding modified files).

  • \n
  • GIT_CHECKOUT_SAFE is between these two options, it will only make modifications that will not lose changes.

    \n\n
                     |  target == baseline   |  target != baseline  |    ---------------------|-----------------------|----------------------|     workdir == baseline |       no action       |  create, update, or  |                         |                       |     delete file      |    ---------------------|-----------------------|----------------------|     workdir exists and  |       no action       |   conflict (notify   |       is != baseline    | notify dirty MODIFIED | and cancel checkout) |    ---------------------|-----------------------|----------------------|      workdir missing,   | notify dirty DELETED  |     create file      |      baseline present   |                       |                      |    ---------------------|-----------------------|----------------------|\n
  • \n
\n\n

To emulate git checkout, use GIT_CHECKOUT_SAFE with a checkout notification callback (see below) that displays information about dirty files. The default behavior will cancel checkout on conflicts.

\n\n

To emulate git checkout-index, use GIT_CHECKOUT_SAFE with a notification callback that cancels the operation if a dirty-but-existing file is found in the working directory. This core git command isn't quite "force" but is sensitive about some types of changes.

\n\n

To emulate git checkout -f, use GIT_CHECKOUT_FORCE.

\n\n

There are some additional flags to modified the behavior of checkout:

\n\n
    \n
  • GIT_CHECKOUT_ALLOW_CONFLICTS makes SAFE mode apply safe file updates even if there are conflicts (instead of cancelling the checkout).

  • \n
  • GIT_CHECKOUT_REMOVE_UNTRACKED means remove untracked files (i.e. not in target, baseline, or index, and not ignored) from the working dir.

  • \n
  • GIT_CHECKOUT_REMOVE_IGNORED means remove ignored files (that are also untracked) from the working directory as well.

  • \n
  • GIT_CHECKOUT_UPDATE_ONLY means to only update the content of files that already exist. Files will not be created nor deleted. This just skips applying adds, deletes, and typechanges.

  • \n
  • GIT_CHECKOUT_DONT_UPDATE_INDEX prevents checkout from writing the updated files' information to the index.

  • \n
  • Normally, checkout will reload the index and git attributes from disk before any operations. GIT_CHECKOUT_NO_REFRESH prevents this reload.

  • \n
  • Unmerged index entries are conflicts. GIT_CHECKOUT_SKIP_UNMERGED skips files with unmerged index entries instead. GIT_CHECKOUT_USE_OURS and GIT_CHECKOUT_USE_THEIRS to proceed with the checkout using either the stage 2 ("ours") or stage 3 ("theirs") version of files in the index.

  • \n
  • GIT_CHECKOUT_DONT_OVERWRITE_IGNORED prevents ignored files from being overwritten. Normally, files that are ignored in the working directory are not considered "precious" and may be overwritten if the checkout target contains that file.

  • \n
  • GIT_CHECKOUT_DONT_REMOVE_EXISTING prevents checkout from removing files or folders that fold to the same name on case insensitive filesystems. This can cause files to retain their existing names and write through existing symbolic links.

  • \n
\n", "fields": [ { "type": "int", @@ -25442,8 +25668,10 @@ "git_cherrypick_commit", "git_commit_amend", "git_commit_author", + "git_commit_body", "git_commit_committer", "git_commit_create", + "git_commit_create_from_callback", "git_commit_free", "git_commit_header_field", "git_commit_id", @@ -25488,8 +25716,10 @@ "needs": [ "git_config_add_backend", "git_config_add_file_ondisk", + "git_config_backend_foreach_match", "git_config_delete_entry", "git_config_delete_multivar", + "git_config_entry_free", "git_config_foreach", "git_config_foreach_match", "git_config_free", @@ -25502,10 +25732,14 @@ "git_config_get_path", "git_config_get_string", "git_config_get_string_buf", + "git_config_init_backend", + "git_config_iterator_free", "git_config_iterator_glob_new", "git_config_iterator_new", + "git_config_lock", "git_config_multivar_iterator_new", "git_config_new", + "git_config_next", "git_config_open_default", "git_config_open_global", "git_config_open_level", @@ -25532,7 +25766,7 @@ "file": "types.h", "line": 141, "lineto": 141, - "block": "unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nvoid (*)(struct git_config_backend *) free", + "block": "unsigned int version\nint readonly\nstruct git_config * cfg\nint (*)(struct git_config_backend *, git_config_level_t) open\nint (*)(struct git_config_backend *, const char *, git_config_entry **) get\nint (*)(struct git_config_backend *, const char *, const char *) set\nint (*)(git_config_backend *, const char *, const char *, const char *) set_multivar\nint (*)(struct git_config_backend *, const char *) del\nint (*)(struct git_config_backend *, const char *, const char *) del_multivar\nint (*)(git_config_iterator **, struct git_config_backend *) iterator\nint (*)(struct git_config_backend **, struct git_config_backend *) snapshot\nint (*)(struct git_config_backend *) lock\nint (*)(struct git_config_backend *, int) unlock\nvoid (*)(struct git_config_backend *) free", "tdef": "typedef", "description": " Interface to access a configuration file ", "comments": "", @@ -25592,6 +25826,16 @@ "name": "snapshot", "comments": " Produce a read-only version of this backend " }, + { + "type": "int (*)(struct git_config_backend *)", + "name": "lock", + "comments": " Lock this backend.\n\n Prevent any writes to the data store backing this\n backend. Any updates must not be visible to any other\n readers." + }, + { + "type": "int (*)(struct git_config_backend *, int)", + "name": "unlock", + "comments": " Unlock the data store backing this backend. If success is\n true, the changes should be committed, otherwise rolled\n back." + }, { "type": "void (*)(struct git_config_backend *)", "name": "free", @@ -25621,8 +25865,8 @@ "type": "struct", "value": "git_config_entry", "file": "config.h", - "line": 61, - "lineto": 67, + "line": 64, + "lineto": 70, "block": "const char * name\nconst char * value\ngit_config_level_t level\nvoid (*)(struct git_config_entry *) free\nvoid * payload", "tdef": "typedef", "description": " An entry in a configuration file", @@ -25681,7 +25925,7 @@ "block": "git_config_backend * backend\nunsigned int flags\nint (*)(git_config_entry **, git_config_iterator *) next\nvoid (*)(git_config_iterator *) free", "tdef": null, "description": " Every iterator must have this struct as its first element, so the\n API can talk to it. You'd define your iterator as", - "comments": "
 struct my_iterator {\n         git_config_iterator parent;\n         ...\n }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n", + "comments": "
 struct my_iterator {             git_config_iterator parent;             ...     }\n
\n\n

and assign iter->parent.backend to your git_config_backend.

\n", "fields": [ { "type": "git_config_backend *", @@ -25720,6 +25964,7 @@ "git_config_level_t", { "decl": [ + "GIT_CONFIG_LEVEL_PROGRAMDATA", "GIT_CONFIG_LEVEL_SYSTEM", "GIT_CONFIG_LEVEL_XDG", "GIT_CONFIG_LEVEL_GLOBAL", @@ -25730,41 +25975,47 @@ "type": "enum", "file": "config.h", "line": 31, - "lineto": 56, - "block": "GIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", + "lineto": 59, + "block": "GIT_CONFIG_LEVEL_PROGRAMDATA\nGIT_CONFIG_LEVEL_SYSTEM\nGIT_CONFIG_LEVEL_XDG\nGIT_CONFIG_LEVEL_GLOBAL\nGIT_CONFIG_LEVEL_LOCAL\nGIT_CONFIG_LEVEL_APP\nGIT_CONFIG_HIGHEST_LEVEL", "tdef": "typedef", "description": " Priority level of a config file.\n These priority levels correspond to the natural escalation logic\n (from higher to lower) when searching for config entries in git.git.", - "comments": "

git_config_open_default() and git_repository_config() honor those\n priority levels as well.

\n", + "comments": "

git_config_open_default() and git_repository_config() honor those priority levels as well.

\n", "fields": [ + { + "type": "int", + "name": "GIT_CONFIG_LEVEL_PROGRAMDATA", + "comments": "

System-wide on Windows, for compatibility with portable git

\n", + "value": 1 + }, { "type": "int", "name": "GIT_CONFIG_LEVEL_SYSTEM", "comments": "

System-wide configuration file; /etc/gitconfig on Linux systems

\n", - "value": 1 + "value": 2 }, { "type": "int", "name": "GIT_CONFIG_LEVEL_XDG", "comments": "

XDG compatible configuration file; typically ~/.config/git/config

\n", - "value": 2 + "value": 3 }, { "type": "int", "name": "GIT_CONFIG_LEVEL_GLOBAL", "comments": "

User-specific configuration file (also called Global configuration\n file); typically ~/.gitconfig

\n", - "value": 3 + "value": 4 }, { "type": "int", "name": "GIT_CONFIG_LEVEL_LOCAL", "comments": "

Repository specific configuration file; $WORK_DIR/.git/config on\n non-bare repos

\n", - "value": 4 + "value": 5 }, { "type": "int", "name": "GIT_CONFIG_LEVEL_APP", "comments": "

Application specific configuration file; freely defined by applications

\n", - "value": 5 + "value": 6 }, { "type": "int", @@ -25790,8 +26041,8 @@ "type": "struct", "value": "git_cred_default", "file": "transport.h", - "line": 183, - "lineto": 183, + "line": 176, + "lineto": 176, "tdef": "typedef", "description": " A key for NTLM/Kerberos \"default\" credentials ", "comments": "", @@ -25815,8 +26066,8 @@ "type": "struct", "value": "git_cred_ssh_custom", "file": "transport.h", - "line": 173, - "lineto": 180, + "line": 166, + "lineto": 173, "block": "git_cred parent\nchar * username\nchar * publickey\nsize_t publickey_len\ngit_cred_sign_callback sign_callback\nvoid * payload", "tdef": "typedef", "description": " A key with a custom signature function", @@ -25871,8 +26122,8 @@ "type": "struct", "value": "git_cred_ssh_interactive", "file": "transport.h", - "line": 163, - "lineto": 168, + "line": 156, + "lineto": 161, "block": "git_cred parent\nchar * username\ngit_cred_ssh_interactive_callback prompt_callback\nvoid * payload", "tdef": "typedef", "description": " Keyboard-interactive based ssh authentication", @@ -25901,7 +26152,9 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_cred_ssh_interactive_new" + ] } } ], @@ -25918,8 +26171,8 @@ "type": "struct", "value": "git_cred_ssh_key", "file": "transport.h", - "line": 152, - "lineto": 158, + "line": 145, + "lineto": 151, "block": "git_cred parent\nchar * username\nchar * publickey\nchar * privatekey\nchar * passphrase", "tdef": "typedef", "description": " A ssh key from disk", @@ -25967,8 +26220,8 @@ "type": "struct", "value": "git_cred_username", "file": "transport.h", - "line": 186, - "lineto": 189, + "line": 179, + "lineto": 182, "block": "git_cred parent\nchar [1] username", "tdef": "typedef", "description": " Username-only credential information ", @@ -26036,8 +26289,8 @@ "type": "struct", "value": "git_cred_userpass_plaintext", "file": "transport.h", - "line": 129, - "lineto": 133, + "line": 122, + "lineto": 126, "block": "git_cred parent\nchar * username\nchar * password", "tdef": "typedef", "description": " A plaintext username and password ", @@ -26079,8 +26332,8 @@ ], "type": "enum", "file": "transport.h", - "line": 88, - "lineto": 118, + "line": 81, + "lineto": 111, "block": "GIT_CREDTYPE_USERPASS_PLAINTEXT\nGIT_CREDTYPE_SSH_KEY\nGIT_CREDTYPE_SSH_CUSTOM\nGIT_CREDTYPE_DEFAULT\nGIT_CREDTYPE_SSH_INTERACTIVE\nGIT_CREDTYPE_USERNAME\nGIT_CREDTYPE_SSH_MEMORY", "tdef": "typedef", "description": " Authentication type requested ", @@ -26146,8 +26399,8 @@ "type": "struct", "value": "git_cvar_map", "file": "config.h", - "line": 90, - "lineto": 94, + "line": 93, + "lineto": 97, "block": "git_cvar_t cvar_type\nconst char * str_match\nint map_value", "tdef": "typedef", "description": " Mapping from config variables to values.", @@ -26189,8 +26442,8 @@ ], "type": "enum", "file": "config.h", - "line": 80, - "lineto": 85, + "line": 83, + "lineto": 88, "block": "GIT_CVAR_FALSE\nGIT_CVAR_TRUE\nGIT_CVAR_INT32\nGIT_CVAR_STRING", "tdef": "typedef", "description": " Config var type", @@ -26245,12 +26498,12 @@ ], "type": "enum", "file": "diff.h", - "line": 242, - "lineto": 254, + "line": 246, + "lineto": 258, "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\nGIT_DELTA_UNREADABLE\nGIT_DELTA_CONFLICTED", "tdef": "typedef", "description": " What type of change is described by a git_diff_delta?", - "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run\n git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE\n in the option flags (otherwise type changes will be split into ADDED /\n DELETED pairs).

\n", + "comments": "

GIT_DELTA_RENAMED and GIT_DELTA_COPIED will only show up if you run git_diff_find_similar() on the diff object.

\n\n

GIT_DELTA_TYPECHANGE only shows up given GIT_DIFF_INCLUDE_TYPECHANGE in the option flags (otherwise type changes will be split into ADDED / DELETED pairs).

\n", "fields": [ { "type": "int", @@ -26395,7 +26648,7 @@ "block": "unsigned int version\nunsigned int max_candidates_tags\nunsigned int describe_strategy\nconst char * pattern\nint only_follow_first_parent\nint show_commit_oid_as_fallback", "tdef": "typedef", "description": " Describe options structure", - "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set\n the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n", + "comments": "

Initialize with GIT_DESCRIBE_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;\n
\n", "fields": [ { "type": "unsigned int", @@ -26452,7 +26705,7 @@ "block": "GIT_DESCRIBE_DEFAULT\nGIT_DESCRIBE_TAGS\nGIT_DESCRIBE_ALL", "tdef": "typedef", "description": " Reference lookup strategy", - "comments": "

These behave like the --tags and --all optios to git-describe,\n namely they say to look for any reference in either refs/tags/ or\n refs/ respectively.

\n", + "comments": "

These behave like the --tags and --all optios to git-describe, namely they say to look for any reference in either refs/tags/ or refs/ respectively.

\n", "fields": [ { "type": "int", @@ -26486,33 +26739,66 @@ "type": "struct", "value": "git_diff", "file": "diff.h", - "line": 215, - "lineto": 215, + "line": 219, + "lineto": 219, "tdef": "typedef", "description": " The diff object that contains all individual file deltas.", - "comments": "

This is an opaque structure which will be allocated by one of the diff\n generator functions below (such as git_diff_tree_to_tree). You are\n responsible for releasing the object memory when done, using the\n git_diff_free() function.

\n", + "comments": "

This is an opaque structure which will be allocated by one of the diff generator functions below (such as git_diff_tree_to_tree). You are responsible for releasing the object memory when done, using the git_diff_free() function.

\n", "used": { - "returns": [], + "returns": [ + "git_diff_get_delta", + "git_patch_get_delta", + "git_pathspec_match_list_diff_entry" + ], "needs": [ + "git_checkout_notify_cb", + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_commit_as_email", + "git_diff_file_cb", + "git_diff_find_init_options", "git_diff_find_similar", "git_diff_foreach", "git_diff_format_email", + "git_diff_format_email_init_options", "git_diff_free", "git_diff_get_delta", "git_diff_get_perfdata", "git_diff_get_stats", + "git_diff_hunk_cb", + "git_diff_index_to_index", "git_diff_index_to_workdir", + "git_diff_init_options", "git_diff_is_sorted_icase", + "git_diff_line_cb", "git_diff_merge", + "git_diff_notify_cb", "git_diff_num_deltas", "git_diff_num_deltas_of_type", "git_diff_print", + "git_diff_print_callback__to_buf", + "git_diff_print_callback__to_file_handle", + "git_diff_progress_cb", + "git_diff_stats_deletions", + "git_diff_stats_files_changed", + "git_diff_stats_free", + "git_diff_stats_insertions", + "git_diff_stats_to_buf", "git_diff_tree_to_index", "git_diff_tree_to_tree", "git_diff_tree_to_workdir", "git_diff_tree_to_workdir_with_index", + "git_patch_from_blob_and_buffer", + "git_patch_from_blobs", + "git_patch_from_buffers", "git_patch_from_diff", - "git_pathspec_match_diff" + "git_patch_get_hunk", + "git_patch_get_line_in_hunk", + "git_patch_print", + "git_pathspec_match_diff", + "git_status_list_get_perfdata" ] } } @@ -26527,8 +26813,8 @@ "type": "struct", "value": "git_diff_binary", "file": "diff.h", - "line": 461, - "lineto": 464, + "line": 484, + "lineto": 487, "block": "git_diff_binary_file old_file\ngit_diff_binary_file new_file", "tdef": "typedef", "description": " Structure describing the binary contents of a diff. ", @@ -26547,7 +26833,13 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_diff_binary_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" + ] } } ], @@ -26563,8 +26855,8 @@ "type": "struct", "value": "git_diff_binary_file", "file": "diff.h", - "line": 446, - "lineto": 458, + "line": 469, + "lineto": 481, "block": "git_diff_binary_t type\nconst char * data\nsize_t datalen\nsize_t inflatedlen", "tdef": "typedef", "description": " The contents of one of the files in a binary diff. ", @@ -26607,8 +26899,8 @@ ], "type": "enum", "file": "diff.h", - "line": 434, - "lineto": 443, + "line": 457, + "lineto": 466, "block": "GIT_DIFF_BINARY_NONE\nGIT_DIFF_BINARY_LITERAL\nGIT_DIFF_BINARY_DELTA", "tdef": "typedef", "description": " When producing a binary diff, the binary data returned will be\n either the deflated full (\"literal\") contents of the file, or\n the deflated binary delta between the two sides (whichever is\n smaller).", @@ -26653,12 +26945,12 @@ "type": "struct", "value": "git_diff_delta", "file": "diff.h", - "line": 321, - "lineto": 328, + "line": 325, + "lineto": 332, "block": "git_delta_t status\nuint32_t flags\nuint16_t similarity\nuint16_t nfiles\ngit_diff_file old_file\ngit_diff_file new_file", "tdef": "typedef", "description": " Description of changes to one entry.", - "comments": "

When iterating over a diff, this will be passed to most callbacks and\n you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file\n represents to "to" side of the diff. What those means depend on the\n function that was used to generate the diff and will be documented below.\n You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file",\n they actually may correspond to entries that represent a file, a symbolic\n link, a submodule commit id, or even a tree (if you are tracking type\n changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will\n be filled in, but we generally try to fill in as much as possible. One\n example is that the "flags" field may not have either the BINARY or the\n NOT_BINARY flag set to avoid examining file contents if you do not pass\n in hunk and/or line callbacks to the diff foreach iteration function. It\n will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar()\n which does a similarity analysis of files in the diff. Use that\n function to do rename and copy detection, and to split heavily modified\n files in add/delete pairs. After that call, deltas with a status of\n GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score\n between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to\n break, but to not actually break the records, then GIT_DELTA_MODIFIED\n records may have a non-zero similarity score if the self-similarity is\n below the split threshold. To display this value like core Git, invert\n the score (a la printf("M%03d", 100 - delta->similarity)).

\n", + "comments": "

When iterating over a diff, this will be passed to most callbacks and you can use the contents to understand exactly what has changed.

\n\n

The old_file represents the "from" side of the diff and the new_file represents to "to" side of the diff. What those means depend on the function that was used to generate the diff and will be documented below. You can also use the GIT_DIFF_REVERSE flag to flip it around.

\n\n

Although the two sides of the delta are named "old_file" and "new_file", they actually may correspond to entries that represent a file, a symbolic link, a submodule commit id, or even a tree (if you are tracking type changes or ignored/untracked directories).

\n\n

Under some circumstances, in the name of efficiency, not all fields will be filled in, but we generally try to fill in as much as possible. One example is that the "flags" field may not have either the BINARY or the NOT_BINARY flag set to avoid examining file contents if you do not pass in hunk and/or line callbacks to the diff foreach iteration function. It will just use the git attributes for those files.

\n\n

The similarity score is zero unless you call git_diff_find_similar() which does a similarity analysis of files in the diff. Use that function to do rename and copy detection, and to split heavily modified files in add/delete pairs. After that call, deltas with a status of GIT_DELTA_RENAMED or GIT_DELTA_COPIED will have a similarity score between 0 and 100 indicating how similar the old and new sides are.

\n\n

If you ask git_diff_find_similar to find heavily modified files to break, but to not actually break the records, then GIT_DELTA_MODIFIED records may have a non-zero similarity score if the self-similarity is below the split threshold. To display this value like core Git, invert the score (a la printf("M%03d", 100 - delta->similarity)).

\n", "fields": [ { "type": "git_delta_t", @@ -26698,6 +26990,11 @@ "git_pathspec_match_list_diff_entry" ], "needs": [ + "git_diff_binary_cb", + "git_diff_file_cb", + "git_diff_hunk_cb", + "git_diff_line_cb", + "git_diff_notify_cb", "git_diff_print_callback__to_buf", "git_diff_print_callback__to_file_handle" ] @@ -26717,12 +27014,12 @@ "type": "struct", "value": "git_diff_file", "file": "diff.h", - "line": 277, - "lineto": 283, + "line": 281, + "lineto": 287, "block": "git_oid id\nconst char * path\ngit_off_t size\nuint32_t flags\nuint16_t mode", "tdef": "typedef", "description": " Description of one side of a delta.", - "comments": "

Although this is called a "file", it could represent a file, a symbolic\n link, a submodule commit id, or even a tree (although that only if you\n are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an\n absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta),\n then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working\n directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will\n be restricted to one of the git_filemode_t values.

\n", + "comments": "

Although this is called a "file", it could represent a file, a symbolic link, a submodule commit id, or even a tree (although that only if you are tracking type changes or ignored/untracked directories).

\n\n

The oid is the git_oid of the item. If the entry represents an absent side of a diff (e.g. the old_file of a GIT_DELTA_ADDED delta), then the oid will be zeroes.

\n\n

path is the NUL-terminated path to the entry relative to the working directory of the repository.

\n\n

size is the size of the entry in bytes.

\n\n

flags is a combination of the git_diff_flag_t types

\n\n

mode is, roughly, the stat() st_mode value for the item. This will be restricted to one of the git_filemode_t values.

\n", "fields": [ { "type": "git_oid", @@ -26752,7 +27049,13 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_checkout_notify_cb", + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach" + ] } } ], @@ -26772,12 +27075,12 @@ "type": "struct", "value": "git_diff_find_options", "file": "diff.h", - "line": 658, - "lineto": 684, + "line": 681, + "lineto": 707, "block": "unsigned int version\nuint32_t flags\nuint16_t rename_threshold\nuint16_t rename_from_rewrite_threshold\nuint16_t copy_threshold\nuint16_t break_rewrite_threshold\nsize_t rename_limit\ngit_diff_similarity_metric * metric", "tdef": "typedef", "description": " Control behavior of rename and copy detection", - "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n\n
    \n
  • rename_threshold is the same as the -M option with a value
  • \n
  • copy_threshold is the same as the -C option with a value
  • \n
  • rename_from_rewrite_threshold matches the top of the -B option
  • \n
  • break_rewrite_threshold matches the bottom of the -B option
  • \n
  • rename_limit is the maximum number of matches to consider for\na particular file. This is a little different from the -l option\nto regular Git because we will still process up to this many matches\nbefore abandoning the search.
  • \n
\n\n

The metric option allows you to plug in a custom similarity metric.\n Set it to NULL for the default internal metric which is based on sampling\n hashes of ranges of data in the file. The default metric is a pretty\n good similarity approximation that should work fairly well for both text\n and binary data, and is pretty fast with fixed memory overhead.

\n", + "comments": "

These options mostly mimic parameters that can be passed to git-diff.

\n\n
    \n
  • rename_threshold is the same as the -M option with a value - copy_threshold is the same as the -C option with a value - rename_from_rewrite_threshold matches the top of the -B option - break_rewrite_threshold matches the bottom of the -B option - rename_limit is the maximum number of matches to consider for a particular file. This is a little different from the -l option to regular Git because we will still process up to this many matches before abandoning the search.
  • \n
\n\n

The metric option allows you to plug in a custom similarity metric. Set it to NULL for the default internal metric which is based on sampling hashes of ranges of data in the file. The default metric is a pretty good similarity approximation that should work fairly well for both text and binary data, and is pretty fast with fixed memory overhead.

\n", "fields": [ { "type": "unsigned int", @@ -26852,8 +27155,8 @@ ], "type": "enum", "file": "diff.h", - "line": 552, - "lineto": 621, + "line": 575, + "lineto": 644, "block": "GIT_DIFF_FIND_BY_CONFIG\nGIT_DIFF_FIND_RENAMES\nGIT_DIFF_FIND_RENAMES_FROM_REWRITES\nGIT_DIFF_FIND_COPIES\nGIT_DIFF_FIND_COPIES_FROM_UNMODIFIED\nGIT_DIFF_FIND_REWRITES\nGIT_DIFF_BREAK_REWRITES\nGIT_DIFF_FIND_AND_BREAK_REWRITES\nGIT_DIFF_FIND_FOR_UNTRACKED\nGIT_DIFF_FIND_ALL\nGIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE\nGIT_DIFF_FIND_IGNORE_WHITESPACE\nGIT_DIFF_FIND_DONT_IGNORE_WHITESPACE\nGIT_DIFF_FIND_EXACT_MATCH_ONLY\nGIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY\nGIT_DIFF_FIND_REMOVE_UNMODIFIED", "tdef": "typedef", "description": " Flags to control the behavior of diff rename/copy detection.", @@ -26973,12 +27276,12 @@ ], "type": "enum", "file": "diff.h", - "line": 225, - "lineto": 230, + "line": 229, + "lineto": 234, "block": "GIT_DIFF_FLAG_BINARY\nGIT_DIFF_FLAG_NOT_BINARY\nGIT_DIFF_FLAG_VALID_ID\nGIT_DIFF_FLAG_EXISTS", "tdef": "typedef", "description": " Flags for the delta object and the file objects on each side.", - "comments": "

These flags are used for both the flags value of the git_diff_delta\n and the flags for the git_diff_file objects representing the old and\n new sides of the delta. Values outside of this public range should be\n considered reserved for internal or future use.

\n", + "comments": "

These flags are used for both the flags value of the git_diff_delta and the flags for the git_diff_file objects representing the old and new sides of the delta. Values outside of this public range should be considered reserved for internal or future use.

\n", "fields": [ { "type": "int", @@ -27020,8 +27323,8 @@ ], "type": "enum", "file": "diff.h", - "line": 1218, - "lineto": 1225, + "line": 1260, + "lineto": 1267, "block": "GIT_DIFF_FORMAT_EMAIL_NONE\nGIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER", "tdef": "typedef", "description": " Formatting options for diff e-mail generation", @@ -27058,14 +27361,15 @@ "size_t total_patches", "const git_oid * id", "const char * summary", + "const char * body", "const git_signature * author" ], "type": "struct", "value": "git_diff_format_email_options", "file": "diff.h", - "line": 1230, - "lineto": 1249, - "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst git_signature * author", + "line": 1272, + "lineto": 1294, + "block": "unsigned int version\ngit_diff_format_email_flags_t flags\nsize_t patch_no\nsize_t total_patches\nconst git_oid * id\nconst char * summary\nconst char * body\nconst git_signature * author", "tdef": "typedef", "description": " Options for controlling the formatting of the generated e-mail.", "comments": "", @@ -27100,6 +27404,11 @@ "name": "summary", "comments": " Summary of the change " }, + { + "type": "const char *", + "name": "body", + "comments": " Commit message's body " + }, { "type": "const git_signature *", "name": "author", @@ -27127,8 +27436,8 @@ ], "type": "enum", "file": "diff.h", - "line": 981, - "lineto": 987, + "line": 1023, + "lineto": 1029, "block": "GIT_DIFF_FORMAT_PATCH\nGIT_DIFF_FORMAT_PATCH_HEADER\nGIT_DIFF_FORMAT_RAW\nGIT_DIFF_FORMAT_NAME_ONLY\nGIT_DIFF_FORMAT_NAME_STATUS", "tdef": "typedef", "description": " Possible output formats for diff data", @@ -27187,8 +27496,8 @@ "type": "struct", "value": "git_diff_hunk", "file": "diff.h", - "line": 478, - "lineto": 485, + "line": 501, + "lineto": 508, "block": "int old_start\nint old_lines\nint new_start\nint new_lines\nsize_t header_len\nchar [128] header", "tdef": "typedef", "description": " Structure describing a hunk of a diff.", @@ -27228,6 +27537,12 @@ "used": { "returns": [], "needs": [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach", + "git_diff_hunk_cb", + "git_diff_line_cb", "git_diff_print_callback__to_buf", "git_diff_print_callback__to_file_handle", "git_patch_get_hunk" @@ -27250,8 +27565,8 @@ "type": "struct", "value": "git_diff_line", "file": "diff.h", - "line": 525, - "lineto": 533, + "line": 548, + "lineto": 556, "block": "char origin\nint old_lineno\nint new_lineno\nint num_lines\nsize_t content_len\ngit_off_t content_offset\nconst char * content", "tdef": "typedef", "description": " Structure describing a line (or data span) of a diff.", @@ -27296,9 +27611,16 @@ "used": { "returns": [], "needs": [ + "git_diff_blob_to_buffer", + "git_diff_blobs", + "git_diff_buffers", + "git_diff_foreach", + "git_diff_line_cb", + "git_diff_print", "git_diff_print_callback__to_buf", "git_diff_print_callback__to_file_handle", - "git_patch_get_line_in_hunk" + "git_patch_get_line_in_hunk", + "git_patch_print" ] } } @@ -27319,12 +27641,12 @@ ], "type": "enum", "file": "diff.h", - "line": 504, - "lineto": 520, + "line": 527, + "lineto": 543, "block": "GIT_DIFF_LINE_CONTEXT\nGIT_DIFF_LINE_ADDITION\nGIT_DIFF_LINE_DELETION\nGIT_DIFF_LINE_CONTEXT_EOFNL\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", "description": " Line origin constants.", - "comments": "

These values describe where a line came from and will be passed to\n the git_diff_line_cb when iterating over a diff. There are some\n special origin constants at the end that are used for the text\n output callbacks to demarcate lines that are actually part of\n the file or hunk headers.

\n", + "comments": "

These values describe where a line came from and will be passed to the git_diff_line_cb when iterating over a diff. There are some special origin constants at the end that are used for the text output callbacks to demarcate lines that are actually part of the file or hunk headers.

\n", "fields": [ { "type": "int", @@ -27424,7 +27746,7 @@ "type": "enum", "file": "diff.h", "line": 72, - "lineto": 205, + "lineto": 209, "block": "GIT_DIFF_NORMAL\nGIT_DIFF_REVERSE\nGIT_DIFF_INCLUDE_IGNORED\nGIT_DIFF_RECURSE_IGNORED_DIRS\nGIT_DIFF_INCLUDE_UNTRACKED\nGIT_DIFF_RECURSE_UNTRACKED_DIRS\nGIT_DIFF_INCLUDE_UNMODIFIED\nGIT_DIFF_INCLUDE_TYPECHANGE\nGIT_DIFF_INCLUDE_TYPECHANGE_TREES\nGIT_DIFF_IGNORE_FILEMODE\nGIT_DIFF_IGNORE_SUBMODULES\nGIT_DIFF_IGNORE_CASE\nGIT_DIFF_INCLUDE_CASECHANGE\nGIT_DIFF_DISABLE_PATHSPEC_MATCH\nGIT_DIFF_SKIP_BINARY_CHECK\nGIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS\nGIT_DIFF_UPDATE_INDEX\nGIT_DIFF_INCLUDE_UNREADABLE\nGIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED\nGIT_DIFF_FORCE_TEXT\nGIT_DIFF_FORCE_BINARY\nGIT_DIFF_IGNORE_WHITESPACE\nGIT_DIFF_IGNORE_WHITESPACE_CHANGE\nGIT_DIFF_IGNORE_WHITESPACE_EOL\nGIT_DIFF_SHOW_UNTRACKED_CONTENT\nGIT_DIFF_SHOW_UNMODIFIED\nGIT_DIFF_PATIENCE\nGIT_DIFF_MINIMAL\nGIT_DIFF_SHOW_BINARY", "tdef": "typedef", "description": " Flags for diff options. A combination of these flags can be passed\n in via the `flags` value in the `git_diff_options`.", @@ -27511,7 +27833,7 @@ { "type": "int", "name": "GIT_DIFF_DISABLE_PATHSPEC_MATCH", - "comments": "

If the pathspec is set in the diff options, this flags means to\n apply it as an exact match instead of as an fnmatch pattern.

\n", + "comments": "

If the pathspec is set in the diff options, this flags indicates\n that the paths will be treated as literal paths instead of\n fnmatch patterns. Each path in the list must either be a full\n path to a file or a directory. (A trailing slash indicates that\n the path will only match a directory). If a directory is\n specified, all children will be included.

\n", "value": 4096 }, { @@ -27620,7 +27942,8 @@ "git_submodule_ignore_t ignore_submodules", "git_strarray pathspec", "git_diff_notify_cb notify_cb", - "void * notify_payload", + "git_diff_progress_cb progress_cb", + "void * payload", "uint32_t context_lines", "uint32_t interhunk_lines", "uint16_t id_abbrev", @@ -27631,12 +27954,12 @@ "type": "struct", "value": "git_diff_options", "file": "diff.h", - "line": 374, - "lineto": 393, - "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\nvoid * notify_payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", + "line": 396, + "lineto": 416, + "block": "unsigned int version\nuint32_t flags\ngit_submodule_ignore_t ignore_submodules\ngit_strarray pathspec\ngit_diff_notify_cb notify_cb\ngit_diff_progress_cb progress_cb\nvoid * payload\nuint32_t context_lines\nuint32_t interhunk_lines\nuint16_t id_abbrev\ngit_off_t max_size\nconst char * old_prefix\nconst char * new_prefix", "tdef": "typedef", "description": " Structure describing options about how the diff should be executed.", - "comments": "

Setting all values of the structure to zero will yield the default\n values. Similarly, passing NULL for the options structure will\n give the defaults. The default values are marked below.

\n\n
    \n
  • flags is a combination of the git_diff_option_t values above
  • \n
  • context_lines is the number of unchanged lines that define the\nboundary of a hunk (and to display before and after)
  • \n
  • interhunk_lines is the maximum number of unchanged lines between\nhunk boundaries before the hunks will be merged into a one.
  • \n
  • old_prefix is the virtual "directory" to prefix to old file names\nin hunk headers (default "a")
  • \n
  • new_prefix is the virtual "directory" to prefix to new file names\nin hunk headers (default "b")
  • \n
  • pathspec is an array of paths / fnmatch patterns to constrain diff
  • \n
  • max_size is a file size (in bytes) above which a blob will be marked\nas binary automatically; pass a negative value to disable.
  • \n
  • notify_cb is an optional callback function, notifying the consumer of\nwhich files are being examined as the diff is generated
  • \n
  • notify_payload is the payload data to pass to the notify_cb function
  • \n
  • ignore_submodules overrides the submodule ignore setting for all\nsubmodules in the diff.
  • \n
\n", + "comments": "

Setting all values of the structure to zero will yield the default values. Similarly, passing NULL for the options structure will give the defaults. The default values are marked below.

\n\n
    \n
  • flags is a combination of the git_diff_option_t values above - context_lines is the number of unchanged lines that define the boundary of a hunk (and to display before and after) - interhunk_lines is the maximum number of unchanged lines between hunk boundaries before the hunks will be merged into a one. - old_prefix is the virtual "directory" to prefix to old file names in hunk headers (default "a") - new_prefix is the virtual "directory" to prefix to new file names in hunk headers (default "b") - pathspec is an array of paths / fnmatch patterns to constrain diff - max_size is a file size (in bytes) above which a blob will be marked as binary automatically; pass a negative value to disable. - notify_cb is an optional callback function, notifying the consumer of changes to the diff as new deltas are added. - progress_cb is an optional callback function, notifying the consumer of which files are being examined as the diff is generated. - payload is the payload to pass to the callback functions. - ignore_submodules overrides the submodule ignore setting for all submodules in the diff.
  • \n
\n", "fields": [ { "type": "unsigned int", @@ -27663,9 +27986,14 @@ "name": "notify_cb", "comments": "" }, + { + "type": "git_diff_progress_cb", + "name": "progress_cb", + "comments": "" + }, { "type": "void *", - "name": "notify_payload", + "name": "payload", "comments": "" }, { @@ -27706,6 +28034,7 @@ "git_diff_blobs", "git_diff_buffers", "git_diff_commit_as_email", + "git_diff_index_to_index", "git_diff_index_to_workdir", "git_diff_init_options", "git_diff_tree_to_index", @@ -27719,49 +28048,6 @@ } } ], - [ - "git_diff_perfdata", - { - "decl": [ - "unsigned int version", - "size_t stat_calls", - "size_t oid_calculations" - ], - "type": "struct", - "value": "git_diff_perfdata", - "file": "sys/diff.h", - "line": 67, - "lineto": 71, - "block": "unsigned int version\nsize_t stat_calls\nsize_t oid_calculations", - "tdef": "typedef", - "description": " Performance data from diffing", - "comments": "", - "fields": [ - { - "type": "unsigned int", - "name": "version", - "comments": "" - }, - { - "type": "size_t", - "name": "stat_calls", - "comments": " Number of stat() calls performed " - }, - { - "type": "size_t", - "name": "oid_calculations", - "comments": " Number of ID calculations " - } - ], - "used": { - "returns": [], - "needs": [ - "git_diff_get_perfdata", - "git_status_list_get_perfdata" - ] - } - } - ], [ "git_diff_similarity_metric", { @@ -27775,8 +28061,8 @@ "type": "struct", "value": "git_diff_similarity_metric", "file": "diff.h", - "line": 626, - "lineto": 636, + "line": 649, + "lineto": 659, "block": "int (*)(void **, const git_diff_file *, const char *, void *) file_signature\nint (*)(void **, const git_diff_file *, const char *, size_t, void *) buffer_signature\nvoid (*)(void *, void *) free_signature\nint (*)(int *, void *, void *, void *) similarity\nvoid * payload", "tdef": "typedef", "description": " Pluggable similarity metric", @@ -27821,8 +28107,8 @@ "type": "struct", "value": "git_diff_stats", "file": "diff.h", - "line": 1132, - "lineto": 1132, + "line": 1174, + "lineto": 1174, "tdef": "typedef", "description": " This is an opaque structure which is allocated by `git_diff_get_stats`.\n You are responsible for releasing the object memory when done, using the\n `git_diff_stats_free()` function.", "comments": "", @@ -27851,8 +28137,8 @@ ], "type": "enum", "file": "diff.h", - "line": 1137, - "lineto": 1152, + "line": 1179, + "lineto": 1194, "block": "GIT_DIFF_STATS_NONE\nGIT_DIFF_STATS_FULL\nGIT_DIFF_STATS_SHORT\nGIT_DIFF_STATS_NUMBER\nGIT_DIFF_STATS_INCLUDE_SUMMARY", "tdef": "typedef", "description": " Formatting options for diff stats", @@ -27911,7 +28197,7 @@ "block": "GIT_DIRECTION_FETCH\nGIT_DIRECTION_PUSH", "tdef": "typedef", "description": " Direction of the connection.", - "comments": "

We need this because we need to know whether we should call\n git-upload-pack or git-receive-pack on the remote end when get_refs\n gets called.

\n", + "comments": "

We need this because we need to know whether we should call git-upload-pack or git-receive-pack on the remote end when get_refs gets called.

\n", "fields": [ { "type": "int", @@ -27927,7 +28213,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_refspec_direction" + ], "needs": [ "git_remote_connect" ] @@ -27944,12 +28232,12 @@ "type": "struct", "value": "git_error", "file": "errors.h", - "line": 63, - "lineto": 66, + "line": 64, + "lineto": 67, "block": "char * message\nint klass", "tdef": "typedef", "description": " Structure to store extra details of the last error that occurred.", - "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the\n library was build, otherwise one is kept globally for the library

\n", + "comments": "

This is kept on a per-thread basis if GIT_THREADS was defined when the library was build, otherwise one is kept globally for the library

\n", "fields": [ { "type": "char *", @@ -27966,9 +28254,7 @@ "returns": [ "giterr_last" ], - "needs": [ - "giterr_detach" - ] + "needs": [] } } ], @@ -27999,14 +28285,15 @@ "GIT_EINVALID", "GIT_EUNCOMMITTED", "GIT_EDIRECTORY", + "GIT_EMERGECONFLICT", "GIT_PASSTHROUGH", "GIT_ITEROVER" ], "type": "enum", "file": "errors.h", "line": 21, - "lineto": 55, - "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_PASSTHROUGH\nGIT_ITEROVER", + "lineto": 56, + "block": "GIT_OK\nGIT_ERROR\nGIT_ENOTFOUND\nGIT_EEXISTS\nGIT_EAMBIGUOUS\nGIT_EBUFS\nGIT_EUSER\nGIT_EBAREREPO\nGIT_EUNBORNBRANCH\nGIT_EUNMERGED\nGIT_ENONFASTFORWARD\nGIT_EINVALIDSPEC\nGIT_ECONFLICT\nGIT_ELOCKED\nGIT_EMODIFIED\nGIT_EAUTH\nGIT_ECERTIFICATE\nGIT_EAPPLIED\nGIT_EPEEL\nGIT_EEOF\nGIT_EINVALID\nGIT_EUNCOMMITTED\nGIT_EDIRECTORY\nGIT_EMERGECONFLICT\nGIT_PASSTHROUGH\nGIT_ITEROVER", "tdef": "typedef", "description": " Generic return codes ", "comments": "", @@ -28149,6 +28436,12 @@ "comments": "

The operation is not valid for a directory

\n", "value": -23 }, + { + "type": "int", + "name": "GIT_EMERGECONFLICT", + "comments": "

A merge conflict exists and cannot continue

\n", + "value": -24 + }, { "type": "int", "name": "GIT_PASSTHROUGH", @@ -28206,8 +28499,8 @@ ], "type": "enum", "file": "errors.h", - "line": 69, - "lineto": 101, + "line": 70, + "lineto": 102, "block": "GITERR_NONE\nGITERR_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\nGITERR_CHECKOUT\nGITERR_FETCHHEAD\nGITERR_MERGE\nGITERR_SSH\nGITERR_FILTER\nGITERR_REVERT\nGITERR_CALLBACK\nGITERR_CHERRYPICK\nGITERR_DESCRIBE\nGITERR_REBASE\nGITERR_FILESYSTEM", "tdef": "typedef", "description": " Error classes ", @@ -28412,13 +28705,14 @@ "decl": [ "GIT_FEATURE_THREADS", "GIT_FEATURE_HTTPS", - "GIT_FEATURE_SSH" + "GIT_FEATURE_SSH", + "GIT_FEATURE_NSEC" ], "type": "enum", "file": "common.h", - "line": 100, - "lineto": 104, - "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH", + "line": 111, + "lineto": 116, + "block": "GIT_FEATURE_THREADS\nGIT_FEATURE_HTTPS\nGIT_FEATURE_SSH\nGIT_FEATURE_NSEC", "tdef": "typedef", "description": " Combinations of these values describe the features with which libgit2\n was compiled", "comments": "", @@ -28440,6 +28734,12 @@ "name": "GIT_FEATURE_SSH", "comments": "", "value": 4 + }, + { + "type": "int", + "name": "GIT_FEATURE_NSEC", + "comments": "", + "value": 8 } ], "used": { @@ -28456,17 +28756,18 @@ "git_remote_callbacks callbacks", "git_fetch_prune_t prune", "int update_fetchhead", - "git_remote_autotag_option_t download_tags" + "git_remote_autotag_option_t download_tags", + "git_strarray custom_headers" ], "type": "struct", "value": "git_fetch_options", "file": "remote.h", - "line": 522, - "lineto": 549, - "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags", + "line": 523, + "lineto": 555, + "block": "int version\ngit_remote_callbacks callbacks\ngit_fetch_prune_t prune\nint update_fetchhead\ngit_remote_autotag_option_t download_tags\ngit_strarray custom_headers", "tdef": "typedef", "description": " Fetch options structure.", - "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to\n correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", + "comments": "

Zero out for defaults. Initialize with GIT_FETCH_OPTIONS_INIT macro to correctly set the version field. E.g.

\n\n
    git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;\n
\n", "fields": [ { "type": "int", @@ -28492,6 +28793,11 @@ "type": "git_remote_autotag_option_t", "name": "download_tags", "comments": " Determines how to behave regarding tags on the remote, such\n as auto-downloading tags for objects we're downloading or\n downloading all of them.\n\n The default is to auto-follow tags." + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra headers for this fetch operation" } ], "used": { @@ -28562,7 +28868,10 @@ } ], "used": { - "returns": [], + "returns": [ + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw" + ], "needs": [ "git_treebuilder_insert" ] @@ -28585,61 +28894,83 @@ "type": "struct", "value": "git_filter", "file": "sys/filter.h", - "line": 248, - "lineto": 259, + "line": 226, + "lineto": 271, "tdef": null, "description": " Filter structure used to register custom filters.", - "comments": "

To associate extra data with a filter, allocate extra data and put the\n git_filter struct at the start of your data buffer, then cast the\n self pointer to your larger structure when your callback is invoked.

\n\n

version should be set to GIT_FILTER_VERSION

\n\n

attributes is a whitespace-separated list of attribute names to check\n for this filter (e.g. "eol crlf text"). If the attribute name is bare,\n it will be simply loaded and passed to the check callback. If it has\n a value (i.e. "name=value"), the attribute must match that value for\n the filter to be applied.

\n\n

The initialize, shutdown, check, apply, and cleanup callbacks\n are all documented above with the respective function pointer typedefs.

\n", + "comments": "

To associate extra data with a filter, allocate extra data and put the git_filter struct at the start of your data buffer, then cast the self pointer to your larger structure when your callback is invoked.

\n", "block": "unsigned int version\nconst char * attributes\ngit_filter_init_fn initialize\ngit_filter_shutdown_fn shutdown\ngit_filter_check_fn check\ngit_filter_apply_fn apply\ngit_filter_stream_fn stream\ngit_filter_cleanup_fn cleanup", "fields": [ { "type": "unsigned int", "name": "version", - "comments": "" + "comments": " The `version` field should be set to `GIT_FILTER_VERSION`. " }, { "type": "const char *", "name": "attributes", - "comments": "" + "comments": " A whitespace-separated list of attribute names to check for this\n filter (e.g. \"eol crlf text\"). If the attribute name is bare, it\n will be simply loaded and passed to the `check` callback. If it\n has a value (i.e. \"name=value\"), the attribute must match that\n value for the filter to be applied. The value may be a wildcard\n (eg, \"name=*\"), in which case the filter will be invoked for any\n value for the given attribute name. See the attribute parameter\n of the `check` callback for the attribute value that was specified." }, { "type": "git_filter_init_fn", "name": "initialize", - "comments": "" + "comments": " Called when the filter is first used for any file. " }, { "type": "git_filter_shutdown_fn", "name": "shutdown", - "comments": "" + "comments": " Called when the filter is removed or unregistered from the system. " }, { "type": "git_filter_check_fn", "name": "check", - "comments": "" + "comments": " Called to determine whether the filter should be invoked for a\n given file. If this function returns `GIT_PASSTHROUGH` then the\n `apply` function will not be invoked and the contents will be passed\n through unmodified." }, { "type": "git_filter_apply_fn", "name": "apply", - "comments": "" + "comments": " Called to actually apply the filter to file contents. If this\n function returns `GIT_PASSTHROUGH` then the contents will be passed\n through unmodified." }, { "type": "git_filter_stream_fn", "name": "stream", - "comments": "" + "comments": " Called to apply the filter in a streaming manner. If this is not\n specified then the system will call `apply` with the whole buffer." }, { "type": "git_filter_cleanup_fn", "name": "cleanup", - "comments": "" + "comments": " Called when the system is done filtering for a file. " } ], "used": { "returns": [ - "git_filter_lookup" + "git_filter_lookup", + "git_filter_source_mode" ], "needs": [ + "git_filter_apply_fn", + "git_filter_check_fn", + "git_filter_cleanup_fn", + "git_filter_init_fn", + "git_filter_list_apply_to_blob", + "git_filter_list_apply_to_data", + "git_filter_list_apply_to_file", + "git_filter_list_contains", + "git_filter_list_free", + "git_filter_list_load", + "git_filter_list_new", "git_filter_list_push", - "git_filter_register" + "git_filter_list_stream_blob", + "git_filter_list_stream_data", + "git_filter_list_stream_file", + "git_filter_register", + "git_filter_shutdown_fn", + "git_filter_source_filemode", + "git_filter_source_flags", + "git_filter_source_id", + "git_filter_source_mode", + "git_filter_source_path", + "git_filter_source_repo" ] } } @@ -28690,7 +29021,7 @@ "lineto": 73, "tdef": "typedef", "description": " List of filters to be applied", - "comments": "

This represents a list of filters to be applied to a file / blob. You\n can build the list with one call, apply it with another, and dispose it\n with a third. In typical usage, there are not many occasions where a\n git_filter_list is needed directly since the library will generally\n handle conversions for you, but it can be convenient to be able to\n build and apply the list sometimes.

\n", + "comments": "

This represents a list of filters to be applied to a file / blob. You can build the list with one call, apply it with another, and dispose it with a third. In typical usage, there are not many occasions where a git_filter_list is needed directly since the library will generally handle conversions for you, but it can be convenient to be able to build and apply the list sometimes.

\n", "used": { "returns": [], "needs": [ @@ -28699,7 +29030,6 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", "git_filter_list_new", "git_filter_list_push", @@ -28754,7 +29084,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_filter_source_mode" + ], "needs": [ "git_filter_list_load", "git_filter_list_new" @@ -28777,6 +29109,8 @@ "used": { "returns": [], "needs": [ + "git_filter_apply_fn", + "git_filter_check_fn", "git_filter_source_filemode", "git_filter_source_flags", "git_filter_source_id", @@ -28803,7 +29137,6 @@ "returns": [], "needs": [ "git_hashsig_compare", - "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free" ] @@ -28826,7 +29159,7 @@ "block": "GIT_HASHSIG_NORMAL\nGIT_HASHSIG_IGNORE_WHITESPACE\nGIT_HASHSIG_SMART_WHITESPACE\nGIT_HASHSIG_ALLOW_SMALL_FILES", "tdef": "typedef", "description": " Options for hashsig computation", - "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE,\n GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", + "comments": "

The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE, GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.

\n", "fields": [ { "type": "int", @@ -28856,7 +29189,6 @@ "used": { "returns": [], "needs": [ - "git_hashsig_create", "git_hashsig_create_fromfile" ] } @@ -28888,7 +29220,7 @@ "block": "GIT_IDXENTRY_INTENT_TO_ADD\nGIT_IDXENTRY_SKIP_WORKTREE\nGIT_IDXENTRY_EXTENDED2\nGIT_IDXENTRY_EXTENDED_FLAGS\nGIT_IDXENTRY_UPDATE\nGIT_IDXENTRY_REMOVE\nGIT_IDXENTRY_UPTODATE\nGIT_IDXENTRY_ADDED\nGIT_IDXENTRY_HASHED\nGIT_IDXENTRY_UNHASHED\nGIT_IDXENTRY_WT_REMOVE\nGIT_IDXENTRY_CONFLICTED\nGIT_IDXENTRY_UNPACKED\nGIT_IDXENTRY_NEW_SKIP_WORKTREE", "tdef": "typedef", "description": " Bitmasks for on-disk fields of `git_index_entry`'s `flags_extended`", - "comments": "

In memory, the flags_extended fields are divided into two parts: the\n fields that are read from and written to disk, and other fields that\n in-memory only and used by libgit2. Only the flags in\n GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the\n git_index_entry flags_extended value that belong on disk. You\n can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry\n flags_extended value that are only used in-memory by libgit2.\n You can use them to interpret the data in the flags_extended.

\n", + "comments": "

In memory, the flags_extended fields are divided into two parts: the fields that are read from and written to disk, and other fields that in-memory only and used by libgit2. Only the flags in GIT_IDXENTRY_EXTENDED_FLAGS will get saved on-disk.

\n\n

Thee first three bitmasks match the three fields in the git_index_entry flags_extended value that belong on disk. You can use them to interpret the data in the flags_extended.

\n\n

The rest of the bitmasks match the other fields in the git_index_entry flags_extended value that are only used in-memory by libgit2. You can use them to interpret the data in the flags_extended.

\n", "fields": [ { "type": "int", @@ -28994,10 +29326,14 @@ "description": " Memory representation of an index file. ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_index_get_byindex", + "git_index_get_bypath" + ], "needs": [ "git_checkout_index", "git_cherrypick_commit", + "git_diff_index_to_index", "git_diff_index_to_workdir", "git_diff_tree_to_index", "git_index_add", @@ -29010,10 +29346,15 @@ "git_index_conflict_add", "git_index_conflict_cleanup", "git_index_conflict_get", + "git_index_conflict_iterator_free", "git_index_conflict_iterator_new", + "git_index_conflict_next", "git_index_conflict_remove", + "git_index_entry_is_conflict", + "git_index_entry_stage", "git_index_entrycount", "git_index_find", + "git_index_find_prefix", "git_index_free", "git_index_get_byindex", "git_index_get_bypath", @@ -29033,9 +29374,16 @@ "git_index_write", "git_index_write_tree", "git_index_write_tree_to", + "git_indexer_append", + "git_indexer_commit", + "git_indexer_free", + "git_indexer_hash", + "git_indexer_new", "git_merge_commits", + "git_merge_file_from_index", "git_merge_trees", "git_pathspec_match_index", + "git_rebase_inmemory_index", "git_repository_index", "git_repository_set_index", "git_revert_commit" @@ -29139,7 +29487,7 @@ "block": "git_index_time ctime\ngit_index_time mtime\nuint32_t dev\nuint32_t ino\nuint32_t mode\nuint32_t uid\nuint32_t gid\nuint32_t file_size\ngit_oid id\nuint16_t flags\nuint16_t flags_extended\nconst char * path", "tdef": "typedef", "description": " In-memory representation of a file entry in the index.", - "comments": "

This is a public structure that represents a file entry in the index.\n The meaning of the fields corresponds to core Git's documentation (in\n "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be\n accessed via the first set of GIT_IDXENTRY_... bitmasks below. These\n flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be\n accessed via the later GIT_IDXENTRY_... bitmasks below. Some of\n these flags are read from and written to disk, but some are set aside\n for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This\n is enough to detect changes, which is enough for the index to\n function as a cache, but it should not be taken as an authoritative\n source for that data.

\n", + "comments": "

This is a public structure that represents a file entry in the index. The meaning of the fields corresponds to core Git's documentation (in "Documentation/technical/index-format.txt").

\n\n

The flags field consists of a number of bit fields which can be accessed via the first set of GIT_IDXENTRY_... bitmasks below. These flags are all read from and persisted to disk.

\n\n

The flags_extended field also has a number of bit fields which can be accessed via the later GIT_IDXENTRY_... bitmasks below. Some of these flags are read from and written to disk, but some are set aside for in-memory only reference.

\n\n

Note that the time and size fields are truncated to 32 bits. This is enough to detect changes, which is enough for the index to function as a cache, but it should not be taken as an authoritative source for that data.

\n", "fields": [ { "type": "git_index_time", @@ -29354,16 +29702,19 @@ "GIT_OPT_GET_CACHED_MEMORY", "GIT_OPT_GET_TEMPLATE_PATH", "GIT_OPT_SET_TEMPLATE_PATH", - "GIT_OPT_SET_SSL_CERT_LOCATIONS" + "GIT_OPT_SET_SSL_CERT_LOCATIONS", + "GIT_OPT_SET_USER_AGENT", + "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "GIT_OPT_SET_SSL_CIPHERS" ], "type": "enum", "file": "common.h", - "line": 132, - "lineto": 146, - "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS", + "line": 144, + "lineto": 161, + "block": "GIT_OPT_GET_MWINDOW_SIZE\nGIT_OPT_SET_MWINDOW_SIZE\nGIT_OPT_GET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_SET_MWINDOW_MAPPED_LIMIT\nGIT_OPT_GET_SEARCH_PATH\nGIT_OPT_SET_SEARCH_PATH\nGIT_OPT_SET_CACHE_OBJECT_LIMIT\nGIT_OPT_SET_CACHE_MAX_SIZE\nGIT_OPT_ENABLE_CACHING\nGIT_OPT_GET_CACHED_MEMORY\nGIT_OPT_GET_TEMPLATE_PATH\nGIT_OPT_SET_TEMPLATE_PATH\nGIT_OPT_SET_SSL_CERT_LOCATIONS\nGIT_OPT_SET_USER_AGENT\nGIT_OPT_ENABLE_STRICT_OBJECT_CREATION\nGIT_OPT_SET_SSL_CIPHERS", "tdef": "typedef", "description": " Global library options", - "comments": "

These are used to select which global option to set or get and are\n used in git_libgit2_opts().

\n", + "comments": "

These are used to select which global option to set or get and are used in git_libgit2_opts().

\n", "fields": [ { "type": "int", @@ -29442,6 +29793,24 @@ "name": "GIT_OPT_SET_SSL_CERT_LOCATIONS", "comments": "", "value": 12 + }, + { + "type": "int", + "name": "GIT_OPT_SET_USER_AGENT", + "comments": "", + "value": 13 + }, + { + "type": "int", + "name": "GIT_OPT_ENABLE_STRICT_OBJECT_CREATION", + "comments": "", + "value": 14 + }, + { + "type": "int", + "name": "GIT_OPT_SET_SSL_CIPHERS", + "comments": "", + "value": 15 } ], "used": { @@ -29462,8 +29831,8 @@ ], "type": "enum", "file": "merge.h", - "line": 272, - "lineto": 301, + "line": 302, + "lineto": 331, "block": "GIT_MERGE_ANALYSIS_NONE\nGIT_MERGE_ANALYSIS_NORMAL\nGIT_MERGE_ANALYSIS_UP_TO_DATE\nGIT_MERGE_ANALYSIS_FASTFORWARD\nGIT_MERGE_ANALYSIS_UNBORN", "tdef": "typedef", "description": " The results of `git_merge_analysis` indicate the merge opportunities.", @@ -29519,8 +29888,8 @@ ], "type": "enum", "file": "merge.h", - "line": 81, - "lineto": 111, + "line": 101, + "lineto": 131, "block": "GIT_MERGE_FILE_FAVOR_NORMAL\nGIT_MERGE_FILE_FAVOR_OURS\nGIT_MERGE_FILE_FAVOR_THEIRS\nGIT_MERGE_FILE_FAVOR_UNION", "tdef": "typedef", "description": " Merge file favor options for `git_merge_options` instruct the file-level\n merging functionality how to deal with conflicting regions of the files.", @@ -29558,7 +29927,7 @@ } ], [ - "git_merge_file_flags_t", + "git_merge_file_flag_t", { "decl": [ "GIT_MERGE_FILE_DEFAULT", @@ -29573,8 +29942,8 @@ ], "type": "enum", "file": "merge.h", - "line": 116, - "lineto": 143, + "line": 136, + "lineto": 163, "block": "GIT_MERGE_FILE_DEFAULT\nGIT_MERGE_FILE_STYLE_MERGE\nGIT_MERGE_FILE_STYLE_DIFF3\nGIT_MERGE_FILE_SIMPLIFY_ALNUM\nGIT_MERGE_FILE_IGNORE_WHITESPACE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE\nGIT_MERGE_FILE_IGNORE_WHITESPACE_EOL\nGIT_MERGE_FILE_DIFF_PATIENCE\nGIT_MERGE_FILE_DIFF_MINIMAL", "tdef": "typedef", "description": " File merging flags", @@ -29705,14 +30074,14 @@ "const char * our_label", "const char * their_label", "git_merge_file_favor_t favor", - "unsigned int flags" + "git_merge_file_flag_t flags" ], "type": "struct", "value": "git_merge_file_options", "file": "merge.h", - "line": 148, - "lineto": 174, - "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\nunsigned int flags", + "line": 168, + "lineto": 194, + "block": "unsigned int version\nconst char * ancestor_label\nconst char * our_label\nconst char * their_label\ngit_merge_file_favor_t favor\ngit_merge_file_flag_t flags", "tdef": "typedef", "description": " Options for merging a file", "comments": "", @@ -29743,9 +30112,9 @@ "comments": " The file to favor in region conflicts. " }, { - "type": "unsigned int", + "type": "git_merge_file_flag_t", "name": "flags", - "comments": " see `git_merge_file_flags_t` above " + "comments": " see `git_merge_file_flag_t` above " } ], "used": { @@ -29771,8 +30140,8 @@ "type": "struct", "value": "git_merge_file_result", "file": "merge.h", - "line": 195, - "lineto": 216, + "line": 215, + "lineto": 236, "block": "unsigned int automergeable\nconst char * path\nunsigned int mode\nconst char * ptr\nsize_t len", "tdef": "typedef", "description": " Information about file-level merging", @@ -29814,24 +30183,74 @@ } } ], + [ + "git_merge_flag_t", + { + "decl": [ + "GIT_MERGE_FIND_RENAMES", + "GIT_MERGE_FAIL_ON_CONFLICT", + "GIT_MERGE_SKIP_REUC", + "GIT_MERGE_NO_RECURSIVE" + ], + "type": "enum", + "file": "merge.h", + "line": 68, + "lineto": 95, + "block": "GIT_MERGE_FIND_RENAMES\nGIT_MERGE_FAIL_ON_CONFLICT\nGIT_MERGE_SKIP_REUC\nGIT_MERGE_NO_RECURSIVE", + "tdef": "typedef", + "description": " Flags for `git_merge` options. A combination of these flags can be\n passed in via the `flags` value in the `git_merge_options`.", + "comments": "", + "fields": [ + { + "type": "int", + "name": "GIT_MERGE_FIND_RENAMES", + "comments": "

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n", + "value": 1 + }, + { + "type": "int", + "name": "GIT_MERGE_FAIL_ON_CONFLICT", + "comments": "

If a conflict occurs, exit immediately instead of attempting to\n continue resolving conflicts. The merge operation will fail with\n GIT_EMERGECONFLICT and no index will be returned.

\n", + "value": 2 + }, + { + "type": "int", + "name": "GIT_MERGE_SKIP_REUC", + "comments": "

Do not write the REUC extension on the generated index

\n", + "value": 4 + }, + { + "type": "int", + "name": "GIT_MERGE_NO_RECURSIVE", + "comments": "

If the commits being merged have multiple merge bases, do not build\n a recursive merge base (by merging the multiple merge bases),\n instead simply use the first base. This flag provides a similar\n merge base to git-merge-resolve.

\n", + "value": 8 + } + ], + "used": { + "returns": [], + "needs": [] + } + } + ], [ "git_merge_options", { "decl": [ "unsigned int version", - "git_merge_tree_flag_t tree_flags", + "git_merge_flag_t flags", "unsigned int rename_threshold", "unsigned int target_limit", "git_diff_similarity_metric * metric", + "unsigned int recursion_limit", "git_merge_file_favor_t file_favor", - "unsigned int file_flags" + "git_merge_file_flag_t file_flags" ], "type": "struct", "value": "git_merge_options", "file": "merge.h", - "line": 221, - "lineto": 251, - "block": "unsigned int version\ngit_merge_tree_flag_t tree_flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\ngit_merge_file_favor_t file_favor\nunsigned int file_flags", + "line": 241, + "lineto": 281, + "block": "unsigned int version\ngit_merge_flag_t flags\nunsigned int rename_threshold\nunsigned int target_limit\ngit_diff_similarity_metric * metric\nunsigned int recursion_limit\ngit_merge_file_favor_t file_favor\ngit_merge_file_flag_t file_flags", "tdef": "typedef", "description": " Merging options", "comments": "", @@ -29842,14 +30261,14 @@ "comments": "" }, { - "type": "git_merge_tree_flag_t", - "name": "tree_flags", - "comments": "" + "type": "git_merge_flag_t", + "name": "flags", + "comments": " See `git_merge_flag_t` above " }, { "type": "unsigned int", "name": "rename_threshold", - "comments": " Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename." + "comments": " Similarity to consider a file renamed (default 50). If\n `GIT_MERGE_FIND_RENAMES` is enabled, added files will be compared\n with deleted files to determine their similarity. Files that are\n more similar than the rename threshold (percentage-wise) will be\n treated as a rename." }, { "type": "unsigned int", @@ -29861,15 +30280,20 @@ "name": "metric", "comments": " Pluggable similarity metric; pass NULL to use internal metric " }, + { + "type": "unsigned int", + "name": "recursion_limit", + "comments": " Maximum number of times to merge common ancestors to build a\n virtual merge base when faced with criss-cross merges. When this\n limit is reached, the next ancestor will simply be used instead of\n attempting to merge it. The default is unlimited." + }, { "type": "git_merge_file_favor_t", "name": "file_favor", "comments": " Flags for handling conflicting content. " }, { - "type": "unsigned int", + "type": "git_merge_file_flag_t", "name": "file_flags", - "comments": " see `git_merge_file_flags_t` above " + "comments": " see `git_merge_file_flag_t` above " } ], "used": { @@ -29895,8 +30319,8 @@ ], "type": "enum", "file": "merge.h", - "line": 306, - "lineto": 324, + "line": 336, + "lineto": 354, "block": "GIT_MERGE_PREFERENCE_NONE\nGIT_MERGE_PREFERENCE_NO_FASTFORWARD\nGIT_MERGE_PREFERENCE_FASTFORWARD_ONLY", "tdef": "typedef", "description": " The user's stated preference for merges.", @@ -29947,34 +30371,6 @@ } } ], - [ - "git_merge_tree_flag_t", - { - "decl": [ - "GIT_MERGE_TREE_FIND_RENAMES" - ], - "type": "enum", - "file": "merge.h", - "line": 68, - "lineto": 75, - "block": "GIT_MERGE_TREE_FIND_RENAMES", - "tdef": "typedef", - "description": " Flags for `git_merge_tree` options. A combination of these flags can be\n passed in via the `tree_flags` value in the `git_merge_options`.", - "comments": "", - "fields": [ - { - "type": "int", - "name": "GIT_MERGE_TREE_FIND_RENAMES", - "comments": "

Detect renames that occur between the common ancestor and the "ours"\n side or the common ancestor and the "theirs" side. This will enable\n the ability to merge between a modified and renamed file.

\n", - "value": 1 - } - ], - "used": { - "returns": [], - "needs": [] - } - } - ], [ "git_note", { @@ -29992,9 +30388,13 @@ "needs": [ "git_note_author", "git_note_committer", + "git_note_foreach", "git_note_free", "git_note_id", + "git_note_iterator_free", + "git_note_iterator_new", "git_note_message", + "git_note_next", "git_note_read" ] } @@ -30080,16 +30480,28 @@ "returns": [], "needs": [ "git_indexer_new", + "git_mempack_new", + "git_mempack_reset", "git_odb_add_alternate", "git_odb_add_backend", "git_odb_add_disk_alternate", + "git_odb_backend_loose", + "git_odb_backend_one_pack", + "git_odb_backend_pack", "git_odb_exists", "git_odb_exists_prefix", "git_odb_foreach", "git_odb_free", "git_odb_get_backend", + "git_odb_init_backend", "git_odb_new", "git_odb_num_backends", + "git_odb_object_data", + "git_odb_object_dup", + "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", @@ -30097,6 +30509,10 @@ "git_odb_read_header", "git_odb_read_prefix", "git_odb_refresh", + "git_odb_stream_finalize_write", + "git_odb_stream_free", + "git_odb_stream_read", + "git_odb_stream_write", "git_odb_write", "git_odb_write_pack", "git_repository_odb", @@ -30115,7 +30531,7 @@ "file": "types.h", "line": 84, "lineto": 84, - "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t) read_prefix\nint (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, size_t) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free", + "block": "unsigned int version\ngit_odb * odb\nint (*)(void **, int *, git_otype *, git_odb_backend *, const git_oid *) read\nint (*)(git_oid *, void **, int *, git_otype *, git_odb_backend *, const git_oid *, int) read_prefix\nint (*)(int *, git_otype *, git_odb_backend *, const git_oid *) read_header\nint (*)(git_odb_backend *, const git_oid *, const void *, int, git_otype) write\nint (*)(git_odb_stream **, git_odb_backend *, git_off_t, git_otype) writestream\nint (*)(git_odb_stream **, git_odb_backend *, const git_oid *) readstream\nint (*)(git_odb_backend *, const git_oid *) exists\nint (*)(git_oid *, git_odb_backend *, const git_oid *, int) exists_prefix\nint (*)(git_odb_backend *) refresh\nint (*)(git_odb_backend *, git_odb_foreach_cb, void *) foreach\nint (*)(git_odb_writepack **, git_odb_backend *, git_odb *, git_transfer_progress_cb, void *) writepack\nvoid (*)(git_odb_backend *) free", "tdef": "typedef", "description": " A custom backend in an ODB ", "comments": "", @@ -30131,22 +30547,22 @@ "comments": "" }, { - "type": "int (*)(void **, size_t *, git_otype *, git_odb_backend *, const git_oid *)", + "type": "int (*)(void **, int *, git_otype *, git_odb_backend *, const git_oid *)", "name": "read", "comments": "" }, { - "type": "int (*)(git_oid *, void **, size_t *, git_otype *, git_odb_backend *, const git_oid *, size_t)", + "type": "int (*)(git_oid *, void **, int *, git_otype *, git_odb_backend *, const git_oid *, int)", "name": "read_prefix", "comments": "" }, { - "type": "int (*)(size_t *, git_otype *, git_odb_backend *, const git_oid *)", + "type": "int (*)(int *, git_otype *, git_odb_backend *, const git_oid *)", "name": "read_header", "comments": "" }, { - "type": "int (*)(git_odb_backend *, const git_oid *, const void *, size_t, git_otype)", + "type": "int (*)(git_odb_backend *, const git_oid *, const void *, int, git_otype)", "name": "write", "comments": " Write an object into the backend. The id of the object has\n already been calculated and is passed in." }, @@ -30166,7 +30582,7 @@ "comments": "" }, { - "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, size_t)", + "type": "int (*)(git_oid *, git_odb_backend *, const git_oid *, int)", "name": "exists_prefix", "comments": "" }, @@ -30188,7 +30604,7 @@ { "type": "void (*)(git_odb_backend *)", "name": "free", - "comments": "" + "comments": " Frees any resources held by the odb (including the `git_odb_backend`\n itself). An odb backend implementation must provide this function." } ], "used": { @@ -30427,6 +30843,7 @@ "git_note_id", "git_object_id", "git_odb_object_id", + "git_oid_shorten_new", "git_packbuilder_hash", "git_reference_target", "git_reference_target_peel", @@ -30452,8 +30869,8 @@ "git_commit_amend", "git_commit_create", "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", + "git_commit_extract_signature", "git_commit_lookup", "git_commit_lookup_prefix", "git_graph_ahead_behind", @@ -30466,6 +30883,7 @@ "git_merge_bases", "git_merge_bases_many", "git_note_create", + "git_note_foreach_cb", "git_note_next", "git_note_read", "git_note_remove", @@ -30473,6 +30891,7 @@ "git_object_lookup_prefix", "git_odb_exists", "git_odb_exists_prefix", + "git_odb_foreach_cb", "git_odb_hash", "git_odb_hashfile", "git_odb_open_rstream", @@ -30493,10 +30912,13 @@ "git_oid_ncmp", "git_oid_nfmt", "git_oid_pathfmt", + "git_oid_shorten_add", + "git_oid_shorten_free", "git_oid_strcmp", "git_oid_streq", "git_oid_tostr", "git_oid_tostr_s", + "git_oidarray_free", "git_packbuilder_insert", "git_packbuilder_insert_commit", "git_packbuilder_insert_recur", @@ -30511,6 +30933,7 @@ "git_repository_hashfile", "git_repository_set_head_detached", "git_revwalk_hide", + "git_revwalk_hide_cb", "git_revwalk_next", "git_revwalk_push", "git_tag_annotation_create", @@ -30675,7 +31098,13 @@ } ], "used": { - "returns": [], + "returns": [ + "git_object_string2type", + "git_object_type", + "git_odb_object_type", + "git_tag_target_type", + "git_tree_entry_type" + ], "needs": [ "git_object__size", "git_object_lookup", @@ -30774,7 +31203,7 @@ "lineto": 29, "tdef": "typedef", "description": " The diff patch is used to store all the text diffs for a delta.", - "comments": "

You can easily loop over the content of patches and get information about\n them.

\n", + "comments": "

You can easily loop over the content of patches and get information about them.

\n", "used": { "returns": [], "needs": [ @@ -30814,6 +31243,12 @@ "git_pathspec_free", "git_pathspec_match_diff", "git_pathspec_match_index", + "git_pathspec_match_list_diff_entry", + "git_pathspec_match_list_entry", + "git_pathspec_match_list_entrycount", + "git_pathspec_match_list_failed_entry", + "git_pathspec_match_list_failed_entrycount", + "git_pathspec_match_list_free", "git_pathspec_match_tree", "git_pathspec_match_workdir", "git_pathspec_matches_path", @@ -30841,7 +31276,7 @@ "block": "GIT_PATHSPEC_DEFAULT\nGIT_PATHSPEC_IGNORE_CASE\nGIT_PATHSPEC_USE_CASE\nGIT_PATHSPEC_NO_GLOB\nGIT_PATHSPEC_NO_MATCH_ERROR\nGIT_PATHSPEC_FIND_FAILURES\nGIT_PATHSPEC_FAILURES_ONLY", "tdef": "typedef", "description": " Options controlling how pathspec match should be executed", - "comments": "
    \n
  • GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise\nmatch will use native case sensitivity of platform filesystem
  • \n
  • GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple\nstring comparison for matching
  • \n
  • GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error\ncode GIT_ENOTFOUND if no matches are found; otherwise no matches is\nstill success (return 0) but git_pathspec_match_list_entrycount\nwill indicate 0 matches.
  • \n
  • GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list\nshould track which patterns matched which files so that at the end of\nthe match we can identify patterns that did not match any files.
  • \n
  • GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list\ndoes not need to keep the actual matching filenames. Use this to\njust test if there were any matches at all or in combination with\nGIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
  • \n
\n", + "comments": "
    \n
  • GIT_PATHSPEC_IGNORE_CASE forces match to ignore case; otherwise match will use native case sensitivity of platform filesystem - GIT_PATHSPEC_USE_CASE forces case sensitive match; otherwise match will use native case sensitivity of platform filesystem - GIT_PATHSPEC_NO_GLOB disables glob patterns and just uses simple string comparison for matching - GIT_PATHSPEC_NO_MATCH_ERROR means the match functions return error code GIT_ENOTFOUND if no matches are found; otherwise no matches is still success (return 0) but git_pathspec_match_list_entrycount will indicate 0 matches. - GIT_PATHSPEC_FIND_FAILURES means that the git_pathspec_match_list should track which patterns matched which files so that at the end of the match we can identify patterns that did not match any files. - GIT_PATHSPEC_FAILURES_ONLY means that the git_pathspec_match_list does not need to keep the actual matching filenames. Use this to just test if there were any matches at all or in combination with GIT_PATHSPEC_FIND_FAILURES to validate a pathspec.
  • \n
\n", "fields": [ { "type": "int", @@ -30935,7 +31370,12 @@ "comments": "", "used": { "returns": [], - "needs": [] + "needs": [ + "git_push_init_options", + "git_push_negotiation", + "git_remote_push", + "git_remote_upload" + ] } } ], @@ -30945,14 +31385,15 @@ "decl": [ "unsigned int version", "unsigned int pb_parallelism", - "git_remote_callbacks callbacks" + "git_remote_callbacks callbacks", + "git_strarray custom_headers" ], "type": "struct", "value": "git_push_options", "file": "remote.h", - "line": 571, - "lineto": 588, - "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks", + "line": 577, + "lineto": 599, + "block": "unsigned int version\nunsigned int pb_parallelism\ngit_remote_callbacks callbacks\ngit_strarray custom_headers", "tdef": "typedef", "description": " Controls the behavior of a git_push object.", "comments": "", @@ -30971,6 +31412,11 @@ "type": "git_remote_callbacks", "name": "callbacks", "comments": " Callbacks to use for this push operation" + }, + { + "type": "git_strarray", + "name": "custom_headers", + "comments": " Extra headers for this push operation" } ], "used": { @@ -30995,8 +31441,8 @@ "type": "struct", "value": "git_push_update", "file": "remote.h", - "line": 340, - "lineto": 357, + "line": 341, + "lineto": 358, "block": "char * src_refname\nchar * dst_refname\ngit_oid src\ngit_oid dst", "tdef": "typedef", "description": " Represents an update which will be performed on the remote during push", @@ -31025,7 +31471,9 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_push_negotiation" + ] } } ], @@ -31042,13 +31490,17 @@ "description": " Representation of a rebase ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_rebase_operation_byindex" + ], "needs": [ "git_rebase_abort", "git_rebase_commit", "git_rebase_finish", "git_rebase_free", "git_rebase_init", + "git_rebase_init_options", + "git_rebase_inmemory_index", "git_rebase_next", "git_rebase_open", "git_rebase_operation_byindex", @@ -31069,12 +31521,12 @@ "type": "struct", "value": "git_rebase_operation", "file": "rebase.h", - "line": 115, - "lineto": 130, + "line": 130, + "lineto": 145, "block": "git_rebase_operation_t type\nconst git_oid id\nconst char * exec", "tdef": "typedef", "description": " A rebase operation", - "comments": "

Describes a single instruction/operation to be performed during the\n rebase.

\n", + "comments": "

Describes a single instruction/operation to be performed during the rebase.

\n", "fields": [ { "type": "git_rebase_operation_t", @@ -31115,8 +31567,8 @@ ], "type": "enum", "file": "rebase.h", - "line": 64, - "lineto": 100, + "line": 78, + "lineto": 114, "block": "GIT_REBASE_OPERATION_PICK\nGIT_REBASE_OPERATION_REWORD\nGIT_REBASE_OPERATION_EDIT\nGIT_REBASE_OPERATION_SQUASH\nGIT_REBASE_OPERATION_FIXUP\nGIT_REBASE_OPERATION_EXEC", "tdef": "typedef", "description": " Type of rebase operation in-progress after calling `git_rebase_next`.", @@ -31209,7 +31661,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_reference_type" + ], "needs": [] } } @@ -31229,8 +31683,10 @@ "used": { "returns": [], "needs": [ + "git_refdb_backend_fs", "git_refdb_compress", "git_refdb_free", + "git_refdb_init_backend", "git_refdb_new", "git_refdb_open", "git_refdb_set_backend", @@ -31287,7 +31743,7 @@ { "type": "int (*)(git_refdb_backend *, const char *, const git_oid *, const char *)", "name": "del", - "comments": " Deletes the given reference from the refdb. A refdb implementation\n must provide this function." + "comments": " Deletes the given reference (and if necessary its reflog)\n from the refdb. A refdb implementation must provide this\n function." }, { "type": "int (*)(git_refdb_backend *)", @@ -31307,7 +31763,7 @@ { "type": "void (*)(git_refdb_backend *)", "name": "free", - "comments": " Frees any resources held by the refdb. A refdb implementation may\n provide this function; if it is not provided, nothing will be done." + "comments": " Frees any resources held by the refdb (including the `git_refdb_backend`\n itself). A refdb backend implementation must provide this function." }, { "type": "int (*)(git_reflog **, git_refdb_backend *, const char *)", @@ -31384,14 +31840,21 @@ "git_reference_create_matching", "git_reference_delete", "git_reference_dwim", + "git_reference_foreach", + "git_reference_foreach_glob", + "git_reference_foreach_name", "git_reference_free", "git_reference_is_branch", "git_reference_is_note", "git_reference_is_remote", "git_reference_is_tag", + "git_reference_iterator_free", + "git_reference_iterator_glob_new", + "git_reference_iterator_new", "git_reference_lookup", "git_reference_name", "git_reference_next", + "git_reference_next_name", "git_reference_owner", "git_reference_peel", "git_reference_rename", @@ -31520,11 +31983,17 @@ "description": " Representation of a reference log ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_reflog_entry_byindex" + ], "needs": [ "git_reflog_append", "git_reflog_drop", "git_reflog_entry_byindex", + "git_reflog_entry_committer", + "git_reflog_entry_id_new", + "git_reflog_entry_id_old", + "git_reflog_entry_message", "git_reflog_entrycount", "git_reflog_free", "git_reflog_read", @@ -31571,13 +32040,17 @@ "description": " Git's idea of a remote repository. A remote can be anonymous (in\n which case it does not have backing configuration entires).", "comments": "", "used": { - "returns": [], + "returns": [ + "git_remote_autotag" + ], "needs": [ + "git_headlist_cb", "git_remote_autotag", "git_remote_connect", "git_remote_connected", "git_remote_create", "git_remote_create_anonymous", + "git_remote_create_cb", "git_remote_create_with_fetchspec", "git_remote_default_branch", "git_remote_disconnect", @@ -31588,6 +32061,7 @@ "git_remote_get_fetch_refspecs", "git_remote_get_push_refspecs", "git_remote_get_refspec", + "git_remote_init_callbacks", "git_remote_lookup", "git_remote_ls", "git_remote_name", @@ -31597,11 +32071,13 @@ "git_remote_push", "git_remote_pushurl", "git_remote_refspec_count", + "git_remote_set_autotag", "git_remote_stats", "git_remote_stop", "git_remote_update_tips", "git_remote_upload", "git_remote_url", + "git_transport_cb", "git_transport_dummy", "git_transport_local", "git_transport_new", @@ -31622,8 +32098,8 @@ ], "type": "enum", "file": "remote.h", - "line": 494, - "lineto": 512, + "line": 495, + "lineto": 513, "block": "GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED\nGIT_REMOTE_DOWNLOAD_TAGS_AUTO\nGIT_REMOTE_DOWNLOAD_TAGS_NONE\nGIT_REMOTE_DOWNLOAD_TAGS_ALL", "tdef": "typedef", "description": " Automatic tag following option", @@ -31655,7 +32131,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_remote_autotag" + ], "needs": [ "git_remote_set_autotag", "git_remote_update_tips" @@ -31684,12 +32162,12 @@ "type": "struct", "value": "git_remote_callbacks", "file": "remote.h", - "line": 373, - "lineto": 457, + "line": 374, + "lineto": 458, "block": "unsigned int version\ngit_transport_message_cb sideband_progress\nint (*)(git_remote_completion_type, void *) completion\ngit_cred_acquire_cb credentials\ngit_transport_certificate_check_cb certificate_check\ngit_transfer_progress_cb transfer_progress\nint (*)(const char *, const git_oid *, const git_oid *, void *) update_tips\ngit_packbuilder_progress pack_progress\ngit_push_transfer_progress push_transfer_progress\nint (*)(const char *, const char *, void *) push_update_reference\ngit_push_negotiation push_negotiation\ngit_transport_cb transport\nvoid * payload", "tdef": null, "description": " The callback settings structure", - "comments": "

Set the callbacks to be called by the remote when informing the user\n about the progress of the network operations.

\n", + "comments": "

Set the callbacks to be called by the remote when informing the user about the progress of the network operations.

\n", "fields": [ { "type": "unsigned int", @@ -31778,8 +32256,8 @@ ], "type": "enum", "file": "remote.h", - "line": 325, - "lineto": 329, + "line": 326, + "lineto": 330, "block": "GIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR\nGIT_REMOTE_COMPLETION_DOWNLOAD\nGIT_REMOTE_COMPLETION_INDEXING\nGIT_REMOTE_COMPLETION_ERROR", "tdef": "typedef", "description": " Argument to the completion callback which tells it which operation\n finished.", @@ -31859,6 +32337,7 @@ "used": { "returns": [], "needs": [ + "git_headlist_cb", "git_remote_ls" ] } @@ -31919,12 +32398,13 @@ "git_clone", "git_commit_create", "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", + "git_commit_extract_signature", "git_commit_lookup", "git_commit_lookup_prefix", "git_describe_workdir", "git_diff_commit_as_email", + "git_diff_index_to_index", "git_diff_index_to_workdir", "git_diff_tree_to_index", "git_diff_tree_to_tree", @@ -31987,6 +32467,7 @@ "git_remote_add_push", "git_remote_create", "git_remote_create_anonymous", + "git_remote_create_cb", "git_remote_create_with_fetchspec", "git_remote_delete", "git_remote_list", @@ -31998,6 +32479,7 @@ "git_repository__cleanup", "git_repository_config", "git_repository_config_snapshot", + "git_repository_create_cb", "git_repository_detach_head", "git_repository_fetchhead_foreach", "git_repository_free", @@ -32010,6 +32492,7 @@ "git_repository_index", "git_repository_init", "git_repository_init_ext", + "git_repository_init_init_options", "git_repository_is_bare", "git_repository_is_empty", "git_repository_is_shallow", @@ -32107,7 +32590,7 @@ "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\nGIT_REPOSITORY_INIT_RELATIVE_GITLINK", "tdef": "typedef", "description": " Option flags for `git_repository_init_ext`.", - "comments": "

These flags configure extra behaviors to git_repository_init_ext.\n In every case, the default behavior is the zero value (i.e. flag is\n not set). Just OR the flag values together for the flags parameter\n when initializing a new repo. Details of individual values are:

\n\n
    \n
  • BARE - Create a bare repository with no working directory.
  • \n
  • NO_REINIT - Return an GIT_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.
  • \n
  • GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is\n specified, use relative paths for the gitdir and core.worktree.
  • \n
\n", + "comments": "

These flags configure extra behaviors to git_repository_init_ext. In every case, the default behavior is the zero value (i.e. flag is not set). Just OR the flag values together for the flags parameter when initializing a new repo. Details of individual values are:

\n\n
    \n
  • BARE - Create a bare repository with no working directory. * NO_REINIT - Return an GIT_EEXISTS error if the repo_path appears to already be an git repository. * NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo path for non-bare repos (if it is not already there), but passing this flag prevents that behavior. * MKDIR - Make the repo_path (and workdir_path) as needed. Init is always willing to create the ".git" directory even without this flag. This flag tells init to create the trailing component of the repo and workdir paths as needed. * MKPATH - Recursively make all components of the repo and workdir paths as necessary. * EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to initialize a new repo. This flags enables external templates, looking the "template_path" from the options if set, or the init.templatedir global config if not, or falling back on "/usr/share/git-core/templates" if it exists. * GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is specified, use relative paths for the gitdir and core.worktree.
  • \n
\n", "fields": [ { "type": "int", @@ -32173,7 +32656,7 @@ "block": "GIT_REPOSITORY_INIT_SHARED_UMASK\nGIT_REPOSITORY_INIT_SHARED_GROUP\nGIT_REPOSITORY_INIT_SHARED_ALL", "tdef": "typedef", "description": " Mode options for `git_repository_init_ext`.", - "comments": "

Set the mode field of the git_repository_init_options structure\n either to the custom mode that you would like, or to one of the\n following modes:

\n\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.
  • \n
\n", + "comments": "

Set the mode field of the git_repository_init_options structure either to the custom mode that you would like, or to one of the following modes:

\n\n
    \n
  • SHARED_UMASK - Use permissions configured by umask - the default. * SHARED_GROUP - Use "--shared=group" behavior, chmod'ing the new repo to be group writable and "g+sx" for sticky group assignment. * SHARED_ALL - Use "--shared=all" behavior, adding world readability. * Anything else - Set to custom value.
  • \n
\n", "fields": [ { "type": "int", @@ -32221,7 +32704,7 @@ "block": "unsigned int version\nuint32_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", "description": " Extended options structure for `git_repository_init_ext`.", - "comments": "

This contains extra options for git_repository_init_ext that enable\n additional initialization features. The fields are:

\n\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.
  • \n
\n", + "comments": "

This contains extra options for git_repository_init_ext that enable additional initialization features. The fields are:

\n\n
    \n
  • flags - Combination of GIT_REPOSITORY_INIT flags above. * mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... constants above, or to a custom value that you would like. * workdir_path - The path to the working dir or NULL for default (i.e. repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH, IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not the "natural" working directory, a .git gitlink file will be created here linking to the repo_path. * description - If set, this will be used to initialize the "description" file in the repository, instead of using the template content. * template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains the path to use for the template directory. If this is NULL, the config or default directory options will be used instead. * initial_head - The name of the head to point HEAD at. If NULL, then this will be treated as "master" and the HEAD ref will be set to "refs/heads/master". If this begins with "refs/" it will be used verbatim; otherwise "refs/heads/" will be prefixed. * origin_url - If this is non-NULL, then after the rest of the repository initialization is completed, an "origin" remote will be added pointing to this URL.
  • \n
\n", "fields": [ { "type": "unsigned int", @@ -32288,7 +32771,7 @@ "block": "GIT_REPOSITORY_OPEN_NO_SEARCH\nGIT_REPOSITORY_OPEN_CROSS_FS\nGIT_REPOSITORY_OPEN_BARE", "tdef": "typedef", "description": " Option flags for `git_repository_open_ext`.", - "comments": "
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be\nimmediately found in the start_path. Do not walk up from the\nstart_path looking at parent directories.
  • \n
  • GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not\ncontinue searching across filesystem boundaries (i.e. when st_dev\nchanges from the stat system call). (E.g. Searching in a user's home\ndirectory "/home/user/source/" will not return "/.git/" as the found\nrepo if "/" is a different filesystem than "/home".)
  • \n
  • GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless\nof core.bare config, and defer loading config file for faster setup.\nUnlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n", + "comments": "
    \n
  • GIT_REPOSITORY_OPEN_NO_SEARCH - Only open the repository if it can be immediately found in the start_path. Do not walk up from the start_path looking at parent directories. * GIT_REPOSITORY_OPEN_CROSS_FS - Unless this flag is set, open will not continue searching across filesystem boundaries (i.e. when st_dev changes from the stat system call). (E.g. Searching in a user's home directory "/home/user/source/" will not return "/.git/" as the found repo if "/" is a different filesystem than "/home".) * GIT_REPOSITORY_OPEN_BARE - Open repository as a bare repo regardless of core.bare config, and defer loading config file for faster setup. Unlike git_repository_open_bare, this can follow gitlinks.
  • \n
\n", "fields": [ { "type": "int", @@ -32322,7 +32805,9 @@ "GIT_REPOSITORY_STATE_NONE", "GIT_REPOSITORY_STATE_MERGE", "GIT_REPOSITORY_STATE_REVERT", + "GIT_REPOSITORY_STATE_REVERT_SEQUENCE", "GIT_REPOSITORY_STATE_CHERRYPICK", + "GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE", "GIT_REPOSITORY_STATE_BISECT", "GIT_REPOSITORY_STATE_REBASE", "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", @@ -32333,11 +32818,11 @@ "type": "enum", "file": "repository.h", "line": 674, - "lineto": 685, - "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "lineto": 687, + "block": "GIT_REPOSITORY_STATE_NONE\nGIT_REPOSITORY_STATE_MERGE\nGIT_REPOSITORY_STATE_REVERT\nGIT_REPOSITORY_STATE_REVERT_SEQUENCE\nGIT_REPOSITORY_STATE_CHERRYPICK\nGIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE\nGIT_REPOSITORY_STATE_BISECT\nGIT_REPOSITORY_STATE_REBASE\nGIT_REPOSITORY_STATE_REBASE_INTERACTIVE\nGIT_REPOSITORY_STATE_REBASE_MERGE\nGIT_REPOSITORY_STATE_APPLY_MAILBOX\nGIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", "tdef": "typedef", "description": " Repository state", - "comments": "

These values represent possible states for the repository to be in,\n based on the current operation which is ongoing.

\n", + "comments": "

These values represent possible states for the repository to be in, based on the current operation which is ongoing.

\n", "fields": [ { "type": "int", @@ -32359,45 +32844,57 @@ }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_CHERRYPICK", + "name": "GIT_REPOSITORY_STATE_REVERT_SEQUENCE", "comments": "", "value": 3 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_BISECT", + "name": "GIT_REPOSITORY_STATE_CHERRYPICK", "comments": "", "value": 4 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_REBASE", + "name": "GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE", "comments": "", "value": 5 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", + "name": "GIT_REPOSITORY_STATE_BISECT", "comments": "", "value": 6 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_REBASE_MERGE", + "name": "GIT_REPOSITORY_STATE_REBASE", "comments": "", "value": 7 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "name": "GIT_REPOSITORY_STATE_REBASE_INTERACTIVE", "comments": "", "value": 8 }, { "type": "int", - "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "name": "GIT_REPOSITORY_STATE_REBASE_MERGE", "comments": "", "value": 9 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX", + "comments": "", + "value": 10 + }, + { + "type": "int", + "name": "GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE", + "comments": "", + "value": 11 } ], "used": { @@ -32668,7 +33165,6 @@ "git_commit_amend", "git_commit_create", "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", "git_note_create", "git_note_remove", @@ -32697,12 +33193,12 @@ "type": "struct", "value": "git_smart_subtransport_definition", "file": "sys/transport.h", - "line": 296, - "lineto": 309, + "line": 324, + "lineto": 337, "block": "git_smart_subtransport_cb callback\nunsigned int rpc\nvoid * param", "tdef": "typedef", "description": " Definition for a \"subtransport\"", - "comments": "

This is used to let the smart protocol code know about the protocol\n which you are implementing.

\n", + "comments": "

This is used to let the smart protocol code know about the protocol which you are implementing.

\n", "fields": [ { "type": "git_smart_subtransport_cb", @@ -32911,7 +33407,7 @@ "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\nGIT_STATUS_OPT_RECURSE_IGNORED_DIRS\nGIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX\nGIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR\nGIT_STATUS_OPT_SORT_CASE_SENSITIVELY\nGIT_STATUS_OPT_SORT_CASE_INSENSITIVELY\nGIT_STATUS_OPT_RENAMES_FROM_REWRITES\nGIT_STATUS_OPT_NO_REFRESH\nGIT_STATUS_OPT_UPDATE_INDEX\nGIT_STATUS_OPT_INCLUDE_UNREADABLE\nGIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED", "tdef": "typedef", "description": " Flags to control status callbacks", - "comments": "
    \n
  • GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made\non untracked files. These will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files get callbacks.\nAgain, these callbacks will only be made if the workdir files are\nincluded in the status "show" option.
  • \n
  • GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be\nmade even on unmodified files.
  • \n
  • GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that submodules should be\nskipped. This only applies if there are no pending typechanges to\nthe submodule (either from or to another type).
  • \n
  • GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that all files in\nuntracked directories should be included. Normally if an entire\ndirectory is new, then just the top-level directory is included (with\na trailing slash on the entry name). This flag says to include all\nof the individual files in the directory instead.
  • \n
  • GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path\nshould be treated as a literal path, and not as a pathspec pattern.
  • \n
  • GIT_STATUS_OPT_RECURSE_IGNORED_DIRS indicates that the contents of\nignored directories should be included in the status. This is like\ndoing git ls-files -o -i --exclude-standard with core git.
  • \n
  • GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX indicates that rename detection\nshould be processed between the head and the index and enables\nthe GIT_STATUS_INDEX_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates that rename\ndetection should be run between the index and the working directory\nand enabled GIT_STATUS_WT_RENAMED as a possible status flag.
  • \n
  • GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-sensitive order
  • \n
  • GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case\nsensitivity for the file system and forces the output to be in\ncase-insensitive order
  • \n
  • GIT_STATUS_OPT_RENAMES_FROM_REWRITES indicates that rename detection\nshould include rewritten files
  • \n
  • GIT_STATUS_OPT_NO_REFRESH bypasses the default status behavior of\ndoing a "soft" index reload (i.e. reloading the index data if the\nfile on disk has been modified outside libgit2).
  • \n
  • GIT_STATUS_OPT_UPDATE_INDEX tells libgit2 to refresh the stat cache\nin the index for files that are unchanged but have out of date stat\ninformation in the index. It will result in less work being done on\nsubsequent calls to get status. This is mutually exclusive with the\nNO_REFRESH option.
  • \n
\n\n

Calling git_status_foreach() is like calling the extended version\n with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED,\n and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled\n together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", + "comments": "
    \n
  • GIT_STATUS_OPT_INCLUDE_UNTRACKED says that callbacks should be made on untracked files. These will only be made if the workdir files are included in the status "show" option. - GIT_STATUS_OPT_INCLUDE_IGNORED says that ignored files get callbacks. Again, these callbacks will only be made if the workdir files are included in the status "show" option. - GIT_STATUS_OPT_INCLUDE_UNMODIFIED indicates that callback should be made even on unmodified files. - GIT_STATUS_OPT_EXCLUDE_SUBMODULES indicates that submodules should be skipped. This only applies if there are no pending typechanges to the submodule (either from or to another type). - GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS indicates that all files in untracked directories should be included. Normally if an entire directory is new, then just the top-level directory is included (with a trailing slash on the entry name). This flag says to include all of the individual files in the directory instead. - GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH indicates that the given path should be treated as a literal path, and not as a pathspec pattern. - GIT_STATUS_OPT_RECURSE_IGNORED_DIRS indicates that the contents of ignored directories should be included in the status. This is like doing git ls-files -o -i --exclude-standard with core git. - GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX indicates that rename detection should be processed between the head and the index and enables the GIT_STATUS_INDEX_RENAMED as a possible status flag. - GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR indicates that rename detection should be run between the index and the working directory and enabled GIT_STATUS_WT_RENAMED as a possible status flag. - GIT_STATUS_OPT_SORT_CASE_SENSITIVELY overrides the native case sensitivity for the file system and forces the output to be in case-sensitive order - GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY overrides the native case sensitivity for the file system and forces the output to be in case-insensitive order - GIT_STATUS_OPT_RENAMES_FROM_REWRITES indicates that rename detection should include rewritten files - GIT_STATUS_OPT_NO_REFRESH bypasses the default status behavior of doing a "soft" index reload (i.e. reloading the index data if the file on disk has been modified outside libgit2). - GIT_STATUS_OPT_UPDATE_INDEX tells libgit2 to refresh the stat cache in the index for files that are unchanged but have out of date stat information in the index. It will result in less work being done on subsequent calls to get status. This is mutually exclusive with the NO_REFRESH option.
  • \n
\n\n

Calling git_status_foreach() is like calling the extended version with: GIT_STATUS_OPT_INCLUDE_IGNORED, GIT_STATUS_OPT_INCLUDE_UNTRACKED, and GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS. Those options are bundled together as GIT_STATUS_OPT_DEFAULTS if you want them as a baseline.

\n", "fields": [ { "type": "int", @@ -33031,7 +33527,7 @@ "block": "GIT_STATUS_SHOW_INDEX_AND_WORKDIR\nGIT_STATUS_SHOW_INDEX_ONLY\nGIT_STATUS_SHOW_WORKDIR_ONLY", "tdef": "typedef", "description": " Select the files on which to report status.", - "comments": "

With git_status_foreach_ext, this will control which changes get\n callbacks. With git_status_list_new, these will control which\n changes are included in the list.

\n\n
    \n
  • GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This roughly\nmatches git status --porcelain regarding which files are\nincluded and in what order.
  • \n
  • GIT_STATUS_SHOW_INDEX_ONLY only gives status based on HEAD to index\ncomparison, not looking at working directory changes.
  • \n
  • GIT_STATUS_SHOW_WORKDIR_ONLY only gives status based on index to\nworking directory comparison, not comparing the index to the HEAD.
  • \n
\n", + "comments": "

With git_status_foreach_ext, this will control which changes get callbacks. With git_status_list_new, these will control which changes are included in the list.

\n\n
    \n
  • GIT_STATUS_SHOW_INDEX_AND_WORKDIR is the default. This roughly matches git status --porcelain regarding which files are included and in what order. - GIT_STATUS_SHOW_INDEX_ONLY only gives status based on HEAD to index comparison, not looking at working directory changes. - GIT_STATUS_SHOW_WORKDIR_ONLY only gives status based on index to working directory comparison, not comparing the index to the HEAD.
  • \n
\n", "fields": [ { "type": "int", @@ -33084,7 +33580,7 @@ "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_WT_RENAMED\nGIT_STATUS_WT_UNREADABLE\nGIT_STATUS_IGNORED\nGIT_STATUS_CONFLICTED", "tdef": "typedef", "description": " Status flags for a single file.", - "comments": "

A combination of these values will be returned to indicate the status of\n a file. Status compares the working directory, the index, and the\n current HEAD of the repository. The GIT_STATUS_INDEX set of flags\n represents 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\n working directory relative to the index.

\n", + "comments": "

A combination of these values will be returned to indicate the status of a file. Status compares the working directory, the index, and the current HEAD of the repository. The GIT_STATUS_INDEX set of flags represents the status of file in the index relative to the HEAD, and the GIT_STATUS_WT set of flags represent the status of the file in the working directory relative to the index.

\n", "fields": [ { "type": "int", @@ -33213,6 +33709,7 @@ "git_index_update_all", "git_pathspec_new", "git_reference_list", + "git_remote_connect", "git_remote_download", "git_remote_fetch", "git_remote_get_fetch_refspecs", @@ -33240,8 +33737,8 @@ "int (*)(struct git_stream *) connect", "int (*)(git_cert **, struct git_stream *) certificate", "int (*)(struct git_stream *, const char *) set_proxy", - "ssize_t (*)(struct git_stream *, void *, size_t) read", - "ssize_t (*)(struct git_stream *, const char *, size_t, int) write", + "ssize_t (*)(struct git_stream *, void *, int) read", + "ssize_t (*)(struct git_stream *, const char *, int, int) write", "int (*)(struct git_stream *) close", "void (*)(struct git_stream *) free" ], @@ -33250,10 +33747,10 @@ "file": "sys/stream.h", "line": 28, "lineto": 40, - "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const char *) set_proxy\nssize_t (*)(struct git_stream *, void *, size_t) read\nssize_t (*)(struct git_stream *, const char *, size_t, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", + "block": "int version\nint encrypted\nint proxy_support\nint (*)(struct git_stream *) connect\nint (*)(git_cert **, struct git_stream *) certificate\nint (*)(struct git_stream *, const char *) set_proxy\nssize_t (*)(struct git_stream *, void *, int) read\nssize_t (*)(struct git_stream *, const char *, int, int) write\nint (*)(struct git_stream *) close\nvoid (*)(struct git_stream *) free", "tdef": "typedef", "description": " Every stream must have this struct as its first element, so the\n API can talk to it. You'd define your stream as", - "comments": "
 struct my_stream {\n         git_stream parent;\n         ...\n }\n
\n\n

and fill the functions

\n", + "comments": "
 struct my_stream {             git_stream parent;             ...     }\n
\n\n

and fill the functions

\n", "fields": [ { "type": "int", @@ -33286,12 +33783,12 @@ "comments": "" }, { - "type": "ssize_t (*)(struct git_stream *, void *, size_t)", + "type": "ssize_t (*)(struct git_stream *, void *, int)", "name": "read", "comments": "" }, { - "type": "ssize_t (*)(struct git_stream *, const char *, size_t, int)", + "type": "ssize_t (*)(struct git_stream *, const char *, int, int)", "name": "write", "comments": "" }, @@ -33308,7 +33805,9 @@ ], "used": { "returns": [], - "needs": [] + "needs": [ + "git_stream_register_tls" + ] } } ], @@ -33325,12 +33824,17 @@ "description": " Opaque structure representing a submodule.", "comments": "", "used": { - "returns": [], + "returns": [ + "git_submodule_fetch_recurse_submodules", + "git_submodule_ignore", + "git_submodule_update_strategy" + ], "needs": [ "git_submodule_add_finalize", "git_submodule_add_setup", "git_submodule_add_to_index", "git_submodule_branch", + "git_submodule_cb", "git_submodule_fetch_recurse_submodules", "git_submodule_foreach", "git_submodule_free", @@ -33346,8 +33850,13 @@ "git_submodule_path", "git_submodule_reload", "git_submodule_repo_init", + "git_submodule_set_fetch_recurse_submodules", + "git_submodule_set_ignore", + "git_submodule_set_update", + "git_submodule_status", "git_submodule_sync", "git_submodule_update", + "git_submodule_update_init_options", "git_submodule_update_strategy", "git_submodule_url", "git_submodule_wd_id" @@ -33372,7 +33881,7 @@ "block": "GIT_SUBMODULE_IGNORE_UNSPECIFIED\nGIT_SUBMODULE_IGNORE_NONE\nGIT_SUBMODULE_IGNORE_UNTRACKED\nGIT_SUBMODULE_IGNORE_DIRTY\nGIT_SUBMODULE_IGNORE_ALL", "tdef": "typedef", "description": " Submodule ignore values", - "comments": "

These values represent settings for the submodule.$name.ignore\n configuration value which says how deeply to look at the working\n directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with\n git_submodule_set_ignore() and can write the changed value to disk\n with git_submodule_save(). If you have overwritten the value, you\n can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration
  • \n
  • GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an\nuntracked file, will mark the submodule as dirty. Ignored files are\nstill ignored, of course.
  • \n
  • GIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files; only changes\nto tracked files, or the index or the HEAD commit will matter.
  • \n
  • GIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory,\nonly considering changes if the HEAD of submodule has moved from the\nvalue in the superproject.
  • \n
  • GIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty
  • \n
  • GIT_SUBMODULE_IGNORE_DEFAULT: not used except as static initializer\nwhen we don't want any particular ignore rule to be specified.
  • \n
\n", + "comments": "

These values represent settings for the submodule.$name.ignore configuration value which says how deeply to look at the working directory when getting submodule status.

\n\n

You can override this value in memory on a per-submodule basis with git_submodule_set_ignore() and can write the changed value to disk with git_submodule_save(). If you have overwritten the value, you can revert to the on disk value by using GIT_SUBMODULE_IGNORE_RESET.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration - GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an untracked file, will mark the submodule as dirty. Ignored files are still ignored, of course. - GIT_SUBMODULE_IGNORE_UNTRACKED: ignore untracked files; only changes to tracked files, or the index or the HEAD commit will matter. - GIT_SUBMODULE_IGNORE_DIRTY: ignore changes in the working directory, only considering changes if the HEAD of submodule has moved from the value in the superproject. - GIT_SUBMODULE_IGNORE_ALL: never check if the submodule is dirty - GIT_SUBMODULE_IGNORE_DEFAULT: not used except as static initializer when we don't want any particular ignore rule to be specified.
  • \n
\n", "fields": [ { "type": "int", @@ -33406,7 +33915,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_submodule_ignore" + ], "needs": [ "git_submodule_set_ignore", "git_submodule_status" @@ -33429,7 +33940,7 @@ "block": "GIT_SUBMODULE_RECURSE_NO\nGIT_SUBMODULE_RECURSE_YES\nGIT_SUBMODULE_RECURSE_ONDEMAND", "tdef": "typedef", "description": " Options for submodule recurse.", - "comments": "

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n
    \n
  • GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_YES - recurse into submodules
  • \n
  • GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when\n commit not already in local clone
  • \n
\n", + "comments": "

Represent the value of submodule.$name.fetchRecurseSubmodules

\n\n
    \n
  • GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules * GIT_SUBMODULE_RECURSE_YES - recurse into submodules * GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when commit not already in local clone
  • \n
\n", "fields": [ { "type": "int", @@ -33451,7 +33962,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_submodule_fetch_recurse_submodules" + ], "needs": [ "git_submodule_set_fetch_recurse_submodules" ] @@ -33484,7 +33997,7 @@ "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", "description": " Return codes for submodule status.", - "comments": "

A combination of these flags will be returned to describe the status of a\n submodule. Depending on the "ignore" property of the submodule, some of\n the flags may never be returned because they indicate changes that are\n supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config\n files (both .git/config and .gitmodules), and the working directory. Any\n or all of those places might be missing information about the submodule\n depending on what state the repo is in. We consider all four places to\n build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info\n about what sources of submodule data are available. These will be\n returned even if ignore is set to "ALL".

\n\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
\n\n

The following values will be returned so long as ignore is not "ALL".

\n\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
\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n
    \n
  • WD_INDEX_MODIFIED - submodule workdir index is dirty
  • \n
  • WD_WD_MODIFIED - submodule workdir has modified files
  • \n
\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n
    \n
  • WD_UNTRACKED - wd contains untracked files
  • \n
\n", + "comments": "

A combination of these flags will be returned to describe the status of a submodule. Depending on the "ignore" property of the submodule, some of the flags may never be returned because they indicate changes that are supposed to be ignored.

\n\n

Submodule info is contained in 4 places: the HEAD tree, the index, config files (both .git/config and .gitmodules), and the working directory. Any or all of those places might be missing information about the submodule depending on what state the repo is in. We consider all four places to build the combination of status flags.

\n\n

There are four values that are not really status, but give basic info about what sources of submodule data are available. These will be returned even if ignore is set to "ALL".

\n\n
    \n
  • IN_HEAD - superproject head contains submodule * IN_INDEX - superproject index contains submodule * IN_CONFIG - superproject gitmodules has submodule * IN_WD - superproject workdir has submodule
  • \n
\n\n

The following values will be returned so long as ignore is not "ALL".

\n\n
    \n
  • INDEX_ADDED - in index, not in head * INDEX_DELETED - in head, not in index * INDEX_MODIFIED - index and head don't match * WD_UNINITIALIZED - workdir contains empty directory * WD_ADDED - in workdir, not index * WD_DELETED - in index, not workdir * WD_MODIFIED - index and workdir head don't match
  • \n
\n\n

The following can only be returned if ignore is "NONE" or "UNTRACKED".

\n\n
    \n
  • WD_INDEX_MODIFIED - submodule workdir index is dirty * WD_WD_MODIFIED - submodule workdir has modified files
  • \n
\n\n

Lastly, the following will only be returned for ignore "NONE".

\n\n
    \n
  • WD_UNTRACKED - wd contains untracked files
  • \n
\n", "fields": [ { "type": "int", @@ -33589,12 +34102,12 @@ "type": "struct", "value": "git_submodule_update_options", "file": "submodule.h", - "line": 118, - "lineto": 146, + "line": 129, + "lineto": 157, "block": "unsigned int version\ngit_checkout_options checkout_opts\ngit_fetch_options fetch_opts\nunsigned int clone_checkout_strategy", "tdef": "typedef", "description": " Submodule update options structure", - "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings,\n like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", + "comments": "

Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings, like this:

\n\n

git_submodule_update_options opts = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;

\n", "fields": [ { "type": "unsigned int", @@ -33643,7 +34156,7 @@ "block": "GIT_SUBMODULE_UPDATE_CHECKOUT\nGIT_SUBMODULE_UPDATE_REBASE\nGIT_SUBMODULE_UPDATE_MERGE\nGIT_SUBMODULE_UPDATE_NONE\nGIT_SUBMODULE_UPDATE_DEFAULT", "tdef": "typedef", "description": " Submodule update values", - "comments": "

These values represent settings for the submodule.$name.update\n configuration value which says how to handle git submodule update for\n this submodule. The value is usually set in the ".gitmodules" file and\n copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with\n git_submodule_set_update() and write the changed value to disk using\n git_submodule_save(). If you have overwritten the value, you can\n revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is\nupdated, checkout the new detached HEAD to the submodule directory.
  • \n
  • GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked\nout branch onto the commit from the superproject.
  • \n
  • GIT_SUBMODULE_UPDATE_MERGE: update by merging the commit in the\nsuperproject into the current checkout out branch of the submodule.
  • \n
  • GIT_SUBMODULE_UPDATE_NONE: do not update this submodule even when\nthe commit in the superproject is updated.
  • \n
  • GIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer\nwhen we don't want any particular update rule to be specified.
  • \n
\n", + "comments": "

These values represent settings for the submodule.$name.update configuration value which says how to handle git submodule update for this submodule. The value is usually set in the ".gitmodules" file and copied to ".git/config" when the submodule is initialized.

\n\n

You can override this setting on a per-submodule basis with git_submodule_set_update() and write the changed value to disk using git_submodule_save(). If you have overwritten the value, you can revert it by passing GIT_SUBMODULE_UPDATE_RESET to the set function.

\n\n

The values are:

\n\n
    \n
  • GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is updated, checkout the new detached HEAD to the submodule directory. - GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked out branch onto the commit from the superproject. - GIT_SUBMODULE_UPDATE_MERGE: update by merging the commit in the superproject into the current checkout out branch of the submodule. - GIT_SUBMODULE_UPDATE_NONE: do not update this submodule even when the commit in the superproject is updated. - GIT_SUBMODULE_UPDATE_DEFAULT: not used except as static initializer when we don't want any particular update rule to be specified.
  • \n
\n", "fields": [ { "type": "int", @@ -33677,7 +34190,9 @@ } ], "used": { - "returns": [], + "returns": [ + "git_submodule_update_strategy" + ], "needs": [ "git_submodule_set_update" ] @@ -33699,6 +34214,7 @@ "used": { "returns": [], "needs": [ + "git_tag_foreach", "git_tag_free", "git_tag_id", "git_tag_lookup", @@ -33744,8 +34260,12 @@ } ], "used": { - "returns": [], - "needs": [] + "returns": [ + "git_commit_time" + ], + "needs": [ + "git_signature_new" + ] } } ], @@ -33816,6 +34336,7 @@ "used": { "returns": [], "needs": [ + "git_trace_callback", "git_trace_set" ] } @@ -33835,7 +34356,9 @@ "comments": "", "used": { "returns": [], - "needs": [] + "needs": [ + "git_config_lock" + ] } } ], @@ -33859,7 +34382,7 @@ "block": "unsigned int total_objects\nunsigned int indexed_objects\nunsigned int received_objects\nunsigned int local_objects\nunsigned int total_deltas\nunsigned int indexed_deltas\nsize_t received_bytes", "tdef": "typedef", "description": " This is passed as the first argument to the callback to allow the\n user to see the progress.", - "comments": "
    \n
  • total_objects: number of objects in the packfile being downloaded
  • \n
  • indexed_objects: received objects that have been hashed
  • \n
  • received_objects: objects which have been downloaded
  • \n
  • local_objects: locally-available objects that have been injected\nin order to fix a thin pack.
  • \n
  • received-bytes: size of the packfile received up to now
  • \n
\n", + "comments": "
    \n
  • total_objects: number of objects in the packfile being downloaded - indexed_objects: received objects that have been hashed - received_objects: objects which have been downloaded - local_objects: locally-available objects that have been injected in order to fix a thin pack. - received-bytes: size of the packfile received up to now
  • \n
\n", "fields": [ { "type": "unsigned int", @@ -33903,7 +34426,11 @@ ], "needs": [ "git_indexer_append", - "git_indexer_commit" + "git_indexer_commit", + "git_indexer_new", + "git_odb_write_pack", + "git_packbuilder_write", + "git_transfer_progress_cb" ] } } @@ -33926,11 +34453,13 @@ "git_smart_subtransport_git", "git_smart_subtransport_http", "git_smart_subtransport_ssh", + "git_transport_cb", "git_transport_dummy", "git_transport_init", "git_transport_local", "git_transport_new", "git_transport_smart", + "git_transport_smart_certificate_check", "git_transport_ssh_with_paths" ] } @@ -33944,8 +34473,8 @@ ], "type": "enum", "file": "sys/transport.h", - "line": 29, - "lineto": 31, + "line": 30, + "lineto": 32, "block": "GIT_TRANSPORTFLAGS_NONE", "tdef": "typedef", "description": " Flags to pass to transport", @@ -33977,7 +34506,12 @@ "description": " Representation of a tree object. ", "comments": "", "used": { - "returns": [], + "returns": [ + "git_tree_entry_byid", + "git_tree_entry_byindex", + "git_tree_entry_byname", + "git_treebuilder_get" + ], "needs": [ "git_commit_amend", "git_commit_create", @@ -33994,6 +34528,15 @@ "git_tree_entry_byindex", "git_tree_entry_byname", "git_tree_entry_bypath", + "git_tree_entry_cmp", + "git_tree_entry_dup", + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "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", @@ -34001,7 +34544,17 @@ "git_tree_lookup_prefix", "git_tree_owner", "git_tree_walk", - "git_treebuilder_new" + "git_treebuilder_clear", + "git_treebuilder_entrycount", + "git_treebuilder_filter", + "git_treebuilder_filter_cb", + "git_treebuilder_free", + "git_treebuilder_get", + "git_treebuilder_insert", + "git_treebuilder_new", + "git_treebuilder_remove", + "git_treebuilder_write", + "git_treewalk_cb" ] } } @@ -34036,7 +34589,9 @@ "git_tree_entry_name", "git_tree_entry_to_object", "git_tree_entry_type", - "git_treebuilder_insert" + "git_treebuilder_filter_cb", + "git_treebuilder_insert", + "git_treewalk_cb" ] } } @@ -34239,11 +34794,12 @@ [ "git_commit_amend", "git_commit_author", + "git_commit_body", "git_commit_committer", "git_commit_create", "git_commit_create_from_callback", - "git_commit_create_from_ids", "git_commit_create_v", + "git_commit_extract_signature", "git_commit_free", "git_commit_header_field", "git_commit_id", @@ -34275,6 +34831,7 @@ "git_config_delete_multivar", "git_config_entry_free", "git_config_find_global", + "git_config_find_programdata", "git_config_find_system", "git_config_find_xdg", "git_config_foreach", @@ -34293,6 +34850,7 @@ "git_config_iterator_free", "git_config_iterator_glob_new", "git_config_iterator_new", + "git_config_lock", "git_config_lookup_map_value", "git_config_multivar_iterator_new", "git_config_new", @@ -34317,6 +34875,7 @@ "cred", [ "git_cred_default_new", + "git_cred_free", "git_cred_has_username", "git_cred_ssh_custom_new", "git_cred_ssh_interactive_new", @@ -34353,6 +34912,7 @@ "git_diff_get_delta", "git_diff_get_perfdata", "git_diff_get_stats", + "git_diff_index_to_index", "git_diff_index_to_workdir", "git_diff_init_options", "git_diff_is_sorted_icase", @@ -34388,7 +34948,6 @@ "git_filter_list_apply_to_file", "git_filter_list_contains", "git_filter_list_free", - "git_filter_list_length", "git_filter_list_load", "git_filter_list_new", "git_filter_list_push", @@ -34410,7 +34969,6 @@ "giterr", [ "giterr_clear", - "giterr_detach", "giterr_last", "giterr_set_oom", "giterr_set_str" @@ -34427,7 +34985,6 @@ "hashsig", [ "git_hashsig_compare", - "git_hashsig_create", "git_hashsig_create_fromfile", "git_hashsig_free" ] @@ -34461,6 +35018,7 @@ "git_index_entry_stage", "git_index_entrycount", "git_index_find", + "git_index_find_prefix", "git_index_free", "git_index_get_byindex", "git_index_get_bypath", @@ -34718,6 +35276,7 @@ "git_rebase_free", "git_rebase_init", "git_rebase_init_options", + "git_rebase_inmemory_index", "git_rebase_next", "git_rebase_open", "git_rebase_operation_byindex", @@ -35007,6 +35566,12 @@ "git_strarray_free" ] ], + [ + "stream", + [ + "git_stream_register_tls" + ] + ], [ "submodule", [ @@ -35083,6 +35648,7 @@ "git_transport_local", "git_transport_new", "git_transport_smart", + "git_transport_smart_certificate_check", "git_transport_ssh_with_paths", "git_transport_unregister" ] @@ -35130,91 +35696,91 @@ "examples": [ [ "add.c", - "ex/v0.23.2/add.html" + "ex/v0.24.1/add.html" ], [ "blame.c", - "ex/v0.23.2/blame.html" + "ex/v0.24.1/blame.html" ], [ "cat-file.c", - "ex/v0.23.2/cat-file.html" + "ex/v0.24.1/cat-file.html" ], [ "common.c", - "ex/v0.23.2/common.html" + "ex/v0.24.1/common.html" ], [ "describe.c", - "ex/v0.23.2/describe.html" + "ex/v0.24.1/describe.html" ], [ "diff.c", - "ex/v0.23.2/diff.html" + "ex/v0.24.1/diff.html" ], [ "for-each-ref.c", - "ex/v0.23.2/for-each-ref.html" + "ex/v0.24.1/for-each-ref.html" ], [ "general.c", - "ex/v0.23.2/general.html" + "ex/v0.24.1/general.html" ], [ "init.c", - "ex/v0.23.2/init.html" + "ex/v0.24.1/init.html" ], [ "log.c", - "ex/v0.23.2/log.html" + "ex/v0.24.1/log.html" ], [ "network/clone.c", - "ex/v0.23.2/network/clone.html" + "ex/v0.24.1/network/clone.html" ], [ "network/common.c", - "ex/v0.23.2/network/common.html" + "ex/v0.24.1/network/common.html" ], [ "network/fetch.c", - "ex/v0.23.2/network/fetch.html" + "ex/v0.24.1/network/fetch.html" ], [ "network/git2.c", - "ex/v0.23.2/network/git2.html" + "ex/v0.24.1/network/git2.html" ], [ "network/index-pack.c", - "ex/v0.23.2/network/index-pack.html" + "ex/v0.24.1/network/index-pack.html" ], [ "network/ls-remote.c", - "ex/v0.23.2/network/ls-remote.html" + "ex/v0.24.1/network/ls-remote.html" ], [ "remote.c", - "ex/v0.23.2/remote.html" + "ex/v0.24.1/remote.html" ], [ "rev-list.c", - "ex/v0.23.2/rev-list.html" + "ex/v0.24.1/rev-list.html" ], [ "rev-parse.c", - "ex/v0.23.2/rev-parse.html" + "ex/v0.24.1/rev-parse.html" ], [ "showindex.c", - "ex/v0.23.2/showindex.html" + "ex/v0.24.1/showindex.html" ], [ "status.c", - "ex/v0.23.2/status.html" + "ex/v0.24.1/status.html" ], [ "tag.c", - "ex/v0.23.2/tag.html" + "ex/v0.24.1/tag.html" ] ] } diff --git a/vendor/libgit2/.mailmap b/vendor/libgit2/.mailmap index c656f64c7..8479cf6c4 100644 --- a/vendor/libgit2/.mailmap +++ b/vendor/libgit2/.mailmap @@ -16,6 +16,7 @@ Xavier L. Sascha Cunz Authmillenon Authmillenon -Edward Thomson +Edward Thomson +Edward Thomson J. David Ibáñez Russell Belfer diff --git a/vendor/libgit2/.travis.yml b/vendor/libgit2/.travis.yml index 9022fdec2..2f3ffe355 100644 --- a/vendor/libgit2/.travis.yml +++ b/vendor/libgit2/.travis.yml @@ -46,13 +46,13 @@ matrix: - compiler: gcc env: - VALGRIND=1 - OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug" + OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DDEBUG_POOL=ON -DCMAKE_BUILD_TYPE=Debug" os: linux allow_failures: - env: COVERITY=1 - env: - VALGRIND=1 - OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug" + OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DDEBUG_POOL=ON -DCMAKE_BUILD_TYPE=Debug" install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./script/install-deps-${TRAVIS_OS_NAME}.sh; fi diff --git a/vendor/libgit2/CHANGELOG.md b/vendor/libgit2/CHANGELOG.md index b824a66da..43476b99a 100644 --- a/vendor/libgit2/CHANGELOG.md +++ b/vendor/libgit2/CHANGELOG.md @@ -1,4 +1,4 @@ -v0.23 + 1 +v0.24 + 1 ------- ### Changes or improvements @@ -7,6 +7,116 @@ v0.23 + 1 ### API removals +### Breaking API changes + +v0.24 +------- + +### Changes or improvements + +* Custom filters can now be registered with wildcard attributes, for + example `filter=*`. Consumers should examine the attributes parameter + of the `check` function for details. + +* Symlinks are now followed when locking a file, which can be + necessary when multiple worktrees share a base repository. + +* You can now set your own user-agent to be sent for HTTP requests by + using the `GIT_OPT_SET_USER_AGENT` with `git_libgit2_opts()`. + +* You can set custom HTTP header fields to be sent along with requests + by passing them in the fetch and push options. + +* Tree objects are now assumed to be sorted. If a tree is not + correctly formed, it will give bad results. This is the git approach + and cuts a significant amount of time when reading the trees. + +* Filter registration is now protected against concurrent + registration. + +* Filenames which are not valid on Windows in an index no longer cause + to fail to parse it on that OS. + +* Rebases can now be performed purely in-memory, without touching the + repository's workdir. + +* When adding objects to the index, or when creating new tree or commit + objects, the inputs are validated to ensure that the dependent objects + exist and are of the correct type. This object validation can be + disabled with the GIT_OPT_ENABLE_STRICT_OBJECT_CREATION option. + +* The WinHTTP transport's handling of bad credentials now behaves like + the others, asking for credentials again. + +### API additions + +* `git_config_lock()` has been added, which allow for + transactional/atomic complex updates to the configuration, removing + the opportunity for concurrent operations and not committing any + changes until the unlock. + +* `git_diff_options` added a new callback `progress_cb` to report on the + progress of the diff as files are being compared. The documentation of + the existing callback `notify_cb` was updated to reflect that it only + gets called when new deltas are added to the diff. + +* `git_fetch_options` and `git_push_options` have gained a `custom_headers` + field to set the extra HTTP header fields to send. + +* `git_stream_register_tls()` lets you register a callback to be used + as the constructor for a TLS stream instead of the libgit2 built-in + one. + +* `git_commit_header_field()` allows you to look up a specific header + field in a commit. + +* `git_commit_extract_signature()` extracts the signature from a + commit and gives you both the signature and the signed data so you + can verify it. + +### API removals + +* No APIs were removed in this version. + +### Breaking API changes + +* The `git_merge_tree_flag_t` is now `git_merge_flag_t`. Subsequently, + its members are no longer prefixed with `GIT_MERGE_TREE_FLAG` but are + now prefixed with `GIT_MERGE_FLAG`, and the `tree_flags` field of the + `git_merge_options` structure is now named `flags`. + +* The `git_merge_file_flags_t` enum is now `git_merge_file_flag_t` for + consistency with other enum type names. + +* `git_cert` descendent types now have a proper `parent` member + +* It is the responsibility of the refdb backend to decide what to do + with the reflog on ref deletion. The file-based backend must delete + it, a database-backed one may wish to archive it. + +* `git_config_backend` has gained two entries. `lock` and `unlock` + with which to implement the transactional/atomic semantics for the + configuration backend. + +* `git_index_add` and `git_index_conflict_add()` will now use the case + as provided by the caller on case insensitive systems. Previous + versions would keep the case as it existed in the index. This does + not affect the higher-level `git_index_add_bypath` or + `git_index_add_frombuffer` functions. + +* The `notify_payload` field of `git_diff_options` was renamed to `payload` + to reflect that it's also the payload for the new progress callback. + +* The `git_config_level_t` enum has gained a higher-priority value + `GIT_CONFIG_LEVEL_PROGRAMDATA` which represent a rough Windows equivalent + to the system level configuration. + +* `git_rebase_init()` not also takes a merge options. + +* The index no longer performs locking itself. This is not something + users of the library should have been relying on as it's not part of + the concurrency guarantees. + v0.23 ------ @@ -239,8 +349,8 @@ v0.23 * `git_rebase_options` now contains a `git_checkout_options` struct that will be used for functions that modify the working directory, - namely `git_checkout_init`, `git_checkout_next` and - `git_checkout_abort`. As a result, `git_rebase_open` now also takes + namely `git_rebase_init`, `git_rebase_next` and + `git_rebase_abort`. As a result, `git_rebase_open` now also takes a `git_rebase_options` and only the `git_rebase_init` and `git_rebase_open` functions take a `git_rebase_options`, where they will persist the options to subsequent `git_rebase` calls. diff --git a/vendor/libgit2/CMakeLists.txt b/vendor/libgit2/CMakeLists.txt index 714e188e9..c79b2637c 100644 --- a/vendor/libgit2/CMakeLists.txt +++ b/vendor/libgit2/CMakeLists.txt @@ -20,6 +20,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Mo INCLUDE(CheckLibraryExists) INCLUDE(CheckFunctionExists) +INCLUDE(CheckStructHasMember) INCLUDE(AddCFlagIfSupported) INCLUDE(FindPkgConfig) @@ -40,6 +41,11 @@ OPTION( USE_SSH "Link with libssh to enable SSH support" ON ) OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF ) OPTION( VALGRIND "Configure build for valgrind" OFF ) OPTION( CURL "User curl for HTTP if available" ON) +OPTION( DEBUG_POOL "Enable debug pool allocator" OFF ) + +IF(DEBUG_POOL) + ADD_DEFINITIONS(-DGIT_DEBUG_POOL) +ENDIF() IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET( USE_ICONV ON ) @@ -60,6 +66,10 @@ IF(MSVC) # are linking statically OPTION( STATIC_CRT "Link the static CRT libraries" ON ) + # If you want to embed a copy of libssh2 into libgit2, pass a + # path to libssh2 + OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF ) + ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) @@ -81,6 +91,27 @@ IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OPTION( USE_OPENSSL "Link with and use openssl library" ON ) ENDIF() +CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtim "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_MTIM LANGUAGE C) +CHECK_STRUCT_HAS_MEMBER ("struct stat" st_mtimespec "sys/types.h;sys/stat.h" + HAVE_STRUCT_STAT_ST_MTIMESPEC LANGUAGE C) +CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_nsec sys/stat.h + HAVE_STRUCT_STAT_MTIME_NSEC LANGUAGE C) + +IF (HAVE_STRUCT_STAT_ST_MTIM) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec sys/stat.h + HAVE_STRUCT_STAT_NSEC LANGUAGE C) +ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC) + CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec sys/stat.h + HAVE_STRUCT_STAT_NSEC LANGUAGE C) +ELSE () + SET( HAVE_STRUCT_STAT_NSEC ON ) +ENDIF() + +IF (HAVE_STRUCT_STAT_NSEC OR WIN32) + OPTION( USE_NSEC "Care about sub-second file mtimes and ctimes" OFF ) +ENDIF() + # This variable will contain the libraries we need to put into # libgit2.pc's Requires.private. That is, what we're linking to or # what someone who's statically linking us needs to link to. @@ -133,13 +164,13 @@ FUNCTION(TARGET_OS_LIBRARIES target) ENDIF() ENDFUNCTION() -# For the MSVC IDE, this function splits up the source files like windows -# explorer does. This is esp. useful with the libgit2_clar project, were -# usually 2 or more files share the same name. Sadly, this file grouping -# is a per-directory option in cmake and not per-target, resulting in -# empty virtual folders "tests" for the git2.dll -FUNCTION(MSVC_SPLIT_SOURCES target) - IF(MSVC_IDE) +# This function splits the sources files up into their appropriate +# subdirectories. This is especially useful for IDEs like Xcode and +# Visual Studio, so that you can navigate into the libgit2_clar project, +# and see the folders within the tests folder (instead of just seeing all +# source and tests in a single folder.) +FUNCTION(IDE_SPLIT_SOURCES target) + IF(MSVC_IDE OR CMAKE_GENERATOR STREQUAL Xcode) GET_TARGET_PROPERTY(sources ${target} SOURCES) FOREACH(source ${sources}) IF(source MATCHES ".*/") @@ -190,6 +221,13 @@ IF (COREFOUNDATION_FOUND) ENDIF() +IF (WIN32 AND EMBED_SSH_PATH) + FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c") + INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include") + FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"") + ADD_DEFINITIONS(-DGIT_SSH) +ENDIF() + IF (WIN32 AND WINHTTP) ADD_DEFINITIONS(-DGIT_WINHTTP) INCLUDE_DIRECTORIES(deps/http-parser) @@ -206,7 +244,7 @@ IF (WIN32 AND WINHTTP) SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps/winhttp") FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH}) - IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + IF (CMAKE_SIZEOF_VOID_P EQUAL 8) set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp64.def") ELSE() set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def") @@ -228,7 +266,8 @@ IF (WIN32 AND WINHTTP) LINK_DIRECTORIES(${LIBWINHTTP_PATH}) ENDIF () - LINK_LIBRARIES(winhttp rpcrt4 crypt32) + LINK_LIBRARIES(winhttp rpcrt4 crypt32 ole32) + LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp" "-lrpcrt4" "-lcrypt32" "-lole32") ELSE () IF (CURL) PKG_CHECK_MODULES(CURL libcurl) @@ -364,6 +403,7 @@ IF (MSVC) IF (MSVC_CRTDBG) SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG") + SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" "Dbghelp.lib") ENDIF() # /Zi - Create debugging information @@ -372,7 +412,7 @@ IF (MSVC) # /MTd - Statically link the multithreaded debug version of the CRT # /MDd - Dynamically link the multithreaded debug version of the CRT # /RTC1 - Run time checks - SET(CMAKE_C_FLAGS_DEBUG "/Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}") # /DNDEBUG - Disables asserts # /MT - Statically link the multithreaded release version of the CRT @@ -424,7 +464,7 @@ ELSE () ENDIF() IF (WIN32 AND NOT CYGWIN) - SET(CMAKE_C_FLAGS_DEBUG "-D_DEBUG") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") ENDIF () IF (MINGW) # MinGW always does PIC and complains if we tell it to @@ -504,6 +544,18 @@ IF (THREADSAFE) ADD_DEFINITIONS(-DGIT_THREADS) ENDIF() +IF (USE_NSEC) + ADD_DEFINITIONS(-DGIT_USE_NSEC) +ENDIF() + +IF (HAVE_STRUCT_STAT_ST_MTIM) + ADD_DEFINITIONS(-DGIT_USE_STAT_MTIM) +ELSEIF (HAVE_STRUCT_STAT_ST_MTIMESPEC) + ADD_DEFINITIONS(-DGIT_USE_STAT_MTIMESPEC) +ELSEIF (HAVE_STRUCT_STAT_ST_MTIME_NSEC) + ADD_DEFINITIONS(-DGIT_USE_STAT_MTIME_NSEC) +ENDIF() + ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64) # Collect sourcefiles @@ -533,7 +585,7 @@ ELSE() ENDIF() # Compile and link libgit2 -ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC}) +ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC}) TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS}) TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS}) TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES}) @@ -548,7 +600,7 @@ IF(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64") ENDIF() -MSVC_SPLIT_SOURCES(git2) +IDE_SPLIT_SOURCES(git2) IF (SONAME) SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING}) @@ -556,6 +608,8 @@ IF (SONAME) IF (LIBGIT2_FILENAME) ADD_DEFINITIONS(-DLIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\") SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME}) + ELSEIF (DEFINED LIBGIT2_PREFIX) + SET_TARGET_PROPERTIES(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}") ENDIF() ENDIF() STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}") @@ -608,7 +662,7 @@ IF (BUILD_CLAR) ${CLAR_PATH}/clar.c PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite) - ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1}) + ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1}) TARGET_LINK_LIBRARIES(libgit2_clar ${COREFOUNDATION_DIRS}) TARGET_LINK_LIBRARIES(libgit2_clar ${SECURITY_DIRS}) @@ -617,7 +671,7 @@ IF (BUILD_CLAR) TARGET_LINK_LIBRARIES(libgit2_clar ${GSSAPI_LIBRARIES}) TARGET_LINK_LIBRARIES(libgit2_clar ${ICONV_LIBRARIES}) TARGET_OS_LIBRARIES(libgit2_clar) - MSVC_SPLIT_SOURCES(libgit2_clar) + IDE_SPLIT_SOURCES(libgit2_clar) IF (MSVC_IDE) # Precompiled headers @@ -630,6 +684,10 @@ IF (BUILD_CLAR) ELSE () ADD_TEST(libgit2_clar libgit2_clar -v) ENDIF () + + # Add a test target which runs the cred callback tests, to be + # called after setting the url and user + ADD_TEST(libgit2_clar-cred_callback libgit2_clar -v -sonline::clone::cred_callback) ENDIF () IF (TAGS) diff --git a/vendor/libgit2/CODE_OF_CONDUCT.md b/vendor/libgit2/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..0a0e4ebab --- /dev/null +++ b/vendor/libgit2/CODE_OF_CONDUCT.md @@ -0,0 +1,75 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [libgit2@gmail.com][email]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[email]: mailto:libgit2@gmail.com +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/libgit2/CONVENTIONS.md b/vendor/libgit2/CONVENTIONS.md index 5b8238a78..0be4b33cc 100644 --- a/vendor/libgit2/CONVENTIONS.md +++ b/vendor/libgit2/CONVENTIONS.md @@ -3,6 +3,38 @@ We like to keep the source consistent and readable. Herein are some guidelines that should help with that. +## External API + +We have a few rules to avoid surprising ways of calling functions and +some rules for consumers of the library to avoid stepping on each +other's toes. + + - Property accessors return the value directly (e.g. an `int` or + `const char *`) but if a function can fail, we return a `int` value + and the output parameters go first in the parameter list, followed + by the object that a function is operating on, and then any other + arguments the function may need. + + - If a function returns an object as a return value, that function is + a getter and the object's lifetime is tied to the parent + object. Objects which are returned as the first argument as a + pointer-to-pointer are owned by the caller and it is repsponsible + for freeing it. Strings are returned via `git_buf` in order to + allow for re-use and safe freeing. + + - Most of what libgit2 does relates to I/O so you as a general rule + you should assume that any function can fail due to errors as even + getting data from the filesystem can result in all sorts of errors + and complex failure cases. + + - Paths inside the Git system are separated by a slash (0x2F). If a + function accepts a path on disk, then backslashes (0x5C) are also + accepted on Windows. + + - Do not mix allocators. If something has been allocated by libgit2, + you do not know which is the right free function in the general + case. Use the free functions provided for each object type. + ## Compatibility `libgit2` runs on many different platforms with many different compilers. diff --git a/vendor/libgit2/PROJECTS.md b/vendor/libgit2/PROJECTS.md index 4f200b7f9..87ce78f02 100644 --- a/vendor/libgit2/PROJECTS.md +++ b/vendor/libgit2/PROJECTS.md @@ -48,7 +48,7 @@ These are good small projects to get started with libgit2. a new example that mirrors the behavior. Examples don't have to be perfect emulations, but should demonstrate how to use the libgit2 APIs to get results that are similar to Git commands. This lets you (and us) - easily exercise a particular facet of the API and measure compatability + easily exercise a particular facet of the API and measure compatibility and feature parity with core git. * Submit a PR to clarify documentation! While we do try to document all of the APIs, your fresh eyes on the documentation will find areas that are @@ -75,8 +75,6 @@ might make good smaller projects by themselves. * Extract the Git tests that exercise that command * Convert the tests to call our emulation * These tests could go in examples/tests/... -* Fix symlink support for files in the .git directory (i.e. don't overwrite - the symlinks when writing the file contents back out) * Add hooks API to enumerate and manage hooks (not run them at this point) * Enumeration of available hooks * Lookup API to see which hooks have a script and get the script @@ -85,8 +83,6 @@ might make good smaller projects by themselves. executes the action in question * Isolate logic of ignore evaluation into a standalone API * Upgrade internal libxdiff code to latest from core Git -* Improve index internals with hashtable lookup for files instead of - using binary search every time * Tree builder improvements: * Extend to allow building a tree hierarchy * Apply-patch API diff --git a/vendor/libgit2/README.md b/vendor/libgit2/README.md index 3191aeee2..8ea787b3e 100644 --- a/vendor/libgit2/README.md +++ b/vendor/libgit2/README.md @@ -18,7 +18,7 @@ Additionally, the example code has been released to the public domain (see the * Website: [libgit2.github.com](http://libgit2.github.com) * StackOverflow Tag: [libgit2](http://stackoverflow.com/questions/tagged/libgit2) * Issues: [GitHub Issues](https://github.com/libgit2/libgit2/issues) (Right here!) -* API documentation: +* API documentation: * IRC: [#libgit2](irc://irc.freenode.net/libgit2) on irc.freenode.net. * Mailing list: The libgit2 mailing list was traditionally hosted in Librelist but has been deprecated. We encourage you to @@ -80,6 +80,12 @@ Threading See [THREADING](THREADING.md) for information +Conventions +=========== + +See [CONVENTIONS](CONVENTIONS.md) for an overview of the external +and internal API/coding conventions we use. + Building libgit2 - Using CMake ============================== @@ -88,7 +94,7 @@ Under Unix-like systems, like Linux, \*BSD and Mac OS X, libgit2 expects `pthrea they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API for threading. -The `libgit2` library is built using [CMake]() (version 2.8 or newer) on all platforms. +The `libgit2` library is built using [CMake]() (version 2.8 or newer) on all platforms. On most systems you can build the library using the following commands @@ -103,7 +109,7 @@ To install the library you can specify the install prefix by setting: $ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix $ cmake --build . --target install -For more advanced use or questions about CMake please read . +For more advanced use or questions about CMake please read . The following CMake variables are declared: @@ -141,7 +147,7 @@ You need to run the CMake commands from the Visual Studio command prompt, not the regular or Windows SDK one. Select the right generator for your version with the `-G "Visual Studio X" option. -See [the website](https://libgit2.github.com/docs/guides/build-and-link) +See [the website](http://libgit2.github.com/docs/guides/build-and-link/) for more detailed instructions. Android @@ -184,9 +190,9 @@ Here are the bindings to libgit2 that are currently available: * Go * git2go * GObject - * libgit2-glib + * libgit2-glib * Haskell - * hgit2 + * hgit2 * Java * Jagged * Julia @@ -197,7 +203,7 @@ Here are the bindings to libgit2 that are currently available: * libgit2sharp * Node.js * node-gitteh - * nodegit + * nodegit * Objective-C * objective-git * OCaml @@ -230,7 +236,7 @@ How Can I Contribute? ================================== Check the [contribution guidelines](CONTRIBUTING.md) to understand our -workflow, the libgit2 [coding conventions](CONVENTIONS.md), and out list of +workflow, the libgit2 [coding conventions](CONVENTIONS.md), and our list of [good starting projects](PROJECTS.md). License diff --git a/vendor/libgit2/THREADING.md b/vendor/libgit2/THREADING.md index 3717d6c88..0b9e50286 100644 --- a/vendor/libgit2/THREADING.md +++ b/vendor/libgit2/THREADING.md @@ -72,13 +72,19 @@ which locking function it should use. This means that libgit2 cannot know what to set as the user of libgit2 may use OpenSSL independently and the locking settings must survive libgit2 shutting down. +Even if libgit2 doesn't use OpenSSL directly, OpenSSL can still be used +by libssh2 depending on the configuration. If OpenSSL is used both by +libgit2 and libssh2, you only need to set up threading for OpenSSL once. + libgit2 does provide a last-resort convenience function `git_openssl_set_locking()` (available in `sys/openssl.h`) to use the platform-native mutex mechanisms to perform the locking, which you may rely on if you do not want to use OpenSSL outside of libgit2, or you know that libgit2 will outlive the rest of the operations. It is not safe to use OpenSSL multi-threaded after libgit2's shutdown function -has been called. +has been called. Note `git_openssl_set_locking()` only works if +libgit2 uses OpenSSL directly - if OpenSSL is only used as a dependency +of libssh2 as described above, `git_openssl_set_locking()` is a no-op. If your programming language offers a package/bindings for OpenSSL, you should very strongly prefer to use that in order to set up @@ -87,14 +93,14 @@ when using this function. See the [OpenSSL documentation](https://www.openssl.org/docs/crypto/threads.html) -on threading for more details. +on threading for more details, and http://trac.libssh2.org/wiki/MultiThreading +for a specific example of providing the threading callbacks. Be also aware that libgit2 does not always link against OpenSSL if there are alternatives provided by the system. -libssh2 may be linked against OpenSSL or libgcrypt. If it uses -OpenSSL, you only need to set up threading for OpenSSL once and the -above paragraphs are enough. If it uses libgcrypt, then you need to +libssh2 may be linked against OpenSSL or libgcrypt. If it uses OpenSSL, +see the above paragraphs. If it uses libgcrypt, then you need to set up its locking before using it multi-threaded. libgit2 has no direct connection to libgcrypt and thus has not convenience functions for it (but libgcrypt has macros). Read libgcrypt's diff --git a/vendor/libgit2/appveyor.yml b/vendor/libgit2/appveyor.yml index 166fa56b1..3ed3c49a1 100644 --- a/vendor/libgit2/appveyor.yml +++ b/vendor/libgit2/appveyor.yml @@ -36,4 +36,8 @@ build_script: - cmd: | if "%GENERATOR%"=="MSYS Makefiles" (C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh) test_script: -- ps: ctest -V . +- ps: | + ctest -V -R libgit2_clar + $env:GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent" + $env:GITTEST_REMOTE_USER="libgit2test" + ctest -V -R libgit2_clar-cred_callback diff --git a/vendor/libgit2/deps/http-parser/http_parser.c b/vendor/libgit2/deps/http-parser/http_parser.c index 203530254..27bdd2081 100644 --- a/vendor/libgit2/deps/http-parser/http_parser.c +++ b/vendor/libgit2/deps/http-parser/http_parser.c @@ -99,7 +99,7 @@ do { \ FOR##_mark = NULL; \ } \ } while (0) - + /* Run the data callback FOR and consume the current byte */ #define CALLBACK_DATA(FOR) \ CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1) @@ -444,6 +444,9 @@ parse_url_char(enum state s, const char ch) return s_req_path; } + /* The schema must start with an alpha character. After that, it may + * consist of digits, '+', '-' or '.', followed by a ':'. + */ if (IS_ALPHA(ch)) { return s_req_schema; } @@ -451,7 +454,7 @@ parse_url_char(enum state s, const char ch) break; case s_req_schema: - if (IS_ALPHA(ch)) { + if (IS_ALPHANUM(ch) || ch == '+' || ch == '-' || ch == '.') { return s; } diff --git a/vendor/libgit2/examples/network/fetch.c b/vendor/libgit2/examples/network/fetch.c index 6be12406b..177359b88 100644 --- a/vendor/libgit2/examples/network/fetch.c +++ b/vendor/libgit2/examples/network/fetch.c @@ -23,32 +23,6 @@ static int progress_cb(const char *str, int len, void *data) return 0; } -static void *download(void *ptr) -{ - struct dl_data *data = (struct dl_data *)ptr; - - // Connect to the remote end specifying that we want to fetch - // information from it. - if (git_remote_connect(data->remote, GIT_DIRECTION_FETCH, &data->fetch_opts->callbacks) < 0) { - data->ret = -1; - goto exit; - } - - // Download the packfile and index it. This function updates the - // amount of received data and the indexer stats which lets you - // inform the user about progress. - if (git_remote_download(data->remote, NULL, data->fetch_opts) < 0) { - data->ret = -1; - goto exit; - } - - data->ret = 0; - -exit: - data->finished = 1; - return &data->ret; -} - /** * This function gets called for each remote-tracking branch that gets * updated. The message we output depends on whether it's a new one or @@ -73,6 +47,25 @@ static int update_cb(const char *refname, const git_oid *a, const git_oid *b, vo return 0; } +/** + * This gets called during the download and indexing. Here we show + * processed and total objects in the pack and the amount of received + * data. Most frontends will probably want to show a percentage and + * the download rate. + */ +static int transfer_progress_cb(const git_transfer_progress *stats, void *payload) +{ + if (stats->received_objects == stats->total_objects) { + printf("Resolving deltas %d/%d\r", + stats->indexed_deltas, stats->total_deltas); + } else if (stats->total_objects > 0) { + printf("Received %d/%d objects (%d) in %" PRIuZ " bytes\r", + stats->received_objects, stats->total_objects, + stats->indexed_objects, stats->received_bytes); + } + return 0; +} + /** Entry point for this command */ int fetch(git_repository *repo, int argc, char **argv) { @@ -80,9 +73,6 @@ int fetch(git_repository *repo, int argc, char **argv) const git_transfer_progress *stats; struct dl_data data; git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; -#ifndef _WIN32 - pthread_t worker; -#endif if (argc < 2) { fprintf(stderr, "usage: %s fetch \n", argv[-1]); @@ -99,49 +89,23 @@ int fetch(git_repository *repo, int argc, char **argv) // Set up the callbacks (only update_tips for now) fetch_opts.callbacks.update_tips = &update_cb; fetch_opts.callbacks.sideband_progress = &progress_cb; + fetch_opts.callbacks.transfer_progress = transfer_progress_cb; fetch_opts.callbacks.credentials = cred_acquire_cb; - // Set up the information for the background worker thread - data.remote = remote; - data.fetch_opts = &fetch_opts; - data.ret = 0; - data.finished = 0; - - stats = git_remote_stats(remote); - -#ifdef _WIN32 - download(&data); -#else - pthread_create(&worker, NULL, download, &data); - - // Loop while the worker thread is still running. Here we show processed - // and total objects in the pack and the amount of received - // data. Most frontends will probably want to show a percentage and - // the download rate. - do { - usleep(10000); - - if (stats->received_objects == stats->total_objects) { - printf("Resolving deltas %d/%d\r", - stats->indexed_deltas, stats->total_deltas); - } else if (stats->total_objects > 0) { - printf("Received %d/%d objects (%d) in %" PRIuZ " bytes\r", - stats->received_objects, stats->total_objects, - stats->indexed_objects, stats->received_bytes); - } - } while (!data.finished); - - if (data.ret < 0) - goto on_error; - - pthread_join(worker, NULL); -#endif + /** + * Perform the fetch with the configured refspecs from the + * config. Update the reflog for the updated references with + * "fetch". + */ + if (git_remote_fetch(remote, NULL, &fetch_opts, "fetch") < 0) + return -1; /** * If there are local objects (we got a thin pack), then tell * the user how many objects we saved from having to cross the * network. */ + stats = git_remote_stats(remote); if (stats->local_objects > 0) { printf("\rReceived %d/%d objects in %" PRIuZ " bytes (used %d local objects)\n", stats->indexed_objects, stats->total_objects, stats->received_bytes, stats->local_objects); @@ -150,16 +114,6 @@ int fetch(git_repository *repo, int argc, char **argv) stats->indexed_objects, stats->total_objects, stats->received_bytes); } - // Disconnect the underlying connection to prevent from idling. - git_remote_disconnect(remote); - - // Update the references in the remote's namespace to point to the - // right commits. This may be needed even if there was no packfile - // to download, which can happen e.g. when the branches have been - // changed but all the needed objects are available locally. - if (git_remote_update_tips(remote, &fetch_opts.callbacks, 1, fetch_opts.download_tags, NULL) < 0) - return -1; - git_remote_free(remote); return 0; diff --git a/vendor/libgit2/examples/network/ls-remote.c b/vendor/libgit2/examples/network/ls-remote.c index 21026562f..c9da79f5f 100644 --- a/vendor/libgit2/examples/network/ls-remote.c +++ b/vendor/libgit2/examples/network/ls-remote.c @@ -26,7 +26,7 @@ static int use_remote(git_repository *repo, char *name) */ callbacks.credentials = cred_acquire_cb; - error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks); + error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL); if (error < 0) goto cleanup; diff --git a/vendor/libgit2/git.git-authors b/vendor/libgit2/git.git-authors index 9131a1fa1..6a85224b4 100644 --- a/vendor/libgit2/git.git-authors +++ b/vendor/libgit2/git.git-authors @@ -39,6 +39,7 @@ ok Adam Simpkins (http transport) ok Adrian Johnson ok Alexey Shumkin ok Andreas Ericsson +ok Antoine Pelisse ok Boyd Lynn Gerber ok Brandon Casey ok Brian Downing diff --git a/vendor/libgit2/include/git2/blame.h b/vendor/libgit2/include/git2/blame.h index 173e9994b..84bb7f94c 100644 --- a/vendor/libgit2/include/git2/blame.h +++ b/vendor/libgit2/include/git2/blame.h @@ -74,8 +74,8 @@ typedef struct git_blame_options { uint16_t min_match_characters; git_oid newest_commit; git_oid oldest_commit; - uint32_t min_line; - uint32_t max_line; + size_t min_line; + size_t max_line; } git_blame_options; #define GIT_BLAME_OPTIONS_VERSION 1 @@ -113,15 +113,15 @@ GIT_EXTERN(int) git_blame_init_options( * root, or the commit specified in git_blame_options.oldest_commit) */ typedef struct git_blame_hunk { - uint16_t lines_in_hunk; + size_t lines_in_hunk; git_oid final_commit_id; - uint16_t final_start_line_number; + size_t final_start_line_number; git_signature *final_signature; git_oid orig_commit_id; const char *orig_path; - uint16_t orig_start_line_number; + size_t orig_start_line_number; git_signature *orig_signature; char boundary; @@ -156,7 +156,7 @@ GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byindex( */ GIT_EXTERN(const git_blame_hunk*) git_blame_get_hunk_byline( git_blame *blame, - uint32_t lineno); + size_t lineno); /** * Get the blame for a single file. diff --git a/vendor/libgit2/include/git2/blob.h b/vendor/libgit2/include/git2/blob.h index 4a6d8e50a..9a57c37f5 100644 --- a/vendor/libgit2/include/git2/blob.h +++ b/vendor/libgit2/include/git2/blob.h @@ -171,8 +171,8 @@ typedef int (*git_blob_chunk_cb)(char *content, size_t max_length, void *payload * - The `callback` must return the number of bytes that have been * written to the `content` buffer. * - * - When there is no more data to stream, `callback` should return - * 0. This will prevent it from being invoked anymore. + * - When there is no more data to stream, `callback` should return 0. + * This will prevent it from being invoked anymore. * * - If an error occurs, the callback should return a negative value. * This value will be returned to the caller. diff --git a/vendor/libgit2/include/git2/commit.h b/vendor/libgit2/include/git2/commit.h index 04711c1fa..3488c7440 100644 --- a/vendor/libgit2/include/git2/commit.h +++ b/vendor/libgit2/include/git2/commit.h @@ -127,6 +127,19 @@ GIT_EXTERN(const char *) git_commit_message_raw(const git_commit *commit); */ GIT_EXTERN(const char *) git_commit_summary(git_commit *commit); +/** + * Get the long "body" of the git commit message. + * + * The returned message is the body of the commit, comprising + * everything but the first paragraph of the message. Leading and + * trailing whitespaces are trimmed. + * + * @param commit a previously loaded commit. + * @return the body of a commit or NULL when no the message only + * consists of a summary + */ +GIT_EXTERN(const char *) git_commit_body(git_commit *commit); + /** * Get the commit time (i.e. committer time) of a commit. * @@ -250,6 +263,24 @@ GIT_EXTERN(int) git_commit_nth_gen_ancestor( */ GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field); +/** + * Extract the signature from a commit + * + * If the id is not for a commit, the error class will be + * `GITERR_INVALID`. If the commit does not have a signature, the + * error class will be `GITERR_OBJECT`. + * + * @param signature the signature block + * @param signed_data signed data; this is the commit contents minus the signature block + * @param repo the repository in which the commit exists + * @param commit_id the commit from which to extract the data + * @param field the name of the header field containing the signature + * block; pass `NULL` to extract the default 'gpgsig' + * @return 0 on success, GIT_ENOTFOUND if the id is not for a commit + * or the commit does not have a signature. + */ +GIT_EXTERN(int) git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, const char *field); + /** * Create new commit in the repository from a list of `git_object` pointers * diff --git a/vendor/libgit2/include/git2/common.h b/vendor/libgit2/include/git2/common.h index 577906115..d7428d811 100644 --- a/vendor/libgit2/include/git2/common.h +++ b/vendor/libgit2/include/git2/common.h @@ -24,10 +24,19 @@ GIT_BEGIN_DECL # include "inttypes.h" GIT_END_DECL -#else +/** This check is needed for importing this file in an iOS/OS X framework throws an error in Xcode otherwise.*/ +#elif !defined(__CLANG_INTTYPES_H) # include #endif +#ifdef DOCURIUM +/* + * This is so clang's doc parser acknowledges comments on functions + * with size_t parameters. + */ +typedef size_t size_t; +#endif + /** Declare a public function exported for application use. */ #if __GNUC__ >= 4 # define GIT_EXTERN(type) extern \ @@ -101,8 +110,9 @@ GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev); */ typedef enum { GIT_FEATURE_THREADS = (1 << 0), - GIT_FEATURE_HTTPS = (1 << 1), - GIT_FEATURE_SSH = (1 << 2), + GIT_FEATURE_HTTPS = (1 << 1), + GIT_FEATURE_SSH = (1 << 2), + GIT_FEATURE_NSEC = (1 << 3), } git_feature_t; /** @@ -145,6 +155,9 @@ typedef enum { GIT_OPT_GET_TEMPLATE_PATH, GIT_OPT_SET_TEMPLATE_PATH, GIT_OPT_SET_SSL_CERT_LOCATIONS, + GIT_OPT_SET_USER_AGENT, + GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, + GIT_OPT_SET_SSL_CIPHERS, } git_libgit2_opt_t; /** @@ -172,9 +185,9 @@ typedef enum { * * opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf) * * > Get the search path for a given level of config data. "level" must - * > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, or - * > `GIT_CONFIG_LEVEL_XDG`. The search path is written to the `out` - * > buffer. + * > be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`, + * > `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`. + * > The search path is written to the `out` buffer. * * * opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path) * @@ -186,8 +199,9 @@ typedef enum { * > variables). Use magic path `$PATH` to include the old value * > of the path (if you want to prepend or append, for instance). * > - * > - `level` must be GIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_GLOBAL, - * > or GIT_CONFIG_LEVEL_XDG. + * > - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`, + * > `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or + * > `GIT_CONFIG_LEVEL_PROGRAMDATA`. * * * opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size) * @@ -240,6 +254,27 @@ typedef enum { * > * > Either parameter may be `NULL`, but not both. * + * * opts(GIT_OPT_SET_USER_AGENT, const char *user_agent) + * + * > Set the value of the User-Agent header. This value will be + * > appended to "git/1.0", for compatibility with other git clients. + * > + * > - `user_agent` is the value that will be delivered as the + * > User-Agent header on HTTP requests. + * + * * opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled) + * + * > Enable strict input validation when creating new objects + * > to ensure that all inputs to the new objects are valid. For + * > example, when this is enabled, the parent(s) and tree inputs + * > will be validated when creating a new commit. This defaults + * > to disabled. + * * opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers) + * + * > Set the SSL ciphers use for HTTPS connections. + * > + * > - `ciphers` is the list of ciphers that are eanbled. + * * @param option Option key * @param ... value to set the option * @return 0 on success, <0 on failure diff --git a/vendor/libgit2/include/git2/config.h b/vendor/libgit2/include/git2/config.h index 537663ec9..d0f1ba1b3 100644 --- a/vendor/libgit2/include/git2/config.h +++ b/vendor/libgit2/include/git2/config.h @@ -29,25 +29,28 @@ GIT_BEGIN_DECL * priority levels as well. */ typedef enum { + /** System-wide on Windows, for compatibility with portable git */ + GIT_CONFIG_LEVEL_PROGRAMDATA = 1, + /** System-wide configuration file; /etc/gitconfig on Linux systems */ - GIT_CONFIG_LEVEL_SYSTEM = 1, + GIT_CONFIG_LEVEL_SYSTEM = 2, /** XDG compatible configuration file; typically ~/.config/git/config */ - GIT_CONFIG_LEVEL_XDG = 2, + GIT_CONFIG_LEVEL_XDG = 3, /** User-specific configuration file (also called Global configuration * file); typically ~/.gitconfig */ - GIT_CONFIG_LEVEL_GLOBAL = 3, + GIT_CONFIG_LEVEL_GLOBAL = 4, /** Repository specific configuration file; $WORK_DIR/.git/config on * non-bare repos */ - GIT_CONFIG_LEVEL_LOCAL = 4, + GIT_CONFIG_LEVEL_LOCAL = 5, /** Application specific configuration file; freely defined by applications */ - GIT_CONFIG_LEVEL_APP = 5, + GIT_CONFIG_LEVEL_APP = 6, /** Represents the highest level available config file (i.e. the most * specific config file available that actually is loaded) @@ -141,6 +144,17 @@ GIT_EXTERN(int) git_config_find_xdg(git_buf *out); */ GIT_EXTERN(int) git_config_find_system(git_buf *out); +/** + * Locate the path to the configuration file in ProgramData + * + * Look for the file in %PROGRAMDATA%\Git\config used by portable git. + * + * @param out Pointer to a user-allocated git_buf in which to store the path + * @return 0 if a ProgramData configuration file has been + * found. Its path will be stored in `out`. + */ +GIT_EXTERN(int) git_config_find_programdata(git_buf *out); + /** * Open the global, XDG and system configuration files * @@ -691,6 +705,24 @@ GIT_EXTERN(int) git_config_backend_foreach_match( void *payload); +/** + * Lock the backend with the highest priority + * + * Locking disallows anybody else from writing to that backend. Any + * updates made after locking will not be visible to a reader until + * the file is unlocked. + * + * You can apply the changes by calling `git_transaction_commit()` + * before freeing the transaction. Either of these actions will unlock + * the config. + * + * @param tx the resulting transaction, use this to commit or undo the + * changes + * @param cfg the configuration in which to lock + * @return 0 or an error code + */ +GIT_EXTERN(int) git_config_lock(git_transaction **tx, git_config *cfg); + /** @} */ GIT_END_DECL #endif diff --git a/vendor/libgit2/include/git2/diff.h b/vendor/libgit2/include/git2/diff.h index b3ab5397e..c35701a46 100644 --- a/vendor/libgit2/include/git2/diff.h +++ b/vendor/libgit2/include/git2/diff.h @@ -129,8 +129,12 @@ typedef enum { */ GIT_DIFF_INCLUDE_CASECHANGE = (1u << 11), - /** If the pathspec is set in the diff options, this flags means to - * apply it as an exact match instead of as an fnmatch pattern. + /** If the pathspec is set in the diff options, this flags indicates + * that the paths will be treated as literal paths instead of + * fnmatch patterns. Each path in the list must either be a full + * path to a file or a directory. (A trailing slash indicates that + * the path will _only_ match a directory). If a directory is + * specified, all children will be included. */ GIT_DIFF_DISABLE_PATHSPEC_MATCH = (1u << 12), @@ -346,6 +350,22 @@ typedef int (*git_diff_notify_cb)( const char *matched_pathspec, void *payload); +/** + * Diff progress callback. + * + * Called before each file comparison. + * + * @param diff_so_far The diff being generated. + * @param old_path The path to the old file or NULL. + * @param new_path The path to the new file or NULL. + * @return Non-zero to abort the diff. + */ +typedef int (*git_diff_progress_cb)( + const git_diff *diff_so_far, + const char *old_path, + const char *new_path, + void *payload); + /** * Structure describing options about how the diff should be executed. * @@ -366,8 +386,10 @@ typedef int (*git_diff_notify_cb)( * - `max_size` is a file size (in bytes) above which a blob will be marked * as binary automatically; pass a negative value to disable. * - `notify_cb` is an optional callback function, notifying the consumer of - * which files are being examined as the diff is generated - * - `notify_payload` is the payload data to pass to the `notify_cb` function + * changes to the diff as new deltas are added. + * - `progress_cb` is an optional callback function, notifying the consumer of + * which files are being examined as the diff is generated. + * - `payload` is the payload to pass to the callback functions. * - `ignore_submodules` overrides the submodule ignore setting for all * submodules in the diff. */ @@ -379,8 +401,9 @@ typedef struct { git_submodule_ignore_t ignore_submodules; /**< submodule ignore rule */ git_strarray pathspec; /**< defaults to include all paths */ - git_diff_notify_cb notify_cb; - void *notify_payload; + git_diff_notify_cb notify_cb; + git_diff_progress_cb progress_cb; + void *payload; /* options controlling how to diff text is generated */ @@ -399,7 +422,7 @@ typedef struct { * `git_diff_options_init` programmatic initialization. */ #define GIT_DIFF_OPTIONS_INIT \ - {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3} + {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3} /** * Initializes a `git_diff_options` with default values. Equivalent to @@ -835,6 +858,25 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index( git_tree *old_tree, const git_diff_options *opts); /**< can be NULL for defaults */ +/** + * Create a diff with the difference between two index objects. + * + * The first index will be used for the "old_file" side of the delta and the + * second index will be used for the "new_file" side of the delta. + * + * @param diff Output pointer to a git_diff pointer to be allocated. + * @param repo The repository containing the indexes. + * @param old_index A git_index object to diff from. + * @param new_index A git_index object to diff to. + * @param opts Structure with options to influence diff or NULL for defaults. + */ +GIT_EXTERN(int) git_diff_index_to_index( + git_diff **diff, + git_repository *repo, + git_index *old_index, + git_index *new_index, + const git_diff_options *opts); /**< can be NULL for defaults */ + /** * Merge one diff into another. * @@ -1152,7 +1194,7 @@ typedef enum { } git_diff_stats_format_t; /** - * Accumlate diff statistics for all patches. + * Accumulate diff statistics for all patches. * * @param out Structure containg the diff statistics. * @param diff A git_diff generated by one of the above functions. @@ -1244,12 +1286,15 @@ typedef struct { /** Summary of the change */ const char *summary; + /** Commit message's body */ + const char *body; + /** Author of the change */ const git_signature *author; } git_diff_format_email_options; #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1 -#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL} +#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL} /** * Create an e-mail ready patch from a diff. diff --git a/vendor/libgit2/include/git2/errors.h b/vendor/libgit2/include/git2/errors.h index e189e55f1..3ecea34bf 100644 --- a/vendor/libgit2/include/git2/errors.h +++ b/vendor/libgit2/include/git2/errors.h @@ -49,6 +49,7 @@ typedef enum { GIT_EINVALID = -21, /**< Invalid operation or input */ GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */ GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */ + GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */ GIT_PASSTHROUGH = -30, /**< Internal only */ GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */ @@ -113,18 +114,6 @@ GIT_EXTERN(const git_error *) giterr_last(void); */ GIT_EXTERN(void) giterr_clear(void); -/** - * Get the last error data and clear it. - * - * This copies the last error into the given `git_error` struct - * and returns 0 if the copy was successful, leaving the error - * cleared as if `giterr_clear` had been called. - * - * If there was no existing error in the library, -1 will be returned - * and the contents of `cpy` will be left unmodified. - */ -GIT_EXTERN(int) giterr_detach(git_error *cpy); - /** * Set the error message string for this thread. * @@ -137,11 +126,6 @@ GIT_EXTERN(int) giterr_detach(git_error *cpy); * This error message is stored in thread-local storage and only applies * to the particular thread that this libgit2 call is made from. * - * NOTE: Passing the `error_class` as GITERR_OS has a special behavior: we - * attempt to append the system default error message for the last OS error - * that occurred and then clear the last error. The specific implementation - * of looking up and clearing this last OS error will vary by platform. - * * @param error_class One of the `git_error_t` enum above describing the * general subsystem that is responsible for the error. * @param string The formatted error message to keep diff --git a/vendor/libgit2/include/git2/index.h b/vendor/libgit2/include/git2/index.h index 7caf3ed78..466765be3 100644 --- a/vendor/libgit2/include/git2/index.h +++ b/vendor/libgit2/include/git2/index.h @@ -154,13 +154,27 @@ typedef enum { GIT_INDEX_ADD_CHECK_PATHSPEC = (1u << 2), } git_index_add_option_t; -/** - * Match any index stage. - * - * Some index APIs take a stage to match; pass this value to match - * any entry matching the path regardless of stage. - */ -#define GIT_INDEX_STAGE_ANY -1 +typedef enum { + /** + * Match any index stage. + * + * Some index APIs take a stage to match; pass this value to match + * any entry matching the path regardless of stage. + */ + GIT_INDEX_STAGE_ANY = -1, + + /** A normal staged file in the index. */ + GIT_INDEX_STAGE_NORMAL = 0, + + /** The ancestor side of a conflict. */ + GIT_INDEX_STAGE_ANCESTOR = 1, + + /** The "ours" side of a conflict. */ + GIT_INDEX_STAGE_OURS = 2, + + /** The "theirs" side of a conflict. */ + GIT_INDEX_STAGE_THEIRS = 3, +} git_index_stage_t; /** @name Index File Functions * @@ -643,6 +657,17 @@ GIT_EXTERN(int) git_index_update_all( */ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path); +/** + * Find the first position of any entries matching a prefix. To find the first position + * of a path inside a given folder, suffix the prefix with a '/'. + * + * @param at_pos the address to which the position of the index entry is written (optional) + * @param index an existing index object + * @param prefix the prefix to search for + * @return 0 with valid value in at_pos; an error code otherwise + */ +GIT_EXTERN(int) git_index_find_prefix(size_t *at_pos, git_index *index, const char *prefix); + /**@}*/ /** @name Conflict Index Entry Functions diff --git a/vendor/libgit2/include/git2/merge.h b/vendor/libgit2/include/git2/merge.h index 5fef452b9..560797a0c 100644 --- a/vendor/libgit2/include/git2/merge.h +++ b/vendor/libgit2/include/git2/merge.h @@ -62,8 +62,8 @@ GIT_EXTERN(int) git_merge_file_init_input( unsigned int version); /** - * Flags for `git_merge_tree` options. A combination of these flags can be - * passed in via the `tree_flags` value in the `git_merge_options`. + * Flags for `git_merge` options. A combination of these flags can be + * passed in via the `flags` value in the `git_merge_options`. */ typedef enum { /** @@ -71,8 +71,28 @@ typedef enum { * side or the common ancestor and the "theirs" side. This will enable * the ability to merge between a modified and renamed file. */ - GIT_MERGE_TREE_FIND_RENAMES = (1 << 0), -} git_merge_tree_flag_t; + GIT_MERGE_FIND_RENAMES = (1 << 0), + + /** + * If a conflict occurs, exit immediately instead of attempting to + * continue resolving conflicts. The merge operation will fail with + * GIT_EMERGECONFLICT and no index will be returned. + */ + GIT_MERGE_FAIL_ON_CONFLICT = (1 << 1), + + /** + * Do not write the REUC extension on the generated index + */ + GIT_MERGE_SKIP_REUC = (1 << 2), + + /** + * If the commits being merged have multiple merge bases, do not build + * a recursive merge base (by merging the multiple merge bases), + * instead simply use the first base. This flag provides a similar + * merge base to `git-merge-resolve`. + */ + GIT_MERGE_NO_RECURSIVE = (1 << 3), +} git_merge_flag_t; /** * Merge file favor options for `git_merge_options` instruct the file-level @@ -140,7 +160,7 @@ typedef enum { /** Take extra time to find minimal diff */ GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7), -} git_merge_file_flags_t; +} git_merge_file_flag_t; /** * Options for merging a file @@ -169,8 +189,8 @@ typedef struct { /** The file to favor in region conflicts. */ git_merge_file_favor_t favor; - /** see `git_merge_file_flags_t` above */ - unsigned int flags; + /** see `git_merge_file_flag_t` above */ + git_merge_file_flag_t flags; } git_merge_file_options; #define GIT_MERGE_FILE_OPTIONS_VERSION 1 @@ -220,11 +240,13 @@ typedef struct { */ typedef struct { unsigned int version; - git_merge_tree_flag_t tree_flags; + + /** See `git_merge_flag_t` above */ + git_merge_flag_t flags; /** * Similarity to consider a file renamed (default 50). If - * `GIT_MERGE_TREE_FIND_RENAMES` is enabled, added files will be compared + * `GIT_MERGE_FIND_RENAMES` is enabled, added files will be compared * with deleted files to determine their similarity. Files that are * more similar than the rename threshold (percentage-wise) will be * treated as a rename. @@ -243,11 +265,19 @@ typedef struct { /** Pluggable similarity metric; pass NULL to use internal metric */ git_diff_similarity_metric *metric; + /** + * Maximum number of times to merge common ancestors to build a + * virtual merge base when faced with criss-cross merges. When this + * limit is reached, the next ancestor will simply be used instead of + * attempting to merge it. The default is unlimited. + */ + unsigned int recursion_limit; + /** Flags for handling conflicting content. */ git_merge_file_favor_t file_favor; - /** see `git_merge_file_flags_t` above */ - unsigned int file_flags; + /** see `git_merge_file_flag_t` above */ + git_merge_file_flag_t file_flags; } git_merge_options; #define GIT_MERGE_OPTIONS_VERSION 1 @@ -497,10 +527,6 @@ GIT_EXTERN(int) git_merge_trees( * or checked out. If the index is to be converted to a tree, the caller * should resolve any conflicts that arose as part of the merge. * - * The merge performed uses the first common ancestor, unlike the - * `git-merge-recursive` strategy, which may produce an artificial common - * ancestor tree when there are multiple ancestors. - * * The returned index must be freed explicitly with `git_index_free`. * * @param out pointer to store the index result in @@ -523,10 +549,6 @@ GIT_EXTERN(int) git_merge_commits( * to the index. Callers should inspect the repository's index after this * completes, resolve any conflicts and prepare a commit. * - * The merge performed uses the first common ancestor, unlike the - * `git-merge-recursive` strategy, which may produce an artificial common - * ancestor tree when there are multiple ancestors. - * * For compatibility with git, the repository is put into a merging * state. Once the commit is done (or if the uses wishes to abort), * you should clear this state by calling diff --git a/vendor/libgit2/include/git2/rebase.h b/vendor/libgit2/include/git2/rebase.h index d9aa175c7..9b9065ee4 100644 --- a/vendor/libgit2/include/git2/rebase.h +++ b/vendor/libgit2/include/git2/rebase.h @@ -38,19 +38,33 @@ typedef struct { */ int quiet; + /** + * Used by `git_rebase_init`, this will begin an in-memory rebase, + * which will allow callers to step through the rebase operations and + * commit the rebased changes, but will not rewind HEAD or update the + * repository to be in a rebasing state. This will not interfere with + * the working directory (if there is one). + */ + int inmemory; + /** * Used by `git_rebase_finish`, this is the name of the notes reference * used to rewrite notes for rebased commits when finishing the rebase; - * if NULL, the contents of the coniguration option `notes.rewriteRef` + * if NULL, the contents of the configuration option `notes.rewriteRef` * is examined, unless the configuration option `notes.rewrite.rebase` * is set to false. If `notes.rewriteRef` is also NULL, notes will * not be rewritten. */ const char *rewrite_notes_ref; + /** + * Options to control how trees are merged during `git_rebase_next`. + */ + git_merge_options merge_options; + /** * Options to control how files are written during `git_rebase_init`, - * `git_checkout_next` and `git_checkout_abort`. Note that a minimum + * `git_rebase_next` and `git_rebase_abort`. Note that a minimum * strategy of `GIT_CHECKOUT_SAFE` is defaulted in `init` and `next`, * and a minimum strategy of `GIT_CHECKOUT_FORCE` is defaulted in * `abort` to match git semantics. @@ -101,7 +115,8 @@ typedef enum { #define GIT_REBASE_OPTIONS_VERSION 1 #define GIT_REBASE_OPTIONS_INIT \ - {GIT_REBASE_OPTIONS_VERSION, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT} + { GIT_REBASE_OPTIONS_VERSION, 0, 0, NULL, GIT_MERGE_OPTIONS_INIT, \ + GIT_CHECKOUT_OPTIONS_INIT} /** Indicates that a rebase operation is not (yet) in progress. */ #define GIT_REBASE_NO_OPERATION SIZE_MAX @@ -226,6 +241,21 @@ GIT_EXTERN(int) git_rebase_next( git_rebase_operation **operation, git_rebase *rebase); +/** + * Gets the index produced by the last operation, which is the result + * of `git_rebase_next` and which will be committed by the next + * invocation of `git_rebase_commit`. This is useful for resolving + * conflicts in an in-memory rebase before committing them. You must + * call `git_index_free` when you are finished with this. + * + * This is only applicable for in-memory rebases; for rebases within + * a working directory, the changes were applied to the repository's + * index. + */ +GIT_EXTERN(int) git_rebase_inmemory_index( + git_index **index, + git_rebase *rebase); + /** * Commits the current patch. You must have resolved any conflicts that * were introduced during the patch application from the `git_rebase_next` diff --git a/vendor/libgit2/include/git2/remote.h b/vendor/libgit2/include/git2/remote.h index 444fe5276..c42d96710 100644 --- a/vendor/libgit2/include/git2/remote.h +++ b/vendor/libgit2/include/git2/remote.h @@ -241,9 +241,10 @@ GIT_EXTERN(const git_refspec *)git_remote_get_refspec(const git_remote *remote, * @param direction GIT_DIRECTION_FETCH if you want to fetch or * GIT_DIRECTION_PUSH if you want to push * @param callbacks the callbacks to use for this connection + * @param custom_headers extra HTTP headers to use in this connection * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks); +GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers); /** * Get the remote repository's reference advertisement list @@ -546,6 +547,11 @@ typedef struct { * The default is to auto-follow tags. */ git_remote_autotag_option_t download_tags; + + /** + * Extra headers for this fetch operation + */ + git_strarray custom_headers; } git_fetch_options; #define GIT_FETCH_OPTIONS_VERSION 1 @@ -585,6 +591,11 @@ typedef struct { * Callbacks to use for this push operation */ git_remote_callbacks callbacks; + + /** + * Extra headers for this push operation + */ + git_strarray custom_headers; } git_push_options; #define GIT_PUSH_OPTIONS_VERSION 1 diff --git a/vendor/libgit2/include/git2/repository.h b/vendor/libgit2/include/git2/repository.h index cf268ef85..85b7e6861 100644 --- a/vendor/libgit2/include/git2/repository.h +++ b/vendor/libgit2/include/git2/repository.h @@ -675,7 +675,9 @@ typedef enum { GIT_REPOSITORY_STATE_NONE, GIT_REPOSITORY_STATE_MERGE, GIT_REPOSITORY_STATE_REVERT, + GIT_REPOSITORY_STATE_REVERT_SEQUENCE, GIT_REPOSITORY_STATE_CHERRYPICK, + GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE, GIT_REPOSITORY_STATE_BISECT, GIT_REPOSITORY_STATE_REBASE, GIT_REPOSITORY_STATE_REBASE_INTERACTIVE, diff --git a/vendor/libgit2/include/git2/stash.h b/vendor/libgit2/include/git2/stash.h index 526db0ba2..733d75a7f 100644 --- a/vendor/libgit2/include/git2/stash.h +++ b/vendor/libgit2/include/git2/stash.h @@ -68,7 +68,7 @@ GIT_EXTERN(int) git_stash_save( git_repository *repo, const git_signature *stasher, const char *message, - unsigned int flags); + uint32_t flags); /** Stash application flags. */ typedef enum { @@ -150,7 +150,7 @@ typedef struct git_stash_apply_options { * `GIT_STASH_APPLY_OPTIONS_INIT` here. * @return Zero on success; -1 on failure. */ -int git_stash_apply_init_options( +GIT_EXTERN(int) git_stash_apply_init_options( git_stash_apply_options *opts, unsigned int version); /** diff --git a/vendor/libgit2/include/git2/submodule.h b/vendor/libgit2/include/git2/submodule.h index 689fe4b64..bc94eacaa 100644 --- a/vendor/libgit2/include/git2/submodule.h +++ b/vendor/libgit2/include/git2/submodule.h @@ -107,6 +107,17 @@ typedef enum { GIT_SUBMODULE_STATUS_WD_WD_MODIFIED | \ GIT_SUBMODULE_STATUS_WD_UNTRACKED)) != 0) +/** + * Function pointer to receive each submodule + * + * @param sm git_submodule currently being visited + * @param name name of the submodule + * @param payload value you passed to the foreach function as payload + * @return 0 on success or error code + */ +typedef int (*git_submodule_cb)( + git_submodule *sm, const char *name, void *payload); + /** * Submodule update options structure * @@ -239,7 +250,7 @@ GIT_EXTERN(void) git_submodule_free(git_submodule *submodule); */ GIT_EXTERN(int) git_submodule_foreach( git_repository *repo, - int (*callback)(git_submodule *sm, const char *name, void *payload), + git_submodule_cb callback, void *payload); /** diff --git a/vendor/libgit2/include/git2/sys/config.h b/vendor/libgit2/include/git2/sys/config.h index 044e34417..4dad6da42 100644 --- a/vendor/libgit2/include/git2/sys/config.h +++ b/vendor/libgit2/include/git2/sys/config.h @@ -67,6 +67,20 @@ struct git_config_backend { int (*iterator)(git_config_iterator **, struct git_config_backend *); /** Produce a read-only version of this backend */ int (*snapshot)(struct git_config_backend **, struct git_config_backend *); + /** + * Lock this backend. + * + * Prevent any writes to the data store backing this + * backend. Any updates must not be visible to any other + * readers. + */ + int (*lock)(struct git_config_backend *); + /** + * Unlock the data store backing this backend. If success is + * true, the changes should be committed, otherwise rolled + * back. + */ + int (*unlock)(struct git_config_backend *, int success); void (*free)(struct git_config_backend *); }; #define GIT_CONFIG_BACKEND_VERSION 1 diff --git a/vendor/libgit2/include/git2/sys/filter.h b/vendor/libgit2/include/git2/sys/filter.h index 5fd8d5566..d0e5d4d6f 100644 --- a/vendor/libgit2/include/git2/sys/filter.h +++ b/vendor/libgit2/include/git2/sys/filter.h @@ -127,17 +127,6 @@ GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *sr */ GIT_EXTERN(uint32_t) git_filter_source_flags(const git_filter_source *src); -/* - * struct git_filter - * - * The filter lifecycle: - * - initialize - first use of filter - * - shutdown - filter removed/unregistered from system - * - check - considering filter for file - * - apply - apply filter to file contents - * - cleanup - done with file - */ - /** * Initialize callback on filter * @@ -233,28 +222,51 @@ typedef void (*git_filter_cleanup_fn)( * To associate extra data with a filter, allocate extra data and put the * `git_filter` struct at the start of your data buffer, then cast the * `self` pointer to your larger structure when your callback is invoked. - * - * `version` should be set to GIT_FILTER_VERSION - * - * `attributes` is a whitespace-separated list of attribute names to check - * for this filter (e.g. "eol crlf text"). If the attribute name is bare, - * it will be simply loaded and passed to the `check` callback. If it has - * a value (i.e. "name=value"), the attribute must match that value for - * the filter to be applied. - * - * The `initialize`, `shutdown`, `check`, `apply`, and `cleanup` callbacks - * are all documented above with the respective function pointer typedefs. */ struct git_filter { + /** The `version` field should be set to `GIT_FILTER_VERSION`. */ unsigned int version; + /** + * A whitespace-separated list of attribute names to check for this + * filter (e.g. "eol crlf text"). If the attribute name is bare, it + * will be simply loaded and passed to the `check` callback. If it + * has a value (i.e. "name=value"), the attribute must match that + * value for the filter to be applied. The value may be a wildcard + * (eg, "name=*"), in which case the filter will be invoked for any + * value for the given attribute name. See the attribute parameter + * of the `check` callback for the attribute value that was specified. + */ const char *attributes; + /** Called when the filter is first used for any file. */ git_filter_init_fn initialize; + + /** Called when the filter is removed or unregistered from the system. */ git_filter_shutdown_fn shutdown; + + /** + * Called to determine whether the filter should be invoked for a + * given file. If this function returns `GIT_PASSTHROUGH` then the + * `apply` function will not be invoked and the contents will be passed + * through unmodified. + */ git_filter_check_fn check; + + /** + * Called to actually apply the filter to file contents. If this + * function returns `GIT_PASSTHROUGH` then the contents will be passed + * through unmodified. + */ git_filter_apply_fn apply; + + /** + * Called to apply the filter in a streaming manner. If this is not + * specified then the system will call `apply` with the whole buffer. + */ git_filter_stream_fn stream; + + /** Called when the system is done filtering for a file. */ git_filter_cleanup_fn cleanup; }; diff --git a/vendor/libgit2/include/git2/sys/index.h b/vendor/libgit2/include/git2/sys/index.h index 29a99f798..2e2b87e68 100644 --- a/vendor/libgit2/include/git2/sys/index.h +++ b/vendor/libgit2/include/git2/sys/index.h @@ -25,7 +25,7 @@ typedef struct git_index_name_entry { /** Representation of a resolve undo entry in the index. */ typedef struct git_index_reuc_entry { - unsigned int mode[3]; + uint32_t mode[3]; git_oid oid[3]; char *path; } git_index_reuc_entry; diff --git a/vendor/libgit2/include/git2/sys/odb_backend.h b/vendor/libgit2/include/git2/sys/odb_backend.h index fe102ff3c..e423a9236 100644 --- a/vendor/libgit2/include/git2/sys/odb_backend.h +++ b/vendor/libgit2/include/git2/sys/odb_backend.h @@ -83,6 +83,10 @@ struct git_odb_backend { git_odb_writepack **, git_odb_backend *, git_odb *odb, git_transfer_progress_cb progress_cb, void *progress_payload); + /** + * Frees any resources held by the odb (including the `git_odb_backend` + * itself). An odb backend implementation must provide this function. + */ void (* free)(git_odb_backend *); }; diff --git a/vendor/libgit2/include/git2/sys/refdb_backend.h b/vendor/libgit2/include/git2/sys/refdb_backend.h index 8b004a7e0..5129ad84a 100644 --- a/vendor/libgit2/include/git2/sys/refdb_backend.h +++ b/vendor/libgit2/include/git2/sys/refdb_backend.h @@ -103,8 +103,9 @@ struct git_refdb_backend { const git_signature *who, const char *message); /** - * Deletes the given reference from the refdb. A refdb implementation - * must provide this function. + * Deletes the given reference (and if necessary its reflog) + * from the refdb. A refdb implementation must provide this + * function. */ int (*del)(git_refdb_backend *backend, const char *ref_name, const git_oid *old_id, const char *old_target); @@ -129,8 +130,8 @@ struct git_refdb_backend { int (*ensure_log)(git_refdb_backend *backend, const char *refname); /** - * Frees any resources held by the refdb. A refdb implementation may - * provide this function; if it is not provided, nothing will be done. + * Frees any resources held by the refdb (including the `git_refdb_backend` + * itself). A refdb backend implementation must provide this function. */ void (*free)(git_refdb_backend *backend); diff --git a/vendor/libgit2/include/git2/sys/stream.h b/vendor/libgit2/include/git2/sys/stream.h index 55a714bbb..2b4ff7fd8 100644 --- a/vendor/libgit2/include/git2/sys/stream.h +++ b/vendor/libgit2/include/git2/sys/stream.h @@ -39,6 +39,19 @@ typedef struct git_stream { void (*free)(struct git_stream *); } git_stream; +typedef int (*git_stream_cb)(git_stream **out, const char *host, const char *port); + +/** + * Register a TLS stream constructor for the library to use + * + * If a constructor is already set, it will be overwritten. Pass + * `NULL` in order to deregister the current constructor. + * + * @param ctor the constructor to use + * @return 0 or an error code + */ +GIT_EXTERN(int) git_stream_register_tls(git_stream_cb ctor); + GIT_END_DECL #endif diff --git a/vendor/libgit2/include/git2/sys/transport.h b/vendor/libgit2/include/git2/sys/transport.h index e6ee3c654..ce0234a18 100644 --- a/vendor/libgit2/include/git2/sys/transport.h +++ b/vendor/libgit2/include/git2/sys/transport.h @@ -41,6 +41,11 @@ struct git_transport { git_transport_certificate_check_cb certificate_check_cb, void *payload); + /* Set custom headers for HTTP requests */ + int (*set_custom_headers)( + git_transport *transport, + const git_strarray *custom_headers); + /* Connect the transport to the remote repository, using the given * direction. */ int (*connect)( @@ -212,6 +217,28 @@ GIT_EXTERN(int) git_transport_smart( git_remote *owner, /* (git_smart_subtransport_definition *) */ void *payload); +/** + * Call the certificate check for this transport. + * + * @param transport a smart transport + * @param cert the certificate to pass to the caller + * @param valid whether we believe the certificate is valid + * @param hostname the hostname we connected to + * @return the return value of the callback + */ +GIT_EXTERN(int) git_transport_smart_certificate_check(git_transport *transport, git_cert *cert, int valid, const char *hostname); + +/** + * Call the credentials callback for this transport + * + * @param out the pointer where the creds are to be stored + * @param transport a smart transport + * @param user the user we saw on the url (if any) + * @param methods available methods for authentication + * @return the return value of the callback + */ +GIT_EXTERN(int) git_transport_smart_credentials(git_cred **out, git_transport *transport, const char *user, int methods); + /* *** End of base transport interface *** *** Begin interface for subtransports for the smart transport *** diff --git a/vendor/libgit2/include/git2/transport.h b/vendor/libgit2/include/git2/transport.h index 2eeebd565..0ec241699 100644 --- a/vendor/libgit2/include/git2/transport.h +++ b/vendor/libgit2/include/git2/transport.h @@ -37,39 +37,32 @@ typedef enum { * Hostkey information taken from libssh2 */ typedef struct { + git_cert parent; + /** - * Type of certificate. Here to share the header with - * `git_cert`. + * A hostkey type from libssh2, either + * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1` */ - git_cert_t cert_type; - /** - * A hostkey type from libssh2, either - * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1` - */ git_cert_ssh_t type; - /** - * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will - * have the MD5 hash of the hostkey. - */ + /** + * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will + * have the MD5 hash of the hostkey. + */ unsigned char hash_md5[16]; - /** - * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will - * have the SHA-1 hash of the hostkey. - */ - unsigned char hash_sha1[20]; + /** + * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will + * have the SHA-1 hash of the hostkey. + */ + unsigned char hash_sha1[20]; } git_cert_hostkey; /** * X.509 certificate information */ typedef struct { - /** - * Type of certificate. Here to share the header with - * `git_cert`. - */ - git_cert_t cert_type; + git_cert parent; /** * Pointer to the X.509 certificate data */ @@ -314,6 +307,17 @@ GIT_EXTERN(int) git_cred_ssh_key_memory_new( const char *privatekey, const char *passphrase); + +/** + * Free a credential. + * + * This is only necessary if you own the object; that is, if you are a + * transport. + * + * @param cred the object to free + */ +GIT_EXTERN(void) git_cred_free(git_cred *cred); + /** * Signature of a function which acquires a credential object. * diff --git a/vendor/libgit2/include/git2/version.h b/vendor/libgit2/include/git2/version.h index 116a13524..66a6623cd 100644 --- a/vendor/libgit2/include/git2/version.h +++ b/vendor/libgit2/include/git2/version.h @@ -7,12 +7,12 @@ #ifndef INCLUDE_git_version_h__ #define INCLUDE_git_version_h__ -#define LIBGIT2_VERSION "0.23.4" +#define LIBGIT2_VERSION "0.24.0" #define LIBGIT2_VER_MAJOR 0 -#define LIBGIT2_VER_MINOR 23 -#define LIBGIT2_VER_REVISION 4 +#define LIBGIT2_VER_MINOR 24 +#define LIBGIT2_VER_REVISION 0 #define LIBGIT2_VER_PATCH 0 -#define LIBGIT2_SOVERSION 23 +#define LIBGIT2_SOVERSION 24 #endif diff --git a/vendor/libgit2/libgit2.pc.in b/vendor/libgit2/libgit2.pc.in index 880266a30..329a560a7 100644 --- a/vendor/libgit2/libgit2.pc.in +++ b/vendor/libgit2/libgit2.pc.in @@ -6,7 +6,7 @@ Name: libgit2 Description: The git library, take 2 Version: @LIBGIT2_VERSION_STRING@ -Libs: -L${libdir} -lgit2 +Libs: -L"${libdir}" -lgit2 Libs.private: @LIBGIT2_PC_LIBS@ Requires.private: @LIBGIT2_PC_REQUIRES@ diff --git a/vendor/libgit2/script/cibuild.sh b/vendor/libgit2/script/cibuild.sh index de5df9ea8..00cde0ada 100755 --- a/vendor/libgit2/script/cibuild.sh +++ b/vendor/libgit2/script/cibuild.sh @@ -25,7 +25,7 @@ git daemon --listen=localhost --export-all --enable=receive-pack --base-path="$H export GITTEST_REMOTE_URL="git://localhost/test.git" # Run the test suite -ctest -V . || exit $? +ctest -V -R libgit2_clar || exit $? # Now that we've tested the raw git protocol, let's set up ssh to we # can do the push tests over it @@ -56,3 +56,7 @@ if [ -e ./libgit2_clar ]; then ./libgit2_clar -sonline::clone::cred_callback || exit $? fi fi + +export GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent" +export GITTEST_REMOTE_USER="libgit2test" +ctest -V -R libgit2_clar-cred_callback diff --git a/vendor/libgit2/script/coverity.sh b/vendor/libgit2/script/coverity.sh index dcfeffc1d..7fe9eb4c7 100755 --- a/vendor/libgit2/script/coverity.sh +++ b/vendor/libgit2/script/coverity.sh @@ -33,6 +33,8 @@ if [ ! -d "$TOOL_BASE" ]; then ln -s "$TOOL_DIR" "$TOOL_BASE"/cov-analysis fi +cp script/user_nodefs.h "$TOOL_BASE"/cov-analysis/config/user_nodefs.h + COV_BUILD="$TOOL_BASE/cov-analysis/bin/cov-build" # Configure and build @@ -47,11 +49,24 @@ COVERITY_UNSUPPORTED=1 \ # Upload results tar czf libgit2.tgz cov-int SHA=$(git rev-parse --short HEAD) -curl \ - --form project=libgit2 \ + +HTML="$(curl \ + --silent \ + --write-out "\n%{http_code}" \ --form token="$COVERITY_TOKEN" \ --form email=bs@github.com \ --form file=@libgit2.tgz \ --form version="$SHA" \ --form description="Travis build" \ - http://scan5.coverity.com/cgi-bin/upload.py + https://scan.coverity.com/builds?project=libgit2)" +# Body is everything up to the last line +BODY="$(echo "$HTML" | head -n-1)" +# Status code is the last line +STATUS_CODE="$(echo "$HTML" | tail -n1)" + +echo "${BODY}" + +if [ "${STATUS_CODE}" != "201" ]; then + echo "Received error code ${STATUS_CODE} from Coverity" + exit 1 +fi diff --git a/vendor/libgit2/script/install-deps-osx.sh b/vendor/libgit2/script/install-deps-osx.sh index c2e0162d8..5510379d4 100755 --- a/vendor/libgit2/script/install-deps-osx.sh +++ b/vendor/libgit2/script/install-deps-osx.sh @@ -2,4 +2,5 @@ set -x -brew install libssh2 cmake +brew update +brew install libssh2 diff --git a/vendor/libgit2/script/user_nodefs.h b/vendor/libgit2/script/user_nodefs.h new file mode 100644 index 000000000..3c06a706d --- /dev/null +++ b/vendor/libgit2/script/user_nodefs.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#nodef GITERR_CHECK_ALLOC(ptr) if (ptr == NULL) { __coverity_panic__(); } +#nodef GITERR_CHECK_ALLOC_BUF(buf) if (buf == NULL || git_buf_oom(buf)) { __coverity_panic__(); } + +#nodef GITERR_CHECK_ALLOC_ADD(out, one, two) \ + if (GIT_ADD_SIZET_OVERFLOW(out, one, two)) { __coverity_panic__(); } + +#nodef GITERR_CHECK_ALLOC_ADD3(out, one, two, three) \ + if (GIT_ADD_SIZET_OVERFLOW(out, one, two) || \ + GIT_ADD_SIZET_OVERFLOW(out, *(out), three)) { __coverity_panic__(); } + +#nodef GITERR_CHECK_ALLOC_ADD4(out, one, two, three, four) \ + if (GIT_ADD_SIZET_OVERFLOW(out, one, two) || \ + GIT_ADD_SIZET_OVERFLOW(out, *(out), three) || \ + GIT_ADD_SIZET_OVERFLOW(out, *(out), four)) { __coverity_panic__(); } + +#nodef GITERR_CHECK_ALLOC_MULTIPLY(out, nelem, elsize) \ + if (GIT_MULTIPLY_SIZET_OVERFLOW(out, nelem, elsize)) { __coverity_panic__(); } + +#nodef GITERR_CHECK_VERSION(S,V,N) if (giterr__check_version(S,V,N) < 0) { __coverity_panic__(); } + +#nodef LOOKS_LIKE_DRIVE_PREFIX(S) (strlen(S) >= 2 && git__isalpha((S)[0]) && (S)[1] == ':') + +#nodef git_vector_foreach(v, iter, elem) \ + for ((iter) = 0; (v)->contents != NULL && (iter) < (v)->length && ((elem) = (v)->contents[(iter)], 1); (iter)++ ) + +#nodef git_vector_rforeach(v, iter, elem) \ + for ((iter) = (v)->length - 1; (v)->contents != NULL && (iter) < SIZE_MAX && ((elem) = (v)->contents[(iter)], 1); (iter)-- ) diff --git a/vendor/libgit2/src/annotated_commit.c b/vendor/libgit2/src/annotated_commit.c index 3f2d2ed17..e53b95dee 100644 --- a/vendor/libgit2/src/annotated_commit.c +++ b/vendor/libgit2/src/annotated_commit.c @@ -7,12 +7,16 @@ #include "common.h" #include "annotated_commit.h" +#include "refs.h" +#include "cache.h" #include "git2/commit.h" #include "git2/refs.h" #include "git2/repository.h" #include "git2/annotated_commit.h" #include "git2/revparse.h" +#include "git2/tree.h" +#include "git2/index.h" static int annotated_commit_init( git_annotated_commit **out, @@ -22,14 +26,17 @@ static int annotated_commit_init( const char *remote_url) { git_annotated_commit *annotated_commit; + git_commit *commit = NULL; int error = 0; assert(out && id); *out = NULL; - annotated_commit = git__calloc(1, sizeof(git_annotated_commit)); - GITERR_CHECK_ALLOC(annotated_commit); + if ((error = git_commit_lookup(&commit, repo, id)) < 0 || + (error = git_annotated_commit_from_commit(&annotated_commit, + commit)) < 0) + goto done; if (ref_name) { annotated_commit->ref_name = git__strdup(ref_name); @@ -41,15 +48,10 @@ static int annotated_commit_init( GITERR_CHECK_ALLOC(annotated_commit->remote_url); } - git_oid_fmt(annotated_commit->id_str, id); - annotated_commit->id_str[GIT_OID_HEXSZ] = '\0'; - - if ((error = git_commit_lookup(&annotated_commit->commit, repo, id)) < 0) { - git_annotated_commit_free(annotated_commit); - return error; - } - *out = annotated_commit; + +done: + git_commit_free(commit); return error; } @@ -75,6 +77,51 @@ int git_annotated_commit_from_ref( return error; } +int git_annotated_commit_from_head( + git_annotated_commit **out, + git_repository *repo) +{ + git_reference *head; + int error; + + assert(out && repo); + + *out = NULL; + + if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0) + return -1; + + error = git_annotated_commit_from_ref(out, repo, head); + + git_reference_free(head); + return error; +} + +int git_annotated_commit_from_commit( + git_annotated_commit **out, + git_commit *commit) +{ + git_annotated_commit *annotated_commit; + + assert(out && commit); + + *out = NULL; + + annotated_commit = git__calloc(1, sizeof(git_annotated_commit)); + GITERR_CHECK_ALLOC(annotated_commit); + + annotated_commit->type = GIT_ANNOTATED_COMMIT_REAL; + + git_cached_obj_incref(commit); + annotated_commit->commit = commit; + + git_oid_fmt(annotated_commit->id_str, git_commit_id(commit)); + annotated_commit->id_str[GIT_OID_HEXSZ] = '\0'; + + *out = annotated_commit; + return 0; +} + int git_annotated_commit_lookup( git_annotated_commit **out, git_repository *repo, @@ -136,14 +183,20 @@ void git_annotated_commit_free(git_annotated_commit *annotated_commit) if (annotated_commit == NULL) return; - if (annotated_commit->commit != NULL) - git_commit_free(annotated_commit->commit); - - if (annotated_commit->ref_name != NULL) - git__free(annotated_commit->ref_name); - - if (annotated_commit->remote_url != NULL) - git__free(annotated_commit->remote_url); + switch (annotated_commit->type) { + case GIT_ANNOTATED_COMMIT_REAL: + git_commit_free(annotated_commit->commit); + git_tree_free(annotated_commit->tree); + git__free(annotated_commit->ref_name); + git__free(annotated_commit->remote_url); + break; + case GIT_ANNOTATED_COMMIT_VIRTUAL: + git_index_free(annotated_commit->index); + git_array_clear(annotated_commit->parents); + break; + default: + abort(); + } git__free(annotated_commit); } diff --git a/vendor/libgit2/src/annotated_commit.h b/vendor/libgit2/src/annotated_commit.h index e873184ae..cbb88fd22 100644 --- a/vendor/libgit2/src/annotated_commit.h +++ b/vendor/libgit2/src/annotated_commit.h @@ -7,11 +7,31 @@ #ifndef INCLUDE_annotated_commit_h__ #define INCLUDE_annotated_commit_h__ +#include "oidarray.h" + #include "git2/oid.h" -/** Internal structure for merge inputs */ +typedef enum { + GIT_ANNOTATED_COMMIT_REAL = 1, + GIT_ANNOTATED_COMMIT_VIRTUAL = 2, +} git_annotated_commit_t; + +/** + * Internal structure for merge inputs. An annotated commit is generally + * "real" and backed by an actual commit in the repository, but merge will + * internally create "virtual" commits that are in-memory intermediate + * commits backed by an index. + */ struct git_annotated_commit { + git_annotated_commit_t type; + + /* real commit */ git_commit *commit; + git_tree *tree; + + /* virtual commit structure */ + git_index *index; + git_array_oid_t parents; char *ref_name; char *remote_url; @@ -19,4 +39,9 @@ struct git_annotated_commit { char id_str[GIT_OID_HEXSZ+1]; }; +extern int git_annotated_commit_from_head(git_annotated_commit **out, + git_repository *repo); +extern int git_annotated_commit_from_commit(git_annotated_commit **out, + git_commit *commit); + #endif diff --git a/vendor/libgit2/src/array.h b/vendor/libgit2/src/array.h index 7cd9b7153..490e6be20 100644 --- a/vendor/libgit2/src/array.h +++ b/vendor/libgit2/src/array.h @@ -82,4 +82,44 @@ GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size) #define git_array_valid_index(a, i) ((i) < (a).size) +#define git_array_foreach(a, i, element) \ + for ((i) = 0; (i) < (a).size && ((element) = &(a).ptr[(i)]); (i)++) + + +GIT_INLINE(int) git_array__search( + size_t *out, + void *array_ptr, + size_t item_size, + size_t array_len, + int (*compare)(const void *, const void *), + const void *key) +{ + size_t lim; + unsigned char *part, *array = array_ptr, *base = array_ptr; + int cmp; + + for (lim = array_len; lim != 0; lim >>= 1) { + part = base + (lim >> 1) * item_size; + cmp = (*compare)(key, part); + + if (cmp == 0) { + base = part; + break; + } + if (cmp > 0) { /* key > p; take right partition */ + base = part + 1 * item_size; + lim--; + } /* else take left partition */ + } + + if (out) + *out = (base - array) / item_size; + + return (cmp == 0) ? 0 : GIT_ENOTFOUND; +} + +#define git_array_search(out, a, cmp, key) \ + git_array__search(out, (a).ptr, sizeof(*(a).ptr), (a).size, \ + (cmp), (key)) + #endif diff --git a/vendor/libgit2/src/attr_file.c b/vendor/libgit2/src/attr_file.c index 89706865a..11d149358 100644 --- a/vendor/libgit2/src/attr_file.c +++ b/vendor/libgit2/src/attr_file.c @@ -35,11 +35,7 @@ int git_attr_file__new( return -1; } - if (git_pool_init(&attrs->pool, 1, 0) < 0) { - attr_file_free(attrs); - return -1; - } - + git_pool_init(&attrs->pool, 1); GIT_REFCOUNT_INC(attrs); attrs->entry = entry; attrs->source = source; @@ -127,7 +123,7 @@ int git_attr_file__load( break; } case GIT_ATTR_FILE__FROM_FILE: { - int fd; + int fd = -1; /* For open or read errors, pretend that we got ENOTFOUND. */ /* TODO: issue warning when warning API is available */ @@ -137,7 +133,8 @@ int git_attr_file__load( (fd = git_futils_open_ro(entry->fullpath)) < 0 || (error = git_futils_readbuffer_fd(&content, fd, (size_t)st.st_size)) < 0) nonexistent = true; - else + + if (fd >= 0) p_close(fd); break; diff --git a/vendor/libgit2/src/attrcache.c b/vendor/libgit2/src/attrcache.c index 5bc260460..a57110684 100644 --- a/vendor/libgit2/src/attrcache.c +++ b/vendor/libgit2/src/attrcache.c @@ -388,10 +388,11 @@ int git_attr_cache__do_init(git_repository *repo) * hashtable for attribute macros, and string pool */ if ((ret = git_strmap_alloc(&cache->files)) < 0 || - (ret = git_strmap_alloc(&cache->macros)) < 0 || - (ret = git_pool_init(&cache->pool, 1, 0)) < 0) + (ret = git_strmap_alloc(&cache->macros)) < 0) goto cancel; + git_pool_init(&cache->pool, 1); + cache = git__compare_and_swap(&repo->attrcache, NULL, cache); if (cache) goto cancel; /* raced with another thread, free this but no error */ diff --git a/vendor/libgit2/src/blame.c b/vendor/libgit2/src/blame.c index 08a90dcfd..2c8584ba5 100644 --- a/vendor/libgit2/src/blame.c +++ b/vendor/libgit2/src/blame.c @@ -23,8 +23,8 @@ static int hunk_byfinalline_search_cmp(const void *key, const void *entry) git_blame_hunk *hunk = (git_blame_hunk*)entry; size_t lineno = *(size_t*)key; - size_t lines_in_hunk = (size_t)hunk->lines_in_hunk; - size_t final_start_line_number = (size_t)hunk->final_start_line_number; + size_t lines_in_hunk = hunk->lines_in_hunk; + size_t final_start_line_number = hunk->final_start_line_number; if (lineno < final_start_line_number) return -1; @@ -44,7 +44,7 @@ static int hunk_cmp(const void *_a, const void *_b) static bool hunk_ends_at_or_before_line(git_blame_hunk *hunk, size_t line) { - return line >= (size_t)(hunk->final_start_line_number + hunk->lines_in_hunk - 1); + return line >= (hunk->final_start_line_number + hunk->lines_in_hunk - 1); } static bool hunk_starts_at_or_after_line(git_blame_hunk *hunk, size_t line) @@ -53,9 +53,9 @@ static bool hunk_starts_at_or_after_line(git_blame_hunk *hunk, size_t line) } static git_blame_hunk* new_hunk( - uint16_t start, - uint16_t lines, - uint16_t orig_start, + size_t start, + size_t lines, + size_t orig_start, const char *path) { git_blame_hunk *hunk = git__calloc(1, sizeof(git_blame_hunk)); @@ -166,9 +166,9 @@ const git_blame_hunk *git_blame_get_hunk_byindex(git_blame *blame, uint32_t inde return (git_blame_hunk*)git_vector_get(&blame->hunks, index); } -const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, uint32_t lineno) +const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, size_t lineno) { - size_t i, new_lineno = (size_t)lineno; + size_t i, new_lineno = lineno; assert(blame); if (!git_vector_bsearch2(&i, &blame->hunks, hunk_byfinalline_search_cmp, &new_lineno)) { @@ -178,7 +178,7 @@ const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, uint32_t linen return NULL; } -static void normalize_options( +static int normalize_options( git_blame_options *out, const git_blame_options *in, git_repository *repo) @@ -190,7 +190,9 @@ static void normalize_options( /* No newest_commit => HEAD */ if (git_oid_iszero(&out->newest_commit)) { - git_reference_name_to_id(&out->newest_commit, repo, "HEAD"); + if (git_reference_name_to_id(&out->newest_commit, repo, "HEAD") < 0) { + return -1; + } } /* min_line 0 really means 1 */ @@ -204,6 +206,8 @@ static void normalize_options( out->flags |= GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES; if (out->flags & GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES) out->flags |= GIT_BLAME_TRACK_COPIES_SAME_FILE; + + return 0; } static git_blame_hunk *split_hunk_in_vector( @@ -223,8 +227,8 @@ static git_blame_hunk *split_hunk_in_vector( } new_line_count = hunk->lines_in_hunk - rel_line; - nh = new_hunk((uint16_t)(hunk->final_start_line_number+rel_line), (uint16_t)new_line_count, - (uint16_t)(hunk->orig_start_line_number+rel_line), hunk->orig_path); + nh = new_hunk(hunk->final_start_line_number + rel_line, new_line_count, + hunk->orig_start_line_number + rel_line, hunk->orig_path); if (!nh) return NULL; @@ -233,7 +237,7 @@ static git_blame_hunk *split_hunk_in_vector( git_oid_cpy(&nh->orig_commit_id, &hunk->orig_commit_id); /* Adjust hunk that was split */ - hunk->lines_in_hunk -= (uint16_t)new_line_count; + hunk->lines_in_hunk -= new_line_count; git_vector_insert_sorted(vec, nh, NULL); { git_blame_hunk *ret = return_new ? nh : hunk; @@ -362,7 +366,8 @@ int git_blame_file( git_blame *blame = NULL; assert(out && repo && path); - normalize_options(&normOptions, options, repo); + if ((error = normalize_options(&normOptions, options, repo)) < 0) + goto on_error; blame = git_blame__alloc(repo, normOptions, path); GITERR_CHECK_ALLOC(blame); @@ -442,7 +447,7 @@ static int buffer_line_cb( } else { /* Create a new buffer-blame hunk with this line */ shift_hunks_by(&blame->hunks, blame->current_diff_line, 1); - blame->current_hunk = new_hunk((uint16_t)blame->current_diff_line, 1, 0, blame->path); + blame->current_hunk = new_hunk(blame->current_diff_line, 1, 0, blame->path); GITERR_CHECK_ALLOC(blame->current_hunk); git_vector_insert_sorted(&blame->hunks, blame->current_hunk, NULL); diff --git a/vendor/libgit2/src/blame.h b/vendor/libgit2/src/blame.h index 7e23de808..d8db8d5c1 100644 --- a/vendor/libgit2/src/blame.h +++ b/vendor/libgit2/src/blame.h @@ -31,10 +31,10 @@ typedef struct git_blame__entry { /* the first line of this group in the final image; * internally all line numbers are 0 based. */ - int lno; + size_t lno; /* how many lines this group has */ - int num_lines; + size_t num_lines; /* the commit that introduced this group into the final image */ git_blame__origin *suspect; @@ -51,7 +51,7 @@ typedef struct git_blame__entry { /* the line number of the first line of this group in the * suspect's file; internally all line numbers are 0 based. */ - int s_lno; + size_t s_lno; /* how significant this entry is -- cached to avoid * scanning the lines over and over. diff --git a/vendor/libgit2/src/blame_git.c b/vendor/libgit2/src/blame_git.c index 67bae2384..700207edb 100644 --- a/vendor/libgit2/src/blame_git.c +++ b/vendor/libgit2/src/blame_git.c @@ -93,18 +93,25 @@ static bool same_suspect(git_blame__origin *a, git_blame__origin *b) } /* find the line number of the last line the target is suspected for */ -static int find_last_in_target(git_blame *blame, git_blame__origin *target) +static bool find_last_in_target(size_t *out, git_blame *blame, git_blame__origin *target) { git_blame__entry *e; - int last_in_target = -1; + size_t last_in_target = 0; + bool found = false; + + *out = 0; for (e=blame->ent; e; e=e->next) { if (e->guilty || !same_suspect(e->suspect, target)) continue; - if (last_in_target < e->s_lno + e->num_lines) + if (last_in_target < e->s_lno + e->num_lines) { + found = true; last_in_target = e->s_lno + e->num_lines; + } } - return last_in_target; + + *out = last_in_target; + return found; } /* @@ -122,9 +129,9 @@ static int find_last_in_target(git_blame *blame, git_blame__origin *target) * to be blamed for the parent, and after that portion. */ static void split_overlap(git_blame__entry *split, git_blame__entry *e, - int tlno, int plno, int same, git_blame__origin *parent) + size_t tlno, size_t plno, size_t same, git_blame__origin *parent) { - int chunk_end_lno; + size_t chunk_end_lno; if (e->s_lno < tlno) { /* there is a pre-chunk part not blamed on the parent */ @@ -265,9 +272,9 @@ static void decref_split(git_blame__entry *split) static void blame_overlap( git_blame *blame, git_blame__entry *e, - int tlno, - int plno, - int same, + size_t tlno, + size_t plno, + size_t same, git_blame__origin *parent) { git_blame__entry split[3] = {{0}}; @@ -285,9 +292,9 @@ static void blame_overlap( */ static void blame_chunk( git_blame *blame, - int tlno, - int plno, - int same, + size_t tlno, + size_t plno, + size_t same, git_blame__origin *target, git_blame__origin *parent) { @@ -314,7 +321,7 @@ static int my_emit( blame_chunk(d->blame, d->tlno, d->plno, start_b, d->target, d->parent); d->plno = start_a + count_a; d->tlno = start_b + count_b; - + return 0; } @@ -376,12 +383,11 @@ static int pass_blame_to_parent( git_blame__origin *target, git_blame__origin *parent) { - int last_in_target; + size_t last_in_target; mmfile_t file_p, file_o; blame_chunk_cb_data d = { blame, target, parent, 0, 0 }; - last_in_target = find_last_in_target(blame, target); - if (last_in_target < 0) + if (!find_last_in_target(&last_in_target, blame, target)) return 1; /* nothing remains for this target */ fill_origin_blob(parent, &file_p); @@ -519,7 +525,8 @@ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt) if (sg_origin[i]) continue; - git_commit_parent(&p, origin->commit, i); + if ((error = git_commit_parent(&p, origin->commit, i)) < 0) + goto finish; porigin = find_origin(blame, p, origin); if (!porigin) diff --git a/vendor/libgit2/src/branch.c b/vendor/libgit2/src/branch.c index 791d55106..0dcc14c29 100644 --- a/vendor/libgit2/src/branch.c +++ b/vendor/libgit2/src/branch.c @@ -155,18 +155,7 @@ int git_branch_delete(git_reference *branch) git_reference_owner(branch), git_buf_cstr(&config_section), NULL) < 0) goto on_error; - if (git_reference_delete(branch) < 0) - goto on_error; - - if ((error = git_reflog_delete(git_reference_owner(branch), git_reference_name(branch))) < 0) { - if (error == GIT_ENOTFOUND) { - giterr_clear(); - error = 0; - } - goto on_error; - } - - error = 0; + error = git_reference_delete(branch); on_error: git_buf_free(&config_section); diff --git a/vendor/libgit2/src/checkout.c b/vendor/libgit2/src/checkout.c index 12e308257..deeee62e0 100644 --- a/vendor/libgit2/src/checkout.c +++ b/vendor/libgit2/src/checkout.c @@ -200,8 +200,7 @@ static bool checkout_is_workdir_modified( * out.) */ if ((ie = git_index_get_bypath(data->index, wditem->path, 0)) != NULL) { - if (wditem->mtime.seconds == ie->mtime.seconds && - wditem->mtime.nanoseconds == ie->mtime.nanoseconds && + if (git_index_time_eq(&wditem->mtime, &ie->mtime) && wditem->file_size == ie->file_size) return !is_workdir_base_or_new(&ie->id, baseitem, newitem); } @@ -1227,7 +1226,7 @@ static int checkout_verify_paths( int action, git_diff_delta *delta) { - unsigned int flags = GIT_PATH_REJECT_DEFAULTS | GIT_PATH_REJECT_DOT_GIT; + unsigned int flags = GIT_PATH_REJECT_WORKDIR_DEFAULTS; if (action & CHECKOUT_ACTION__REMOVE) { if (!git_path_isvalid(repo, delta->old_file.path, flags)) { @@ -1255,11 +1254,13 @@ static int checkout_get_actions( int error = 0, act; const git_index_entry *wditem; git_vector pathspec = GIT_VECTOR_INIT, *deltas; - git_pool pathpool = GIT_POOL_INIT_STRINGPOOL; + git_pool pathpool; git_diff_delta *delta; size_t i, *counts = NULL; uint32_t *actions = NULL; + git_pool_init(&pathpool, 1); + if (data->opts.paths.count > 0 && git_pathspec__vinit(&pathspec, &data->opts.paths, &pathpool) < 0) return -1; @@ -1367,7 +1368,7 @@ static int checkout_mkdir( mkdir_opts.dir_map = data->mkdir_map; mkdir_opts.pool = &data->pool; - error = git_futils_mkdir_ext( + error = git_futils_mkdir_relative( path, base, mode, flags, &mkdir_opts); data->perfdata.mkdir_calls += mkdir_opts.perfdata.mkdir_calls; @@ -1486,8 +1487,10 @@ static int blob_content_to_file( if (!data->opts.disable_filters && (error = git_filter_list__load_ext( &fl, data->repo, blob, hint_path, - GIT_FILTER_TO_WORKTREE, &filter_opts))) + GIT_FILTER_TO_WORKTREE, &filter_opts))) { + p_close(fd); return error; + } /* setup the writer */ memset(&writer, 0, sizeof(struct checkout_stream)); @@ -2439,10 +2442,11 @@ static int checkout_data_init( git_config_entry_free(conflict_style); } + git_pool_init(&data->pool, 1); + if ((error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 || (error = git_vector_init(&data->remove_conflicts, 0, NULL)) < 0 || (error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 || - (error = git_pool_init(&data->pool, 1, 0)) < 0 || (error = git_buf_puts(&data->path, data->opts.target_directory)) < 0 || (error = git_path_to_dir(&data->path)) < 0 || (error = git_strmap_alloc(&data->mkdir_map)) < 0) @@ -2469,11 +2473,12 @@ int git_checkout_iterator( { int error = 0; git_iterator *baseline = NULL, *workdir = NULL; + git_iterator_options baseline_opts = GIT_ITERATOR_OPTIONS_INIT, + workdir_opts = GIT_ITERATOR_OPTIONS_INIT; checkout_data data = {0}; git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; uint32_t *actions = NULL; size_t *counts = NULL; - git_iterator_flag_t iterflags = 0; /* initialize structures and options */ error = checkout_data_init(&data, target, opts); @@ -2497,25 +2502,31 @@ int git_checkout_iterator( /* set up iterators */ - iterflags = git_iterator_ignore_case(target) ? + workdir_opts.flags = git_iterator_ignore_case(target) ? GIT_ITERATOR_IGNORE_CASE : GIT_ITERATOR_DONT_IGNORE_CASE; + workdir_opts.flags |= GIT_ITERATOR_DONT_AUTOEXPAND; + workdir_opts.start = data.pfx; + workdir_opts.end = data.pfx; if ((error = git_iterator_reset(target, data.pfx, data.pfx)) < 0 || (error = git_iterator_for_workdir_ext( &workdir, data.repo, data.opts.target_directory, index, NULL, - iterflags | GIT_ITERATOR_DONT_AUTOEXPAND, - data.pfx, data.pfx)) < 0) + &workdir_opts)) < 0) goto cleanup; + baseline_opts.flags = git_iterator_ignore_case(target) ? + GIT_ITERATOR_IGNORE_CASE : GIT_ITERATOR_DONT_IGNORE_CASE; + baseline_opts.start = data.pfx; + baseline_opts.end = data.pfx; + if (data.opts.baseline_index) { if ((error = git_iterator_for_index( - &baseline, data.opts.baseline_index, - iterflags, data.pfx, data.pfx)) < 0) + &baseline, git_index_owner(data.opts.baseline_index), + data.opts.baseline_index, &baseline_opts)) < 0) goto cleanup; } else { if ((error = git_iterator_for_tree( - &baseline, data.opts.baseline, - iterflags, data.pfx, data.pfx)) < 0) + &baseline, data.opts.baseline, &baseline_opts)) < 0) goto cleanup; } @@ -2623,7 +2634,7 @@ int git_checkout_index( return error; GIT_REFCOUNT_INC(index); - if (!(error = git_iterator_for_index(&index_i, index, 0, NULL, NULL))) + if (!(error = git_iterator_for_index(&index_i, repo, index, NULL))) error = git_checkout_iterator(index_i, index, opts); if (owned) @@ -2644,6 +2655,7 @@ int git_checkout_tree( git_index *index; git_tree *tree = NULL; git_iterator *tree_i = NULL; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; if (!treeish && !repo) { giterr_set(GITERR_CHECKOUT, @@ -2679,7 +2691,12 @@ int git_checkout_tree( if ((error = git_repository_index(&index, repo)) < 0) return error; - if (!(error = git_iterator_for_tree(&tree_i, tree, 0, NULL, NULL))) + if ((opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) { + iter_opts.pathlist.count = opts->paths.count; + iter_opts.pathlist.strings = opts->paths.strings; + } + + if (!(error = git_iterator_for_tree(&tree_i, tree, &iter_opts))) error = git_checkout_iterator(tree_i, index, opts); git_iterator_free(tree_i); diff --git a/vendor/libgit2/src/clone.c b/vendor/libgit2/src/clone.c index 070daf94d..6b4b7ae53 100644 --- a/vendor/libgit2/src/clone.c +++ b/vendor/libgit2/src/clone.c @@ -440,14 +440,14 @@ int git_clone( if (error != 0) { git_error_state last_error = {0}; - giterr_capture(&last_error, error); + giterr_state_capture(&last_error, error); git_repository_free(repo); repo = NULL; (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags); - giterr_restore(&last_error); + giterr_state_restore(&last_error); } *out = repo; diff --git a/vendor/libgit2/src/commit.c b/vendor/libgit2/src/commit.c index 616f947db..5ed9c474d 100644 --- a/vendor/libgit2/src/commit.c +++ b/vendor/libgit2/src/commit.c @@ -17,6 +17,7 @@ #include "signature.h" #include "message.h" #include "refs.h" +#include "object.h" void git_commit__free(void *_commit) { @@ -31,11 +32,12 @@ void git_commit__free(void *_commit) git__free(commit->raw_message); git__free(commit->message_encoding); git__free(commit->summary); + git__free(commit->body); git__free(commit); } -int git_commit_create_from_callback( +static int git_commit__create_internal( git_oid *id, git_repository *repo, const char *update_ref, @@ -45,7 +47,8 @@ int git_commit_create_from_callback( const char *message, const git_oid *tree, git_commit_parent_callback parent_cb, - void *parent_payload) + void *parent_payload, + bool validate) { git_reference *ref = NULL; int error = 0, matched_parent = 0; @@ -57,6 +60,9 @@ int git_commit_create_from_callback( assert(id && repo && tree && parent_cb); + if (validate && !git_object__is_valid(repo, tree, GIT_OBJ_TREE)) + return -1; + if (update_ref) { error = git_reference_lookup_resolved(&ref, repo, update_ref, 10); if (error < 0 && error != GIT_ENOTFOUND) @@ -70,6 +76,11 @@ int git_commit_create_from_callback( git_oid__writebuf(&commit, "tree ", tree); while ((parent = parent_cb(i, parent_payload)) != NULL) { + if (validate && !git_object__is_valid(repo, parent, GIT_OBJ_COMMIT)) { + error = -1; + goto on_error; + } + git_oid__writebuf(&commit, "parent ", parent); if (i == 0 && current_id && git_oid_equal(current_id, parent)) matched_parent = 1; @@ -113,10 +124,26 @@ int git_commit_create_from_callback( on_error: git_buf_free(&commit); - giterr_set(GITERR_OBJECT, "Failed to create commit."); return -1; } +int git_commit_create_from_callback( + git_oid *id, + git_repository *repo, + const char *update_ref, + const git_signature *author, + const git_signature *committer, + const char *message_encoding, + const char *message, + const git_oid *tree, + git_commit_parent_callback parent_cb, + void *parent_payload) +{ + return git_commit__create_internal( + id, repo, update_ref, author, committer, message_encoding, message, + tree, parent_cb, parent_payload, true); +} + typedef struct { size_t total; va_list args; @@ -152,10 +179,10 @@ int git_commit_create_v( data.total = parent_count; va_start(data.args, parent_count); - error = git_commit_create_from_callback( + error = git_commit__create_internal( id, repo, update_ref, author, committer, message_encoding, message, git_tree_id(tree), - commit_parent_from_varargs, &data); + commit_parent_from_varargs, &data, false); va_end(data.args); return error; @@ -186,10 +213,10 @@ int git_commit_create_from_ids( { commit_parent_oids data = { parent_count, parents }; - return git_commit_create_from_callback( + return git_commit__create_internal( id, repo, update_ref, author, committer, message_encoding, message, tree, - commit_parent_from_ids, &data); + commit_parent_from_ids, &data, true); } typedef struct { @@ -226,10 +253,10 @@ int git_commit_create( assert(tree && git_tree_owner(tree) == repo); - return git_commit_create_from_callback( + return git_commit__create_internal( id, repo, update_ref, author, committer, message_encoding, message, git_tree_id(tree), - commit_parent_from_array, &data); + commit_parent_from_array, &data, false); } static const git_oid *commit_parent_for_amend(size_t curr, void *payload) @@ -289,9 +316,9 @@ int git_commit_amend( } } - error = git_commit_create_from_callback( + error = git_commit__create_internal( id, repo, NULL, author, committer, message_encoding, message, - &tree_id, commit_parent_for_amend, (void *)commit_to_amend); + &tree_id, commit_parent_for_amend, (void *)commit_to_amend, false); if (!error && update_ref) { error = git_reference__update_for_commit( @@ -431,22 +458,37 @@ const char *git_commit_summary(git_commit *commit) { git_buf summary = GIT_BUF_INIT; const char *msg, *space; + bool space_contains_newline = false; assert(commit); if (!commit->summary) { for (msg = git_commit_message(commit), space = NULL; *msg; ++msg) { - if (msg[0] == '\n' && (!msg[1] || msg[1] == '\n')) + char next_character = msg[0]; + /* stop processing at the end of the first paragraph */ + if (next_character == '\n' && (!msg[1] || msg[1] == '\n')) break; - else if (msg[0] == '\n') - git_buf_putc(&summary, ' '); - else if (git__isspace(msg[0])) - space = space ? space : msg; - else if (space) { - git_buf_put(&summary, space, (msg - space) + 1); - space = NULL; - } else - git_buf_putc(&summary, *msg); + /* record the beginning of contiguous whitespace runs */ + else if (git__isspace(next_character)) { + if(space == NULL) { + space = msg; + space_contains_newline = false; + } + space_contains_newline |= next_character == '\n'; + } + /* the next character is non-space */ + else { + /* process any recorded whitespace */ + if (space) { + if(space_contains_newline) + git_buf_putc(&summary, ' '); /* if the space contains a newline, collapse to ' ' */ + else + git_buf_put(&summary, space, (msg - space)); /* otherwise copy it */ + space = NULL; + } + /* copy the next character */ + git_buf_putc(&summary, next_character); + } } commit->summary = git_buf_detach(&summary); @@ -457,6 +499,33 @@ const char *git_commit_summary(git_commit *commit) return commit->summary; } +const char *git_commit_body(git_commit *commit) +{ + const char *msg, *end; + + assert(commit); + + if (!commit->body) { + /* search for end of summary */ + for (msg = git_commit_message(commit); *msg; ++msg) + if (msg[0] == '\n' && (!msg[1] || msg[1] == '\n')) + break; + + /* trim leading and trailing whitespace */ + for (; *msg; ++msg) + if (!git__isspace(*msg)) + break; + for (end = msg + strlen(msg) - 1; msg <= end; --end) + if (!git__isspace(*end)) + break; + + if (*msg) + commit->body = git__strndup(msg, end - msg + 1); + } + + return commit->body; +} + int git_commit_tree(git_tree **tree_out, const git_commit *commit) { assert(commit); @@ -521,17 +590,103 @@ int git_commit_nth_gen_ancestor( int git_commit_header_field(git_buf *out, const git_commit *commit, const char *field) { - const char *buf = commit->raw_header; - const char *h, *eol; + const char *eol, *buf = commit->raw_header; git_buf_sanitize(out); - while ((h = strchr(buf, '\n')) && h[1] != '\0' && h[1] != '\n') { + + while ((eol = strchr(buf, '\n'))) { + /* We can skip continuations here */ + if (buf[0] == ' ') { + buf = eol + 1; + continue; + } + + /* Skip until we find the field we're after */ + if (git__prefixcmp(buf, field)) { + buf = eol + 1; + continue; + } + + buf += strlen(field); + /* Check that we're not matching a prefix but the field itself */ + if (buf[0] != ' ') { + buf = eol + 1; + continue; + } + + buf++; /* skip the SP */ + + git_buf_put(out, buf, eol - buf); + if (git_buf_oom(out)) + goto oom; + + /* If the next line starts with SP, it's multi-line, we must continue */ + while (eol[1] == ' ') { + git_buf_putc(out, '\n'); + buf = eol + 2; + eol = strchr(buf, '\n'); + if (!eol) + goto malformed; + + git_buf_put(out, buf, eol - buf); + } + + if (git_buf_oom(out)) + goto oom; + + return 0; + } + + giterr_set(GITERR_OBJECT, "no such field '%s'", field); + return GIT_ENOTFOUND; + +malformed: + giterr_set(GITERR_OBJECT, "malformed header"); + return -1; +oom: + giterr_set_oom(); + return -1; +} + +int git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_repository *repo, git_oid *commit_id, const char *field) +{ + git_odb_object *obj; + git_odb *odb; + const char *buf; + const char *h, *eol; + int error; + + git_buf_sanitize(signature); + git_buf_sanitize(signed_data); + + if (!field) + field = "gpgsig"; + + if ((error = git_repository_odb__weakptr(&odb, repo)) < 0) + return error; + + if ((error = git_odb_read(&obj, odb, commit_id)) < 0) + return error; + + if (obj->cached.type != GIT_OBJ_COMMIT) { + giterr_set(GITERR_INVALID, "the requested type does not match the type in ODB"); + error = GIT_ENOTFOUND; + goto cleanup; + } + + buf = git_odb_object_data(obj); + + while ((h = strchr(buf, '\n')) && h[1] != '\0') { h++; - if (git__prefixcmp(h, field)) { + if (git__prefixcmp(buf, field)) { + if (git_buf_put(signed_data, buf, h - buf) < 0) + return -1; + buf = h; continue; } + h = buf; h += strlen(field); eol = strchr(h, '\n'); if (h[0] != ' ') { @@ -543,33 +698,44 @@ int git_commit_header_field(git_buf *out, const git_commit *commit, const char * h++; /* skip the SP */ - git_buf_put(out, h, eol - h); - if (git_buf_oom(out)) + git_buf_put(signature, h, eol - h); + if (git_buf_oom(signature)) goto oom; /* If the next line starts with SP, it's multi-line, we must continue */ while (eol[1] == ' ') { - git_buf_putc(out, '\n'); + git_buf_putc(signature, '\n'); h = eol + 2; eol = strchr(h, '\n'); if (!eol) goto malformed; - git_buf_put(out, h, eol - h); + git_buf_put(signature, h, eol - h); } - if (git_buf_oom(out)) + if (git_buf_oom(signature)) goto oom; - return 0; + git_odb_object_free(obj); + return git_buf_puts(signed_data, eol+1); } - return GIT_ENOTFOUND; + giterr_set(GITERR_OBJECT, "this commit is not signed"); + error = GIT_ENOTFOUND; + goto cleanup; malformed: giterr_set(GITERR_OBJECT, "malformed header"); - return -1; + error = -1; + goto cleanup; oom: giterr_set_oom(); - return -1; + error = -1; + goto cleanup; + +cleanup: + git_odb_object_free(obj); + git_buf_clear(signature); + git_buf_clear(signed_data); + return error; } diff --git a/vendor/libgit2/src/commit.h b/vendor/libgit2/src/commit.h index efb080b50..d01ac2b2f 100644 --- a/vendor/libgit2/src/commit.h +++ b/vendor/libgit2/src/commit.h @@ -28,6 +28,7 @@ struct git_commit { char *raw_header; char *summary; + char *body; }; void git_commit__free(void *commit); diff --git a/vendor/libgit2/src/commit_list.c b/vendor/libgit2/src/commit_list.c index 53612d514..28948c88b 100644 --- a/vendor/libgit2/src/commit_list.c +++ b/vendor/libgit2/src/commit_list.c @@ -47,7 +47,7 @@ git_commit_list *git_commit_list_insert_by_date(git_commit_list_node *item, git_ git_commit_list_node *git_commit_list_alloc_node(git_revwalk *walk) { - return (git_commit_list_node *)git_pool_malloc(&walk->commit_pool, COMMIT_ALLOC); + return (git_commit_list_node *)git_pool_mallocz(&walk->commit_pool, 1); } static int commit_error(git_commit_list_node *commit, const char *msg) diff --git a/vendor/libgit2/src/common.h b/vendor/libgit2/src/common.h index 9056deaae..9abd605cb 100644 --- a/vendor/libgit2/src/common.h +++ b/vendor/libgit2/src/common.h @@ -41,11 +41,16 @@ # include # include "win32/msvc-compat.h" # include "win32/mingw-compat.h" +# include "win32/win32-compat.h" # include "win32/error.h" # include "win32/version.h" # ifdef GIT_THREADS # include "win32/pthread.h" # endif +# if defined(GIT_MSVC_CRTDBG) +# include "win32/w32_stack.h" +# include "win32/w32_crtdbg_stacktrace.h" +# endif #else @@ -57,6 +62,12 @@ # endif #define GIT_STDLIB_CALL +#ifdef GIT_USE_STAT_ATIMESPEC +# define st_atim st_atimespec +# define st_ctim st_ctimespec +# define st_mtim st_mtimespec +#endif + # include #endif @@ -78,6 +89,11 @@ */ #define GITERR_CHECK_ALLOC(ptr) if (ptr == NULL) { return -1; } +/** + * Check a buffer allocation result, returning -1 if it failed. + */ +#define GITERR_CHECK_ALLOC_BUF(buf) if ((void *)(buf) == NULL || git_buf_oom(buf)) { return -1; } + /** * Check a return value and propagate result if non-zero. */ @@ -137,20 +153,25 @@ void giterr_system_set(int code); * Structure to preserve libgit2 error state */ typedef struct { - int error_code; + int error_code; + unsigned int oom : 1; git_error error_msg; } git_error_state; /** * Capture current error state to restore later, returning error code. - * If `error_code` is zero, this does nothing and returns zero. + * If `error_code` is zero, this does not clear the current error state. + * You must either restore this error state, or free it. */ -int giterr_capture(git_error_state *state, int error_code); +extern int giterr_state_capture(git_error_state *state, int error_code); /** * Restore error state to a previous value, returning saved error code. */ -int giterr_restore(git_error_state *state); +extern int giterr_state_restore(git_error_state *state); + +/** Free an error state. */ +extern void giterr_state_free(git_error_state *state); /** * Check a versioned structure for validity diff --git a/vendor/libgit2/src/config.c b/vendor/libgit2/src/config.c index 77cf573e6..f4d4cb2b9 100644 --- a/vendor/libgit2/src/config.c +++ b/vendor/libgit2/src/config.c @@ -13,6 +13,7 @@ #include "vector.h" #include "buf_text.h" #include "config_file.h" +#include "transaction.h" #if GIT_WIN32 # include #endif @@ -1085,6 +1086,12 @@ int git_config_find_system(git_buf *path) return git_sysdir_find_system_file(path, GIT_CONFIG_FILENAME_SYSTEM); } +int git_config_find_programdata(git_buf *path) +{ + git_buf_sanitize(path); + return git_sysdir_find_programdata_file(path, GIT_CONFIG_FILENAME_PROGRAMDATA); +} + int git_config__global_location(git_buf *buf) { const git_buf *paths; @@ -1132,6 +1139,10 @@ int git_config_open_default(git_config **out) error = git_config_add_file_ondisk(cfg, buf.ptr, GIT_CONFIG_LEVEL_SYSTEM, 0); + if (!error && !git_config_find_programdata(&buf)) + error = git_config_add_file_ondisk(cfg, buf.ptr, + GIT_CONFIG_LEVEL_PROGRAMDATA, 0); + git_buf_free(&buf); if (error) { @@ -1144,6 +1155,41 @@ int git_config_open_default(git_config **out) return error; } +int git_config_lock(git_transaction **out, git_config *cfg) +{ + int error; + git_config_backend *file; + file_internal *internal; + + internal = git_vector_get(&cfg->files, 0); + if (!internal || !internal->file) { + giterr_set(GITERR_CONFIG, "cannot lock; the config has no backends/files"); + return -1; + } + file = internal->file; + + if ((error = file->lock(file)) < 0) + return error; + + return git_transaction_config_new(out, cfg); +} + +int git_config_unlock(git_config *cfg, int commit) +{ + git_config_backend *file; + file_internal *internal; + + internal = git_vector_get(&cfg->files, 0); + if (!internal || !internal->file) { + giterr_set(GITERR_CONFIG, "cannot lock; the config has no backends/files"); + return -1; + } + + file = internal->file; + + return file->unlock(file, commit); +} + /*********** * Parsers ***********/ diff --git a/vendor/libgit2/src/config.h b/vendor/libgit2/src/config.h index f257cc90f..00c12b50d 100644 --- a/vendor/libgit2/src/config.h +++ b/vendor/libgit2/src/config.h @@ -12,6 +12,7 @@ #include "vector.h" #include "repository.h" +#define GIT_CONFIG_FILENAME_PROGRAMDATA "config" #define GIT_CONFIG_FILENAME_SYSTEM "gitconfig" #define GIT_CONFIG_FILENAME_GLOBAL ".gitconfig" #define GIT_CONFIG_FILENAME_XDG "config" @@ -88,4 +89,19 @@ extern int git_config__cvar( */ int git_config_lookup_map_enum(git_cvar_t *type_out, const char **str_out, const git_cvar_map *maps, size_t map_n, int enum_val); + +/** + * Unlock the backend with the highest priority + * + * Unlocking will allow other writers to updat the configuration + * file. Optionally, any changes performed since the lock will be + * applied to the configuration. + * + * @param cfg the configuration + * @param commit boolean which indicates whether to commit any changes + * done since locking + * @return 0 or an error code + */ +GIT_EXTERN(int) git_config_unlock(git_config *cfg, int commit); + #endif diff --git a/vendor/libgit2/src/config_cache.c b/vendor/libgit2/src/config_cache.c index c859ec148..dbea871b9 100644 --- a/vendor/libgit2/src/config_cache.c +++ b/vendor/libgit2/src/config_cache.c @@ -86,7 +86,8 @@ int git_config__cvar(int *out, git_config *config, git_cvar_cached cvar) struct map_data *data = &_cvar_maps[(int)cvar]; git_config_entry *entry; - git_config__lookup_entry(&entry, config, data->cvar_name, false); + if ((error = git_config__lookup_entry(&entry, config, data->cvar_name, false)) < 0) + return error; if (!entry) *out = data->default_value; diff --git a/vendor/libgit2/src/config_file.c b/vendor/libgit2/src/config_file.c index 52a5376bd..ca4345cc7 100644 --- a/vendor/libgit2/src/config_file.c +++ b/vendor/libgit2/src/config_file.c @@ -77,8 +77,7 @@ typedef struct git_config_file_iter { (iter) = (tmp)) struct reader { - time_t file_mtime; - size_t file_size; + git_oid checksum; char *file_path; git_buf buffer; char *read_ptr; @@ -105,6 +104,10 @@ typedef struct { git_array_t(struct reader) readers; + bool locked; + git_filebuf locked_buf; + git_buf locked_content; + char *file_path; } diskfile_backend; @@ -281,7 +284,7 @@ static int config_open(git_config_backend *cfg, git_config_level_t level) git_buf_init(&reader->buffer, 0); res = git_futils_readbuffer_updated( - &reader->buffer, b->file_path, &reader->file_mtime, &reader->file_size, NULL); + &reader->buffer, b->file_path, &reader->checksum, NULL); /* It's fine if the file doesn't exist */ if (res == GIT_ENOTFOUND) @@ -341,7 +344,7 @@ static int config_refresh(git_config_backend *cfg) reader = git_array_get(b->readers, i); error = git_futils_readbuffer_updated( &reader->buffer, reader->file_path, - &reader->file_mtime, &reader->file_size, &updated); + &reader->checksum, &updated); if (error < 0 && error != GIT_ENOTFOUND) return error; @@ -550,30 +553,15 @@ static int config_set_multivar( git_config_backend *cfg, const char *name, const char *regexp, const char *value) { diskfile_backend *b = (diskfile_backend *)cfg; - refcounted_strmap *map; - git_strmap *values; char *key; regex_t preg; int result; - khiter_t pos; assert(regexp); if ((result = git_config__normalize_name(name, &key)) < 0) return result; - map = refcounted_strmap_take(&b->header); - values = b->header.values->values; - - pos = git_strmap_lookup_index(values, key); - if (!git_strmap_valid_index(values, pos)) { - /* If we don't have it, behave like a normal set */ - result = config_set(cfg, name, value); - refcounted_strmap_free(map); - git__free(key); - return result; - } - result = regcomp(&preg, regexp, REG_EXTENDED); if (result != 0) { giterr_set_regex(&preg, result); @@ -588,7 +576,6 @@ static int config_set_multivar( result = config_refresh(cfg); out: - refcounted_strmap_free(map); git__free(key); regfree(&preg); @@ -685,6 +672,42 @@ static int config_snapshot(git_config_backend **out, git_config_backend *in) return git_config_file__snapshot(out, b); } +static int config_lock(git_config_backend *_cfg) +{ + diskfile_backend *cfg = (diskfile_backend *) _cfg; + int error; + + if ((error = git_filebuf_open(&cfg->locked_buf, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0) + return error; + + error = git_futils_readbuffer(&cfg->locked_content, cfg->file_path); + if (error < 0 && error != GIT_ENOTFOUND) { + git_filebuf_cleanup(&cfg->locked_buf); + return error; + } + + cfg->locked = true; + return 0; + +} + +static int config_unlock(git_config_backend *_cfg, int success) +{ + diskfile_backend *cfg = (diskfile_backend *) _cfg; + int error = 0; + + if (success) { + git_filebuf_write(&cfg->locked_buf, cfg->locked_content.ptr, cfg->locked_content.size); + error = git_filebuf_commit(&cfg->locked_buf); + } + + git_filebuf_cleanup(&cfg->locked_buf); + git_buf_free(&cfg->locked_content); + cfg->locked = false; + + return error; +} + int git_config_file__ondisk(git_config_backend **out, const char *path) { diskfile_backend *backend; @@ -706,6 +729,8 @@ int git_config_file__ondisk(git_config_backend **out, const char *path) backend->header.parent.del_multivar = config_delete_multivar; backend->header.parent.iterator = config_iterator_new; backend->header.parent.snapshot = config_snapshot; + backend->header.parent.lock = config_lock; + backend->header.parent.unlock = config_unlock; backend->header.parent.free = backend_free; *out = (git_config_backend *)backend; @@ -750,6 +775,21 @@ static int config_delete_readonly(git_config_backend *cfg, const char *name) return config_error_readonly(); } +static int config_lock_readonly(git_config_backend *_cfg) +{ + GIT_UNUSED(_cfg); + + return config_error_readonly(); +} + +static int config_unlock_readonly(git_config_backend *_cfg, int success) +{ + GIT_UNUSED(_cfg); + GIT_UNUSED(success); + + return config_error_readonly(); +} + static void backend_readonly_free(git_config_backend *_backend) { diskfile_backend *backend = (diskfile_backend *)_backend; @@ -803,6 +843,8 @@ int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in) backend->header.parent.del = config_delete_readonly; backend->header.parent.del_multivar = config_delete_multivar_readonly; backend->header.parent.iterator = config_iterator_new; + backend->header.parent.lock = config_lock_readonly; + backend->header.parent.unlock = config_unlock_readonly; backend->header.parent.free = backend_readonly_free; *out = (git_config_backend *)backend; @@ -974,6 +1016,11 @@ static int parse_section_header_ext(struct reader *reader, const char *line, con */ first_quote = strchr(line, '"'); + if (first_quote == NULL) { + set_parse_error(reader, 0, "Missing quotation marks in section header"); + return -1; + } + last_quote = strrchr(line, '"'); quoted_len = last_quote - first_quote; @@ -1425,7 +1472,7 @@ static int config_parse( int (*on_section)(struct reader **reader, const char *current_section, const char *line, size_t line_len, void *data), int (*on_variable)(struct reader **reader, const char *current_section, char *var_name, char *var_value, const char *line, size_t line_len, void *data), int (*on_comment)(struct reader **reader, const char *line, size_t line_len, void *data), - int (*on_eof)(struct reader **reader, void *data), + int (*on_eof)(struct reader **reader, const char *current_section, void *data), void *data) { char *current_section = NULL, *var_name, *var_value, *line_start; @@ -1476,7 +1523,7 @@ static int config_parse( } if (on_eof) - result = on_eof(&reader, data); + result = on_eof(&reader, current_section, data); git__free(current_section); return result; @@ -1559,7 +1606,7 @@ static int read_on_variable( git_buf_init(&r->buffer, 0); result = git_futils_readbuffer_updated( - &r->buffer, r->file_path, &r->file_mtime, &r->file_size, NULL); + &r->buffer, r->file_path, &r->checksum, NULL); if (result == 0) { result = config_read(parse_data->values, parse_data->cfg_file, r, parse_data->level, parse_data->depth+1); @@ -1602,7 +1649,7 @@ static int config_read(git_strmap *values, diskfile_backend *cfg_file, struct re return config_parse(reader, NULL, read_on_variable, NULL, NULL, &parse_data); } -static int write_section(git_filebuf *file, const char *key) +static int write_section(git_buf *fbuf, const char *key) { int result; const char *dot; @@ -1626,7 +1673,7 @@ static int write_section(git_filebuf *file, const char *key) if (git_buf_oom(&buf)) return -1; - result = git_filebuf_write(file, git_buf_cstr(&buf), buf.size); + result = git_buf_put(fbuf, git_buf_cstr(&buf), buf.size); git_buf_free(&buf); return result; @@ -1651,7 +1698,8 @@ static const char *quotes_for_value(const char *value) } struct write_data { - git_filebuf *file; + git_buf *buf; + git_buf buffered_comment; unsigned int in_section : 1, preg_replaced : 1; const char *section; @@ -1660,23 +1708,28 @@ struct write_data { const char *value; }; -static int write_line(struct write_data *write_data, const char *line, size_t line_len) +static int write_line_to(git_buf *buf, const char *line, size_t line_len) { - int result = git_filebuf_write(write_data->file, line, line_len); + int result = git_buf_put(buf, line, line_len); if (!result && line_len && line[line_len-1] != '\n') - result = git_filebuf_printf(write_data->file, "\n"); + result = git_buf_printf(buf, "\n"); return result; } +static int write_line(struct write_data *write_data, const char *line, size_t line_len) +{ + return write_line_to(write_data->buf, line, line_len); +} + static int write_value(struct write_data *write_data) { const char *q; int result; q = quotes_for_value(write_data->value); - result = git_filebuf_printf(write_data->file, + result = git_buf_printf(write_data->buf, "\t%s = %s%s%s\n", write_data->name, q, write_data->value, q); /* If we are updating a single name/value, we're done. Setting `value` @@ -1711,6 +1764,14 @@ static int write_on_section( write_data->in_section = strcmp(current_section, write_data->section) == 0; + /* + * If there were comments just before this section, dump them as well. + */ + if (!result) { + result = git_buf_put(write_data->buf, write_data->buffered_comment.ptr, write_data->buffered_comment.size); + git_buf_clear(&write_data->buffered_comment); + } + if (!result) result = write_line(write_data, line, line_len); @@ -1728,10 +1789,19 @@ static int write_on_variable( { struct write_data *write_data = (struct write_data *)data; bool has_matched = false; + int error; GIT_UNUSED(reader); GIT_UNUSED(current_section); + /* + * If there were comments just before this variable, let's dump them as well. + */ + if ((error = git_buf_put(write_data->buf, write_data->buffered_comment.ptr, write_data->buffered_comment.size)) < 0) + return error; + + git_buf_clear(&write_data->buffered_comment); + /* See if we are to update this name/value pair; first examine name */ if (write_data->in_section && strcasecmp(write_data->name, var_name) == 0) @@ -1766,23 +1836,34 @@ static int write_on_comment(struct reader **reader, const char *line, size_t lin GIT_UNUSED(reader); write_data = (struct write_data *)data; - return write_line(write_data, line, line_len); + return write_line_to(&write_data->buffered_comment, line, line_len); } -static int write_on_eof(struct reader **reader, void *data) +static int write_on_eof( + struct reader **reader, const char *current_section, void *data) { struct write_data *write_data = (struct write_data *)data; int result = 0; GIT_UNUSED(reader); + /* + * If we've buffered comments when reaching EOF, make sure to dump them. + */ + if ((result = git_buf_put(write_data->buf, write_data->buffered_comment.ptr, write_data->buffered_comment.size)) < 0) + return result; + /* If we are at the EOF and have not written our value (again, for a * simple name/value set, not a multivar) then we have never seen the * section in question and should create a new section and write the * value. */ if ((!write_data->preg || !write_data->preg_replaced) && write_data->value) { - if ((result = write_section(write_data->file, write_data->section)) == 0) + /* write the section header unless we're already in it */ + if (!current_section || strcmp(current_section, write_data->section)) + result = write_section(write_data->buf, write_data->section); + + if (!result) result = write_value(write_data); } @@ -1797,18 +1878,23 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p int result; char *section, *name, *ldot; git_filebuf file = GIT_FILEBUF_INIT; + git_buf buf = GIT_BUF_INIT; struct reader *reader = git_array_get(cfg->readers, 0); struct write_data write_data; - /* Lock the file */ - if ((result = git_filebuf_open( - &file, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0) { + if (cfg->locked) { + result = git_buf_puts(&reader->buffer, git_buf_cstr(&cfg->locked_content)); + } else { + /* Lock the file */ + if ((result = git_filebuf_open( + &file, cfg->file_path, GIT_FILEBUF_HASH_CONTENTS, GIT_CONFIG_FILE_MODE)) < 0) { git_buf_free(&reader->buffer); return result; - } + } - /* We need to read in our own config file */ - result = git_futils_readbuffer(&reader->buffer, cfg->file_path); + /* We need to read in our own config file */ + result = git_futils_readbuffer(&reader->buffer, cfg->file_path); + } /* Initialise the reading position */ if (result == GIT_ENOTFOUND) { @@ -1827,7 +1913,8 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p name = ldot + 1; section = git__strndup(key, ldot - key); - write_data.file = &file; + write_data.buf = &buf; + git_buf_init(&write_data.buffered_comment, 0); write_data.section = section; write_data.in_section = 0; write_data.preg_replaced = 0; @@ -1837,19 +1924,25 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p result = config_parse(reader, write_on_section, write_on_variable, write_on_comment, write_on_eof, &write_data); git__free(section); + git_buf_free(&write_data.buffered_comment); if (result < 0) { git_filebuf_cleanup(&file); goto done; } - /* refresh stats - if this errors, then commit will error too */ - (void)git_filebuf_stats(&reader->file_mtime, &reader->file_size, &file); - - result = git_filebuf_commit(&file); - git_buf_free(&reader->buffer); + if (cfg->locked) { + size_t len = buf.asize; + /* Update our copy with the modified contents */ + git_buf_free(&cfg->locked_content); + git_buf_attach(&cfg->locked_content, git_buf_detach(&buf), len); + } else { + git_filebuf_write(&file, git_buf_cstr(&buf), git_buf_len(&buf)); + result = git_filebuf_commit(&file); + } done: + git_buf_free(&buf); git_buf_free(&reader->buffer); return result; } diff --git a/vendor/libgit2/src/config_file.h b/vendor/libgit2/src/config_file.h index 0d8bf740f..1c52892c3 100644 --- a/vendor/libgit2/src/config_file.h +++ b/vendor/libgit2/src/config_file.h @@ -55,6 +55,16 @@ GIT_INLINE(int) git_config_file_foreach_match( return git_config_backend_foreach_match(cfg, regexp, fn, data); } +GIT_INLINE(int) git_config_file_lock(git_config_backend *cfg) +{ + return cfg->lock(cfg); +} + +GIT_INLINE(int) git_config_file_unlock(git_config_backend *cfg, int success) +{ + return cfg->unlock(cfg, success); +} + extern int git_config_file_normalize_section(char *start, char *end); #endif diff --git a/vendor/libgit2/src/crlf.c b/vendor/libgit2/src/crlf.c index f391137c1..5d7510ac7 100644 --- a/vendor/libgit2/src/crlf.c +++ b/vendor/libgit2/src/crlf.c @@ -346,7 +346,7 @@ static int crlf_apply( /* initialize payload in case `check` was bypassed */ if (!*payload) { int error = crlf_check(self, payload, src, NULL); - if (error < 0 && error != GIT_PASSTHROUGH) + if (error < 0) return error; } diff --git a/vendor/libgit2/src/curl_stream.c b/vendor/libgit2/src/curl_stream.c index ca06c20d6..9963d94cc 100644 --- a/vendor/libgit2/src/curl_stream.c +++ b/vendor/libgit2/src/curl_stream.c @@ -67,9 +67,9 @@ static int curls_certificate(git_cert **out, git_stream *stream) /* No information is available, can happen with SecureTransport */ if (certinfo->num_of_certs == 0) { - s->cert_info.cert_type = GIT_CERT_NONE; - s->cert_info.data = NULL; - s->cert_info.len = 0; + s->cert_info.parent.cert_type = GIT_CERT_NONE; + s->cert_info.data = NULL; + s->cert_info.len = 0; return 0; } @@ -79,17 +79,18 @@ static int curls_certificate(git_cert **out, git_stream *stream) for (slist = certinfo->certinfo[0]; slist; slist = slist->next) { char *str = git__strdup(slist->data); GITERR_CHECK_ALLOC(str); + git_vector_insert(&strings, str); } /* Copy the contents of the vector into a strarray so we can expose them */ s->cert_info_strings.strings = (char **) strings.contents; s->cert_info_strings.count = strings.length; - s->cert_info.cert_type = GIT_CERT_STRARRAY; - s->cert_info.data = &s->cert_info_strings; - s->cert_info.len = strings.length; + s->cert_info.parent.cert_type = GIT_CERT_STRARRAY; + s->cert_info.data = &s->cert_info_strings; + s->cert_info.len = strings.length; - *out = (git_cert *) &s->cert_info; + *out = &s->cert_info.parent; return 0; } @@ -207,11 +208,14 @@ int git_curl_stream_new(git_stream **out, const char *host, const char *port) handle = curl_easy_init(); if (handle == NULL) { giterr_set(GITERR_NET, "failed to create curl handle"); + git__free(st); return -1; } - if ((error = git__strtol32(&iport, port, NULL, 10)) < 0) + if ((error = git__strtol32(&iport, port, NULL, 10)) < 0) { + git__free(st); return error; + } curl_easy_setopt(handle, CURLOPT_URL, host); curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, st->curl_error); diff --git a/vendor/libgit2/src/describe.c b/vendor/libgit2/src/describe.c index 48f04e858..13ddad5be 100644 --- a/vendor/libgit2/src/describe.c +++ b/vendor/libgit2/src/describe.c @@ -582,7 +582,8 @@ static int describe( best = (struct possible_tag *)git_vector_get(&all_matches, 0); if (gave_up_on) { - git_pqueue_insert(&list, gave_up_on); + if ((error = git_pqueue_insert(&list, gave_up_on)) < 0) + goto cleanup; seen_commits--; } if ((error = finish_depth_computation( diff --git a/vendor/libgit2/src/diff.c b/vendor/libgit2/src/diff.c index 9cde03e17..9ac5b9250 100644 --- a/vendor/libgit2/src/diff.c +++ b/vendor/libgit2/src/diff.c @@ -56,7 +56,7 @@ static int diff_insert_delta( if (diff->opts.notify_cb) { error = diff->opts.notify_cb( - diff, delta, matched_pathspec, diff->opts.notify_payload); + diff, delta, matched_pathspec, diff->opts.payload); if (error) { git__free(delta); @@ -74,6 +74,32 @@ static int diff_insert_delta( return error; } +static bool diff_pathspec_match( + const char **matched_pathspec, + git_diff *diff, + const git_index_entry *entry) +{ + bool disable_pathspec_match = + DIFF_FLAG_IS_SET(diff, GIT_DIFF_DISABLE_PATHSPEC_MATCH); + + /* If we're disabling fnmatch, then the iterator has already applied + * the filters to the files for us and we don't have to do anything. + * However, this only applies to *files* - the iterator will include + * directories that we need to recurse into when not autoexpanding, + * so we still need to apply the pathspec match to directories. + */ + if ((S_ISLNK(entry->mode) || S_ISREG(entry->mode)) && + disable_pathspec_match) { + *matched_pathspec = entry->path; + return true; + } + + return git_pathspec__match( + &diff->pathspec, entry->path, disable_pathspec_match, + DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE), + matched_pathspec, NULL); +} + static int diff_delta__from_one( git_diff *diff, git_delta_t status, @@ -105,16 +131,12 @@ static int diff_delta__from_one( if (status == GIT_DELTA_UNTRACKED && DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNTRACKED)) return 0; - + if (status == GIT_DELTA_UNREADABLE && DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE)) return 0; - if (!git_pathspec__match( - &diff->pathspec, entry->path, - DIFF_FLAG_IS_SET(diff, GIT_DIFF_DISABLE_PATHSPEC_MATCH), - DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE), - &matched_pathspec, NULL)) + if (!diff_pathspec_match(&matched_pathspec, diff, entry)) return 0; delta = diff_delta__alloc(diff, status, entry->path); @@ -408,8 +430,9 @@ static git_diff *diff_list_alloc( diff->new_src = new_iter->type; memcpy(&diff->opts, &dflt, sizeof(diff->opts)); - if (git_vector_init(&diff->deltas, 0, git_diff_delta__cmp) < 0 || - git_pool_init(&diff->pool, 1, 0) < 0) { + git_pool_init(&diff->pool, 1); + + if (git_vector_init(&diff->deltas, 0, git_diff_delta__cmp) < 0) { git_diff_free(diff); return NULL; } @@ -471,11 +494,6 @@ static int diff_list_apply_options( /* Don't set GIT_DIFFCAPS_USE_DEV - compile time option in core git */ - /* Don't trust nanoseconds; we do not load nanos from disk */ -#ifdef GIT_USE_NSEC - diff->diffcaps = diff->diffcaps | GIT_DIFFCAPS_TRUST_NANOSECS; -#endif - /* If not given explicit `opts`, check `diff.xyz` configs */ if (!opts) { int context = git_config__get_int_force(cfg, "diff.context", 3); @@ -676,13 +694,6 @@ int git_diff__oid_for_entry( return error; } -static bool diff_time_eq( - const git_index_time *a, const git_index_time *b, bool use_nanos) -{ - return a->seconds == b->seconds && - (!use_nanos || a->nanoseconds == b->nanoseconds); -} - typedef struct { git_repository *repo; git_iterator *old_iter; @@ -757,11 +768,7 @@ static int maybe_modified( const char *matched_pathspec; int error = 0; - if (!git_pathspec__match( - &diff->pathspec, oitem->path, - DIFF_FLAG_IS_SET(diff, GIT_DIFF_DISABLE_PATHSPEC_MATCH), - DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE), - &matched_pathspec, NULL)) + if (!diff_pathspec_match(&matched_pathspec, diff, oitem)) return 0; memset(&noid, 0, sizeof(noid)); @@ -819,7 +826,6 @@ static int maybe_modified( */ } else if (git_oid_iszero(&nitem->id) && new_is_workdir) { bool use_ctime = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_CTIME) != 0); - bool use_nanos = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_NANOSECS) != 0); git_index *index; git_iterator_index(&index, info->new_iter); @@ -838,13 +844,12 @@ static int maybe_modified( modified_uncertain = (oitem->file_size <= 0 && nitem->file_size > 0); } - else if (!diff_time_eq(&oitem->mtime, &nitem->mtime, use_nanos) || - (use_ctime && - !diff_time_eq(&oitem->ctime, &nitem->ctime, use_nanos)) || + else if (!git_index_time_eq(&oitem->mtime, &nitem->mtime) || + (use_ctime && !git_index_time_eq(&oitem->ctime, &nitem->ctime)) || oitem->ino != nitem->ino || oitem->uid != nitem->uid || oitem->gid != nitem->gid || - (index && nitem->mtime.seconds >= index->stamp.mtime)) + git_index_entry_newer_than_index(nitem, index)) { status = GIT_DELTA_MODIFIED; modified_uncertain = true; @@ -1055,6 +1060,12 @@ static int handle_unmatched_new_item( &info->nitem, &untracked_state, info->new_iter)) < 0) return error; + /* if we found nothing that matched our pathlist filter, exclude */ + if (untracked_state == GIT_ITERATOR_STATUS_FILTERED) { + git_vector_pop(&diff->deltas); + git__free(last); + } + /* if we found nothing or just ignored items, update the record */ if (untracked_state == GIT_ITERATOR_STATUS_IGNORED || untracked_state == GIT_ITERATOR_STATUS_EMPTY) { @@ -1235,7 +1246,18 @@ int git_diff__from_iterators( /* run iterators building diffs */ while (!error && (info.oitem || info.nitem)) { - int cmp = info.oitem ? + int cmp; + + /* report progress */ + if (opts && opts->progress_cb) { + if ((error = opts->progress_cb(diff, + info.oitem ? info.oitem->path : NULL, + info.nitem ? info.nitem->path : NULL, + opts->payload))) + break; + } + + cmp = info.oitem ? (info.nitem ? diff->entrycomp(info.oitem, info.nitem) : -1) : 1; /* create DELETED records for old items not matched in new */ @@ -1266,11 +1288,26 @@ int git_diff__from_iterators( return error; } -#define DIFF_FROM_ITERATORS(MAKE_FIRST, MAKE_SECOND) do { \ +#define DIFF_FROM_ITERATORS(MAKE_FIRST, FLAGS_FIRST, MAKE_SECOND, FLAGS_SECOND) do { \ git_iterator *a = NULL, *b = NULL; \ - char *pfx = opts ? git_pathspec_prefix(&opts->pathspec) : NULL; \ + char *pfx = (opts && !(opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) ? \ + git_pathspec_prefix(&opts->pathspec) : NULL; \ + git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT, \ + b_opts = GIT_ITERATOR_OPTIONS_INIT; \ + a_opts.flags = FLAGS_FIRST; \ + a_opts.start = pfx; \ + a_opts.end = pfx; \ + b_opts.flags = FLAGS_SECOND; \ + b_opts.start = pfx; \ + b_opts.end = pfx; \ GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options"); \ - if (!(error = MAKE_FIRST) && !(error = MAKE_SECOND)) \ + if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) { \ + a_opts.pathlist.strings = opts->pathspec.strings; \ + a_opts.pathlist.count = opts->pathspec.count; \ + b_opts.pathlist.strings = opts->pathspec.strings; \ + b_opts.pathlist.count = opts->pathspec.count; \ + } \ + if (!error && !(error = MAKE_FIRST) && !(error = MAKE_SECOND)) \ error = git_diff__from_iterators(diff, repo, a, b, opts); \ git__free(pfx); git_iterator_free(a); git_iterator_free(b); \ } while (0) @@ -1282,8 +1319,8 @@ int git_diff_tree_to_tree( git_tree *new_tree, const git_diff_options *opts) { - int error = 0; git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE; + int error = 0; assert(diff && repo); @@ -1295,8 +1332,8 @@ int git_diff_tree_to_tree( iflag = GIT_ITERATOR_IGNORE_CASE; DIFF_FROM_ITERATORS( - git_iterator_for_tree(&a, old_tree, iflag, pfx, pfx), - git_iterator_for_tree(&b, new_tree, iflag, pfx, pfx) + git_iterator_for_tree(&a, old_tree, &a_opts), iflag, + git_iterator_for_tree(&b, new_tree, &b_opts), iflag ); return error; @@ -1320,10 +1357,10 @@ int git_diff_tree_to_index( git_index *index, const git_diff_options *opts) { - int error = 0; - bool index_ignore_case = false; git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_INCLUDE_CONFLICTS; + bool index_ignore_case = false; + int error = 0; assert(diff && repo); @@ -1333,8 +1370,8 @@ int git_diff_tree_to_index( index_ignore_case = index->ignore_case; DIFF_FROM_ITERATORS( - git_iterator_for_tree(&a, old_tree, iflag, pfx, pfx), - git_iterator_for_index(&b, index, iflag, pfx, pfx) + git_iterator_for_tree(&a, old_tree, &a_opts), iflag, + git_iterator_for_index(&b, repo, index, &b_opts), iflag ); /* if index is in case-insensitive order, re-sort deltas to match */ @@ -1358,10 +1395,11 @@ int git_diff_index_to_workdir( return error; DIFF_FROM_ITERATORS( - git_iterator_for_index( - &a, index, GIT_ITERATOR_INCLUDE_CONFLICTS, pfx, pfx), - git_iterator_for_workdir( - &b, repo, index, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, pfx, pfx) + git_iterator_for_index(&a, repo, index, &a_opts), + GIT_ITERATOR_INCLUDE_CONFLICTS, + + git_iterator_for_workdir(&b, repo, index, NULL, &b_opts), + GIT_ITERATOR_DONT_AUTOEXPAND ); if (!error && DIFF_FLAG_IS_SET(*diff, GIT_DIFF_UPDATE_INDEX) && (*diff)->index_updated) @@ -1385,9 +1423,8 @@ int git_diff_tree_to_workdir( return error; DIFF_FROM_ITERATORS( - git_iterator_for_tree(&a, old_tree, 0, pfx, pfx), - git_iterator_for_workdir( - &b, repo, index, old_tree, GIT_ITERATOR_DONT_AUTOEXPAND, pfx, pfx) + git_iterator_for_tree(&a, old_tree, &a_opts), 0, + git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts), GIT_ITERATOR_DONT_AUTOEXPAND ); return error; @@ -1423,6 +1460,29 @@ int git_diff_tree_to_workdir_with_index( return error; } +int git_diff_index_to_index( + git_diff **diff, + git_repository *repo, + git_index *old_index, + git_index *new_index, + const git_diff_options *opts) +{ + int error = 0; + + assert(diff && old_index && new_index); + + DIFF_FROM_ITERATORS( + git_iterator_for_index(&a, repo, old_index, &a_opts), GIT_ITERATOR_DONT_IGNORE_CASE, + git_iterator_for_index(&b, repo, new_index, &b_opts), GIT_ITERATOR_DONT_IGNORE_CASE + ); + + /* if index is in case-insensitive order, re-sort deltas to match */ + if (!error && (old_index->ignore_case || new_index->ignore_case)) + diff_set_ignore_case(*diff, true); + + return error; +} + size_t git_diff_num_deltas(const git_diff *diff) { assert(diff); @@ -1599,6 +1659,7 @@ int git_diff_format_email__append_header_tobuf( const git_oid *id, const git_signature *author, const char *summary, + const char *body, size_t patch_no, size_t total_patches, bool exclude_patchno_marker) @@ -1638,6 +1699,13 @@ int git_diff_format_email__append_header_tobuf( error = git_buf_printf(out, "%s\n\n", summary); + if (body) { + git_buf_puts(out, body); + + if (out->ptr[out->size - 1] != '\n') + git_buf_putc(out, '\n'); + } + return error; } @@ -1715,7 +1783,7 @@ int git_diff_format_email( error = git_diff_format_email__append_header_tobuf(out, opts->id, opts->author, summary == NULL ? opts->summary : summary, - opts->patch_no, opts->total_patches, ignore_marker); + opts->body, opts->patch_no, opts->total_patches, ignore_marker); if (error < 0) goto on_error; @@ -1758,6 +1826,7 @@ int git_diff_commit_as_email( opts.total_patches = total_patches; opts.id = git_commit_id(commit); opts.summary = git_commit_summary(commit); + opts.body = git_commit_body(commit); opts.author = git_commit_author(commit); if ((error = git_diff__commit(&diff, repo, commit, diff_opts)) < 0) diff --git a/vendor/libgit2/src/diff.h b/vendor/libgit2/src/diff.h index 2dfc2c615..47743f88b 100644 --- a/vendor/libgit2/src/diff.h +++ b/vendor/libgit2/src/diff.h @@ -28,7 +28,6 @@ enum { GIT_DIFFCAPS_TRUST_MODE_BITS = (1 << 2), /* use st_mode? */ GIT_DIFFCAPS_TRUST_CTIME = (1 << 3), /* use st_ctime? */ GIT_DIFFCAPS_USE_DEV = (1 << 4), /* use st_dev? */ - GIT_DIFFCAPS_TRUST_NANOSECS = (1 << 5), /* use stat time nanoseconds */ }; #define DIFF_FLAGS_KNOWN_BINARY (GIT_DIFF_FLAG_BINARY|GIT_DIFF_FLAG_NOT_BINARY) diff --git a/vendor/libgit2/src/diff_file.c b/vendor/libgit2/src/diff_file.c index c60362865..ecc34cf55 100644 --- a/vendor/libgit2/src/diff_file.c +++ b/vendor/libgit2/src/diff_file.c @@ -259,10 +259,35 @@ static int diff_file_content_load_blob( return error; } +static int diff_file_content_load_workdir_symlink_fake( + git_diff_file_content *fc, git_buf *path) +{ + git_buf target = GIT_BUF_INIT; + int error; + + if ((error = git_futils_readbuffer(&target, path->ptr)) < 0) + return error; + + fc->map.len = git_buf_len(&target); + fc->map.data = git_buf_detach(&target); + fc->flags |= GIT_DIFF_FLAG__FREE_DATA; + + git_buf_free(&target); + return error; +} + static int diff_file_content_load_workdir_symlink( git_diff_file_content *fc, git_buf *path) { ssize_t alloc_len, read_len; + int symlink_supported, error; + + if ((error = git_repository__cvar( + &symlink_supported, fc->repo, GIT_CVAR_SYMLINKS)) < 0) + return -1; + + if (!symlink_supported) + return diff_file_content_load_workdir_symlink_fake(fc, path); /* link path on disk could be UTF-16, so prepare a buffer that is * big enough to handle some UTF-8 data expansion diff --git a/vendor/libgit2/src/diff_print.c b/vendor/libgit2/src/diff_print.c index bc2d6fab0..dae9e341d 100644 --- a/vendor/libgit2/src/diff_print.c +++ b/vendor/libgit2/src/diff_print.c @@ -92,7 +92,11 @@ static int diff_print_info_init_frompatch( git_diff_line_cb cb, void *payload) { - git_repository *repo = patch && patch->diff ? patch->diff->repo : NULL; + git_repository *repo; + + assert(patch); + + repo = patch->diff ? patch->diff->repo : NULL; memset(pi, 0, sizeof(diff_print_info)); diff --git a/vendor/libgit2/src/diff_tform.c b/vendor/libgit2/src/diff_tform.c index 92647e330..6a6a62811 100644 --- a/vendor/libgit2/src/diff_tform.c +++ b/vendor/libgit2/src/diff_tform.c @@ -134,11 +134,11 @@ int git_diff__merge( return -1; } - if (git_vector_init( - &onto_new, onto->deltas.length, git_diff_delta__cmp) < 0 || - git_pool_init(&onto_pool, 1, 0) < 0) + if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0) return -1; + git_pool_init(&onto_pool, 1); + for (i = 0, j = 0; i < onto->deltas.length || j < from->deltas.length; ) { git_diff_delta *o = GIT_VECTOR_GET(&onto->deltas, i); const git_diff_delta *f = GIT_VECTOR_GET(&from->deltas, j); @@ -261,18 +261,23 @@ static int normalize_find_opts( if (!given || (given->flags & GIT_DIFF_FIND_ALL) == GIT_DIFF_FIND_BY_CONFIG) { - char *rule = - git_config__get_string_force(cfg, "diff.renames", "true"); - int boolval; - - if (!git__parse_bool(&boolval, rule) && !boolval) - /* don't set FIND_RENAMES if bool value is false */; - else if (!strcasecmp(rule, "copies") || !strcasecmp(rule, "copy")) - opts->flags |= GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES; - else - opts->flags |= GIT_DIFF_FIND_RENAMES; + if (cfg) { + char *rule = + git_config__get_string_force(cfg, "diff.renames", "true"); + int boolval; + + if (!git__parse_bool(&boolval, rule) && !boolval) + /* don't set FIND_RENAMES if bool value is false */; + else if (!strcasecmp(rule, "copies") || !strcasecmp(rule, "copy")) + opts->flags |= GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES; + else + opts->flags |= GIT_DIFF_FIND_RENAMES; - git__free(rule); + git__free(rule); + } else { + /* set default flag */ + opts->flags |= GIT_DIFF_FIND_RENAMES; + } } /* some flags imply others */ @@ -313,8 +318,10 @@ static int normalize_find_opts( #undef USE_DEFAULT if (!opts->rename_limit) { - opts->rename_limit = git_config__get_int_force( - cfg, "diff.renamelimit", DEFAULT_RENAME_LIMIT); + if (cfg) { + opts->rename_limit = git_config__get_int_force( + cfg, "diff.renamelimit", DEFAULT_RENAME_LIMIT); + } if (opts->rename_limit <= 0) opts->rename_limit = DEFAULT_RENAME_LIMIT; diff --git a/vendor/libgit2/src/errors.c b/vendor/libgit2/src/errors.c index 7a2600586..91acc3541 100644 --- a/vendor/libgit2/src/errors.c +++ b/vendor/libgit2/src/errors.c @@ -18,19 +18,30 @@ static git_error g_git_oom_error = { GITERR_NOMEMORY }; -static void set_error(int error_class, char *string) +static void set_error_from_buffer(int error_class) { git_error *error = &GIT_GLOBAL->error_t; + git_buf *buf = &GIT_GLOBAL->error_buf; - if (error->message != string) - git__free(error->message); - - error->message = string; + error->message = buf->ptr; error->klass = error_class; GIT_GLOBAL->last_error = error; } +static void set_error(int error_class, char *string) +{ + git_buf *buf = &GIT_GLOBAL->error_buf; + + git_buf_clear(buf); + if (string) { + git_buf_puts(buf, string); + git__free(string); + } + + set_error_from_buffer(error_class); +} + void giterr_set_oom(void) { GIT_GLOBAL->last_error = &g_git_oom_error; @@ -38,27 +49,28 @@ void giterr_set_oom(void) void giterr_set(int error_class, const char *string, ...) { - git_buf buf = GIT_BUF_INIT; va_list arglist; #ifdef GIT_WIN32 DWORD win32_error_code = (error_class == GITERR_OS) ? GetLastError() : 0; #endif int error_code = (error_class == GITERR_OS) ? errno : 0; + git_buf *buf = &GIT_GLOBAL->error_buf; + git_buf_clear(buf); if (string) { va_start(arglist, string); - git_buf_vprintf(&buf, string, arglist); + git_buf_vprintf(buf, string, arglist); va_end(arglist); if (error_class == GITERR_OS) - git_buf_PUTS(&buf, ": "); + git_buf_PUTS(buf, ": "); } if (error_class == GITERR_OS) { #ifdef GIT_WIN32 char * win32_error = git_win32_get_error_message(win32_error_code); if (win32_error) { - git_buf_puts(&buf, win32_error); + git_buf_puts(buf, win32_error); git__free(win32_error); SetLastError(0); @@ -66,26 +78,29 @@ void giterr_set(int error_class, const char *string, ...) else #endif if (error_code) - git_buf_puts(&buf, strerror(error_code)); + git_buf_puts(buf, strerror(error_code)); if (error_code) errno = 0; } - if (!git_buf_oom(&buf)) - set_error(error_class, git_buf_detach(&buf)); + if (!git_buf_oom(buf)) + set_error_from_buffer(error_class); } void giterr_set_str(int error_class, const char *string) { - char *message; + git_buf *buf = &GIT_GLOBAL->error_buf; assert(string); - message = git__strdup(string); + if (!string) + return; - if (message) - set_error(error_class, message); + git_buf_clear(buf); + git_buf_puts(buf, string); + if (!git_buf_oom(buf)) + set_error_from_buffer(error_class); } int giterr_set_regex(const regex_t *regex, int error_code) @@ -116,45 +131,65 @@ void giterr_clear(void) #endif } -int giterr_detach(git_error *cpy) +const git_error *giterr_last(void) +{ + return GIT_GLOBAL->last_error; +} + +int giterr_state_capture(git_error_state *state, int error_code) { git_error *error = GIT_GLOBAL->last_error; + git_buf *error_buf = &GIT_GLOBAL->error_buf; - assert(cpy); + memset(state, 0, sizeof(git_error_state)); - if (!error) - return -1; + if (!error_code) + return 0; - cpy->message = error->message; - cpy->klass = error->klass; + state->error_code = error_code; + state->oom = (error == &g_git_oom_error); - error->message = NULL; - giterr_clear(); + if (error) { + state->error_msg.klass = error->klass; - return 0; -} + if (state->oom) + state->error_msg.message = g_git_oom_error.message; + else + state->error_msg.message = git_buf_detach(error_buf); + } -const git_error *giterr_last(void) -{ - return GIT_GLOBAL->last_error; + giterr_clear(); + return error_code; } -int giterr_capture(git_error_state *state, int error_code) +int giterr_state_restore(git_error_state *state) { - state->error_code = error_code; - if (error_code) - giterr_detach(&state->error_msg); - return error_code; + int ret = 0; + + giterr_clear(); + + if (state && state->error_msg.message) { + if (state->oom) + giterr_set_oom(); + else + set_error(state->error_msg.klass, state->error_msg.message); + + ret = state->error_code; + memset(state, 0, sizeof(git_error_state)); + } + + return ret; } -int giterr_restore(git_error_state *state) +void giterr_state_free(git_error_state *state) { - if (state && state->error_code && state->error_msg.message) - set_error(state->error_msg.klass, state->error_msg.message); - else - giterr_clear(); + if (!state) + return; + + if (!state->oom) + git__free(state->error_msg.message); - return state ? state->error_code : 0; + memset(state, 0, sizeof(git_error_state)); } int giterr_system_last(void) diff --git a/vendor/libgit2/src/filebuf.c b/vendor/libgit2/src/filebuf.c index 2bbc210ba..101d5082a 100644 --- a/vendor/libgit2/src/filebuf.c +++ b/vendor/libgit2/src/filebuf.c @@ -70,6 +70,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode) git_file source; char buffer[FILEIO_BUFSIZE]; ssize_t read_bytes; + int error; source = p_open(file->path_original, O_RDONLY); if (source < 0) { @@ -80,7 +81,8 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode) } while ((read_bytes = p_read(source, buffer, sizeof(buffer))) > 0) { - p_write(file->fd, buffer, read_bytes); + if ((error = p_write(file->fd, buffer, read_bytes)) < 0) + break; if (file->compute_digest) git_hash_update(&file->digest, buffer, read_bytes); } @@ -90,6 +92,9 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode) if (read_bytes < 0) { giterr_set(GITERR_OS, "Failed to read file '%s'", file->path_original); return -1; + } else if (error < 0) { + giterr_set(GITERR_OS, "Failed to write file '%s'", file->path_lock); + return -1; } } @@ -357,6 +362,12 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags, mode_t mode memcpy(file->path_lock, file->path_original, path_len); memcpy(file->path_lock + path_len, GIT_FILELOCK_EXTENSION, GIT_FILELOCK_EXTLENGTH); + if (git_path_isdir(file->path_original)) { + giterr_set(GITERR_FILESYSTEM, "path '%s' is a directory", file->path_original); + error = GIT_EDIRECTORY; + goto cleanup; + } + /* open the file for locking */ if ((error = lock_file(file, flags, mode)) < 0) goto cleanup; diff --git a/vendor/libgit2/src/fileops.c b/vendor/libgit2/src/fileops.c index b7b55159f..22868b489 100644 --- a/vendor/libgit2/src/fileops.c +++ b/vendor/libgit2/src/fileops.c @@ -18,7 +18,7 @@ GIT__USE_STRMAP int git_futils_mkpath2file(const char *file_path, const mode_t mode) { return git_futils_mkdir( - file_path, NULL, mode, + file_path, mode, GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST | GIT_MKDIR_VERIFY_DIR); } @@ -153,13 +153,15 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len) } int git_futils_readbuffer_updated( - git_buf *buf, const char *path, time_t *mtime, size_t *size, int *updated) + git_buf *out, const char *path, git_oid *checksum, int *updated) { + int error; git_file fd; struct stat st; - bool changed = false; + git_buf buf = GIT_BUF_INIT; + git_oid checksum_new; - assert(buf && path && *path); + assert(out && path && *path); if (updated != NULL) *updated = 0; @@ -178,45 +180,50 @@ int git_futils_readbuffer_updated( return -1; } - /* - * If we were given a time and/or a size, we only want to read the file - * if it has been modified. - */ - if (size && *size != (size_t)st.st_size) - changed = true; - if (mtime && *mtime != (time_t)st.st_mtime) - changed = true; - if (!size && !mtime) - changed = true; - - if (!changed) { - return 0; - } - - if (mtime != NULL) - *mtime = st.st_mtime; - if (size != NULL) - *size = (size_t)st.st_size; - if ((fd = git_futils_open_ro(path)) < 0) return fd; - if (git_futils_readbuffer_fd(buf, fd, (size_t)st.st_size) < 0) { + if (git_futils_readbuffer_fd(&buf, fd, (size_t)st.st_size) < 0) { p_close(fd); return -1; } p_close(fd); + if ((error = git_hash_buf(&checksum_new, buf.ptr, buf.size)) < 0) { + git_buf_free(&buf); + return error; + } + + /* + * If we were given a checksum, we only want to use it if it's different + */ + if (checksum && !git_oid__cmp(checksum, &checksum_new)) { + git_buf_free(&buf); + if (updated) + *updated = 0; + + return 0; + } + + /* + * If we're here, the file did change, or the user didn't have an old version + */ + if (checksum) + git_oid_cpy(checksum, &checksum_new); + if (updated != NULL) *updated = 1; + git_buf_swap(out, &buf); + git_buf_free(&buf); + return 0; } int git_futils_readbuffer(git_buf *buf, const char *path) { - return git_futils_readbuffer_updated(buf, path, NULL, NULL, NULL); + return git_futils_readbuffer_updated(buf, path, NULL, NULL); } int git_futils_writebuffer( @@ -289,97 +296,230 @@ void git_futils_mmap_free(git_map *out) p_munmap(out); } -GIT_INLINE(int) validate_existing( - const char *make_path, +GIT_INLINE(int) mkdir_validate_dir( + const char *path, struct stat *st, mode_t mode, uint32_t flags, - struct git_futils_mkdir_perfdata *perfdata) + struct git_futils_mkdir_options *opts) { + /* with exclusive create, existing dir is an error */ + if ((flags & GIT_MKDIR_EXCL) != 0) { + giterr_set(GITERR_FILESYSTEM, + "Failed to make directory '%s': directory exists", path); + return GIT_EEXISTS; + } + if ((S_ISREG(st->st_mode) && (flags & GIT_MKDIR_REMOVE_FILES)) || (S_ISLNK(st->st_mode) && (flags & GIT_MKDIR_REMOVE_SYMLINKS))) { - if (p_unlink(make_path) < 0) { + if (p_unlink(path) < 0) { giterr_set(GITERR_OS, "Failed to remove %s '%s'", - S_ISLNK(st->st_mode) ? "symlink" : "file", make_path); + S_ISLNK(st->st_mode) ? "symlink" : "file", path); return GIT_EEXISTS; } - perfdata->mkdir_calls++; + opts->perfdata.mkdir_calls++; - if (p_mkdir(make_path, mode) < 0) { - giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path); + if (p_mkdir(path, mode) < 0) { + giterr_set(GITERR_OS, "Failed to make directory '%s'", path); return GIT_EEXISTS; } } else if (S_ISLNK(st->st_mode)) { /* Re-stat the target, make sure it's a directory */ - perfdata->stat_calls++; + opts->perfdata.stat_calls++; - if (p_stat(make_path, st) < 0) { - giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path); + if (p_stat(path, st) < 0) { + giterr_set(GITERR_OS, "Failed to make directory '%s'", path); return GIT_EEXISTS; } } else if (!S_ISDIR(st->st_mode)) { giterr_set(GITERR_FILESYSTEM, - "Failed to make directory '%s': directory exists", make_path); + "Failed to make directory '%s': directory exists", path); return GIT_EEXISTS; } return 0; } -int git_futils_mkdir_ext( +GIT_INLINE(int) mkdir_validate_mode( const char *path, - const char *base, + struct stat *st, + bool terminal_path, mode_t mode, uint32_t flags, struct git_futils_mkdir_options *opts) { - int error = -1; - git_buf make_path = GIT_BUF_INIT; - ssize_t root = 0, min_root_len, root_len; - char lastch = '/', *tail; - struct stat st; + if (((terminal_path && (flags & GIT_MKDIR_CHMOD) != 0) || + (flags & GIT_MKDIR_CHMOD_PATH) != 0) && st->st_mode != mode) { - /* build path and find "root" where we should start calling mkdir */ - if (git_path_join_unrooted(&make_path, path, base, &root) < 0) - return -1; + opts->perfdata.chmod_calls++; - if (make_path.size == 0) { - giterr_set(GITERR_OS, "Attempt to create empty path"); - goto done; + if (p_chmod(path, mode) < 0) { + giterr_set(GITERR_OS, "failed to set permissions on '%s'", path); + return -1; + } + } + + return 0; +} + +GIT_INLINE(int) mkdir_canonicalize( + git_buf *path, + uint32_t flags) +{ + ssize_t root_len; + + if (path->size == 0) { + giterr_set(GITERR_OS, "attempt to create empty path"); + return -1; } /* Trim trailing slashes (except the root) */ - if ((root_len = git_path_root(make_path.ptr)) < 0) + if ((root_len = git_path_root(path->ptr)) < 0) root_len = 0; else root_len++; - while (make_path.size > (size_t)root_len && - make_path.ptr[make_path.size - 1] == '/') - make_path.ptr[--make_path.size] = '\0'; + while (path->size > (size_t)root_len && path->ptr[path->size - 1] == '/') + path->ptr[--path->size] = '\0'; /* if we are not supposed to made the last element, truncate it */ if ((flags & GIT_MKDIR_SKIP_LAST2) != 0) { - git_path_dirname_r(&make_path, make_path.ptr); + git_path_dirname_r(path, path->ptr); flags |= GIT_MKDIR_SKIP_LAST; } if ((flags & GIT_MKDIR_SKIP_LAST) != 0) { - git_path_dirname_r(&make_path, make_path.ptr); + git_path_dirname_r(path, path->ptr); } /* We were either given the root path (or trimmed it to - * the root), we don't have anything to do. + * the root), we don't have anything to do. + */ + if (path->size <= (size_t)root_len) + git_buf_clear(path); + + return 0; +} + +int git_futils_mkdir( + const char *path, + mode_t mode, + uint32_t flags) +{ + git_buf make_path = GIT_BUF_INIT, parent_path = GIT_BUF_INIT; + const char *relative; + struct git_futils_mkdir_options opts = { 0 }; + struct stat st; + size_t depth = 0; + int len = 0, root_len, error; + + if ((error = git_buf_puts(&make_path, path)) < 0 || + (error = mkdir_canonicalize(&make_path, flags)) < 0 || + (error = git_buf_puts(&parent_path, make_path.ptr)) < 0 || + make_path.size == 0) + goto done; + + root_len = git_path_root(make_path.ptr); + + /* find the first parent directory that exists. this will be used + * as the base to dirname_relative. */ - if (make_path.size <= (size_t)root_len) { - error = 0; + for (relative = make_path.ptr; parent_path.size; ) { + error = p_lstat(parent_path.ptr, &st); + + if (error == 0) { + break; + } else if (errno != ENOENT) { + giterr_set(GITERR_OS, "failed to stat '%s'", parent_path.ptr); + goto done; + } + + depth++; + + /* examine the parent of the current path */ + if ((len = git_path_dirname_r(&parent_path, parent_path.ptr)) < 0) { + error = len; + goto done; + } + + assert(len); + + /* we've walked all the given path's parents and it's either relative + * or rooted. either way, give up and make the entire path. + */ + if ((len == 1 && parent_path.ptr[0] == '.') || len == root_len+1) { + relative = make_path.ptr; + break; + } + + relative = make_path.ptr + len + 1; + + /* not recursive? just make this directory relative to its parent. */ + if ((flags & GIT_MKDIR_PATH) == 0) + break; + } + + /* we found an item at the location we're trying to create, + * validate it. + */ + if (depth == 0) { + error = mkdir_validate_dir(make_path.ptr, &st, mode, flags, &opts); + + if (!error) + error = mkdir_validate_mode( + make_path.ptr, &st, true, mode, flags, &opts); + goto done; } + /* we already took `SKIP_LAST` and `SKIP_LAST2` into account when + * canonicalizing `make_path`. + */ + flags &= ~(GIT_MKDIR_SKIP_LAST2 | GIT_MKDIR_SKIP_LAST); + + error = git_futils_mkdir_relative(relative, + parent_path.size ? parent_path.ptr : NULL, mode, flags, &opts); + +done: + git_buf_free(&make_path); + git_buf_free(&parent_path); + return error; +} + +int git_futils_mkdir_r(const char *path, const mode_t mode) +{ + return git_futils_mkdir(path, mode, GIT_MKDIR_PATH); +} + +int git_futils_mkdir_relative( + const char *relative_path, + const char *base, + mode_t mode, + uint32_t flags, + struct git_futils_mkdir_options *opts) +{ + git_buf make_path = GIT_BUF_INIT; + ssize_t root = 0, min_root_len; + char lastch = '/', *tail; + struct stat st; + struct git_futils_mkdir_options empty_opts = {0}; + int error; + + if (!opts) + opts = &empty_opts; + + /* build path and find "root" where we should start calling mkdir */ + if (git_path_join_unrooted(&make_path, relative_path, base, &root) < 0) + return -1; + + if ((error = mkdir_canonicalize(&make_path, flags)) < 0 || + make_path.size == 0) + goto done; + /* if we are not supposed to make the whole path, reset root */ if ((flags & GIT_MKDIR_PATH) == 0) root = git_buf_rfind(&make_path, '/'); @@ -437,32 +577,15 @@ int git_futils_mkdir_ext( goto done; } } else { - /* with exclusive create, existing dir is an error */ - if ((flags & GIT_MKDIR_EXCL) != 0) { - giterr_set(GITERR_FILESYSTEM, "Failed to make directory '%s': directory exists", make_path.ptr); - error = GIT_EEXISTS; + if ((error = mkdir_validate_dir( + make_path.ptr, &st, mode, flags, opts)) < 0) goto done; - } - - if ((error = validate_existing( - make_path.ptr, &st, mode, flags, &opts->perfdata)) < 0) - goto done; } /* chmod if requested and necessary */ - if (((flags & GIT_MKDIR_CHMOD_PATH) != 0 || - (lastch == '\0' && (flags & GIT_MKDIR_CHMOD) != 0)) && - st.st_mode != mode) { - - opts->perfdata.chmod_calls++; - - if ((error = p_chmod(make_path.ptr, mode)) < 0 && - lastch == '\0') { - giterr_set(GITERR_OS, "Failed to set permissions on '%s'", - make_path.ptr); - goto done; - } - } + if ((error = mkdir_validate_mode( + make_path.ptr, &st, (lastch == '\0'), mode, flags, opts)) < 0) + goto done; if (opts->dir_map && opts->pool) { char *cache_path; @@ -501,21 +624,6 @@ int git_futils_mkdir_ext( return error; } -int git_futils_mkdir( - const char *path, - const char *base, - mode_t mode, - uint32_t flags) -{ - struct git_futils_mkdir_options options = {0}; - return git_futils_mkdir_ext(path, base, mode, flags, &options); -} - -int git_futils_mkdir_r(const char *path, const char *base, const mode_t mode) -{ - return git_futils_mkdir(path, base, mode, GIT_MKDIR_PATH); -} - typedef struct { const char *base; size_t baselen; @@ -777,7 +885,7 @@ static int _cp_r_mkdir(cp_r_info *info, git_buf *from) /* create root directory the first time we need to create a directory */ if ((info->flags & GIT_CPDIR__MKDIR_DONE_FOR_TO_ROOT) == 0) { error = git_futils_mkdir( - info->to_root, NULL, info->dirmode, + info->to_root, info->dirmode, (info->flags & GIT_CPDIR_CHMOD_DIRS) ? GIT_MKDIR_CHMOD : 0); info->flags |= GIT_CPDIR__MKDIR_DONE_FOR_TO_ROOT; @@ -785,9 +893,9 @@ static int _cp_r_mkdir(cp_r_info *info, git_buf *from) /* create directory with root as base to prevent excess chmods */ if (!error) - error = git_futils_mkdir( + error = git_futils_mkdir_relative( from->ptr + info->from_prefix, info->to_root, - info->dirmode, info->mkdir_flags); + info->dirmode, info->mkdir_flags, NULL); return error; } @@ -934,12 +1042,18 @@ int git_futils_filestamp_check( if (p_stat(path, &st) < 0) return GIT_ENOTFOUND; - if (stamp->mtime == (git_time_t)st.st_mtime && + if (stamp->mtime.tv_sec == st.st_mtime && +#if defined(GIT_USE_NSEC) + stamp->mtime.tv_nsec == st.st_mtime_nsec && +#endif stamp->size == (git_off_t)st.st_size && stamp->ino == (unsigned int)st.st_ino) return 0; - stamp->mtime = (git_time_t)st.st_mtime; + stamp->mtime.tv_sec = st.st_mtime; +#if defined(GIT_USE_NSEC) + stamp->mtime.tv_nsec = st.st_mtime_nsec; +#endif stamp->size = (git_off_t)st.st_size; stamp->ino = (unsigned int)st.st_ino; @@ -962,7 +1076,12 @@ void git_futils_filestamp_set_from_stat( git_futils_filestamp *stamp, struct stat *st) { if (st) { - stamp->mtime = (git_time_t)st->st_mtime; + stamp->mtime.tv_sec = st->st_mtime; +#if defined(GIT_USE_NSEC) + stamp->mtime.tv_nsec = st->st_mtime_nsec; +#else + stamp->mtime.tv_nsec = 0; +#endif stamp->size = (git_off_t)st->st_size; stamp->ino = (unsigned int)st->st_ino; } else { diff --git a/vendor/libgit2/src/fileops.h b/vendor/libgit2/src/fileops.h index 0f6466c59..6c6c49dcf 100644 --- a/vendor/libgit2/src/fileops.h +++ b/vendor/libgit2/src/fileops.h @@ -13,6 +13,7 @@ #include "path.h" #include "pool.h" #include "strmap.h" +#include "oid.h" /** * Filebuffer methods @@ -21,7 +22,7 @@ */ extern int git_futils_readbuffer(git_buf *obj, const char *path); extern int git_futils_readbuffer_updated( - git_buf *obj, const char *path, time_t *mtime, size_t *size, int *updated); + git_buf *obj, const char *path, git_oid *checksum, int *updated); extern int git_futils_readbuffer_fd(git_buf *obj, git_file fd, size_t len); extern int git_futils_writebuffer( @@ -55,12 +56,9 @@ extern int git_futils_creat_locked(const char *path, const mode_t mode); extern int git_futils_creat_locked_withpath(const char *path, const mode_t dirmode, const mode_t mode); /** - * Create a path recursively - * - * If a base parameter is being passed, it's expected to be valued with a - * path pointing to an already existing directory. + * Create a path recursively. */ -extern int git_futils_mkdir_r(const char *path, const char *base, const mode_t mode); +extern int git_futils_mkdir_r(const char *path, const mode_t mode); /** * Flags to pass to `git_futils_mkdir`. @@ -111,20 +109,20 @@ struct git_futils_mkdir_options * and optionally chmods the directory immediately after (or each part of the * path if requested). * - * @param path The path to create. + * @param path The path to create, relative to base. * @param base Root for relative path. These directories will never be made. * @param mode The mode to use for created directories. * @param flags Combination of the mkdir flags above. - * @param opts Extended options, use `git_futils_mkdir` if you are not interested. + * @param opts Extended options, or null. * @return 0 on success, else error code */ -extern int git_futils_mkdir_ext(const char *path, const char *base, mode_t mode, uint32_t flags, struct git_futils_mkdir_options *opts); +extern int git_futils_mkdir_relative(const char *path, const char *base, mode_t mode, uint32_t flags, struct git_futils_mkdir_options *opts); /** - * Create a directory or entire path. Similar to `git_futils_mkdir_withperf` + * Create a directory or entire path. Similar to `git_futils_mkdir_relative` * without performance data. */ -extern int git_futils_mkdir(const char *path, const char *base, mode_t mode, uint32_t flags); +extern int git_futils_mkdir(const char *path, mode_t mode, uint32_t flags); /** * Create all the folders required to contain @@ -312,7 +310,7 @@ extern int git_futils_fake_symlink(const char *new, const char *old); * versions could be implemented in the future. */ typedef struct { - git_time_t mtime; + struct timespec mtime; git_off_t size; unsigned int ino; } git_futils_filestamp; diff --git a/vendor/libgit2/src/filter.c b/vendor/libgit2/src/filter.c index 4006351f8..a0628d779 100644 --- a/vendor/libgit2/src/filter.c +++ b/vendor/libgit2/src/filter.c @@ -56,80 +56,15 @@ static int filter_def_priority_cmp(const void *a, const void *b) return (pa < pb) ? -1 : (pa > pb) ? 1 : 0; } -struct filter_registry { +struct git_filter_registry { + git_rwlock lock; git_vector filters; }; -static struct filter_registry *git__filter_registry = NULL; +static struct git_filter_registry filter_registry; -static void filter_registry_shutdown(void) -{ - struct filter_registry *reg = NULL; - size_t pos; - git_filter_def *fdef; - - if ((reg = git__swap(git__filter_registry, NULL)) == NULL) - return; - - git_vector_foreach(®->filters, pos, fdef) { - if (fdef->filter && fdef->filter->shutdown) { - fdef->filter->shutdown(fdef->filter); - fdef->initialized = false; - } - - git__free(fdef->filter_name); - git__free(fdef->attrdata); - git__free(fdef); - } - - git_vector_free(®->filters); - git__free(reg); -} - -static int filter_registry_initialize(void) -{ - int error = 0; - struct filter_registry *reg; - - if (git__filter_registry) - return 0; - - reg = git__calloc(1, sizeof(struct filter_registry)); - GITERR_CHECK_ALLOC(reg); - - if ((error = git_vector_init( - ®->filters, 2, filter_def_priority_cmp)) < 0) - goto cleanup; +static void git_filter_global_shutdown(void); - reg = git__compare_and_swap(&git__filter_registry, NULL, reg); - if (reg != NULL) - goto cleanup; - - git__on_shutdown(filter_registry_shutdown); - - /* try to register both default filters */ - { - git_filter *crlf = git_crlf_filter_new(); - git_filter *ident = git_ident_filter_new(); - - if (crlf && git_filter_register( - GIT_FILTER_CRLF, crlf, GIT_FILTER_CRLF_PRIORITY) < 0) - crlf = NULL; - if (ident && git_filter_register( - GIT_FILTER_IDENT, ident, GIT_FILTER_IDENT_PRIORITY) < 0) - ident = NULL; - - if (!crlf || !ident) - return -1; - } - - return 0; - -cleanup: - git_vector_free(®->filters); - git__free(reg); - return error; -} static int filter_def_scan_attrs( git_buf *attrs, size_t *nattr, size_t *nmatch, const char *attr_str) @@ -210,40 +145,14 @@ static int filter_def_filter_key_check(const void *key, const void *fdef) return (key == filter) ? 0 : -1; } -static int filter_registry_find(size_t *pos, const char *name) -{ - return git_vector_search2( - pos, &git__filter_registry->filters, filter_def_name_key_check, name); -} - -static git_filter_def *filter_registry_lookup(size_t *pos, const char *name) -{ - git_filter_def *fdef = NULL; - - if (!filter_registry_find(pos, name)) - fdef = git_vector_get(&git__filter_registry->filters, *pos); - - return fdef; -} - -int git_filter_register( +/* Note: callers must lock the registry before calling this function */ +static int filter_registry_insert( const char *name, git_filter *filter, int priority) { git_filter_def *fdef; size_t nattr = 0, nmatch = 0, alloc_len; git_buf attrs = GIT_BUF_INIT; - assert(name && filter); - - if (filter_registry_initialize() < 0) - return -1; - - if (!filter_registry_find(NULL, name)) { - giterr_set( - GITERR_FILTER, "Attempt to reregister existing filter '%s'", name); - return GIT_EEXISTS; - } - if (filter_def_scan_attrs(&attrs, &nattr, &nmatch, filter->attributes) < 0) return -1; @@ -265,21 +174,123 @@ int git_filter_register( filter_def_set_attrs(fdef); - if (git_vector_insert(&git__filter_registry->filters, fdef) < 0) { + if (git_vector_insert(&filter_registry.filters, fdef) < 0) { git__free(fdef->filter_name); git__free(fdef->attrdata); git__free(fdef); return -1; } - git_vector_sort(&git__filter_registry->filters); + git_vector_sort(&filter_registry.filters); return 0; } +int git_filter_global_init(void) +{ + git_filter *crlf = NULL, *ident = NULL; + int error = 0; + + if (git_rwlock_init(&filter_registry.lock) < 0) + return -1; + + if ((error = git_vector_init(&filter_registry.filters, 2, + filter_def_priority_cmp)) < 0) + goto done; + + if ((crlf = git_crlf_filter_new()) == NULL || + filter_registry_insert( + GIT_FILTER_CRLF, crlf, GIT_FILTER_CRLF_PRIORITY) < 0 || + (ident = git_ident_filter_new()) == NULL || + filter_registry_insert( + GIT_FILTER_IDENT, ident, GIT_FILTER_IDENT_PRIORITY) < 0) + error = -1; + + git__on_shutdown(git_filter_global_shutdown); + +done: + if (error) { + git_filter_free(crlf); + git_filter_free(ident); + } + + return error; +} + +static void git_filter_global_shutdown(void) +{ + size_t pos; + git_filter_def *fdef; + + if (git_rwlock_wrlock(&filter_registry.lock) < 0) + return; + + git_vector_foreach(&filter_registry.filters, pos, fdef) { + if (fdef->filter && fdef->filter->shutdown) { + fdef->filter->shutdown(fdef->filter); + fdef->initialized = false; + } + + git__free(fdef->filter_name); + git__free(fdef->attrdata); + git__free(fdef); + } + + git_vector_free(&filter_registry.filters); + + git_rwlock_wrunlock(&filter_registry.lock); + git_rwlock_free(&filter_registry.lock); +} + +/* Note: callers must lock the registry before calling this function */ +static int filter_registry_find(size_t *pos, const char *name) +{ + return git_vector_search2( + pos, &filter_registry.filters, filter_def_name_key_check, name); +} + +/* Note: callers must lock the registry before calling this function */ +static git_filter_def *filter_registry_lookup(size_t *pos, const char *name) +{ + git_filter_def *fdef = NULL; + + if (!filter_registry_find(pos, name)) + fdef = git_vector_get(&filter_registry.filters, *pos); + + return fdef; +} + + +int git_filter_register( + const char *name, git_filter *filter, int priority) +{ + int error; + + assert(name && filter); + + if (git_rwlock_wrlock(&filter_registry.lock) < 0) { + giterr_set(GITERR_OS, "failed to lock filter registry"); + return -1; + } + + if (!filter_registry_find(NULL, name)) { + giterr_set( + GITERR_FILTER, "attempt to reregister existing filter '%s'", name); + error = GIT_EEXISTS; + goto done; + } + + error = filter_registry_insert(name, filter, priority); + +done: + git_rwlock_wrunlock(&filter_registry.lock); + return error; +} + int git_filter_unregister(const char *name) { size_t pos; git_filter_def *fdef; + int error = 0; assert(name); @@ -289,12 +300,18 @@ int git_filter_unregister(const char *name) return -1; } + if (git_rwlock_wrlock(&filter_registry.lock) < 0) { + giterr_set(GITERR_OS, "failed to lock filter registry"); + return -1; + } + if ((fdef = filter_registry_lookup(&pos, name)) == NULL) { giterr_set(GITERR_FILTER, "Cannot find filter '%s' to unregister", name); - return GIT_ENOTFOUND; + error = GIT_ENOTFOUND; + goto done; } - (void)git_vector_remove(&git__filter_registry->filters, pos); + git_vector_remove(&filter_registry.filters, pos); if (fdef->initialized && fdef->filter && fdef->filter->shutdown) { fdef->filter->shutdown(fdef->filter); @@ -305,21 +322,18 @@ int git_filter_unregister(const char *name) git__free(fdef->attrdata); git__free(fdef); - return 0; +done: + git_rwlock_wrunlock(&filter_registry.lock); + return error; } static int filter_initialize(git_filter_def *fdef) { int error = 0; - if (!fdef->initialized && - fdef->filter && - fdef->filter->initialize && - (error = fdef->filter->initialize(fdef->filter)) < 0) - { - /* auto-unregister if initialize fails */ - git_filter_unregister(fdef->filter_name); - return error; + if (!fdef->initialized && fdef->filter && fdef->filter->initialize) { + if ((error = fdef->filter->initialize(fdef->filter)) < 0) + return error; } fdef->initialized = true; @@ -330,17 +344,22 @@ git_filter *git_filter_lookup(const char *name) { size_t pos; git_filter_def *fdef; + git_filter *filter = NULL; - if (filter_registry_initialize() < 0) + if (git_rwlock_rdlock(&filter_registry.lock) < 0) { + giterr_set(GITERR_OS, "failed to lock filter registry"); return NULL; + } - if ((fdef = filter_registry_lookup(&pos, name)) == NULL) - return NULL; + if ((fdef = filter_registry_lookup(&pos, name)) == NULL || + (!fdef->initialized && filter_initialize(fdef) < 0)) + goto done; - if (!fdef->initialized && filter_initialize(fdef) < 0) - return NULL; + filter = fdef->filter; - return fdef->filter; +done: + git_rwlock_rdunlock(&filter_registry.lock); + return filter; } void git_filter_free(git_filter *filter) @@ -433,8 +452,11 @@ static int filter_list_check_attributes( want_type = git_attr_value(want); found_type = git_attr_value(strs[i]); - if (want_type != found_type || - (want_type == GIT_ATTR_VALUE_T && strcmp(want, strs[i]))) + if (want_type != found_type) + error = GIT_ENOTFOUND; + else if (want_type == GIT_ATTR_VALUE_T && + strcmp(want, strs[i]) && + strcmp(want, "*")) error = GIT_ENOTFOUND; } @@ -475,8 +497,10 @@ int git_filter_list__load_ext( size_t idx; git_filter_def *fdef; - if (filter_registry_initialize() < 0) + if (git_rwlock_rdlock(&filter_registry.lock) < 0) { + giterr_set(GITERR_OS, "failed to lock filter registry"); return -1; + } src.repo = repo; src.path = path; @@ -486,7 +510,7 @@ int git_filter_list__load_ext( if (blob) git_oid_cpy(&src.oid, git_blob_id(blob)); - git_vector_foreach(&git__filter_registry->filters, idx, fdef) { + git_vector_foreach(&filter_registry.filters, idx, fdef) { const char **values = NULL; void *payload = NULL; @@ -520,7 +544,7 @@ int git_filter_list__load_ext( else { if (!fl) { if ((error = filter_list_new(&fl, &src)) < 0) - return error; + break; fl->temp_buf = filter_opts->temp_buf; } @@ -534,6 +558,8 @@ int git_filter_list__load_ext( } } + git_rwlock_rdunlock(&filter_registry.lock); + if (error && fl != NULL) { git_array_clear(fl->filters); git__free(fl); @@ -601,20 +627,28 @@ int git_filter_list_push( { int error = 0; size_t pos; - git_filter_def *fdef; + git_filter_def *fdef = NULL; git_filter_entry *fe; assert(fl && filter); + if (git_rwlock_rdlock(&filter_registry.lock) < 0) { + giterr_set(GITERR_OS, "failed to lock filter registry"); + return -1; + } + if (git_vector_search2( - &pos, &git__filter_registry->filters, - filter_def_filter_key_check, filter) < 0) { + &pos, &filter_registry.filters, + filter_def_filter_key_check, filter) == 0) + fdef = git_vector_get(&filter_registry.filters, pos); + + git_rwlock_rdunlock(&filter_registry.lock); + + if (fdef == NULL) { giterr_set(GITERR_FILTER, "Cannot use an unregistered filter"); return -1; } - fdef = git_vector_get(&git__filter_registry->filters, pos); - if (!fdef->initialized && (error = filter_initialize(fdef)) < 0) return error; diff --git a/vendor/libgit2/src/filter.h b/vendor/libgit2/src/filter.h index 5062afba5..9bd835f94 100644 --- a/vendor/libgit2/src/filter.h +++ b/vendor/libgit2/src/filter.h @@ -32,6 +32,8 @@ typedef struct { #define GIT_FILTER_OPTIONS_INIT {0} +extern int git_filter_global_init(void); + extern void git_filter_free(git_filter *filter); extern int git_filter_list__load_ext( diff --git a/vendor/libgit2/src/global.c b/vendor/libgit2/src/global.c index 3f20bfd31..adf353d35 100644 --- a/vendor/libgit2/src/global.c +++ b/vendor/libgit2/src/global.c @@ -8,26 +8,26 @@ #include "global.h" #include "hash.h" #include "sysdir.h" -#include "git2/global.h" -#include "git2/sys/openssl.h" +#include "filter.h" +#include "openssl_stream.h" #include "thread-utils.h" +#include "git2/global.h" +#include "transports/ssh.h" +#if defined(GIT_MSVC_CRTDBG) +#include "win32/w32_stack.h" +#include "win32/w32_crtdbg_stacktrace.h" +#endif git_mutex git__mwindow_mutex; #define MAX_SHUTDOWN_CB 8 -#ifdef GIT_OPENSSL -# include -SSL_CTX *git__ssl_ctx; -# ifdef GIT_THREADS -static git_mutex *openssl_locks; -# endif -#endif - static git_global_shutdown_fn git__shutdown_callbacks[MAX_SHUTDOWN_CB]; static git_atomic git__n_shutdown_callbacks; static git_atomic git__n_inits; +char *git__user_agent; +char *git__ssl_ciphers; void git__on_shutdown(git_global_shutdown_fn callback) { @@ -45,118 +45,50 @@ static void git__global_state_cleanup(git_global_st *st) st->error_t.message = NULL; } -static void git__shutdown(void) -{ - int pos; - - /* Shutdown subsystems that have registered */ - for (pos = git_atomic_get(&git__n_shutdown_callbacks); pos > 0; pos = git_atomic_dec(&git__n_shutdown_callbacks)) { - git_global_shutdown_fn cb = git__swap(git__shutdown_callbacks[pos - 1], NULL); - if (cb != NULL) - cb(); - } -} - -#if defined(GIT_THREADS) && defined(GIT_OPENSSL) -void openssl_locking_function(int mode, int n, const char *file, int line) +static int init_common(void) { - int lock; - - GIT_UNUSED(file); - GIT_UNUSED(line); - - lock = mode & CRYPTO_LOCK; + int ret; - if (lock) { - git_mutex_lock(&openssl_locks[n]); - } else { - git_mutex_unlock(&openssl_locks[n]); - } -} + /* Initialize the CRT debug allocator first, before our first malloc */ +#if defined(GIT_MSVC_CRTDBG) + git_win32__crtdbg_stacktrace_init(); + git_win32__stack_init(); +#endif -static void shutdown_ssl_locking(void) -{ - int num_locks, i; + /* Initialize any other subsystems that have global state */ + if ((ret = git_hash_global_init()) == 0 && + (ret = git_sysdir_global_init()) == 0 && + (ret = git_filter_global_init()) == 0 && + (ret = git_transport_ssh_global_init()) == 0) + ret = git_openssl_stream_global_init(); - num_locks = CRYPTO_num_locks(); - CRYPTO_set_locking_callback(NULL); + GIT_MEMORY_BARRIER; - for (i = 0; i < num_locks; ++i) - git_mutex_free(openssl_locks); - git__free(openssl_locks); + return ret; } -#endif -static void init_ssl(void) +static void shutdown_common(void) { -#ifdef GIT_OPENSSL - long ssl_opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; + int pos; - /* Older OpenSSL and MacOS OpenSSL doesn't have this */ -#ifdef SSL_OP_NO_COMPRESSION - ssl_opts |= SSL_OP_NO_COMPRESSION; -#endif + /* Shutdown subsystems that have registered */ + for (pos = git_atomic_get(&git__n_shutdown_callbacks); + pos > 0; + pos = git_atomic_dec(&git__n_shutdown_callbacks)) { - SSL_load_error_strings(); - OpenSSL_add_ssl_algorithms(); - /* - * Load SSLv{2,3} and TLSv1 so that we can talk with servers - * which use the SSL hellos, which are often used for - * compatibility. We then disable SSL so we only allow OpenSSL - * to speak TLSv1 to perform the encryption itself. - */ - git__ssl_ctx = SSL_CTX_new(SSLv23_method()); - SSL_CTX_set_options(git__ssl_ctx, ssl_opts); - SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY); - SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL); - if (!SSL_CTX_set_default_verify_paths(git__ssl_ctx)) { - SSL_CTX_free(git__ssl_ctx); - git__ssl_ctx = NULL; - } -#endif -} + git_global_shutdown_fn cb = git__swap( + git__shutdown_callbacks[pos - 1], NULL); -/** - * This function aims to clean-up the SSL context which - * we allocated. - */ -static void uninit_ssl(void) -{ -#ifdef GIT_OPENSSL - if (git__ssl_ctx) { - SSL_CTX_free(git__ssl_ctx); - git__ssl_ctx = NULL; + if (cb != NULL) + cb(); } -#endif -} -int git_openssl_set_locking(void) -{ -#ifdef GIT_OPENSSL -# ifdef GIT_THREADS - int num_locks, i; - - num_locks = CRYPTO_num_locks(); - openssl_locks = git__calloc(num_locks, sizeof(git_mutex)); - GITERR_CHECK_ALLOC(openssl_locks); - - for (i = 0; i < num_locks; i++) { - if (git_mutex_init(&openssl_locks[i]) != 0) { - giterr_set(GITERR_SSL, "failed to initialize openssl locks"); - return -1; - } - } + git__free(git__user_agent); + git__free(git__ssl_ciphers); - CRYPTO_set_locking_callback(openssl_locking_function); - git__on_shutdown(shutdown_ssl_locking); - return 0; -# else - giterr_set(GITERR_THREAD, "libgit2 as not built with threads"); - return -1; -# endif -#else - giterr_set(GITERR_SSL, "libgit2 was not built with OpenSSL support"); - return -1; +#if defined(GIT_MSVC_CRTDBG) + git_win32__crtdbg_stacktrace_cleanup(); + git_win32__stack_cleanup(); #endif } @@ -204,14 +136,13 @@ static int synchronized_threads_init(void) int error; _tls_index = TlsAlloc(); + + win32_pthread_initialize(); + if (git_mutex_init(&git__mwindow_mutex)) return -1; - /* Initialize any other subsystems that have global state */ - if ((error = git_hash_global_init()) >= 0) - error = git_sysdir_global_init(); - - win32_pthread_initialize(); + error = init_common(); return error; } @@ -235,17 +166,6 @@ int git_libgit2_init(void) return ret; } -static void synchronized_threads_shutdown(void) -{ - /* Shut down any subsystems that have global state */ - git__shutdown(); - - git__free_tls_data(); - - TlsFree(_tls_index); - git_mutex_free(&git__mwindow_mutex); -} - int git_libgit2_shutdown(void) { int ret; @@ -254,8 +174,14 @@ int git_libgit2_shutdown(void) while (InterlockedCompareExchange(&_mutex, 1, 0)) { Sleep(0); } /* Only do work on a 1 -> 0 transition of the refcount */ - if ((ret = git_atomic_dec(&git__n_inits)) == 0) - synchronized_threads_shutdown(); + if ((ret = git_atomic_dec(&git__n_inits)) == 0) { + shutdown_common(); + + git__free_tls_data(); + + TlsFree(_tls_index); + git_mutex_free(&git__mwindow_mutex); + } /* Exit the lock */ InterlockedExchange(&_mutex, 0); @@ -265,18 +191,19 @@ int git_libgit2_shutdown(void) git_global_st *git__global_state(void) { - void *ptr; + git_global_st *ptr; assert(git_atomic_get(&git__n_inits) > 0); if ((ptr = TlsGetValue(_tls_index)) != NULL) return ptr; - ptr = git__malloc(sizeof(git_global_st)); + ptr = git__calloc(1, sizeof(git_global_st)); if (!ptr) return NULL; - memset(ptr, 0x0, sizeof(git_global_st)); + git_buf_init(&ptr->error_buf, 0); + TlsSetValue(_tls_index, ptr); return ptr; } @@ -297,6 +224,20 @@ void git__free_tls_data(void) TlsSetValue(_tls_index, NULL); } +BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved) +{ + /* This is how Windows lets us know our thread is being shut down */ + if (fdwReason == DLL_THREAD_DETACH) { + git__free_tls_data(); + } + + /* + * Windows pays attention to this during library loading. We don't do anything + * so we trivially succeed. + */ + return TRUE; +} + #elif defined(GIT_THREADS) && defined(_POSIX_THREADS) static pthread_key_t _tls_key; @@ -313,25 +254,18 @@ static void init_once(void) { if ((init_error = git_mutex_init(&git__mwindow_mutex)) != 0) return; - pthread_key_create(&_tls_key, &cb__free_status); - - - /* Initialize any other subsystems that have global state */ - if ((init_error = git_hash_global_init()) >= 0) - init_error = git_sysdir_global_init(); - /* OpenSSL needs to be initialized from the main thread */ - init_ssl(); + pthread_key_create(&_tls_key, &cb__free_status); - GIT_MEMORY_BARRIER; + init_error = init_common(); } int git_libgit2_init(void) { int ret; - pthread_once(&_once_init, init_once); ret = git_atomic_inc(&git__n_inits); + pthread_once(&_once_init, init_once); return init_error ? init_error : ret; } @@ -346,8 +280,7 @@ int git_libgit2_shutdown(void) return ret; /* Shut down any subsystems that have global state */ - git__shutdown(); - uninit_ssl(); + shutdown_common(); ptr = pthread_getspecific(_tls_key); pthread_setspecific(_tls_key, NULL); @@ -364,18 +297,18 @@ int git_libgit2_shutdown(void) git_global_st *git__global_state(void) { - void *ptr; + git_global_st *ptr; assert(git_atomic_get(&git__n_inits) > 0); if ((ptr = pthread_getspecific(_tls_key)) != NULL) return ptr; - ptr = git__malloc(sizeof(git_global_st)); + ptr = git__calloc(1, sizeof(git_global_st)); if (!ptr) return NULL; - memset(ptr, 0x0, sizeof(git_global_st)); + git_buf_init(&ptr->error_buf, 0); pthread_setspecific(_tls_key, ptr); return ptr; } @@ -386,14 +319,16 @@ static git_global_st __state; int git_libgit2_init(void) { - static int ssl_inited = 0; + int ret; - if (!ssl_inited) { - init_ssl(); - ssl_inited = 1; - } + /* Only init SSL the first time */ + if ((ret = git_atomic_inc(&git__n_inits)) != 1) + return ret; - return git_atomic_inc(&git__n_inits); + if ((ret = init_common()) < 0) + return ret; + + return 1; } int git_libgit2_shutdown(void) @@ -401,14 +336,12 @@ int git_libgit2_shutdown(void) int ret; /* Shut down any subsystems that have global state */ - if ((ret = git_atomic_dec(&git__n_inits)) != 0) - return ret; - - git__shutdown(); - git__global_state_cleanup(&__state); - uninit_ssl(); + if ((ret = git_atomic_dec(&git__n_inits)) == 0) { + shutdown_common(); + git__global_state_cleanup(&__state); + } - return 0; + return ret; } git_global_st *git__global_state(void) diff --git a/vendor/libgit2/src/global.h b/vendor/libgit2/src/global.h index fdad6ba89..219951525 100644 --- a/vendor/libgit2/src/global.h +++ b/vendor/libgit2/src/global.h @@ -14,6 +14,7 @@ typedef struct { git_error *last_error; git_error error_t; + git_buf error_buf; char oid_fmt[GIT_OID_HEXSZ+1]; } git_global_st; @@ -34,4 +35,7 @@ extern void git__on_shutdown(git_global_shutdown_fn callback); extern void git__free_tls_data(void); +extern const char *git_libgit2__user_agent(void); +extern const char *git_libgit2__ssl_ciphers(void); + #endif diff --git a/vendor/libgit2/src/idxmap.h b/vendor/libgit2/src/idxmap.h new file mode 100644 index 000000000..4122a89fe --- /dev/null +++ b/vendor/libgit2/src/idxmap.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_idxmap_h__ +#define INCLUDE_idxmap_h__ + +#include +#include "common.h" +#include "git2/index.h" + +#define kmalloc git__malloc +#define kcalloc git__calloc +#define krealloc git__realloc +#define kreallocarray git__reallocarray +#define kfree git__free +#include "khash.h" + +__KHASH_TYPE(idx, const git_index_entry *, git_index_entry *) +__KHASH_TYPE(idxicase, const git_index_entry *, git_index_entry *) + +typedef khash_t(idx) git_idxmap; +typedef khash_t(idxicase) git_idxmap_icase; + +typedef khiter_t git_idxmap_iter; + +/* This is __ac_X31_hash_string but with tolower and it takes the entry's stage into account */ +static kh_inline khint_t idxentry_hash(const git_index_entry *e) +{ + const char *s = e->path; + khint_t h = (khint_t)git__tolower(*s); + if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)git__tolower(*s); + return h + GIT_IDXENTRY_STAGE(e); +} + +#define idxentry_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcmp(a->path, b->path) == 0) +#define idxentry_icase_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0) + +#define GIT__USE_IDXMAP \ + __KHASH_IMPL(idx, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_equal) + +#define GIT__USE_IDXMAP_ICASE \ + __KHASH_IMPL(idxicase, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_icase_equal) + +#define git_idxmap_alloc(hp) \ + ((*(hp) = kh_init(idx)) == NULL) ? giterr_set_oom(), -1 : 0 + +#define git_idxmap_icase_alloc(hp) \ + ((*(hp) = kh_init(idxicase)) == NULL) ? giterr_set_oom(), -1 : 0 + +#define git_idxmap_insert(h, key, val, rval) do { \ + khiter_t __pos = kh_put(idx, h, key, &rval); \ + if (rval >= 0) { \ + if (rval == 0) kh_key(h, __pos) = key; \ + kh_val(h, __pos) = val; \ + } } while (0) + +#define git_idxmap_icase_insert(h, key, val, rval) do { \ + khiter_t __pos = kh_put(idxicase, h, key, &rval); \ + if (rval >= 0) { \ + if (rval == 0) kh_key(h, __pos) = key; \ + kh_val(h, __pos) = val; \ + } } while (0) + +#define git_idxmap_lookup_index(h, k) kh_get(idx, h, k) +#define git_idxmap_icase_lookup_index(h, k) kh_get(idxicase, h, k) +#define git_idxmap_value_at(h, idx) kh_val(h, idx) +#define git_idxmap_valid_index(h, idx) (idx != kh_end(h)) +#define git_idxmap_has_data(h, idx) kh_exist(h, idx) + +#define git_idxmap_resize(h,s) kh_resize(idx, h, s) +#define git_idxmap_free(h) kh_destroy(idx, h), h = NULL +#define git_idxmap_clear(h) kh_clear(idx, h) + +#define git_idxmap_delete_at(h, id) kh_del(idx, h, id) +#define git_idxmap_icase_delete_at(h, id) kh_del(idxicase, h, id) + +#define git_idxmap_delete(h, key) do { \ + khiter_t __pos = git_idxmap_lookup_index(h, key); \ + if (git_idxmap_valid_index(h, __pos)) \ + git_idxmap_delete_at(h, __pos); } while (0) + +#define git_idxmap_icase_delete(h, key) do { \ + khiter_t __pos = git_idxmap_icase_lookup_index(h, key); \ + if (git_idxmap_valid_index(h, __pos)) \ + git_idxmap_icase_delete_at(h, __pos); } while (0) + +#define git_idxmap_begin kh_begin +#define git_idxmap_end kh_end + +#endif diff --git a/vendor/libgit2/src/ignore.c b/vendor/libgit2/src/ignore.c index 0031e4696..ac2af4f58 100644 --- a/vendor/libgit2/src/ignore.c +++ b/vendor/libgit2/src/ignore.c @@ -89,18 +89,20 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match } /* - * If we're dealing with a directory (which we know via the - * strchr() check) we want to use 'dirname/' as the - * pattern so p_fnmatch() honours FNM_PATHNAME + * When dealing with a directory, we add '/' so + * p_fnmatch() honours FNM_PATHNAME. Checking for LEADINGDIR + * alone isn't enough as that's also set for nagations, so we + * need to check that NEGATIVE is off. */ git_buf_clear(&buf); if (rule->containing_dir) { git_buf_puts(&buf, rule->containing_dir); } - if (!strchr(rule->pattern, '*')) - error = git_buf_printf(&buf, "%s/*", rule->pattern); - else - error = git_buf_puts(&buf, rule->pattern); + + error = git_buf_puts(&buf, rule->pattern); + + if ((rule->flags & (GIT_ATTR_FNMATCH_LEADINGDIR | GIT_ATTR_FNMATCH_NEGATIVE)) == GIT_ATTR_FNMATCH_LEADINGDIR) + error = git_buf_PUTS(&buf, "/*"); if (error < 0) goto out; @@ -261,10 +263,18 @@ int git_ignore__for_path( goto cleanup; /* given a unrooted path in a non-bare repo, resolve it */ - if (workdir && git_path_root(path) < 0) - error = git_path_find_dir(&ignores->dir, path, workdir); - else + if (workdir && git_path_root(path) < 0) { + git_buf local = GIT_BUF_INIT; + + if ((error = git_path_dirname_r(&local, path)) < 0 || + (error = git_path_resolve_relative(&local, 0)) < 0 || + (error = git_path_to_dir(&local)) < 0 || + (error = git_buf_joinpath(&ignores->dir, workdir, local.ptr)) < 0) + {;} /* Nothing, we just want to stop on the first error */ + git_buf_free(&local); + } else { error = git_buf_joinpath(&ignores->dir, path, ""); + } if (error < 0) goto cleanup; diff --git a/vendor/libgit2/src/index.c b/vendor/libgit2/src/index.c index cb5902ea9..63e47965a 100644 --- a/vendor/libgit2/src/index.c +++ b/vendor/libgit2/src/index.c @@ -17,6 +17,8 @@ #include "pathspec.h" #include "ignore.h" #include "blob.h" +#include "idxmap.h" +#include "diff.h" #include "git2/odb.h" #include "git2/oid.h" @@ -24,6 +26,32 @@ #include "git2/config.h" #include "git2/sys/index.h" +GIT__USE_IDXMAP +GIT__USE_IDXMAP_ICASE + +#define INSERT_IN_MAP_EX(idx, map, e, err) do { \ + if ((idx)->ignore_case) \ + git_idxmap_icase_insert((khash_t(idxicase) *) (map), (e), (e), (err)); \ + else \ + git_idxmap_insert((map), (e), (e), (err)); \ + } while (0) + +#define INSERT_IN_MAP(idx, e, err) INSERT_IN_MAP_EX(idx, (idx)->entries_map, e, err) + +#define LOOKUP_IN_MAP(p, idx, k) do { \ + if ((idx)->ignore_case) \ + (p) = git_idxmap_icase_lookup_index((khash_t(idxicase) *) index->entries_map, (k)); \ + else \ + (p) = git_idxmap_lookup_index(index->entries_map, (k)); \ + } while (0) + +#define DELETE_IN_MAP(idx, e) do { \ + if ((idx)->ignore_case) \ + git_idxmap_icase_delete((khash_t(idxicase) *) (idx)->entries_map, (e)); \ + else \ + git_idxmap_delete((idx)->entries_map, (e)); \ + } while (0) + static int index_apply_to_wd_diff(git_index *index, int action, const git_strarray *paths, unsigned int flags, git_index_matched_path_cb cb, void *payload); @@ -328,28 +356,6 @@ static unsigned int index_merge_mode( return git_index__create_mode(mode); } -static int index_sort_if_needed(git_index *index, bool need_lock) -{ - /* not truly threadsafe because between when this checks and/or - * sorts the array another thread could come in and unsort it - */ - - if (git_vector_is_sorted(&index->entries)) - return 0; - - if (need_lock && git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Unable to lock index"); - return -1; - } - - git_vector_sort(&index->entries); - - if (need_lock) - git_mutex_unlock(&index->lock); - - return 0; -} - GIT_INLINE(int) index_find_in_entries( size_t *out, git_vector *entries, git_vector_cmp entry_srch, const char *path, size_t path_len, int stage) @@ -363,10 +369,9 @@ GIT_INLINE(int) index_find_in_entries( GIT_INLINE(int) index_find( size_t *out, git_index *index, - const char *path, size_t path_len, int stage, bool need_lock) + const char *path, size_t path_len, int stage) { - if (index_sort_if_needed(index, need_lock) < 0) - return -1; + git_vector_sort(&index->entries); return index_find_in_entries( out, &index->entries, index->entries_search, path, path_len, stage); @@ -390,7 +395,7 @@ void git_index__set_ignore_case(git_index *index, bool ignore_case) git_vector_set_cmp(&index->entries, ignore_case ? git_index_entry_icmp : git_index_entry_cmp); - index_sort_if_needed(index, true); + git_vector_sort(&index->entries); git_vector_set_cmp(&index->reuc, ignore_case ? reuc_icmp : reuc_cmp); git_vector_sort(&index->reuc); @@ -406,13 +411,7 @@ int git_index_open(git_index **index_out, const char *index_path) index = git__calloc(1, sizeof(git_index)); GITERR_CHECK_ALLOC(index); - if (git_mutex_init(&index->lock)) { - giterr_set(GITERR_OS, "Failed to initialize lock"); - git__free(index); - return -1; - } - - git_pool_init(&index->tree_pool, 1, 0); + git_pool_init(&index->tree_pool, 1); if (index_path != NULL) { index->index_file_path = git__strdup(index_path); @@ -425,6 +424,7 @@ int git_index_open(git_index **index_out, const char *index_path) } if (git_vector_init(&index->entries, 32, git_index_entry_cmp) < 0 || + git_idxmap_alloc(&index->entries_map) < 0 || git_vector_init(&index->names, 8, conflict_name_cmp) < 0 || git_vector_init(&index->reuc, 8, reuc_cmp) < 0 || git_vector_init(&index->deleted, 8, git_index_entry_cmp) < 0) @@ -462,13 +462,13 @@ static void index_free(git_index *index) assert(!git_atomic_get(&index->readers)); git_index_clear(index); + git_idxmap_free(index->entries_map); git_vector_free(&index->entries); git_vector_free(&index->names); git_vector_free(&index->reuc); git_vector_free(&index->deleted); git__free(index->index_file_path); - git_mutex_free(&index->lock); git__memzero(index, sizeof(*index)); git__free(index); @@ -508,6 +508,7 @@ static int index_remove_entry(git_index *index, size_t pos) if (entry != NULL) git_tree_cache_invalidate_path(index->tree, entry->path); + DELETE_IN_MAP(index, entry); error = git_vector_remove(&index->entries, pos); if (!error) { @@ -530,11 +531,7 @@ int git_index_clear(git_index *index) index->tree = NULL; git_pool_clear(&index->tree_pool); - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } - + git_idxmap_clear(index->entries_map); while (!error && index->entries.length > 0) error = index_remove_entry(index, index->entries.length - 1); index_free_deleted(index); @@ -544,8 +541,6 @@ int git_index_clear(git_index *index) git_futils_filestamp_set(&index->stamp, NULL); - git_mutex_unlock(&index->lock); - return error; } @@ -608,14 +603,14 @@ const git_oid *git_index_checksum(git_index *index) */ static int compare_checksum(git_index *index) { - int fd, error; + int fd; ssize_t bytes_read; git_oid checksum = {{ 0 }}; if ((fd = p_open(index->index_file_path, O_RDONLY)) < 0) return fd; - if ((error = p_lseek(fd, -20, SEEK_END)) < 0) { + if (p_lseek(fd, -20, SEEK_END) < 0) { p_close(fd); giterr_set(GITERR_OS, "failed to seek to end of file"); return -1; @@ -688,18 +683,13 @@ int git_index__changed_relative_to( return !!git_oid_cmp(&index->checksum, checksum); } -static bool is_racy_timestamp(git_time_t stamp, git_index_entry *entry) +static bool is_racy_entry(git_index *index, const git_index_entry *entry) { /* Git special-cases submodules in the check */ if (S_ISGITLINK(entry->mode)) return false; - /* If we never read the index, we can't have this race either */ - if (stamp == 0) - return false; - - /* If the timestamp is the same or newer than the index, it's racy */ - return ((int32_t) stamp) <= entry->mtime.seconds; + return git_index_entry_newer_than_index(entry, index); } /* @@ -711,9 +701,10 @@ static int truncate_racily_clean(git_index *index) size_t i; int error; git_index_entry *entry; - git_time_t ts = index->stamp.mtime; git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; - git_diff *diff; + git_diff *diff = NULL; + git_vector paths = GIT_VECTOR_INIT; + git_diff_delta *delta; /* Nothing to do if there's no repo to talk about */ if (!INDEX_OWNER(index)) @@ -725,21 +716,33 @@ static int truncate_racily_clean(git_index *index) diff_opts.flags |= GIT_DIFF_INCLUDE_TYPECHANGE | GIT_DIFF_IGNORE_SUBMODULES | GIT_DIFF_DISABLE_PATHSPEC_MATCH; git_vector_foreach(&index->entries, i, entry) { - if (!is_racy_timestamp(ts, entry)) - continue; + if ((entry->flags_extended & GIT_IDXENTRY_UPTODATE) == 0 && + is_racy_entry(index, entry)) + git_vector_insert(&paths, (char *)entry->path); + } - diff_opts.pathspec.count = 1; - diff_opts.pathspec.strings = (char **) &entry->path; + if (paths.length == 0) + goto done; - if ((error = git_diff_index_to_workdir(&diff, INDEX_OWNER(index), index, &diff_opts)) < 0) - return error; + diff_opts.pathspec.count = paths.length; + diff_opts.pathspec.strings = (char **)paths.contents; - if (git_diff_num_deltas(diff) > 0) - entry->file_size = 0; + if ((error = git_diff_index_to_workdir(&diff, INDEX_OWNER(index), index, &diff_opts)) < 0) + return error; + + git_vector_foreach(&diff->deltas, i, delta) { + entry = (git_index_entry *)git_index_get_bypath(index, delta->old_file.path, 0); - git_diff_free(diff); + /* Ensure that we have a stage 0 for this file (ie, it's not a + * conflict), otherwise smudging it is quite pointless. + */ + if (entry) + entry->file_size = 0; } +done: + git_diff_free(diff); + git_vector_free(&paths); return 0; } @@ -796,53 +799,85 @@ const git_index_entry *git_index_get_byindex( git_index *index, size_t n) { assert(index); - if (index_sort_if_needed(index, true) < 0) - return NULL; + git_vector_sort(&index->entries); return git_vector_get(&index->entries, n); } const git_index_entry *git_index_get_bypath( git_index *index, const char *path, int stage) { - size_t pos; + khiter_t pos; + git_index_entry key = {{ 0 }}; assert(index); - if (index_find(&pos, index, path, 0, stage, true) < 0) { - giterr_set(GITERR_INDEX, "Index does not contain %s", path); - return NULL; - } + key.path = path; + GIT_IDXENTRY_STAGE_SET(&key, stage); + + LOOKUP_IN_MAP(pos, index, &key); - return git_index_get_byindex(index, pos); + if (git_idxmap_valid_index(index->entries_map, pos)) + return git_idxmap_value_at(index->entries_map, pos); + + giterr_set(GITERR_INDEX, "Index does not contain %s", path); + return NULL; } void git_index_entry__init_from_stat( git_index_entry *entry, struct stat *st, bool trust_mode) { - entry->ctime.seconds = (git_time_t)st->st_ctime; - entry->mtime.seconds = (git_time_t)st->st_mtime; - /* entry->mtime.nanoseconds = st->st_mtimensec; */ - /* entry->ctime.nanoseconds = st->st_ctimensec; */ + entry->ctime.seconds = (int32_t)st->st_ctime; + entry->mtime.seconds = (int32_t)st->st_mtime; +#if defined(GIT_USE_NSEC) + entry->mtime.nanoseconds = st->st_mtime_nsec; + entry->ctime.nanoseconds = st->st_ctime_nsec; +#endif entry->dev = st->st_rdev; entry->ino = st->st_ino; entry->mode = (!trust_mode && S_ISREG(st->st_mode)) ? git_index__create_mode(0666) : git_index__create_mode(st->st_mode); entry->uid = st->st_uid; entry->gid = st->st_gid; - entry->file_size = st->st_size; + entry->file_size = (uint32_t)st->st_size; +} + +static void index_entry_adjust_namemask( + git_index_entry *entry, + size_t path_length) +{ + entry->flags &= ~GIT_IDXENTRY_NAMEMASK; + + if (path_length < GIT_IDXENTRY_NAMEMASK) + entry->flags |= path_length & GIT_IDXENTRY_NAMEMASK; + else + entry->flags |= GIT_IDXENTRY_NAMEMASK; } +/* When `from_workdir` is true, we will validate the paths to avoid placing + * paths that are invalid for the working directory on the current filesystem + * (eg, on Windows, we will disallow `GIT~1`, `AUX`, `COM1`, etc). This + * function will *always* prevent `.git` and directory traversal `../` from + * being added to the index. + */ static int index_entry_create( git_index_entry **out, git_repository *repo, - const char *path) + const char *path, + bool from_workdir) { size_t pathlen = strlen(path), alloclen; struct entry_internal *entry; + unsigned int path_valid_flags = GIT_PATH_REJECT_INDEX_DEFAULTS; + + /* always reject placing `.git` in the index and directory traversal. + * when requested, disallow platform-specific filenames and upgrade to + * the platform-specific `.git` tests (eg, `git~1`, etc). + */ + if (from_workdir) + path_valid_flags |= GIT_PATH_REJECT_WORKDIR_DEFAULTS; - if (!git_path_isvalid(repo, path, - GIT_PATH_REJECT_DEFAULTS | GIT_PATH_REJECT_DOT_GIT)) { - giterr_set(GITERR_INDEX, "Invalid path: '%s'", path); + if (!git_path_isvalid(repo, path, path_valid_flags)) { + giterr_set(GITERR_INDEX, "invalid path: '%s'", path); return -1; } @@ -874,7 +909,7 @@ static int index_entry_init( "Could not initialize index entry. " "Index is not backed up by an existing repository."); - if (index_entry_create(&entry, INDEX_OWNER(index), rel_path) < 0) + if (index_entry_create(&entry, INDEX_OWNER(index), rel_path, true) < 0) return -1; /* write the blob to disk and get the oid and stat info */ @@ -928,42 +963,64 @@ static int index_entry_reuc_init(git_index_reuc_entry **reuc_out, *reuc_out = reuc = reuc_entry_alloc(path); GITERR_CHECK_ALLOC(reuc); - if ((reuc->mode[0] = ancestor_mode) > 0) + if ((reuc->mode[0] = ancestor_mode) > 0) { + assert(ancestor_oid); git_oid_cpy(&reuc->oid[0], ancestor_oid); + } - if ((reuc->mode[1] = our_mode) > 0) + if ((reuc->mode[1] = our_mode) > 0) { + assert(our_oid); git_oid_cpy(&reuc->oid[1], our_oid); + } - if ((reuc->mode[2] = their_mode) > 0) + if ((reuc->mode[2] = their_mode) > 0) { + assert(their_oid); git_oid_cpy(&reuc->oid[2], their_oid); + } return 0; } -static void index_entry_cpy(git_index_entry *tgt, const git_index_entry *src) +static void index_entry_cpy( + git_index_entry *tgt, + const git_index_entry *src) { const char *tgt_path = tgt->path; memcpy(tgt, src, sizeof(*tgt)); - tgt->path = tgt_path; /* reset to existing path data */ + tgt->path = tgt_path; } static int index_entry_dup( git_index_entry **out, - git_repository *repo, + git_index *index, const git_index_entry *src) { - git_index_entry *entry; + if (index_entry_create(out, INDEX_OWNER(index), src->path, false) < 0) + return -1; - if (!src) { - *out = NULL; - return 0; - } + index_entry_cpy(*out, src); + return 0; +} + +static void index_entry_cpy_nocache( + git_index_entry *tgt, + const git_index_entry *src) +{ + git_oid_cpy(&tgt->id, &src->id); + tgt->mode = src->mode; + tgt->flags = src->flags; + tgt->flags_extended = (src->flags_extended & GIT_IDXENTRY_EXTENDED_FLAGS); +} - if (index_entry_create(&entry, repo, src->path) < 0) +static int index_entry_dup_nocache( + git_index_entry **out, + git_index *index, + const git_index_entry *src) +{ + if (index_entry_create(out, INDEX_OWNER(index), src->path, false) < 0) return -1; - index_entry_cpy(entry, src); - *out = entry; + index_entry_cpy_nocache(*out, src); return 0; } @@ -1019,7 +1076,7 @@ static int has_dir_name(git_index *index, } len = slash - name; - if (!index_find(&pos, index, name, len, stage, false)) { + if (!index_find(&pos, index, name, len, stage)) { retval = -1; if (!ok_to_replace) break; @@ -1065,6 +1122,76 @@ static int check_file_directory_collision(git_index *index, return 0; } +static int canonicalize_directory_path( + git_index *index, + git_index_entry *entry, + git_index_entry *existing) +{ + const git_index_entry *match, *best = NULL; + char *search, *sep; + size_t pos, search_len, best_len; + + if (!index->ignore_case) + return 0; + + /* item already exists in the index, simply re-use the existing case */ + if (existing) { + memcpy((char *)entry->path, existing->path, strlen(existing->path)); + return 0; + } + + /* nothing to do */ + if (strchr(entry->path, '/') == NULL) + return 0; + + if ((search = git__strdup(entry->path)) == NULL) + return -1; + + /* starting at the parent directory and descending to the root, find the + * common parent directory. + */ + while (!best && (sep = strrchr(search, '/'))) { + sep[1] = '\0'; + + search_len = strlen(search); + + git_vector_bsearch2( + &pos, &index->entries, index->entries_search_path, search); + + while ((match = git_vector_get(&index->entries, pos))) { + if (GIT_IDXENTRY_STAGE(match) != 0) { + /* conflicts do not contribute to canonical paths */ + } else if (strncmp(search, match->path, search_len) == 0) { + /* prefer an exact match to the input filename */ + best = match; + best_len = search_len; + break; + } else if (strncasecmp(search, match->path, search_len) == 0) { + /* continue walking, there may be a path with an exact + * (case sensitive) match later in the index, but use this + * as the best match until that happens. + */ + if (!best) { + best = match; + best_len = search_len; + } + } else { + break; + } + + pos++; + } + + sep[0] = '\0'; + } + + if (best) + memcpy((char *)entry->path, best->path, best_len); + + git__free(search); + return 0; +} + static int index_no_dups(void **old, void *new) { const git_index_entry *entry = new; @@ -1074,18 +1201,76 @@ static int index_no_dups(void **old, void *new) return GIT_EEXISTS; } +static void index_existing_and_best( + git_index_entry **existing, + size_t *existing_position, + git_index_entry **best, + git_index *index, + const git_index_entry *entry) +{ + git_index_entry *e; + size_t pos; + int error; + + error = index_find(&pos, + index, entry->path, 0, GIT_IDXENTRY_STAGE(entry)); + + if (error == 0) { + *existing = index->entries.contents[pos]; + *existing_position = pos; + *best = index->entries.contents[pos]; + return; + } + + *existing = NULL; + *existing_position = 0; + *best = NULL; + + if (GIT_IDXENTRY_STAGE(entry) == 0) { + for (; pos < index->entries.length; pos++) { + int (*strcomp)(const char *a, const char *b) = + index->ignore_case ? git__strcasecmp : git__strcmp; + + e = index->entries.contents[pos]; + + if (strcomp(entry->path, e->path) != 0) + break; + + if (GIT_IDXENTRY_STAGE(e) == GIT_INDEX_STAGE_ANCESTOR) { + *best = e; + continue; + } else { + *best = e; + break; + } + } + } +} + /* index_insert takes ownership of the new entry - if it can't insert * it, then it will return an error **and also free the entry**. When * it replaces an existing entry, it will update the entry_ptr with the * actual entry in the index (and free the passed in one). + * + * trust_path is whether we use the given path, or whether (on case + * insensitive systems only) we try to canonicalize the given path to + * be within an existing directory. + * * trust_mode is whether we trust the mode in entry_ptr. + * + * trust_id is whether we trust the id or it should be validated. */ static int index_insert( - git_index *index, git_index_entry **entry_ptr, int replace, bool trust_mode) + git_index *index, + git_index_entry **entry_ptr, + int replace, + bool trust_path, + bool trust_mode, + bool trust_id) { int error = 0; size_t path_length, position; - git_index_entry *existing = NULL, *entry; + git_index_entry *existing, *best, *entry; assert(index && entry_ptr); @@ -1093,34 +1278,40 @@ static int index_insert( /* make sure that the path length flag is correct */ path_length = ((struct entry_internal *)entry)->pathlen; + index_entry_adjust_namemask(entry, path_length); - entry->flags &= ~GIT_IDXENTRY_NAMEMASK; + /* this entry is now up-to-date and should not be checked for raciness */ + entry->flags_extended |= GIT_IDXENTRY_UPTODATE; - if (path_length < GIT_IDXENTRY_NAMEMASK) - entry->flags |= path_length & GIT_IDXENTRY_NAMEMASK; - else - entry->flags |= GIT_IDXENTRY_NAMEMASK; + git_vector_sort(&index->entries); - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire index lock"); - return -1; - } + /* look if an entry with this path already exists, either staged, or (if + * this entry is a regular staged item) as the "ours" side of a conflict. + */ + index_existing_and_best(&existing, &position, &best, index, entry); - git_vector_sort(&index->entries); + /* update the file mode */ + entry->mode = trust_mode ? + git_index__create_mode(entry->mode) : + index_merge_mode(index, best, entry->mode); - /* look if an entry with this path already exists */ - if (!index_find( - &position, index, entry->path, 0, GIT_IDXENTRY_STAGE(entry), false)) { - existing = index->entries.contents[position]; - /* update filemode to existing values if stat is not trusted */ - if (trust_mode) - entry->mode = git_index__create_mode(entry->mode); - else - entry->mode = index_merge_mode(index, existing, entry->mode); + /* canonicalize the directory name */ + if (!trust_path) + error = canonicalize_directory_path(index, entry, best); + + /* ensure that the given id exists (unless it's a submodule) */ + if (!error && !trust_id && INDEX_OWNER(index) && + (entry->mode & GIT_FILEMODE_COMMIT) != GIT_FILEMODE_COMMIT) { + + if (!git_object__is_valid(INDEX_OWNER(index), &entry->id, + git_object__type_from_filemode(entry->mode))) + error = -1; } /* look for tree / blob name collisions, removing conflicts if requested */ - error = check_file_directory_collision(index, entry, position, replace); + if (!error) + error = check_file_directory_collision(index, entry, position, replace); + if (error < 0) /* skip changes */; @@ -1128,8 +1319,13 @@ static int index_insert( * and return it in place of the passed in one. */ else if (existing) { - if (replace) + if (replace) { index_entry_cpy(existing, entry); + + if (trust_path) + memcpy((char *)existing->path, entry->path, strlen(entry->path)); + } + index_entry_free(entry); *entry_ptr = entry = existing; } @@ -1139,6 +1335,10 @@ static int index_insert( * check for dups, this is actually cheaper in the long run.) */ error = git_vector_insert_sorted(&index->entries, entry, index_no_dups); + + if (error == 0) { + INSERT_IN_MAP(index, entry, error); + } } if (error < 0) { @@ -1146,8 +1346,6 @@ static int index_insert( *entry_ptr = NULL; } - git_mutex_unlock(&index->lock); - return error; } @@ -1205,7 +1403,7 @@ int git_index_add_frombuffer( return -1; } - if (index_entry_dup(&entry, INDEX_OWNER(index), source_entry) < 0) + if (index_entry_dup(&entry, index, source_entry) < 0) return -1; error = git_blob_create_frombuffer(&id, INDEX_OWNER(index), buffer, len); @@ -1217,7 +1415,7 @@ int git_index_add_frombuffer( git_oid_cpy(&entry->id, &id); entry->file_size = len; - if ((error = index_insert(index, &entry, 1, true)) < 0) + if ((error = index_insert(index, &entry, 1, true, true, true)) < 0) return error; /* Adding implies conflict was resolved, move conflict entries to REUC */ @@ -1238,7 +1436,7 @@ static int add_repo_as_submodule(git_index_entry **out, git_index *index, const struct stat st; int error; - if (index_entry_create(&entry, INDEX_OWNER(index), path) < 0) + if (index_entry_create(&entry, INDEX_OWNER(index), path, true) < 0) return -1; if ((error = git_buf_joinpath(&abspath, git_repository_workdir(repo), path)) < 0) @@ -1276,7 +1474,7 @@ int git_index_add_bypath(git_index *index, const char *path) assert(index && path); if ((ret = index_entry_init(&entry, index, path)) == 0) - ret = index_insert(index, &entry, 1, false); + ret = index_insert(index, &entry, 1, false, false, true); /* If we were given a directory, let's see if it's a submodule */ if (ret < 0 && ret != GIT_EDIRECTORY) @@ -1286,13 +1484,13 @@ int git_index_add_bypath(git_index *index, const char *path) git_submodule *sm; git_error_state err; - giterr_capture(&err, ret); + giterr_state_capture(&err, ret); ret = git_submodule_lookup(&sm, INDEX_OWNER(index), path); if (ret == GIT_ENOTFOUND) - return giterr_restore(&err); + return giterr_state_restore(&err); - git__free(err.error_msg.message); + giterr_state_free(&err); /* * EEXISTS means that there is a repository at that path, but it's not known @@ -1302,7 +1500,7 @@ int git_index_add_bypath(git_index *index, const char *path) if ((ret = add_repo_as_submodule(&entry, index, path)) < 0) return ret; - if ((ret = index_insert(index, &entry, 1, false)) < 0) + if ((ret = index_insert(index, &entry, 1, false, false, true)) < 0) return ret; } else if (ret < 0) { return ret; @@ -1339,6 +1537,44 @@ int git_index_remove_bypath(git_index *index, const char *path) return 0; } +int git_index__fill(git_index *index, const git_vector *source_entries) +{ + const git_index_entry *source_entry = NULL; + size_t i; + int ret = 0; + + assert(index); + + if (!source_entries->length) + return 0; + + git_vector_size_hint(&index->entries, source_entries->length); + git_idxmap_resize(index->entries_map, (khint_t)(source_entries->length * 1.3)); + + git_vector_foreach(source_entries, i, source_entry) { + git_index_entry *entry = NULL; + + if ((ret = index_entry_dup(&entry, index, source_entry)) < 0) + break; + + index_entry_adjust_namemask(entry, ((struct entry_internal *)entry)->pathlen); + entry->flags_extended |= GIT_IDXENTRY_UPTODATE; + entry->mode = git_index__create_mode(entry->mode); + + if ((ret = git_vector_insert(&index->entries, entry)) < 0) + break; + + INSERT_IN_MAP(index, entry, ret); + if (ret < 0) + break; + } + + if (!ret) + git_vector_sort(&index->entries); + + return ret; +} + int git_index_add(git_index *index, const git_index_entry *source_entry) { @@ -1352,8 +1588,8 @@ int git_index_add(git_index *index, const git_index_entry *source_entry) return -1; } - if ((ret = index_entry_dup(&entry, INDEX_OWNER(index), source_entry)) < 0 || - (ret = index_insert(index, &entry, 1, true)) < 0) + if ((ret = index_entry_dup(&entry, index, source_entry)) < 0 || + (ret = index_insert(index, &entry, 1, true, true, false)) < 0) return ret; git_tree_cache_invalidate_path(index->tree, entry->path); @@ -1364,13 +1600,14 @@ int git_index_remove(git_index *index, const char *path, int stage) { int error; size_t position; + git_index_entry remove_key = {{ 0 }}; - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } + remove_key.path = path; + GIT_IDXENTRY_STAGE_SET(&remove_key, stage); - if (index_find(&position, index, path, 0, stage, false) < 0) { + DELETE_IN_MAP(index, &remove_key); + + if (index_find(&position, index, path, 0, stage) < 0) { giterr_set( GITERR_INDEX, "Index does not contain %s at stage %d", path, stage); error = GIT_ENOTFOUND; @@ -1378,7 +1615,6 @@ int git_index_remove(git_index *index, const char *path, int stage) error = index_remove_entry(index, position); } - git_mutex_unlock(&index->lock); return error; } @@ -1389,14 +1625,9 @@ int git_index_remove_directory(git_index *index, const char *dir, int stage) size_t pos; git_index_entry *entry; - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } - if (!(error = git_buf_sets(&pfx, dir)) && !(error = git_path_to_dir(&pfx))) - index_find(&pos, index, pfx.ptr, pfx.size, GIT_INDEX_STAGE_ANY, false); + index_find(&pos, index, pfx.ptr, pfx.size, GIT_INDEX_STAGE_ANY); while (!error) { entry = git_vector_get(&index->entries, pos); @@ -1413,17 +1644,33 @@ int git_index_remove_directory(git_index *index, const char *dir, int stage) /* removed entry at 'pos' so we don't need to increment */ } - git_mutex_unlock(&index->lock); git_buf_free(&pfx); return error; } +int git_index_find_prefix(size_t *at_pos, git_index *index, const char *prefix) +{ + int error = 0; + size_t pos; + const git_index_entry *entry; + + index_find(&pos, index, prefix, strlen(prefix), GIT_INDEX_STAGE_ANY); + entry = git_vector_get(&index->entries, pos); + if (!entry || git__prefixcmp(entry->path, prefix) != 0) + error = GIT_ENOTFOUND; + + if (!error && at_pos) + *at_pos = pos; + + return error; +} + int git_index__find_pos( size_t *out, git_index *index, const char *path, size_t path_len, int stage) { assert(index && path); - return index_find(out, index, path, path_len, stage, true); + return index_find(out, index, path, path_len, stage); } int git_index_find(size_t *at_pos, git_index *index, const char *path) @@ -1432,14 +1679,8 @@ int git_index_find(size_t *at_pos, git_index *index, const char *path) assert(index && path); - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } - if (git_vector_bsearch2( &pos, &index->entries, index->entries_search_path, path) < 0) { - git_mutex_unlock(&index->lock); giterr_set(GITERR_INDEX, "Index does not contain %s", path); return GIT_ENOTFOUND; } @@ -1457,7 +1698,6 @@ int git_index_find(size_t *at_pos, git_index *index, const char *path) if (at_pos) *at_pos = pos; - git_mutex_unlock(&index->lock); return 0; } @@ -1472,16 +1712,19 @@ int git_index_conflict_add(git_index *index, assert (index); - if ((ret = index_entry_dup(&entries[0], INDEX_OWNER(index), ancestor_entry)) < 0 || - (ret = index_entry_dup(&entries[1], INDEX_OWNER(index), our_entry)) < 0 || - (ret = index_entry_dup(&entries[2], INDEX_OWNER(index), their_entry)) < 0) + if ((ancestor_entry && + (ret = index_entry_dup(&entries[0], index, ancestor_entry)) < 0) || + (our_entry && + (ret = index_entry_dup(&entries[1], index, our_entry)) < 0) || + (their_entry && + (ret = index_entry_dup(&entries[2], index, their_entry)) < 0)) goto on_error; /* Validate entries */ for (i = 0; i < 3; i++) { if (entries[i] && !valid_filemode(entries[i]->mode)) { giterr_set(GITERR_INDEX, "invalid filemode for stage %d entry", - i); + i + 1); return -1; } } @@ -1508,7 +1751,7 @@ int git_index_conflict_add(git_index *index, /* Make sure stage is correct */ GIT_IDXENTRY_STAGE_SET(entries[i], i + 1); - if ((ret = index_insert(index, &entries[i], 0, true)) < 0) + if ((ret = index_insert(index, &entries[i], 1, true, true, false)) < 0) goto on_error; entries[i] = NULL; /* don't free if later entry fails */ @@ -1610,11 +1853,6 @@ static int index_conflict_remove(git_index *index, const char *path) if (path != NULL && git_index_find(&pos, index, path) < 0) return GIT_ENOTFOUND; - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Unable to lock index"); - return -1; - } - while ((conflict_entry = git_vector_get(&index->entries, pos)) != NULL) { if (path != NULL && @@ -1630,8 +1868,6 @@ static int index_conflict_remove(git_index *index, const char *path) break; } - git_mutex_unlock(&index->lock); - return error; } @@ -1919,11 +2155,11 @@ static int read_reuc(git_index *index, const char *buffer, size_t size) /* read 3 ASCII octal numbers for stage entries */ for (i = 0; i < 3; i++) { - int tmp; + int64_t tmp; - if (git__strtol32(&tmp, buffer, &endptr, 8) < 0 || + if (git__strtol64(&tmp, buffer, &endptr, 8) < 0 || !endptr || endptr == buffer || *endptr || - (unsigned)tmp > UINT_MAX) { + tmp < 0) { index_entry_reuc_free(lost); return index_error_invalid("reading reuc entry stage"); } @@ -1977,9 +2213,10 @@ static int read_conflict_names(git_index *index, const char *buffer, size_t size #define read_conflict_name(ptr) \ len = p_strnlen(buffer, size) + 1; \ - if (size < len) \ - return index_error_invalid("reading conflict name entries"); \ - \ + if (size < len) { \ + index_error_invalid("reading conflict name entries"); \ + goto out_err; \ + } \ if (len == 1) \ ptr = NULL; \ else { \ @@ -2000,7 +2237,16 @@ static int read_conflict_names(git_index *index, const char *buffer, size_t size read_conflict_name(conflict_name->theirs); if (git_vector_insert(&index->names, conflict_name) < 0) - return -1; + goto out_err; + + continue; + +out_err: + git__free(conflict_name->ancestor); + git__free(conflict_name->ours); + git__free(conflict_name->theirs); + git__free(conflict_name); + return -1; } #undef read_conflict_name @@ -2079,7 +2325,7 @@ static size_t read_entry( entry.path = (char *)path_ptr; - if (index_entry_dup(out, INDEX_OWNER(index), &entry) < 0) + if (index_entry_dup(out, index, &entry) < 0) return 0; return entry_size; @@ -2170,13 +2416,13 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size) seek_forward(INDEX_HEADER_SIZE); - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire index lock"); - return -1; - } - assert(!index->entries.length); + if (index->ignore_case) + kh_resize(idxicase, (khash_t(idxicase) *) index->entries_map, header.entry_count); + else + kh_resize(idx, index->entries_map, header.entry_count); + /* Parse all the entries */ for (i = 0; i < header.entry_count && buffer_size > INDEX_FOOTER_SIZE; ++i) { git_index_entry *entry; @@ -2193,6 +2439,14 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size) goto done; } + INSERT_IN_MAP(index, entry, error); + + if (error < 0) { + index_entry_free(entry); + goto done; + } + error = 0; + seek_forward(entry_size); } @@ -2239,10 +2493,9 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size) * in-memory index is supposed to be case-insensitive */ git_vector_set_sorted(&index->entries, !index->ignore_case); - error = index_sort_if_needed(index, false); + git_vector_sort(&index->entries); done: - git_mutex_unlock(&index->lock); return error; } @@ -2313,7 +2566,8 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry) if (entry->flags & GIT_IDXENTRY_EXTENDED) { struct entry_long *ondisk_ext; ondisk_ext = (struct entry_long *)ondisk; - ondisk_ext->flags_extended = htons(entry->flags_extended); + ondisk_ext->flags_extended = htons(entry->flags_extended & + GIT_IDXENTRY_EXTENDED_FLAGS); path = ondisk_ext->path; } else @@ -2331,11 +2585,6 @@ static int write_entries(git_index *index, git_filebuf *file) git_vector case_sorted, *entries; git_index_entry *entry; - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } - /* If index->entries is sorted case-insensitively, then we need * to re-sort it case-sensitively before writing */ if (index->ignore_case) { @@ -2350,8 +2599,6 @@ static int write_entries(git_index *index, git_filebuf *file) if ((error = write_disk_entry(file, entry)) < 0) break; - git_mutex_unlock(&index->lock); - if (index->ignore_case) git_vector_free(&case_sorted); @@ -2496,6 +2743,15 @@ static int write_tree_extension(git_index *index, git_filebuf *file) return error; } +static void clear_uptodate(git_index *index) +{ + git_index_entry *entry; + size_t i; + + git_vector_foreach(&index->entries, i, entry) + entry->flags_extended &= ~GIT_IDXENTRY_UPTODATE; +} + static int write_index(git_oid *checksum, git_index *index, git_filebuf *file) { git_oid hash_final; @@ -2535,7 +2791,13 @@ static int write_index(git_oid *checksum, git_index *index, git_filebuf *file) git_oid_cpy(checksum, &hash_final); /* write it at the end of the file */ - return git_filebuf_write(file, hash_final.id, GIT_OID_RAWSZ); + if (git_filebuf_write(file, hash_final.id, GIT_OID_RAWSZ) < 0) + return -1; + + /* file entries are no longer up to date */ + clear_uptodate(index); + + return 0; } int git_index_entry_stage(const git_index_entry *entry) @@ -2570,11 +2832,11 @@ static int read_tree_cb( if (git_buf_joinpath(&path, root, tentry->filename) < 0) return -1; - if (index_entry_create(&entry, INDEX_OWNER(data->index), path.ptr) < 0) + if (index_entry_create(&entry, INDEX_OWNER(data->index), path.ptr, false) < 0) return -1; entry->mode = tentry->attr; - entry->id = tentry->oid; + git_oid_cpy(&entry->id, git_tree_entry_id(tentry)); /* look for corresponding old entry and copy data to new entry */ if (data->old_entries != NULL && @@ -2588,11 +2850,7 @@ static int read_tree_cb( entry->flags_extended = 0; } - if (path.size < GIT_IDXENTRY_NAMEMASK) - entry->flags = path.size & GIT_IDXENTRY_NAMEMASK; - else - entry->flags = GIT_IDXENTRY_NAMEMASK; - + index_entry_adjust_namemask(entry, path.size); git_buf_free(&path); if (git_vector_insert(data->new_entries, entry) < 0) { @@ -2607,7 +2865,13 @@ int git_index_read_tree(git_index *index, const git_tree *tree) { int error = 0; git_vector entries = GIT_VECTOR_INIT; + git_idxmap *entries_map; read_tree_data data; + size_t i; + git_index_entry *e; + + if (git_idxmap_alloc(&entries_map) < 0) + return -1; git_vector_set_cmp(&entries, index->entries._cmp); /* match sort */ @@ -2619,26 +2883,39 @@ int git_index_read_tree(git_index *index, const git_tree *tree) index->tree = NULL; git_pool_clear(&index->tree_pool); - if (index_sort_if_needed(index, true) < 0) - return -1; + git_vector_sort(&index->entries); - error = git_tree_walk(tree, GIT_TREEWALK_POST, read_tree_cb, &data); + if ((error = git_tree_walk(tree, GIT_TREEWALK_POST, read_tree_cb, &data)) < 0) + goto cleanup; - if (!error) { - git_vector_sort(&entries); + if (index->ignore_case) + kh_resize(idxicase, (khash_t(idxicase) *) entries_map, entries.length); + else + kh_resize(idx, entries_map, entries.length); - if ((error = git_index_clear(index)) < 0) - /* well, this isn't good */; - else if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire index lock"); - error = -1; - } else { - git_vector_swap(&entries, &index->entries); - git_mutex_unlock(&index->lock); + git_vector_foreach(&entries, i, e) { + INSERT_IN_MAP_EX(index, entries_map, e, error); + + if (error < 0) { + giterr_set(GITERR_INDEX, "failed to insert entry into map"); + return error; } } + error = 0; + + git_vector_sort(&entries); + + if ((error = git_index_clear(index)) < 0) { + /* well, this isn't good */; + } else { + git_vector_swap(&entries, &index->entries); + entries_map = git__swap(index->entries_map, entries_map); + } + +cleanup: git_vector_free(&entries); + git_idxmap_free(entries_map); if (error < 0) return error; @@ -2653,30 +2930,42 @@ int git_index_read_index( { git_vector new_entries = GIT_VECTOR_INIT, remove_entries = GIT_VECTOR_INIT; + git_idxmap *new_entries_map = NULL; git_iterator *index_iterator = NULL; git_iterator *new_iterator = NULL; + git_iterator_options opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *old_entry, *new_entry; git_index_entry *entry; size_t i; int error; if ((error = git_vector_init(&new_entries, new_index->entries.length, index->entries._cmp)) < 0 || - (error = git_vector_init(&remove_entries, index->entries.length, NULL)) < 0) + (error = git_vector_init(&remove_entries, index->entries.length, NULL)) < 0 || + (error = git_idxmap_alloc(&new_entries_map)) < 0) goto done; - if ((error = git_iterator_for_index(&index_iterator, - index, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&new_iterator, - (git_index *)new_index, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + if (index->ignore_case) + kh_resize(idxicase, (khash_t(idxicase) *) new_entries_map, new_index->entries.length); + else + kh_resize(idx, new_entries_map, new_index->entries.length); + + opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if ((error = git_iterator_for_index(&index_iterator, git_index_owner(index), index, &opts)) < 0 || + (error = git_iterator_for_index(&new_iterator, git_index_owner(new_index), (git_index *)new_index, &opts)) < 0) goto done; - if (((error = git_iterator_current(&old_entry, index_iterator)) < 0 && + if (((error = git_iterator_current(&old_entry, index_iterator)) < 0 && error != GIT_ITEROVER) || - ((error = git_iterator_current(&new_entry, new_iterator)) < 0 && + ((error = git_iterator_current(&new_entry, new_iterator)) < 0 && error != GIT_ITEROVER)) goto done; while (true) { + git_index_entry + *dup_entry = NULL, + *add_entry = NULL, + *remove_entry = NULL; int diff; if (old_entry && new_entry) @@ -2689,27 +2978,39 @@ int git_index_read_index( break; if (diff < 0) { - git_vector_insert(&remove_entries, (git_index_entry *)old_entry); + remove_entry = (git_index_entry *)old_entry; } else if (diff > 0) { - if ((error = index_entry_dup(&entry, git_index_owner(index), new_entry)) < 0) - goto done; - - git_vector_insert(&new_entries, entry); + dup_entry = (git_index_entry *)new_entry; } else { /* Path and stage are equal, if the OID is equal, keep it to * keep the stat cache data. */ if (git_oid_equal(&old_entry->id, &new_entry->id)) { - git_vector_insert(&new_entries, (git_index_entry *)old_entry); + add_entry = (git_index_entry *)old_entry; } else { - if ((error = index_entry_dup(&entry, git_index_owner(index), new_entry)) < 0) - goto done; - - git_vector_insert(&new_entries, entry); - git_vector_insert(&remove_entries, (git_index_entry *)old_entry); + dup_entry = (git_index_entry *)new_entry; + remove_entry = (git_index_entry *)old_entry; } } + if (dup_entry) { + if ((error = index_entry_dup_nocache(&add_entry, index, dup_entry)) < 0) + goto done; + } + + if (add_entry) { + if ((error = git_vector_insert(&new_entries, add_entry)) == 0) + INSERT_IN_MAP_EX(index, new_entries_map, add_entry, error); + } + + if (remove_entry && error >= 0) + error = git_vector_insert(&remove_entries, remove_entry); + + if (error < 0) { + giterr_set(GITERR_INDEX, "failed to insert entry"); + return error; + } + if (diff <= 0) { if ((error = git_iterator_advance(&old_entry, index_iterator)) < 0 && error != GIT_ITEROVER) @@ -2727,6 +3028,7 @@ int git_index_read_index( git_index_reuc_clear(index); git_vector_swap(&new_entries, &index->entries); + new_entries_map = git__swap(index->entries_map, new_entries_map); git_vector_foreach(&remove_entries, i, entry) { if (index->tree) @@ -2738,6 +3040,7 @@ int git_index_read_index( error = 0; done: + git_idxmap_free(new_entries_map); git_vector_free(&new_entries); git_vector_free(&remove_entries); git_iterator_free(index_iterator); @@ -3007,18 +3310,11 @@ int git_index_snapshot_new(git_vector *snap, git_index *index) GIT_REFCOUNT_INC(index); - if (git_mutex_lock(&index->lock) < 0) { - giterr_set(GITERR_OS, "Failed to lock index"); - return -1; - } - git_atomic_inc(&index->readers); git_vector_sort(&index->entries); error = git_vector_dup(snap, &index->entries, index->entries._cmp); - git_mutex_unlock(&index->lock); - if (error < 0) git_index_free(index); @@ -3031,11 +3327,6 @@ void git_index_snapshot_release(git_vector *snap, git_index *index) git_atomic_dec(&index->readers); - if (!git_mutex_lock(&index->lock)) { - index_free_deleted(index); /* try to free pending deleted items */ - git_mutex_unlock(&index->lock); - } - git_index_free(index); } @@ -3100,9 +3391,7 @@ int git_indexwriter_commit(git_indexwriter *writer) if (!writer->should_write) return 0; - if (index_sort_if_needed(writer->index, true) < 0) - return -1; - + git_vector_sort(&writer->index->entries); git_vector_sort(&writer->index->reuc); if ((error = write_index(&checksum, writer->index, &writer->file)) < 0) { diff --git a/vendor/libgit2/src/index.h b/vendor/libgit2/src/index.h index 9c60b015c..8b9b49498 100644 --- a/vendor/libgit2/src/index.h +++ b/vendor/libgit2/src/index.h @@ -10,6 +10,7 @@ #include "fileops.h" #include "filebuf.h" #include "vector.h" +#include "idxmap.h" #include "tree-cache.h" #include "git2/odb.h" #include "git2/index.h" @@ -25,8 +26,8 @@ struct git_index { git_oid checksum; /* checksum at the end of the file */ git_vector entries; + git_idxmap *entries_map; - git_mutex lock; /* lock held while entries is being changed */ git_vector deleted; /* deleted entries if readers > 0 */ git_atomic readers; /* number of active iterators */ @@ -63,6 +64,45 @@ extern int git_index_entry_icmp(const void *a, const void *b); extern int git_index_entry_srch(const void *a, const void *b); extern int git_index_entry_isrch(const void *a, const void *b); +/* Index time handling functions */ +GIT_INLINE(bool) git_index_time_eq(const git_index_time *one, const git_index_time *two) +{ + if (one->seconds != two->seconds) + return false; + +#ifdef GIT_USE_NSEC + if (one->nanoseconds != two->nanoseconds) + return false; +#endif + + return true; +} + +/* + * Test if the given index time is newer than the given existing index entry. + * If the timestamps are exactly equivalent, then the given index time is + * considered "racily newer" than the existing index entry. + */ +GIT_INLINE(bool) git_index_entry_newer_than_index( + const git_index_entry *entry, git_index *index) +{ + /* If we never read the index, we can't have this race either */ + if (!index || index->stamp.mtime.tv_sec == 0) + return false; + + /* If the timestamp is the same or newer than the index, it's racy */ +#if defined(GIT_USE_NSEC) + if ((int32_t)index->stamp.mtime.tv_sec < entry->mtime.seconds) + return true; + else if ((int32_t)index->stamp.mtime.tv_sec > entry->mtime.seconds) + return false; + else + return (uint32_t)index->stamp.mtime.tv_nsec <= entry->mtime.nanoseconds; +#else + return ((int32_t)index->stamp.mtime.tv_sec) <= entry->mtime.seconds; +#endif +} + /* Search index for `path`, returning GIT_ENOTFOUND if it does not exist * (but not setting an error message). * @@ -72,6 +112,8 @@ extern int git_index_entry_isrch(const void *a, const void *b); extern int git_index__find_pos( size_t *at_pos, git_index *index, const char *path, size_t path_len, int stage); +extern int git_index__fill(git_index *index, const git_vector *source_entries); + extern void git_index__set_ignore_case(git_index *index, bool ignore_case); extern unsigned int git_index__create_mode(unsigned int mode); diff --git a/vendor/libgit2/src/indexer.c b/vendor/libgit2/src/indexer.c index 9aa092556..a3a866989 100644 --- a/vendor/libgit2/src/indexer.c +++ b/vendor/libgit2/src/indexer.c @@ -449,7 +449,7 @@ static void hash_partially(git_indexer *idx, const uint8_t *data, size_t size) static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t size) { git_file fd = idx->pack->mwf.fd; - size_t page_size; + size_t mmap_alignment; size_t page_offset; git_off_t page_start; unsigned char *map_data; @@ -458,11 +458,11 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t assert(data && size); - if ((error = git__page_size(&page_size)) < 0) + if ((error = git__mmap_alignment(&mmap_alignment)) < 0) return error; - /* the offset needs to be at the beginning of the a page boundary */ - page_offset = offset % page_size; + /* the offset needs to be at the mmap boundary for the platform */ + page_offset = offset % mmap_alignment; page_start = offset - page_offset; if ((error = p_mmap(&map, page_offset + size, GIT_PROT_WRITE, GIT_MAP_SHARED, fd, page_start)) < 0) @@ -777,7 +777,6 @@ static int fix_thin_pack(git_indexer *idx, git_transfer_progress *stats) curpos = delta->delta_off; error = git_packfile_unpack_header(&size, &type, &idx->pack->mwf, &w, &curpos); - git_mwindow_close(&w); if (error < 0) return error; @@ -914,12 +913,17 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats) git_filebuf index_file = {0}; void *packfile_trailer; + if (!idx->parsed_header) { + giterr_set(GITERR_INDEXER, "incomplete pack header"); + return -1; + } + if (git_hash_ctx_init(&ctx) < 0) return -1; /* Test for this before resolve_deltas(), as it plays with idx->off */ - if (idx->off < idx->pack->mwf.size - 20) { - giterr_set(GITERR_INDEXER, "Unexpected data at the end of the pack"); + if (idx->off + 20 < idx->pack->mwf.size) { + giterr_set(GITERR_INDEXER, "unexpected data at the end of the pack"); return -1; } diff --git a/vendor/libgit2/src/iterator.c b/vendor/libgit2/src/iterator.c index cf51a340d..cb1ea6a87 100644 --- a/vendor/libgit2/src/iterator.c +++ b/vendor/libgit2/src/iterator.c @@ -31,14 +31,22 @@ (P)->base.cb = &(P)->cb; \ ITERATOR_SET_CB(P,NAME_LC); \ (P)->base.repo = (REPO); \ - (P)->base.start = start ? git__strdup(start) : NULL; \ - (P)->base.end = end ? git__strdup(end) : NULL; \ - if ((start && !(P)->base.start) || (end && !(P)->base.end)) { \ + (P)->base.start = options && options->start ? \ + git__strdup(options->start) : NULL; \ + (P)->base.end = options && options->end ? \ + git__strdup(options->end) : NULL; \ + if ((options && options->start && !(P)->base.start) || \ + (options && options->end && !(P)->base.end)) { \ git__free(P); return -1; } \ + (P)->base.strcomp = git__strcmp; \ + (P)->base.strncomp = git__strncmp; \ (P)->base.prefixcomp = git__prefixcmp; \ - (P)->base.flags = flags & ~ITERATOR_CASE_FLAGS; \ + (P)->base.flags = options ? options->flags & ~ITERATOR_CASE_FLAGS : 0; \ if ((P)->base.flags & GIT_ITERATOR_DONT_AUTOEXPAND) \ (P)->base.flags |= GIT_ITERATOR_INCLUDE_TREES; \ + if (options && options->pathlist.count && \ + iterator_pathlist__init(&P->base, &options->pathlist) < 0) { \ + git__free(P); return -1; } \ } while (0) #define iterator__flag(I,F) ((((git_iterator *)(I))->flags & GIT_ITERATOR_ ## F) != 0) @@ -56,6 +64,139 @@ (iterator__end(I) && ((git_iterator *)(I))->prefixcomp((PATH),iterator__end(I)) > 0) +typedef enum { + ITERATOR_PATHLIST_NONE = 0, + ITERATOR_PATHLIST_MATCH = 1, + ITERATOR_PATHLIST_MATCH_DIRECTORY = 2, + ITERATOR_PATHLIST_MATCH_CHILD = 3, +} iterator_pathlist__match_t; + +static int iterator_pathlist__init(git_iterator *iter, git_strarray *pathspec) +{ + size_t i; + + if (git_vector_init(&iter->pathlist, pathspec->count, + (git_vector_cmp)iter->strcomp) < 0) + return -1; + + for (i = 0; i < pathspec->count; i++) { + if (!pathspec->strings[i]) + continue; + + if (git_vector_insert(&iter->pathlist, pathspec->strings[i]) < 0) + return -1; + } + + git_vector_sort(&iter->pathlist); + + return 0; +} + +static iterator_pathlist__match_t iterator_pathlist__match( + git_iterator *iter, const char *path, size_t path_len) +{ + const char *p; + size_t idx; + int error; + + error = git_vector_bsearch2(&idx, &iter->pathlist, + (git_vector_cmp)iter->strcomp, path); + + if (error == 0) + return ITERATOR_PATHLIST_MATCH; + + /* at this point, the path we're examining may be a directory (though we + * don't know that yet, since we're avoiding a stat unless it's necessary) + * so see if the pathlist contains a file beneath this directory. + */ + while ((p = git_vector_get(&iter->pathlist, idx)) != NULL) { + if (iter->prefixcomp(p, path) != 0) + break; + + /* an exact match would have been matched by the bsearch above */ + assert(p[path_len]); + + /* is this a literal directory entry (eg `foo/`) or a file beneath */ + if (p[path_len] == '/') { + return (p[path_len+1] == '\0') ? + ITERATOR_PATHLIST_MATCH_DIRECTORY : + ITERATOR_PATHLIST_MATCH_CHILD; + } + + if (p[path_len] > '/') + break; + + idx++; + } + + return ITERATOR_PATHLIST_NONE; +} + +static void iterator_pathlist_walk__reset(git_iterator *iter) +{ + iter->pathlist_walk_idx = 0; +} + +/* walker for the index iterator that allows it to walk the sorted pathlist + * entries alongside the sorted index entries. the `iter->pathlist_walk_idx` + * stores the starting position for subsequent calls, the position is advanced + * along with the index iterator, with a special case for handling directories + * in the pathlist that are specified without trailing '/'. (eg, `foo`). + * we do not advance over these entries until we're certain that the index + * iterator will not ask us for a file beneath that directory (eg, `foo/bar`). + */ +static bool iterator_pathlist_walk__contains(git_iterator *iter, const char *path) +{ + size_t i; + char *p; + size_t p_len; + int cmp; + + for (i = iter->pathlist_walk_idx; i < iter->pathlist.length; i++) { + p = iter->pathlist.contents[i]; + p_len = strlen(p); + + /* see if the pathlist entry is a prefix of this path */ + cmp = iter->strncomp(p, path, p_len); + + /* this pathlist entry sorts before the given path, try the next */ + if (!p_len || cmp < 0) + iter->pathlist_walk_idx++; + + /* this pathlist sorts after the given path, no match. */ + else if (cmp > 0) + return false; + + /* match! an exact match (`foo` vs `foo`), the path is a child of an + * explicit directory in the pathlist (`foo/` vs `foo/bar`) or the path + * is a child of an entry in the pathlist (`foo` vs `foo/bar`) + */ + else if (path[p_len] == '\0' || p[p_len - 1] == '/' || path[p_len] == '/') + return true; + + /* only advance the start index for future callers if we know that we + * will not see a child of this path. eg, a pathlist entry `foo` is + * a prefix for `foo.txt` and `foo/bar`. don't advance the start + * pathlist index when we see `foo.txt` or we would miss a subsequent + * inspection of `foo/bar`. only advance when there are no more + * potential children. + */ + else if (path[p_len] > '/') + iter->pathlist_walk_idx++; + } + + return false; +} + +static void iterator_pathlist__update_ignore_case(git_iterator *iter) +{ + git_vector_set_cmp(&iter->pathlist, (git_vector_cmp)iter->strcomp); + git_vector_sort(&iter->pathlist); + + iter->pathlist_walk_idx = 0; +} + + static int iterator__reset_range( git_iterator *iter, const char *start, const char *end) { @@ -82,7 +223,8 @@ static int iterator__update_ignore_case( git_iterator *iter, git_iterator_flag_t flags) { - int error = 0, ignore_case = -1; + bool ignore_case; + int error; if ((flags & GIT_ITERATOR_IGNORE_CASE) != 0) ignore_case = true; @@ -91,19 +233,29 @@ static int iterator__update_ignore_case( else { git_index *index; - if (!(error = git_repository_index__weakptr(&index, iter->repo))) - ignore_case = (index->ignore_case != false); + if ((error = git_repository_index__weakptr(&index, iter->repo)) < 0) + return error; + + ignore_case = (index->ignore_case == 1); } - if (ignore_case > 0) + if (ignore_case) { iter->flags = (iter->flags | GIT_ITERATOR_IGNORE_CASE); - else if (ignore_case == 0) + + iter->strcomp = git__strcasecmp; + iter->strncomp = git__strncasecmp; + iter->prefixcomp = git__prefixcmp_icase; + } else { iter->flags = (iter->flags & ~GIT_ITERATOR_IGNORE_CASE); - iter->prefixcomp = iterator__ignore_case(iter) ? - git__prefixcmp_icase : git__prefixcmp; + iter->strcomp = git__strcmp; + iter->strncomp = git__strncmp; + iter->prefixcomp = git__prefixcmp; + } - return error; + iterator_pathlist__update_ignore_case(iter); + + return 0; } GIT_INLINE(void) iterator__clear_entry(const git_index_entry **entry) @@ -149,9 +301,7 @@ typedef struct { int git_iterator_for_nothing( git_iterator **iter, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { empty_iterator *i = git__calloc(1, sizeof(empty_iterator)); GITERR_CHECK_ALLOC(i); @@ -162,7 +312,7 @@ int git_iterator_for_nothing( ITERATOR_BASE_INIT(i, empty, EMPTY, NULL); - if ((flags & GIT_ITERATOR_IGNORE_CASE) != 0) + if (options && (options->flags & GIT_ITERATOR_IGNORE_CASE) != 0) i->base.flags |= GIT_ITERATOR_IGNORE_CASE; *iter = (git_iterator *)i; @@ -201,7 +351,6 @@ typedef struct { int path_ambiguities; bool path_has_filename; bool entry_is_current; - int (*strncomp)(const char *a, const char *b, size_t sz); } tree_iterator; static char *tree_iterator__current_filename( @@ -271,7 +420,7 @@ static int tree_iterator__search_cmp(const void *key, const void *val, void *p) return git_path_cmp( tf->start, tf->startlen, false, te->filename, te->filename_len, te->attr == GIT_FILEMODE_TREE, - ((tree_iterator *)p)->strncomp); + ((git_iterator *)p)->strncomp); } static bool tree_iterator__move_to_next( @@ -303,13 +452,13 @@ static int tree_iterator__set_next(tree_iterator *ti, tree_iterator_frame *tf) for (; tf->next < tf->n_entries; tf->next++, last = te) { te = tf->entries[tf->next]->te; - if (last && tree_iterator__te_cmp(last, te, ti->strncomp)) + if (last && tree_iterator__te_cmp(last, te, ti->base.strncomp)) break; /* try to load trees for items in [current,next) range */ if (!error && git_tree_entry__is_tree(te)) error = git_tree_lookup( - &tf->entries[tf->next]->tree, ti->base.repo, &te->oid); + &tf->entries[tf->next]->tree, ti->base.repo, te->oid); } if (tf->next > tf->current + 1) @@ -409,6 +558,8 @@ static bool tree_iterator__pop_frame(tree_iterator *ti, bool final) { tree_iterator_frame *tf = ti->head; + assert(tf); + if (!tf->up) return false; @@ -418,7 +569,7 @@ static bool tree_iterator__pop_frame(tree_iterator *ti, bool final) tree_iterator__move_to_next(ti, tf); if (!final) { /* if final, don't bother to clean up */ - git_pool_free_array(&ti->pool, tf->n_entries, (void **)tf->entries); + // TODO: maybe free the pool so far? git_buf_rtruncate_at_char(&ti->path, '/'); } @@ -432,6 +583,8 @@ static void tree_iterator__pop_all(tree_iterator *ti, bool to_end, bool final) while (tree_iterator__pop_frame(ti, final)) /* pop to root */; if (!final) { + assert(ti->head); + ti->head->current = to_end ? ti->head->n_entries : 0; ti->path_ambiguities = 0; git_buf_clear(&ti->path); @@ -450,7 +603,7 @@ static int tree_iterator__update_entry(tree_iterator *ti) te = tf->entries[tf->current]->te; ti->entry.mode = te->attr; - git_oid_cpy(&ti->entry.id, &te->oid); + git_oid_cpy(&ti->entry.id, te->oid); ti->entry.path = tree_iterator__current_filename(ti, te); GITERR_CHECK_ALLOC(ti->entry.path); @@ -468,7 +621,7 @@ static int tree_iterator__update_entry(tree_iterator *ti) return 0; } -static int tree_iterator__current( +static int tree_iterator__current_internal( const git_index_entry **entry, git_iterator *self) { int error; @@ -491,41 +644,32 @@ static int tree_iterator__current( return 0; } -static int tree_iterator__advance_into( - const git_index_entry **entry, git_iterator *self) +static int tree_iterator__advance_into_internal(git_iterator *self) { int error = 0; tree_iterator *ti = (tree_iterator *)self; - iterator__clear_entry(entry); - if (tree_iterator__at_tree(ti)) error = tree_iterator__push_frame(ti); - if (!error && entry) - error = tree_iterator__current(entry, self); - return error; } -static int tree_iterator__advance( - const git_index_entry **entry, git_iterator *self) +static int tree_iterator__advance_internal(git_iterator *self) { int error; tree_iterator *ti = (tree_iterator *)self; tree_iterator_frame *tf = ti->head; - iterator__clear_entry(entry); - if (tf->current >= tf->n_entries) return GIT_ITEROVER; if (!iterator__has_been_accessed(ti)) - return tree_iterator__current(entry, self); + return 0; if (iterator__do_autoexpand(ti) && iterator__include_trees(ti) && tree_iterator__at_tree(ti)) - return tree_iterator__advance_into(entry, self); + return tree_iterator__advance_into_internal(self); if (ti->path_has_filename) { git_buf_rtruncate_at_char(&ti->path, '/'); @@ -534,7 +678,7 @@ static int tree_iterator__advance( /* scan forward and up, advancing in frame or popping frame when done */ while (!tree_iterator__move_to_next(ti, tf) && - tree_iterator__pop_frame(ti, false)) + tree_iterator__pop_frame(ti, false)) tf = ti->head; /* find next and load trees */ @@ -543,7 +687,63 @@ static int tree_iterator__advance( /* deal with include_trees / auto_expand as needed */ if (!iterator__include_trees(ti) && tree_iterator__at_tree(ti)) - return tree_iterator__advance_into(entry, self); + return tree_iterator__advance_into_internal(self); + + return 0; +} + +static int tree_iterator__current( + const git_index_entry **out, git_iterator *self) +{ + const git_index_entry *entry = NULL; + iterator_pathlist__match_t m; + int error; + + do { + if ((error = tree_iterator__current_internal(&entry, self)) < 0) + return error; + + if (self->pathlist.length) { + m = iterator_pathlist__match( + self, entry->path, strlen(entry->path)); + + if (m != ITERATOR_PATHLIST_MATCH) { + if ((error = tree_iterator__advance_internal(self)) < 0) + return error; + + entry = NULL; + } + } + } while (!entry); + + if (out) + *out = entry; + + return error; +} + +static int tree_iterator__advance( + const git_index_entry **entry, git_iterator *self) +{ + int error = tree_iterator__advance_internal(self); + + iterator__clear_entry(entry); + + if (error < 0) + return error; + + return tree_iterator__current(entry, self); +} + +static int tree_iterator__advance_into( + const git_index_entry **entry, git_iterator *self) +{ + int error = tree_iterator__advance_into_internal(self); + + iterator__clear_entry(entry); + + if (error < 0) + return error; return tree_iterator__current(entry, self); } @@ -577,10 +777,12 @@ static void tree_iterator__free(git_iterator *self) { tree_iterator *ti = (tree_iterator *)self; - tree_iterator__pop_all(ti, true, false); + if (ti->head) { + tree_iterator__pop_all(ti, true, false); + git_tree_free(ti->head->entries[0]->tree); + git__free(ti->head); + } - git_tree_free(ti->head->entries[0]->tree); - git__free(ti->head); git_pool_clear(&ti->pool); git_buf_free(&ti->path); } @@ -607,15 +809,13 @@ static int tree_iterator__create_root_frame(tree_iterator *ti, git_tree *tree) int git_iterator_for_tree( git_iterator **iter, git_tree *tree, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { int error; tree_iterator *ti; if (tree == NULL) - return git_iterator_for_nothing(iter, flags, start, end); + return git_iterator_for_nothing(iter, options); if ((error = git_object_dup((git_object **)&tree, (git_object *)tree)) < 0) return error; @@ -625,12 +825,12 @@ int git_iterator_for_tree( ITERATOR_BASE_INIT(ti, tree, TREE, git_tree_owner(tree)); - if ((error = iterator__update_ignore_case((git_iterator *)ti, flags)) < 0) + if ((error = iterator__update_ignore_case((git_iterator *)ti, options ? options->flags : 0)) < 0) goto fail; - ti->strncomp = iterator__ignore_case(ti) ? git__strncasecmp : git__strncmp; - if ((error = git_pool_init(&ti->pool, sizeof(tree_iterator_entry),0)) < 0 || - (error = tree_iterator__create_root_frame(ti, tree)) < 0 || + git_pool_init(&ti->pool, sizeof(tree_iterator_entry)); + + if ((error = tree_iterator__create_root_frame(ti, tree)) < 0 || (error = tree_iterator__push_frame(ti)) < 0) /* expand root now */ goto fail; @@ -650,6 +850,8 @@ typedef struct { git_vector entries; git_vector_cmp entry_srch; size_t current; + /* when limiting with a pathlist, this is the current index into it */ + size_t pathlist_idx; /* when not in autoexpand mode, use these to represent "tree" state */ git_buf partial; size_t partial_pos; @@ -669,15 +871,35 @@ static const git_index_entry *index_iterator__index_entry(index_iterator *ii) return ie; } -static const git_index_entry *index_iterator__advance_over_conflicts(index_iterator *ii) +static const git_index_entry *index_iterator__advance_over_unwanted( + index_iterator *ii) { const git_index_entry *ie = index_iterator__index_entry(ii); + bool match; - if (!iterator__include_conflicts(ii)) { - while (ie && git_index_entry_is_conflict(ie)) { + while (ie) { + if (!iterator__include_conflicts(ii) && + git_index_entry_is_conflict(ie)) { ii->current++; ie = index_iterator__index_entry(ii); + continue; + } + + /* if we have a pathlist, this entry's path must be in it to be + * returned. walk the pathlist in unison with the index to + * compare paths. + */ + if (ii->base.pathlist.length) { + match = iterator_pathlist_walk__contains(&ii->base, ie->path); + + if (!match) { + ii->current++; + ie = index_iterator__index_entry(ii); + continue; + } } + + break; } return ie; @@ -706,7 +928,7 @@ static void index_iterator__next_prefix_tree(index_iterator *ii) static int index_iterator__first_prefix_tree(index_iterator *ii) { - const git_index_entry *ie = index_iterator__advance_over_conflicts(ii); + const git_index_entry *ie = index_iterator__advance_over_unwanted(ii); const char *scan, *prior, *slash; if (!ie || !iterator__include_trees(ii)) @@ -825,11 +1047,16 @@ static int index_iterator__reset( ii->current = 0; + iterator_pathlist_walk__reset(self); + + /* if we're given a start prefix, find it; if we're given a pathlist, find + * the first of those. start at the later of the two. + */ if (ii->base.start) git_index_snapshot_find( &ii->current, &ii->entries, ii->entry_srch, ii->base.start, 0, 0); - if ((ie = index_iterator__advance_over_conflicts(ii)) == NULL) + if ((ie = index_iterator__advance_over_unwanted(ii)) == NULL) return 0; if (git_buf_sets(&ii->partial, ie->path) < 0) @@ -859,10 +1086,9 @@ static void index_iterator__free(git_iterator *self) int git_iterator_for_index( git_iterator **iter, + git_repository *repo, git_index *index, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { int error = 0; index_iterator *ii = git__calloc(1, sizeof(index_iterator)); @@ -874,9 +1100,9 @@ int git_iterator_for_index( } ii->index = index; - ITERATOR_BASE_INIT(ii, index, INDEX, git_index_owner(index)); + ITERATOR_BASE_INIT(ii, index, INDEX, repo); - if ((error = iterator__update_ignore_case((git_iterator *)ii, flags)) < 0) { + if ((error = iterator__update_ignore_case((git_iterator *)ii, options ? options->flags : 0)) < 0) { git_iterator_free((git_iterator *)ii); return error; } @@ -916,6 +1142,7 @@ struct fs_iterator { size_t root_len; uint32_t dirload_flags; int depth; + iterator_pathlist__match_t pathlist_match; int (*enter_dir_cb)(fs_iterator *self); int (*leave_dir_cb)(fs_iterator *self); @@ -926,6 +1153,7 @@ struct fs_iterator { typedef struct { struct stat st; + iterator_pathlist__match_t pathlist_match; size_t path_len; char path[GIT_FLEX_ARRAY]; } fs_iterator_path_with_stat; @@ -1007,28 +1235,20 @@ static void fs_iterator__seek_frame_start( ff->index = 0; } -static int dirload_with_stat( - const char *dirpath, - size_t prefix_len, - unsigned int flags, - const char *start_stat, - const char *end_stat, - git_vector *contents) +static int dirload_with_stat(git_vector *contents, fs_iterator *fi) { git_path_diriter diriter = GIT_PATH_DIRITER_INIT; const char *path; - int (*strncomp)(const char *a, const char *b, size_t sz); - size_t start_len = start_stat ? strlen(start_stat) : 0; - size_t end_len = end_stat ? strlen(end_stat) : 0; + size_t start_len = fi->base.start ? strlen(fi->base.start) : 0; + size_t end_len = fi->base.end ? strlen(fi->base.end) : 0; fs_iterator_path_with_stat *ps; size_t path_len, cmp_len, ps_size; + iterator_pathlist__match_t pathlist_match = ITERATOR_PATHLIST_MATCH; int error; - strncomp = (flags & GIT_PATH_DIR_IGNORE_CASE) != 0 ? - git__strncasecmp : git__strncmp; - /* Any error here is equivalent to the dir not existing, skip over it */ - if ((error = git_path_diriter_init(&diriter, dirpath, flags)) < 0) { + if ((error = git_path_diriter_init( + &diriter, fi->path.ptr, fi->dirload_flags)) < 0) { error = GIT_ENOTFOUND; goto done; } @@ -1037,18 +1257,31 @@ static int dirload_with_stat( if ((error = git_path_diriter_fullpath(&path, &path_len, &diriter)) < 0) goto done; - assert(path_len > prefix_len); + assert(path_len > fi->root_len); /* remove the prefix if requested */ - path += prefix_len; - path_len -= prefix_len; + path += fi->root_len; + path_len -= fi->root_len; /* skip if before start_stat or after end_stat */ cmp_len = min(start_len, path_len); - if (cmp_len && strncomp(path, start_stat, cmp_len) < 0) + if (cmp_len && fi->base.strncomp(path, fi->base.start, cmp_len) < 0) continue; + /* skip if after end_stat */ cmp_len = min(end_len, path_len); - if (cmp_len && strncomp(path, end_stat, cmp_len) > 0) + if (cmp_len && fi->base.strncomp(path, fi->base.end, cmp_len) > 0) + continue; + + /* if we have a pathlist that we're limiting to, examine this path. + * if the frame has already deemed us inside the path (eg, we're in + * `foo/bar` and the pathlist previously was detected to say `foo/`) + * then simply continue. otherwise, examine the pathlist looking for + * this path or children of this path. + */ + if (fi->base.pathlist.length && + fi->pathlist_match != ITERATOR_PATHLIST_MATCH && + fi->pathlist_match != ITERATOR_PATHLIST_MATCH_DIRECTORY && + !(pathlist_match = iterator_pathlist__match(&fi->base, path, path_len))) continue; /* Make sure to append two bytes, one for the path's null @@ -1062,6 +1295,8 @@ static int dirload_with_stat( memcpy(ps->path, path, path_len); + /* TODO: don't stat if assume unchanged for this path */ + if ((error = git_path_diriter_stat(&ps->st, &diriter)) < 0) { if (error == GIT_ENOTFOUND) { /* file was removed between readdir and lstat */ @@ -1069,6 +1304,12 @@ static int dirload_with_stat( continue; } + if (pathlist_match == ITERATOR_PATHLIST_MATCH_DIRECTORY) { + /* were looking for a directory, but this is a file */ + git__free(ps); + continue; + } + /* Treat the file as unreadable if we get any other error */ memset(&ps->st, 0, sizeof(ps->st)); ps->st.st_mode = GIT_FILEMODE_UNREADABLE; @@ -1085,6 +1326,11 @@ static int dirload_with_stat( continue; } + /* record whether this path was explicitly found in the path list + * or whether we're only examining it because something beneath it + * is in the path list. + */ + ps->pathlist_match = pathlist_match; git_vector_insert(contents, ps); } @@ -1114,13 +1360,11 @@ static int fs_iterator__expand_dir(fs_iterator *fi) ff = fs_iterator__alloc_frame(fi); GITERR_CHECK_ALLOC(ff); - error = dirload_with_stat( - fi->path.ptr, fi->root_len, fi->dirload_flags, - fi->base.start, fi->base.end, &ff->entries); + error = dirload_with_stat(&ff->entries, fi); if (error < 0) { git_error_state last_error = { 0 }; - giterr_capture(&last_error, error); + giterr_state_capture(&last_error, error); /* these callbacks may clear the error message */ fs_iterator__free_frame(ff); @@ -1128,7 +1372,7 @@ static int fs_iterator__expand_dir(fs_iterator *fi) /* next time return value we skipped to */ fi->base.flags &= ~GIT_ITERATOR_FIRST_ACCESS; - return giterr_restore(&last_error); + return giterr_state_restore(&last_error); } if (ff->entries.length == 0) { @@ -1196,19 +1440,14 @@ static int fs_iterator__advance_into( return error; } -static int fs_iterator__advance_over( - const git_index_entry **entry, git_iterator *self) +static void fs_iterator__advance_over_internal(git_iterator *self) { - int error = 0; fs_iterator *fi = (fs_iterator *)self; fs_iterator_frame *ff; fs_iterator_path_with_stat *next; - if (entry != NULL) - *entry = NULL; - while (fi->entry.path != NULL) { - ff = fi->stack; + ff = fi->stack; next = git_vector_get(&ff->entries, ++ff->index); if (next != NULL) @@ -1216,8 +1455,19 @@ static int fs_iterator__advance_over( fs_iterator__pop_frame(fi, ff, false); } +} - error = fs_iterator__update_entry(fi); +static int fs_iterator__advance_over( + const git_index_entry **entry, git_iterator *self) +{ + int error; + + if (entry != NULL) + *entry = NULL; + + fs_iterator__advance_over_internal(self); + + error = fs_iterator__update_entry((fs_iterator *)self); if (!error && entry != NULL) error = fs_iterator__current(entry, self); @@ -1294,40 +1544,50 @@ static int fs_iterator__update_entry(fs_iterator *fi) { fs_iterator_path_with_stat *ps; - memset(&fi->entry, 0, sizeof(fi->entry)); + while (true) { + memset(&fi->entry, 0, sizeof(fi->entry)); - if (!fi->stack) - return GIT_ITEROVER; + if (!fi->stack) + return GIT_ITEROVER; - ps = git_vector_get(&fi->stack->entries, fi->stack->index); - if (!ps) - return GIT_ITEROVER; + ps = git_vector_get(&fi->stack->entries, fi->stack->index); + if (!ps) + return GIT_ITEROVER; - git_buf_truncate(&fi->path, fi->root_len); - if (git_buf_put(&fi->path, ps->path, ps->path_len) < 0) - return -1; + git_buf_truncate(&fi->path, fi->root_len); + if (git_buf_put(&fi->path, ps->path, ps->path_len) < 0) + return -1; - if (iterator__past_end(fi, fi->path.ptr + fi->root_len)) - return GIT_ITEROVER; + if (iterator__past_end(fi, fi->path.ptr + fi->root_len)) + return GIT_ITEROVER; - fi->entry.path = ps->path; - git_index_entry__init_from_stat(&fi->entry, &ps->st, true); + fi->entry.path = ps->path; + fi->pathlist_match = ps->pathlist_match; + git_index_entry__init_from_stat(&fi->entry, &ps->st, true); - /* need different mode here to keep directories during iteration */ - fi->entry.mode = git_futils_canonical_mode(ps->st.st_mode); + /* need different mode here to keep directories during iteration */ + fi->entry.mode = git_futils_canonical_mode(ps->st.st_mode); - /* allow wrapper to check/update the entry (can force skip) */ - if (fi->update_entry_cb && - fi->update_entry_cb(fi) == GIT_ENOTFOUND) - return fs_iterator__advance_over(NULL, (git_iterator *)fi); + /* allow wrapper to check/update the entry (can force skip) */ + if (fi->update_entry_cb && + fi->update_entry_cb(fi) == GIT_ENOTFOUND) { + fs_iterator__advance_over_internal(&fi->base); + continue; + } - /* if this is a tree and trees aren't included, then skip */ - if (fi->entry.mode == GIT_FILEMODE_TREE && !iterator__include_trees(fi)) { - int error = fs_iterator__advance_into(NULL, (git_iterator *)fi); - if (error != GIT_ENOTFOUND) - return error; - giterr_clear(); - return fs_iterator__advance_over(NULL, (git_iterator *)fi); + /* if this is a tree and trees aren't included, then skip */ + if (fi->entry.mode == GIT_FILEMODE_TREE && !iterator__include_trees(fi)) { + int error = fs_iterator__advance_into(NULL, &fi->base); + + if (error != GIT_ENOTFOUND) + return error; + + giterr_clear(); + fs_iterator__advance_over_internal(&fi->base); + continue; + } + + break; } return 0; @@ -1343,6 +1603,7 @@ static int fs_iterator__initialize( return -1; } fi->root_len = fi->path.size; + fi->pathlist_match = ITERATOR_PATHLIST_MATCH_CHILD; fi->dirload_flags = (iterator__ignore_case(fi) ? GIT_PATH_DIR_IGNORE_CASE : 0) | @@ -1366,16 +1627,14 @@ static int fs_iterator__initialize( int git_iterator_for_filesystem( git_iterator **out, const char *root, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { fs_iterator *fi = git__calloc(1, sizeof(fs_iterator)); GITERR_CHECK_ALLOC(fi); ITERATOR_BASE_INIT(fi, fs, FS, NULL); - if ((flags & GIT_ITERATOR_IGNORE_CASE) != 0) + if (options && (options->flags & GIT_ITERATOR_IGNORE_CASE) != 0) fi->base.flags |= GIT_ITERATOR_IGNORE_CASE; return fs_iterator__initialize(out, fi, root); @@ -1559,9 +1818,7 @@ int git_iterator_for_workdir_ext( const char *repo_workdir, git_index *index, git_tree *tree, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { int error, precompose = 0; workdir_iterator *wi; @@ -1583,7 +1840,7 @@ int git_iterator_for_workdir_ext( wi->fi.leave_dir_cb = workdir_iterator__leave_dir; wi->fi.update_entry_cb = workdir_iterator__update_entry; - if ((error = iterator__update_ignore_case((git_iterator *)wi, flags)) < 0 || + if ((error = iterator__update_ignore_case((git_iterator *)wi, options ? options->flags : 0)) < 0 || (error = git_ignore__for_path(repo, ".gitignore", &wi->ignores)) < 0) { git_iterator_free((git_iterator *)wi); @@ -1618,6 +1875,7 @@ void git_iterator_free(git_iterator *iter) iter->cb->free(iter); + git_vector_free(&iter->pathlist); git__free(iter->start); git__free(iter->end); @@ -1687,7 +1945,7 @@ int git_iterator_current_parent_tree( if (!(tf = tf->down) || tf->current >= tf->n_entries || !(te = tf->entries[tf->current]->te) || - ti->strncomp(scan, te->filename, te->filename_len) != 0) + ti->base.strncomp(scan, te->filename, te->filename_len) != 0) return 0; scan += te->filename_len; @@ -1820,9 +2078,18 @@ int git_iterator_advance_over_with_status( if (!error) continue; + else if (error == GIT_ENOTFOUND) { + /* we entered this directory only hoping to find child matches to + * our pathlist (eg, this is `foo` and we had a pathlist entry for + * `foo/bar`). it should not be ignored, it should be excluded. + */ + if (wi->fi.pathlist_match == ITERATOR_PATHLIST_MATCH_CHILD) + *status = GIT_ITERATOR_STATUS_FILTERED; + else + wi->is_ignored = GIT_IGNORE_TRUE; /* mark empty dirs ignored */ + error = 0; - wi->is_ignored = GIT_IGNORE_TRUE; /* mark empty dirs ignored */ } else break; /* real error, stop here */ } else { diff --git a/vendor/libgit2/src/iterator.h b/vendor/libgit2/src/iterator.h index 893e5db50..ac17d2970 100644 --- a/vendor/libgit2/src/iterator.h +++ b/vendor/libgit2/src/iterator.h @@ -38,6 +38,21 @@ typedef enum { GIT_ITERATOR_INCLUDE_CONFLICTS = (1u << 5), } git_iterator_flag_t; +typedef struct { + const char *start; + const char *end; + + /* paths to include in the iterator (literal). if set, any paths not + * listed here will be excluded from iteration. + */ + git_strarray pathlist; + + /* flags, from above */ + unsigned int flags; +} git_iterator_options; + +#define GIT_ITERATOR_OPTIONS_INIT {0} + typedef struct { int (*current)(const git_index_entry **, git_iterator *); int (*advance)(const git_index_entry **, git_iterator *); @@ -54,6 +69,10 @@ struct git_iterator { git_repository *repo; char *start; char *end; + git_vector pathlist; + size_t pathlist_walk_idx; + int (*strcomp)(const char *a, const char *b); + int (*strncomp)(const char *a, const char *b, size_t n); int (*prefixcomp)(const char *str, const char *prefix); size_t stat_calls; unsigned int flags; @@ -61,9 +80,7 @@ struct git_iterator { extern int git_iterator_for_nothing( git_iterator **out, - git_iterator_flag_t flags, - const char *start, - const char *end); + git_iterator_options *options); /* tree iterators will match the ignore_case value from the index of the * repository, unless you override with a non-zero flag value @@ -71,19 +88,16 @@ extern int git_iterator_for_nothing( extern int git_iterator_for_tree( git_iterator **out, git_tree *tree, - git_iterator_flag_t flags, - const char *start, - const char *end); + git_iterator_options *options); /* index iterators will take the ignore_case value from the index; the * ignore_case flags are not used */ extern int git_iterator_for_index( git_iterator **out, + git_repository *repo, git_index *index, - git_iterator_flag_t flags, - const char *start, - const char *end); + git_iterator_options *options); extern int git_iterator_for_workdir_ext( git_iterator **out, @@ -91,9 +105,7 @@ extern int git_iterator_for_workdir_ext( const char *repo_workdir, git_index *index, git_tree *tree, - git_iterator_flag_t flags, - const char *start, - const char *end); + git_iterator_options *options); /* workdir iterators will match the ignore_case value from the index of the * repository, unless you override with a non-zero flag value @@ -103,11 +115,9 @@ GIT_INLINE(int) git_iterator_for_workdir( git_repository *repo, git_index *index, git_tree *tree, - git_iterator_flag_t flags, - const char *start, - const char *end) + git_iterator_options *options) { - return git_iterator_for_workdir_ext(out, repo, NULL, index, tree, flags, start, end); + return git_iterator_for_workdir_ext(out, repo, NULL, index, tree, options); } /* for filesystem iterators, you have to explicitly pass in the ignore_case @@ -116,9 +126,7 @@ GIT_INLINE(int) git_iterator_for_workdir( extern int git_iterator_for_filesystem( git_iterator **out, const char *root, - git_iterator_flag_t flags, - const char *start, - const char *end); + git_iterator_options *options); extern void git_iterator_free(git_iterator *iter); @@ -271,7 +279,8 @@ extern git_index *git_iterator_get_index(git_iterator *iter); typedef enum { GIT_ITERATOR_STATUS_NORMAL = 0, GIT_ITERATOR_STATUS_IGNORED = 1, - GIT_ITERATOR_STATUS_EMPTY = 2 + GIT_ITERATOR_STATUS_EMPTY = 2, + GIT_ITERATOR_STATUS_FILTERED = 3 } git_iterator_status_t; /* Advance over a directory and check if it contains no files or just diff --git a/vendor/libgit2/src/merge.c b/vendor/libgit2/src/merge.c index 9799f935b..d2f92ccce 100644 --- a/vendor/libgit2/src/merge.c +++ b/vendor/libgit2/src/merge.c @@ -27,6 +27,8 @@ #include "config.h" #include "oidarray.h" #include "annotated_commit.h" +#include "commit.h" +#include "oidarray.h" #include "git2/types.h" #include "git2/repository.h" @@ -47,6 +49,19 @@ #define GIT_MERGE_INDEX_ENTRY_EXISTS(X) ((X).mode != 0) #define GIT_MERGE_INDEX_ENTRY_ISFILE(X) S_ISREG((X).mode) + +/** Internal merge flags. */ +enum { + /** The merge is for a virtual base in a recursive merge. */ + GIT_MERGE__VIRTUAL_BASE = (1 << 31), +}; + +enum { + /** Accept the conflict file, staging it as the merge result. */ + GIT_MERGE_FILE_FAVOR__CONFLICTED = 4, +}; + + typedef enum { TREE_IDX_ANCESTOR = 0, TREE_IDX_OURS = 1, @@ -799,11 +814,9 @@ static int merge_conflict_resolve_automerge( int *resolved, git_merge_diff_list *diff_list, const git_merge_diff *conflict, - unsigned int merge_file_favor, - unsigned int file_flags) + const git_merge_file_options *file_opts) { const git_index_entry *ancestor = NULL, *ours = NULL, *theirs = NULL; - git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT; git_merge_file_result result = {0}; git_index_entry *index_entry; git_odb *odb = NULL; @@ -850,16 +863,13 @@ static int merge_conflict_resolve_automerge( theirs = GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry) ? &conflict->their_entry : NULL; - opts.favor = merge_file_favor; - opts.flags = file_flags; - if ((error = git_repository_odb(&odb, diff_list->repo)) < 0 || - (error = git_merge_file_from_index(&result, diff_list->repo, ancestor, ours, theirs, &opts)) < 0 || - !result.automergeable || + (error = git_merge_file_from_index(&result, diff_list->repo, ancestor, ours, theirs, file_opts)) < 0 || + (!result.automergeable && !(file_opts->flags & GIT_MERGE_FILE_FAVOR__CONFLICTED)) || (error = git_odb_write(&automerge_oid, odb, result.ptr, result.len, GIT_OBJ_BLOB)) < 0) goto done; - if ((index_entry = git_pool_malloc(&diff_list->pool, sizeof(git_index_entry))) == NULL) + if ((index_entry = git_pool_mallocz(&diff_list->pool, sizeof(git_index_entry))) == NULL) GITERR_CHECK_ALLOC(index_entry); index_entry->path = git_pool_strdup(&diff_list->pool, result.path); @@ -885,8 +895,7 @@ static int merge_conflict_resolve( int *out, git_merge_diff_list *diff_list, const git_merge_diff *conflict, - unsigned int merge_file_favor, - unsigned int file_flags) + const git_merge_file_options *file_opts) { int resolved = 0; int error = 0; @@ -902,8 +911,7 @@ static int merge_conflict_resolve( if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0) goto done; - if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, - merge_file_favor, file_flags)) < 0) + if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, file_opts)) < 0) goto done; *out = resolved; @@ -1296,7 +1304,7 @@ int git_merge_diff_list__find_renames( assert(diff_list && opts); - if ((opts->tree_flags & GIT_MERGE_TREE_FIND_RENAMES) == 0) + if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0) return 0; similarity_ours = git__calloc(diff_list->conflicts.length, @@ -1455,7 +1463,6 @@ GIT_INLINE(int) index_entry_dup_pool( { if (src != NULL) { memcpy(out, src, sizeof(git_index_entry)); - if ((out->path = git_pool_strdup(pool, src->path)) == NULL) return -1; } @@ -1491,7 +1498,7 @@ static git_merge_diff *merge_diff_from_index_entries( git_merge_diff *conflict; git_pool *pool = &diff_list->pool; - if ((conflict = git_pool_malloc(pool, sizeof(git_merge_diff))) == NULL) + if ((conflict = git_pool_mallocz(pool, sizeof(git_merge_diff))) == NULL) return NULL; if (index_entry_dup_pool(&conflict->ancestor_entry, pool, entries[TREE_IDX_ANCESTOR]) < 0 || @@ -1590,10 +1597,11 @@ git_merge_diff_list *git_merge_diff_list__alloc(git_repository *repo) diff_list->repo = repo; + git_pool_init(&diff_list->pool, 1); + if (git_vector_init(&diff_list->staged, 0, NULL) < 0 || git_vector_init(&diff_list->conflicts, 0, NULL) < 0 || - git_vector_init(&diff_list->resolved, 0, NULL) < 0 || - git_pool_init(&diff_list->pool, 1, 0) < 0) { + git_vector_init(&diff_list->resolved, 0, NULL) < 0) { git_merge_diff_list__free(diff_list); return NULL; } @@ -1632,8 +1640,8 @@ static int merge_normalize_opts( git_merge_options init = GIT_MERGE_OPTIONS_INIT; memcpy(opts, &init, sizeof(init)); - opts->tree_flags = GIT_MERGE_TREE_FIND_RENAMES; - opts->rename_threshold = GIT_MERGE_TREE_RENAME_THRESHOLD; + opts->flags = GIT_MERGE_FIND_RENAMES; + opts->rename_threshold = GIT_MERGE_DEFAULT_RENAME_THRESHOLD; } if (!opts->target_limit) { @@ -1643,7 +1651,7 @@ static int merge_normalize_opts( limit = git_config__get_int_force(cfg, "diff.renamelimit", 0); opts->target_limit = (limit <= 0) ? - GIT_MERGE_TREE_TARGET_LIMIT : (unsigned int)limit; + GIT_MERGE_DEFAULT_TARGET_LIMIT : (unsigned int)limit; } /* assign the internal metric with whitespace flag as payload */ @@ -1689,11 +1697,48 @@ static int merge_index_insert_reuc( mode[0], oid[0], mode[1], oid[1], mode[2], oid[2]); } -int index_from_diff_list(git_index **out, git_merge_diff_list *diff_list) +static int index_update_reuc(git_index *index, git_merge_diff_list *diff_list) +{ + int error; + size_t i; + git_merge_diff *conflict; + + /* Add each entry in the resolved conflict to the REUC independently, since + * the paths may differ due to renames. */ + git_vector_foreach(&diff_list->resolved, i, conflict) { + const git_index_entry *ancestor = + GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry) ? + &conflict->ancestor_entry : NULL; + + const git_index_entry *ours = + GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ? + &conflict->our_entry : NULL; + + const git_index_entry *theirs = + GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry) ? + &conflict->their_entry : NULL; + + if (ancestor != NULL && + (error = merge_index_insert_reuc(index, TREE_IDX_ANCESTOR, ancestor)) < 0) + return error; + + if (ours != NULL && + (error = merge_index_insert_reuc(index, TREE_IDX_OURS, ours)) < 0) + return error; + + if (theirs != NULL && + (error = merge_index_insert_reuc(index, TREE_IDX_THEIRS, theirs)) < 0) + return error; + } + + return 0; +} + +static int index_from_diff_list(git_index **out, + git_merge_diff_list *diff_list, bool skip_reuc) { git_index *index; size_t i; - git_index_entry *entry; git_merge_diff *conflict; int error = 0; @@ -1702,10 +1747,8 @@ int index_from_diff_list(git_index **out, git_merge_diff_list *diff_list) if ((error = git_index_new(&index)) < 0) return error; - git_vector_foreach(&diff_list->staged, i, entry) { - if ((error = git_index_add(index, entry)) < 0) - goto on_error; - } + if ((error = git_index__fill(index, &diff_list->staged)) < 0) + goto on_error; git_vector_foreach(&diff_list->conflicts, i, conflict) { const git_index_entry *ancestor = @@ -1748,31 +1791,8 @@ int index_from_diff_list(git_index **out, git_merge_diff_list *diff_list) } } - /* Add each entry in the resolved conflict to the REUC independently, since - * the paths may differ due to renames. */ - git_vector_foreach(&diff_list->resolved, i, conflict) { - const git_index_entry *ancestor = - GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry) ? - &conflict->ancestor_entry : NULL; - - const git_index_entry *ours = - GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->our_entry) ? - &conflict->our_entry : NULL; - - const git_index_entry *theirs = - GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->their_entry) ? - &conflict->their_entry : NULL; - - if (ancestor != NULL && - (error = merge_index_insert_reuc(index, TREE_IDX_ANCESTOR, ancestor)) < 0) - goto on_error; - - if (ours != NULL && - (error = merge_index_insert_reuc(index, TREE_IDX_OURS, ours)) < 0) - goto on_error; - - if (theirs != NULL && - (error = merge_index_insert_reuc(index, TREE_IDX_THEIRS, theirs)) < 0) + if (!skip_reuc) { + if ((error = index_update_reuc(index, diff_list)) < 0) goto on_error; } @@ -1781,16 +1801,19 @@ int index_from_diff_list(git_index **out, git_merge_diff_list *diff_list) on_error: git_index_free(index); - return error; } static git_iterator *iterator_given_or_empty(git_iterator **empty, git_iterator *given) { + git_iterator_options opts = GIT_ITERATOR_OPTIONS_INIT; + if (given) return given; - if (git_iterator_for_nothing(empty, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL) < 0) + opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if (git_iterator_for_nothing(empty, &opts) < 0) return NULL; return *empty; @@ -1809,6 +1832,7 @@ int git_merge__iterators( *empty_theirs = NULL; git_merge_diff_list *diff_list; git_merge_options opts; + git_merge_file_options file_opts = GIT_MERGE_FILE_OPTIONS_INIT; git_merge_diff *conflict; git_vector changes; size_t i; @@ -1824,6 +1848,17 @@ int git_merge__iterators( if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0) return error; + file_opts.favor = opts.file_favor; + file_opts.flags = opts.file_flags; + + /* use the git-inspired labels when virtual base building */ + if (opts.flags & GIT_MERGE__VIRTUAL_BASE) { + file_opts.ancestor_label = "merged common ancestors"; + file_opts.our_label = "Temporary merge branch 1"; + file_opts.their_label = "Temporary merge branch 2"; + file_opts.flags |= GIT_MERGE_FILE_FAVOR__CONFLICTED; + } + diff_list = git_merge_diff_list__alloc(repo); GITERR_CHECK_ALLOC(diff_list); @@ -1842,19 +1877,28 @@ int git_merge__iterators( git_vector_foreach(&changes, i, conflict) { int resolved = 0; - if ((error = merge_conflict_resolve(&resolved, diff_list, conflict, opts.file_favor, opts.file_flags)) < 0) + if ((error = merge_conflict_resolve( + &resolved, diff_list, conflict, &file_opts)) < 0) goto done; - if (!resolved) + if (!resolved) { + if ((opts.flags & GIT_MERGE_FAIL_ON_CONFLICT)) { + giterr_set(GITERR_MERGE, "merge conflicts exist"); + error = GIT_EMERGECONFLICT; + goto done; + } + git_vector_insert(&diff_list->conflicts, conflict); + } } + error = index_from_diff_list(out, diff_list, + (opts.flags & GIT_MERGE_SKIP_REUC)); + +done: if (!given_opts || !given_opts->metric) git__free(opts.metric); - error = index_from_diff_list(out, diff_list); - -done: git_merge_diff_list__free(diff_list); git_iterator_free(empty_ancestor); git_iterator_free(empty_ours); @@ -1872,14 +1916,17 @@ int git_merge_trees( const git_merge_options *merge_opts) { git_iterator *ancestor_iter = NULL, *our_iter = NULL, *their_iter = NULL; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; int error; - if ((error = git_iterator_for_tree(&ancestor_iter, (git_tree *)ancestor_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&our_iter, (git_tree *)our_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&their_iter, (git_tree *)their_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if ((error = git_iterator_for_tree( + &ancestor_iter, (git_tree *)ancestor_tree, &iter_opts)) < 0 || + (error = git_iterator_for_tree( + &our_iter, (git_tree *)our_tree, &iter_opts)) < 0 || + (error = git_iterator_for_tree( + &their_iter, (git_tree *)their_tree, &iter_opts)) < 0) goto done; error = git_merge__iterators( @@ -1893,6 +1940,206 @@ int git_merge_trees( return error; } +static int merge_annotated_commits( + git_index **index_out, + git_annotated_commit **base_out, + git_repository *repo, + git_annotated_commit *our_commit, + git_annotated_commit *their_commit, + size_t recursion_level, + const git_merge_options *opts); + +GIT_INLINE(int) insert_head_ids( + git_array_oid_t *ids, + const git_annotated_commit *annotated_commit) +{ + git_oid *id; + size_t i; + + if (annotated_commit->type == GIT_ANNOTATED_COMMIT_REAL) { + id = git_array_alloc(*ids); + GITERR_CHECK_ALLOC(id); + + git_oid_cpy(id, git_commit_id(annotated_commit->commit)); + } else { + for (i = 0; i < annotated_commit->parents.size; i++) { + id = git_array_alloc(*ids); + GITERR_CHECK_ALLOC(id); + + git_oid_cpy(id, &annotated_commit->parents.ptr[i]); + } + } + + return 0; +} + +static int create_virtual_base( + git_annotated_commit **out, + git_repository *repo, + git_annotated_commit *one, + git_annotated_commit *two, + const git_merge_options *opts, + size_t recursion_level) +{ + git_annotated_commit *result = NULL; + git_index *index = NULL; + git_merge_options virtual_opts = GIT_MERGE_OPTIONS_INIT; + + /* Conflicts in the merge base creation do not propagate to conflicts + * in the result; the conflicted base will act as the common ancestor. + */ + if (opts) + memcpy(&virtual_opts, opts, sizeof(git_merge_options)); + + virtual_opts.flags &= ~GIT_MERGE_FAIL_ON_CONFLICT; + virtual_opts.flags |= GIT_MERGE__VIRTUAL_BASE; + + if ((merge_annotated_commits(&index, NULL, repo, one, two, + recursion_level + 1, &virtual_opts)) < 0) + return -1; + + result = git__calloc(1, sizeof(git_annotated_commit)); + GITERR_CHECK_ALLOC(result); + result->type = GIT_ANNOTATED_COMMIT_VIRTUAL; + result->index = index; + + insert_head_ids(&result->parents, one); + insert_head_ids(&result->parents, two); + + *out = result; + return 0; +} + +static int compute_base( + git_annotated_commit **out, + git_repository *repo, + const git_annotated_commit *one, + const git_annotated_commit *two, + const git_merge_options *given_opts, + size_t recursion_level) +{ + git_array_oid_t head_ids = GIT_ARRAY_INIT; + git_oidarray bases = {0}; + git_annotated_commit *base = NULL, *other = NULL, *new_base = NULL; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + size_t i; + int error; + + *out = NULL; + + if (given_opts) + memcpy(&opts, given_opts, sizeof(git_merge_options)); + + if ((error = insert_head_ids(&head_ids, one)) < 0 || + (error = insert_head_ids(&head_ids, two)) < 0) + goto done; + + if ((error = git_merge_bases_many(&bases, repo, + head_ids.size, head_ids.ptr)) < 0 || + (error = git_annotated_commit_lookup(&base, repo, &bases.ids[0])) < 0 || + (opts.flags & GIT_MERGE_NO_RECURSIVE)) + goto done; + + for (i = 1; i < bases.count; i++) { + recursion_level++; + + if (opts.recursion_limit && recursion_level > opts.recursion_limit) + break; + + if ((error = git_annotated_commit_lookup(&other, repo, + &bases.ids[i])) < 0 || + (error = create_virtual_base(&new_base, repo, base, other, &opts, + recursion_level)) < 0) + goto done; + + git_annotated_commit_free(base); + git_annotated_commit_free(other); + + base = new_base; + new_base = NULL; + other = NULL; + } + +done: + if (error == 0) + *out = base; + else + git_annotated_commit_free(base); + + git_annotated_commit_free(other); + git_annotated_commit_free(new_base); + git_oidarray_free(&bases); + git_array_clear(head_ids); + return error; +} + +static int iterator_for_annotated_commit( + git_iterator **out, + git_annotated_commit *commit) +{ + git_iterator_options opts = GIT_ITERATOR_OPTIONS_INIT; + int error; + + opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if (commit == NULL) { + error = git_iterator_for_nothing(out, &opts); + } else if (commit->type == GIT_ANNOTATED_COMMIT_VIRTUAL) { + error = git_iterator_for_index(out, git_index_owner(commit->index), commit->index, &opts); + } else { + if (!commit->tree && + (error = git_commit_tree(&commit->tree, commit->commit)) < 0) + goto done; + + error = git_iterator_for_tree(out, commit->tree, &opts); + } + +done: + return error; +} + +static int merge_annotated_commits( + git_index **index_out, + git_annotated_commit **base_out, + git_repository *repo, + git_annotated_commit *ours, + git_annotated_commit *theirs, + size_t recursion_level, + const git_merge_options *opts) +{ + git_annotated_commit *base = NULL; + git_iterator *base_iter = NULL, *our_iter = NULL, *their_iter = NULL; + int error; + + if ((error = compute_base(&base, repo, ours, theirs, opts, + recursion_level)) < 0) { + + if (error != GIT_ENOTFOUND) + goto done; + + giterr_clear(); + } + + if ((error = iterator_for_annotated_commit(&base_iter, base)) < 0 || + (error = iterator_for_annotated_commit(&our_iter, ours)) < 0 || + (error = iterator_for_annotated_commit(&their_iter, theirs)) < 0 || + (error = git_merge__iterators(index_out, repo, base_iter, our_iter, + their_iter, opts)) < 0) + goto done; + + if (base_out) { + *base_out = base; + base = NULL; + } + +done: + git_annotated_commit_free(base); + git_iterator_free(base_iter); + git_iterator_free(our_iter); + git_iterator_free(their_iter); + return error; +} + int git_merge_commits( git_index **out, @@ -1901,30 +2148,19 @@ int git_merge_commits( const git_commit *their_commit, const git_merge_options *opts) { - git_oid ancestor_oid; - git_commit *ancestor_commit = NULL; - git_tree *our_tree = NULL, *their_tree = NULL, *ancestor_tree = NULL; + git_annotated_commit *ours = NULL, *theirs = NULL, *base = NULL; int error = 0; - if ((error = git_merge_base(&ancestor_oid, repo, git_commit_id(our_commit), git_commit_id(their_commit))) < 0 && - error == GIT_ENOTFOUND) - giterr_clear(); - else if (error < 0 || - (error = git_commit_lookup(&ancestor_commit, repo, &ancestor_oid)) < 0 || - (error = git_commit_tree(&ancestor_tree, ancestor_commit)) < 0) + if ((error = git_annotated_commit_from_commit(&ours, (git_commit *)our_commit)) < 0 || + (error = git_annotated_commit_from_commit(&theirs, (git_commit *)their_commit)) < 0) goto done; - if ((error = git_commit_tree(&our_tree, our_commit)) < 0 || - (error = git_commit_tree(&their_tree, their_commit)) < 0 || - (error = git_merge_trees(out, repo, ancestor_tree, our_tree, their_tree, opts)) < 0) - goto done; + error = merge_annotated_commits(out, &base, repo, ours, theirs, 0, opts); done: - git_commit_free(ancestor_commit); - git_tree_free(our_tree); - git_tree_free(their_tree); - git_tree_free(ancestor_tree); - + git_annotated_commit_free(ours); + git_annotated_commit_free(theirs); + git_annotated_commit_free(base); return error; } @@ -2191,7 +2427,7 @@ static int write_merge_msg( assert(repo && heads); entries = git__calloc(heads_len, sizeof(struct merge_msg_entry)); - GITERR_CHECK_ALLOC(entries); + GITERR_CHECK_ALLOC(entries); if (git_vector_init(&matching, heads_len, NULL) < 0) { git__free(entries); @@ -2245,7 +2481,7 @@ static int write_merge_msg( if (matching.length) sep =','; - + if ((error = merge_msg_entries(&matching, entries, heads_len, msg_entry_is_tag)) < 0 || (error = merge_msg_write_tags(&file, &matching, sep)) < 0) goto cleanup; @@ -2358,49 +2594,50 @@ const char *merge_their_label(const char *branchname) } static int merge_normalize_checkout_opts( + git_checkout_options *out, git_repository *repo, - git_checkout_options *checkout_opts, const git_checkout_options *given_checkout_opts, - const git_annotated_commit *ancestor_head, + unsigned int checkout_strategy, + git_annotated_commit *ancestor, const git_annotated_commit *our_head, - size_t their_heads_len, - const git_annotated_commit **their_heads) + const git_annotated_commit **their_heads, + size_t their_heads_len) { + git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; int error = 0; GIT_UNUSED(repo); if (given_checkout_opts != NULL) - memcpy(checkout_opts, given_checkout_opts, sizeof(git_checkout_options)); - else { - git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; - default_checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + memcpy(out, given_checkout_opts, sizeof(git_checkout_options)); + else + memcpy(out, &default_checkout_opts, sizeof(git_checkout_options)); - memcpy(checkout_opts, &default_checkout_opts, sizeof(git_checkout_options)); - } + out->checkout_strategy = checkout_strategy; - /* TODO: for multiple ancestors in merge-recursive, this is "merged common ancestors" */ - if (!checkout_opts->ancestor_label) { - if (ancestor_head && ancestor_head->commit) - checkout_opts->ancestor_label = git_commit_summary(ancestor_head->commit); + if (!out->ancestor_label) { + if (ancestor && ancestor->type == GIT_ANNOTATED_COMMIT_REAL) + out->ancestor_label = git_commit_summary(ancestor->commit); + else if (ancestor) + out->ancestor_label = "merged common ancestors"; else - checkout_opts->ancestor_label = "ancestor"; + out->ancestor_label = "empty base"; } - if (!checkout_opts->our_label) { + if (!out->our_label) { if (our_head && our_head->ref_name) - checkout_opts->our_label = our_head->ref_name; + out->our_label = our_head->ref_name; else - checkout_opts->our_label = "ours"; + out->our_label = "ours"; } - if (!checkout_opts->their_label) { + if (!out->their_label) { if (their_heads_len == 1 && their_heads[0]->ref_name) - checkout_opts->their_label = merge_their_label(their_heads[0]->ref_name); + out->their_label = merge_their_label(their_heads[0]->ref_name); else if (their_heads_len == 1) - checkout_opts->their_label = their_heads[0]->id_str; + out->their_label = their_heads[0]->id_str; else - checkout_opts->their_label = "theirs"; + out->their_label = "theirs"; } return error; @@ -2411,6 +2648,7 @@ static int merge_check_index(size_t *conflicts, git_repository *repo, git_index git_tree *head_tree = NULL; git_index *index_repo = NULL; git_iterator *iter_repo = NULL, *iter_new = NULL; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; git_diff *staged_diff_list = NULL, *index_diff_list = NULL; git_diff_delta *delta; git_diff_options opts = GIT_DIFF_OPTIONS_INIT; @@ -2440,11 +2678,12 @@ static int merge_check_index(size_t *conflicts, git_repository *repo, git_index goto done; } - opts.pathspec.count = staged_paths.length; - opts.pathspec.strings = (char **)staged_paths.contents; + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + iter_opts.pathlist.strings = (char **)staged_paths.contents; + iter_opts.pathlist.count = staged_paths.length; - if ((error = git_iterator_for_index(&iter_repo, index_repo, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&iter_new, index_new, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + if ((error = git_iterator_for_index(&iter_repo, repo, index_repo, &iter_opts)) < 0 || + (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 || (error = git_diff__from_iterators(&index_diff_list, repo, iter_repo, iter_new, &opts)) < 0) goto done; @@ -2488,6 +2727,7 @@ static int merge_check_workdir(size_t *conflicts, git_repository *repo, git_inde * will be applied by the merge (including conflicts). Ensure that there * are no changes in the workdir to these paths. */ + opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; opts.pathspec.count = merged_paths->length; opts.pathspec.strings = (char **)merged_paths->contents; @@ -2506,6 +2746,7 @@ int git_merge__check_result(git_repository *repo, git_index *index_new) { git_tree *head_tree = NULL; git_iterator *iter_head = NULL, *iter_new = NULL; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; git_diff *merged_list = NULL; git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff_delta *delta; @@ -2514,9 +2755,11 @@ int git_merge__check_result(git_repository *repo, git_index *index_new) const git_index_entry *e; int error = 0; + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + if ((error = git_repository_head_tree(&head_tree, repo)) < 0 || - (error = git_iterator_for_tree(&iter_head, head_tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&iter_new, index_new, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + (error = git_iterator_for_tree(&iter_head, head_tree, &iter_opts)) < 0 || + (error = git_iterator_for_index(&iter_new, repo, index_new, &iter_opts)) < 0 || (error = git_diff__from_iterators(&merged_list, repo, iter_head, iter_new, &opts)) < 0) goto done; @@ -2747,11 +2990,10 @@ int git_merge( { git_reference *our_ref = NULL; git_checkout_options checkout_opts; - git_annotated_commit *ancestor_head = NULL, *our_head = NULL; - git_tree *ancestor_tree = NULL, *our_tree = NULL, **their_trees = NULL; + git_annotated_commit *our_head = NULL, *base = NULL; git_index *index = NULL; git_indexwriter indexwriter = GIT_INDEXWRITER_INIT; - size_t i; + unsigned int checkout_strategy; int error = 0; assert(repo && their_heads); @@ -2761,61 +3003,49 @@ int git_merge( return -1; } - their_trees = git__calloc(their_heads_len, sizeof(git_tree *)); - GITERR_CHECK_ALLOC(their_trees); - - if ((error = merge_heads(&ancestor_head, &our_head, repo, their_heads, their_heads_len)) < 0 || - (error = merge_normalize_checkout_opts(repo, &checkout_opts, given_checkout_opts, - ancestor_head, our_head, their_heads_len, their_heads)) < 0 || - (error = git_indexwriter_init_for_operation(&indexwriter, repo, &checkout_opts.checkout_strategy)) < 0) - goto on_error; - - /* Write the merge files to the repository. */ - if ((error = git_merge__setup(repo, our_head, their_heads, their_heads_len)) < 0) - goto on_error; + if ((error = git_repository__ensure_not_bare(repo, "merge")) < 0) + goto done; - if (ancestor_head != NULL && - (error = git_commit_tree(&ancestor_tree, ancestor_head->commit)) < 0) - goto on_error; + checkout_strategy = given_checkout_opts ? + given_checkout_opts->checkout_strategy : + GIT_CHECKOUT_SAFE; - if ((error = git_commit_tree(&our_tree, our_head->commit)) < 0) - goto on_error; + if ((error = git_indexwriter_init_for_operation(&indexwriter, repo, + &checkout_strategy)) < 0) + goto done; - for (i = 0; i < their_heads_len; i++) { - if ((error = git_commit_tree(&their_trees[i], their_heads[i]->commit)) < 0) - goto on_error; - } + /* Write the merge setup files to the repository. */ + if ((error = git_annotated_commit_from_head(&our_head, repo)) < 0 || + (error = git_merge__setup(repo, our_head, their_heads, + their_heads_len)) < 0) + goto done; - /* TODO: recursive, octopus, etc... */ + /* TODO: octopus */ - if ((error = git_merge_trees(&index, repo, ancestor_tree, our_tree, their_trees[0], merge_opts)) < 0 || + if ((error = merge_annotated_commits(&index, &base, repo, our_head, + (git_annotated_commit *)their_heads[0], 0, merge_opts)) < 0 || (error = git_merge__check_result(repo, index)) < 0 || - (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 || - (error = git_checkout_index(repo, index, &checkout_opts)) < 0 || - (error = git_indexwriter_commit(&indexwriter)) < 0) - goto on_error; + (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0) + goto done; - goto done; + /* check out the merge results */ -on_error: - merge_state_cleanup(repo); + if ((error = merge_normalize_checkout_opts(&checkout_opts, repo, + given_checkout_opts, checkout_strategy, + base, our_head, their_heads, their_heads_len)) < 0 || + (error = git_checkout_index(repo, index, &checkout_opts)) < 0) + goto done; + + error = git_indexwriter_commit(&indexwriter); done: - git_indexwriter_cleanup(&indexwriter); + if (error < 0) + merge_state_cleanup(repo); + git_indexwriter_cleanup(&indexwriter); git_index_free(index); - - git_tree_free(ancestor_tree); - git_tree_free(our_tree); - - for (i = 0; i < their_heads_len; i++) - git_tree_free(their_trees[i]); - - git__free(their_trees); - git_annotated_commit_free(our_head); - git_annotated_commit_free(ancestor_head); - + git_annotated_commit_free(base); git_reference_free(our_ref); return error; diff --git a/vendor/libgit2/src/merge.h b/vendor/libgit2/src/merge.h index 3caf617c6..bd839be49 100644 --- a/vendor/libgit2/src/merge.h +++ b/vendor/libgit2/src/merge.h @@ -19,8 +19,8 @@ #define GIT_MERGE_MODE_FILE "MERGE_MODE" #define GIT_MERGE_FILE_MODE 0666 -#define GIT_MERGE_TREE_RENAME_THRESHOLD 50 -#define GIT_MERGE_TREE_TARGET_LIMIT 1000 +#define GIT_MERGE_DEFAULT_RENAME_THRESHOLD 50 +#define GIT_MERGE_DEFAULT_TARGET_LIMIT 1000 /** Types of changes when files are merged from branch to branch. */ typedef enum { diff --git a/vendor/libgit2/src/mwindow.c b/vendor/libgit2/src/mwindow.c index 55c8d894b..d3e9be78b 100644 --- a/vendor/libgit2/src/mwindow.c +++ b/vendor/libgit2/src/mwindow.c @@ -296,8 +296,18 @@ static git_mwindow *new_window( */ if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) { - git__free(w); - return NULL; + /* + * The first error might be down to memory fragmentation even if + * we're below our soft limits, so free up what we can and try again. + */ + + while (git_mwindow_close_lru(mwf) == 0) + /* nop */; + + if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) { + git__free(w); + return NULL; + } } ctl->mmap_calls++; diff --git a/vendor/libgit2/src/netops.c b/vendor/libgit2/src/netops.c index 5e8075597..c4241989f 100644 --- a/vendor/libgit2/src/netops.c +++ b/vendor/libgit2/src/netops.c @@ -261,6 +261,10 @@ int gitno_extract_url_parts( *path = git__substrdup(_path, u.field_data[UF_PATH].len); GITERR_CHECK_ALLOC(*path); } else { + git__free(*port); + *port = NULL; + git__free(*host); + *host = NULL; giterr_set(GITERR_NET, "invalid url, missing path"); return GIT_EINVALIDSPEC; } diff --git a/vendor/libgit2/src/notes.c b/vendor/libgit2/src/notes.c index ef4b41b31..fe8d2164f 100644 --- a/vendor/libgit2/src/notes.c +++ b/vendor/libgit2/src/notes.c @@ -663,7 +663,7 @@ int git_note_iterator_new( if (error < 0) goto cleanup; - if ((error = git_iterator_for_tree(it, tree, 0, NULL, NULL)) < 0) + if ((error = git_iterator_for_tree(it, tree, NULL)) < 0) git_iterator_free(*it); cleanup: diff --git a/vendor/libgit2/src/object.c b/vendor/libgit2/src/object.c index 1073559fd..1d45f9f1b 100644 --- a/vendor/libgit2/src/object.c +++ b/vendor/libgit2/src/object.c @@ -12,9 +12,10 @@ #include "commit.h" #include "tree.h" #include "blob.h" +#include "oid.h" #include "tag.h" -static const int OBJECT_BASE_SIZE = 4096; +bool git_object__strict_input_validation = true; typedef struct { const char *str; /* type name string */ @@ -166,13 +167,9 @@ int git_object_lookup_prefix( error = git_odb_read(&odb_obj, odb, id); } } else { - git_oid short_oid; + git_oid short_oid = {{ 0 }}; - /* We copy the first len*4 bits from id and fill the remaining with 0s */ - memcpy(short_oid.id, id->id, (len + 1) / 2); - if (len % 2) - short_oid.id[len / 2] &= 0xF0; - memset(short_oid.id + (len + 1) / 2, 0, (GIT_OID_HEXSZ - len) / 2); + git_oid__cpy_prefix(&short_oid, id, len); /* If len < GIT_OID_HEXSZ (a strict short oid was given), we have * 2 options : @@ -467,3 +464,27 @@ int git_object_short_id(git_buf *out, const git_object *obj) return error; } +bool git_object__is_valid( + git_repository *repo, const git_oid *id, git_otype expected_type) +{ + git_odb *odb; + git_otype actual_type; + size_t len; + int error; + + if (!git_object__strict_input_validation) + return true; + + if ((error = git_repository_odb__weakptr(&odb, repo)) < 0 || + (error = git_odb_read_header(&len, &actual_type, odb, id)) < 0) + return false; + + if (expected_type != GIT_OBJ_ANY && expected_type != actual_type) { + giterr_set(GITERR_INVALID, + "the requested type does not match the type in the ODB"); + return false; + } + + return true; +} + diff --git a/vendor/libgit2/src/object.h b/vendor/libgit2/src/object.h index d187c55b7..dd227d16d 100644 --- a/vendor/libgit2/src/object.h +++ b/vendor/libgit2/src/object.h @@ -7,6 +7,10 @@ #ifndef INCLUDE_object_h__ #define INCLUDE_object_h__ +#include "repository.h" + +extern bool git_object__strict_input_validation; + /** Base git object for inheritance */ struct git_object { git_cached_obj cached; @@ -28,4 +32,23 @@ int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid); +bool git_object__is_valid( + git_repository *repo, const git_oid *id, git_otype expected_type); + +GIT_INLINE(git_otype) git_object__type_from_filemode(git_filemode_t mode) +{ + switch (mode) { + case GIT_FILEMODE_TREE: + return GIT_OBJ_TREE; + case GIT_FILEMODE_COMMIT: + return GIT_OBJ_COMMIT; + case GIT_FILEMODE_BLOB: + case GIT_FILEMODE_BLOB_EXECUTABLE: + case GIT_FILEMODE_LINK: + return GIT_OBJ_BLOB; + default: + return GIT_OBJ_BAD; + } +} + #endif diff --git a/vendor/libgit2/src/odb.c b/vendor/libgit2/src/odb.c index 805d2c333..cb0f70623 100644 --- a/vendor/libgit2/src/odb.c +++ b/vendor/libgit2/src/odb.c @@ -604,8 +604,7 @@ static void odb_free(git_odb *db) backend_internal *internal = git_vector_get(&db->backends, i); git_odb_backend *backend = internal->backend; - if (backend->free) backend->free(backend); - else git__free(backend); + backend->free(backend); git__free(internal); } @@ -726,7 +725,8 @@ int git_odb_exists_prefix( git_oid_cpy(out, short_id); return 0; } else { - return git_odb__error_notfound("no match for id prefix", short_id); + return git_odb__error_notfound( + "no match for id prefix", short_id, len); } } @@ -741,7 +741,7 @@ int git_odb_exists_prefix( error = odb_exists_prefix_1(out, db, &key, len, true); if (error == GIT_ENOTFOUND) - return git_odb__error_notfound("no match for id prefix", &key); + return git_odb__error_notfound("no match for id prefix", &key, len); return error; } @@ -882,7 +882,7 @@ int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id) error = odb_read_1(out, db, id, true); if (error == GIT_ENOTFOUND) - return git_odb__error_notfound("no match for id", id); + return git_odb__error_notfound("no match for id", id, GIT_OID_HEXSZ); return error; } @@ -968,7 +968,7 @@ int git_odb_read_prefix( error = read_prefix_1(out, db, &key, len, true); if (error == GIT_ENOTFOUND) - return git_odb__error_notfound("no match for prefix", &key); + return git_odb__error_notfound("no match for prefix", &key, len); return error; } @@ -1224,12 +1224,14 @@ int git_odb_refresh(struct git_odb *db) return 0; } -int git_odb__error_notfound(const char *message, const git_oid *oid) +int git_odb__error_notfound( + const char *message, const git_oid *oid, size_t oid_len) { if (oid != NULL) { char oid_str[GIT_OID_HEXSZ + 1]; - git_oid_tostr(oid_str, sizeof(oid_str), oid); - giterr_set(GITERR_ODB, "Object not found - %s (%s)", message, oid_str); + git_oid_tostr(oid_str, oid_len, oid); + giterr_set(GITERR_ODB, "Object not found - %s (%.*s)", + message, oid_len, oid_str); } else giterr_set(GITERR_ODB, "Object not found - %s", message); diff --git a/vendor/libgit2/src/odb.h b/vendor/libgit2/src/odb.h index 281bd3a4d..31a9fd1b9 100644 --- a/vendor/libgit2/src/odb.h +++ b/vendor/libgit2/src/odb.h @@ -82,7 +82,8 @@ int git_odb__hashlink(git_oid *out, const char *path); /* * Generate a GIT_ENOTFOUND error for the ODB. */ -int git_odb__error_notfound(const char *message, const git_oid *oid); +int git_odb__error_notfound( + const char *message, const git_oid *oid, size_t oid_len); /* * Generate a GIT_EAMBIGUOUS error for the ODB. diff --git a/vendor/libgit2/src/odb_loose.c b/vendor/libgit2/src/odb_loose.c index 99b8f7c91..9d9bffd21 100644 --- a/vendor/libgit2/src/odb_loose.c +++ b/vendor/libgit2/src/odb_loose.c @@ -84,9 +84,9 @@ static int object_file_name( static int object_mkdir(const git_buf *name, const loose_backend *be) { - return git_futils_mkdir( + return git_futils_mkdir_relative( name->ptr + be->objects_dirlen, be->objects_dir, be->object_dir_mode, - GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST | GIT_MKDIR_VERIFY_DIR); + GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST | GIT_MKDIR_VERIFY_DIR, NULL); } static size_t get_binary_object_header(obj_hdr *hdr, git_buf *obj) @@ -547,7 +547,8 @@ static int locate_object_short_oid( /* Check that directory exists */ if (git_path_isdir(object_location->ptr) == false) - return git_odb__error_notfound("no matching loose object for prefix", short_oid); + return git_odb__error_notfound("no matching loose object for prefix", + short_oid, len); state.dir_len = git_buf_len(object_location); state.short_oid_len = len; @@ -560,7 +561,8 @@ static int locate_object_short_oid( return error; if (!state.found) - return git_odb__error_notfound("no matching loose object for prefix", short_oid); + return git_odb__error_notfound("no matching loose object for prefix", + short_oid, len); if (state.found > 1) return git_odb__error_ambiguous("multiple matches in loose objects"); @@ -613,9 +615,10 @@ static int loose_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_ raw.len = 0; raw.type = GIT_OBJ_BAD; - if (locate_object(&object_path, (loose_backend *)backend, oid) < 0) - error = git_odb__error_notfound("no matching loose object", oid); - else if ((error = read_header_loose(&raw, &object_path)) == 0) { + if (locate_object(&object_path, (loose_backend *)backend, oid) < 0) { + error = git_odb__error_notfound("no matching loose object", + oid, GIT_OID_HEXSZ); + } else if ((error = read_header_loose(&raw, &object_path)) == 0) { *len_p = raw.len; *type_p = raw.type; } @@ -633,9 +636,10 @@ static int loose_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p assert(backend && oid); - if (locate_object(&object_path, (loose_backend *)backend, oid) < 0) - error = git_odb__error_notfound("no matching loose object", oid); - else if ((error = read_loose(&raw, &object_path)) == 0) { + if (locate_object(&object_path, (loose_backend *)backend, oid) < 0) { + error = git_odb__error_notfound("no matching loose object", + oid, GIT_OID_HEXSZ); + } else if ((error = read_loose(&raw, &object_path)) == 0) { *buffer_p = raw.data; *len_p = raw.len; *type_p = raw.type; diff --git a/vendor/libgit2/src/odb_mempack.c b/vendor/libgit2/src/odb_mempack.c index 73accabb5..594a2784c 100644 --- a/vendor/libgit2/src/odb_mempack.c +++ b/vendor/libgit2/src/odb_mempack.c @@ -155,17 +155,14 @@ void git_mempack_reset(git_odb_backend *_backend) git_array_clear(db->commits); - git_oidmap_free(db->objects); - db->objects = git_oidmap_alloc(); + git_oidmap_clear(db->objects); } static void impl__free(git_odb_backend *_backend) { struct memory_packer_db *db = (struct memory_packer_db *)_backend; - git_mempack_reset((git_odb_backend *) db); git_oidmap_free(db->objects); - git__free(db); } diff --git a/vendor/libgit2/src/odb_pack.c b/vendor/libgit2/src/odb_pack.c index 77d2c75b9..5a57864ad 100644 --- a/vendor/libgit2/src/odb_pack.c +++ b/vendor/libgit2/src/odb_pack.c @@ -264,7 +264,8 @@ static int pack_entry_find(struct git_pack_entry *e, struct pack_backend *backen if (!pack_entry_find_inner(e, backend, oid, last_found)) return 0; - return git_odb__error_notfound("failed to find pack entry", oid); + return git_odb__error_notfound( + "failed to find pack entry", oid, GIT_OID_HEXSZ); } static int pack_entry_find_prefix( @@ -309,7 +310,8 @@ static int pack_entry_find_prefix( } if (!found) - return git_odb__error_notfound("no matching pack entry for prefix", short_oid); + return git_odb__error_notfound("no matching pack entry for prefix", + short_oid, len); else return 0; } @@ -333,7 +335,7 @@ static int pack_backend__refresh(git_odb_backend *backend_) return 0; if (p_stat(backend->pack_folder, &st) < 0 || !S_ISDIR(st.st_mode)) - return git_odb__error_notfound("failed to refresh packfiles", NULL); + return git_odb__error_notfound("failed to refresh packfiles", NULL, 0); git_buf_sets(&path, backend->pack_folder); diff --git a/vendor/libgit2/src/oid.h b/vendor/libgit2/src/oid.h index aa1f0bfdc..922a2a347 100644 --- a/vendor/libgit2/src/oid.h +++ b/vendor/libgit2/src/oid.h @@ -44,4 +44,13 @@ GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b) return git_oid__hashcmp(a->id, b->id); } +GIT_INLINE(void) git_oid__cpy_prefix( + git_oid *out, const git_oid *id, size_t len) +{ + memcpy(&out->id, id->id, (len + 1) / 2); + + if (len & 1) + out->id[len / 2] &= 0xF0; +} + #endif diff --git a/vendor/libgit2/src/oidmap.h b/vendor/libgit2/src/oidmap.h index d2c451e7f..2cf208f53 100644 --- a/vendor/libgit2/src/oidmap.h +++ b/vendor/libgit2/src/oidmap.h @@ -49,4 +49,6 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid) #define git_oidmap_size(h) kh_size(h) +#define git_oidmap_clear(h) kh_clear(oid, h) + #endif diff --git a/vendor/libgit2/src/openssl_stream.c b/vendor/libgit2/src/openssl_stream.c index 16ee78341..a65f5586e 100644 --- a/vendor/libgit2/src/openssl_stream.c +++ b/vendor/libgit2/src/openssl_stream.c @@ -15,6 +15,7 @@ #include "socket_stream.h" #include "netops.h" #include "git2/transport.h" +#include "git2/sys/openssl.h" #ifdef GIT_CURL # include "curl_stream.h" @@ -31,6 +32,128 @@ #include #include +SSL_CTX *git__ssl_ctx; + +#define GIT_SSL_DEFAULT_CIPHERS "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES128-SHA256:DHE-DSS-AES256-SHA256:DHE-DSS-AES128-SHA:DHE-DSS-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA" + +#ifdef GIT_THREADS + +static git_mutex *openssl_locks; + +static void openssl_locking_function( + int mode, int n, const char *file, int line) +{ + int lock; + + GIT_UNUSED(file); + GIT_UNUSED(line); + + lock = mode & CRYPTO_LOCK; + + if (lock) { + git_mutex_lock(&openssl_locks[n]); + } else { + git_mutex_unlock(&openssl_locks[n]); + } +} + +static void shutdown_ssl_locking(void) +{ + int num_locks, i; + + num_locks = CRYPTO_num_locks(); + CRYPTO_set_locking_callback(NULL); + + for (i = 0; i < num_locks; ++i) + git_mutex_free(openssl_locks); + git__free(openssl_locks); +} + +#endif /* GIT_THREADS */ + +/** + * This function aims to clean-up the SSL context which + * we allocated. + */ +static void shutdown_ssl(void) +{ + if (git__ssl_ctx) { + SSL_CTX_free(git__ssl_ctx); + git__ssl_ctx = NULL; + } +} + +int git_openssl_stream_global_init(void) +{ +#ifdef GIT_OPENSSL + long ssl_opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; + const char *ciphers = git_libgit2__ssl_ciphers(); + + /* Older OpenSSL and MacOS OpenSSL doesn't have this */ +#ifdef SSL_OP_NO_COMPRESSION + ssl_opts |= SSL_OP_NO_COMPRESSION; +#endif + + SSL_load_error_strings(); + OpenSSL_add_ssl_algorithms(); + /* + * Load SSLv{2,3} and TLSv1 so that we can talk with servers + * which use the SSL hellos, which are often used for + * compatibility. We then disable SSL so we only allow OpenSSL + * to speak TLSv1 to perform the encryption itself. + */ + git__ssl_ctx = SSL_CTX_new(SSLv23_method()); + SSL_CTX_set_options(git__ssl_ctx, ssl_opts); + SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY); + SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL); + if (!SSL_CTX_set_default_verify_paths(git__ssl_ctx)) { + SSL_CTX_free(git__ssl_ctx); + git__ssl_ctx = NULL; + return -1; + } + + if (!ciphers) { + ciphers = GIT_SSL_DEFAULT_CIPHERS; + } + + if(!SSL_CTX_set_cipher_list(git__ssl_ctx, ciphers)) { + SSL_CTX_free(git__ssl_ctx); + git__ssl_ctx = NULL; + return -1; + } +#endif + + git__on_shutdown(shutdown_ssl); + + return 0; +} + +int git_openssl_set_locking(void) +{ +#ifdef GIT_THREADS + int num_locks, i; + + num_locks = CRYPTO_num_locks(); + openssl_locks = git__calloc(num_locks, sizeof(git_mutex)); + GITERR_CHECK_ALLOC(openssl_locks); + + for (i = 0; i < num_locks; i++) { + if (git_mutex_init(&openssl_locks[i]) != 0) { + giterr_set(GITERR_SSL, "failed to initialize openssl locks"); + return -1; + } + } + + CRYPTO_set_locking_callback(openssl_locking_function); + git__on_shutdown(shutdown_ssl_locking); + return 0; +#else + giterr_set(GITERR_THREAD, "libgit2 as not built with threads"); + return -1; +#endif +} + + static int bio_create(BIO *b) { b->init = 1; @@ -158,7 +281,6 @@ static int ssl_teardown(SSL *ssl) else ret = 0; - SSL_free(ssl); return ret; } @@ -274,6 +396,8 @@ static int verify_server_cert(SSL *ssl, const char *host) GITERR_CHECK_ALLOC(peer_cn); memcpy(peer_cn, ASN1_STRING_data(str), size); peer_cn[size] = '\0'; + } else { + goto cert_fail_name; } } else { int size = ASN1_STRING_to_UTF8(&peer_cn, str); @@ -363,11 +487,12 @@ int openssl_certificate(git_cert **out, git_stream *stream) return -1; } - st->cert_info.cert_type = GIT_CERT_X509; + st->cert_info.parent.cert_type = GIT_CERT_X509; st->cert_info.data = encoded_cert; st->cert_info.len = len; - *out = (git_cert *)&st->cert_info; + *out = &st->cert_info.parent; + return 0; } @@ -420,6 +545,7 @@ void openssl_free(git_stream *stream) { openssl_stream *st = (openssl_stream *) stream; + SSL_free(st->ssl); git__free(st->host); git__free(st->cert_info.data); git_stream_free(st->io); @@ -434,6 +560,7 @@ int git_openssl_stream_new(git_stream **out, const char *host, const char *port) st = git__calloc(1, sizeof(openssl_stream)); GITERR_CHECK_ALLOC(st); + st->io = NULL; #ifdef GIT_CURL error = git_curl_stream_new(&st->io, host, port); #else @@ -441,12 +568,13 @@ int git_openssl_stream_new(git_stream **out, const char *host, const char *port) #endif if (error < 0) - return error; + goto out_err; st->ssl = SSL_new(git__ssl_ctx); if (st->ssl == NULL) { giterr_set(GITERR_SSL, "failed to create ssl object"); - return -1; + error = -1; + goto out_err; } st->host = git__strdup(host); @@ -465,11 +593,29 @@ int git_openssl_stream_new(git_stream **out, const char *host, const char *port) *out = (git_stream *) st; return 0; + +out_err: + git_stream_free(st->io); + git__free(st); + + return error; } #else #include "stream.h" +#include "git2/sys/openssl.h" + +int git_openssl_stream_global_init(void) +{ + return 0; +} + +int git_openssl_set_locking(void) +{ + giterr_set(GITERR_SSL, "libgit2 was not built with OpenSSL support"); + return -1; +} int git_openssl_stream_new(git_stream **out, const char *host, const char *port) { diff --git a/vendor/libgit2/src/openssl_stream.h b/vendor/libgit2/src/openssl_stream.h index 9ca06489e..82b5110c4 100644 --- a/vendor/libgit2/src/openssl_stream.h +++ b/vendor/libgit2/src/openssl_stream.h @@ -9,6 +9,8 @@ #include "git2/sys/stream.h" +extern int git_openssl_stream_global_init(void); + extern int git_openssl_stream_new(git_stream **out, const char *host, const char *port); #endif diff --git a/vendor/libgit2/src/pack-objects.c b/vendor/libgit2/src/pack-objects.c index c4c061a3a..11e13f7d4 100644 --- a/vendor/libgit2/src/pack-objects.c +++ b/vendor/libgit2/src/pack-objects.c @@ -91,7 +91,7 @@ static unsigned name_hash(const char *name) static int packbuilder_config(git_packbuilder *pb) { git_config *config; - int ret; + int ret = 0; int64_t val; if ((ret = git_repository_config_snapshot(&config, pb->repo)) < 0) @@ -100,8 +100,10 @@ static int packbuilder_config(git_packbuilder *pb) #define config_get(KEY,DST,DFLT) do { \ ret = git_config_get_int64(&val, config, KEY); \ if (!ret) (DST) = val; \ - else if (ret == GIT_ENOTFOUND) (DST) = (DFLT); \ - else if (ret < 0) return -1; } while (0) + else if (ret == GIT_ENOTFOUND) { \ + (DST) = (DFLT); \ + ret = 0; \ + } else if (ret < 0) goto out; } while (0) config_get("pack.deltaCacheSize", pb->max_delta_cache_size, GIT_PACK_DELTA_CACHE_SIZE); @@ -113,9 +115,10 @@ static int packbuilder_config(git_packbuilder *pb) #undef config_get +out: git_config_free(config); - return 0; + return ret; } int git_packbuilder_new(git_packbuilder **out, git_repository *repo) @@ -135,8 +138,7 @@ int git_packbuilder_new(git_packbuilder **out, git_repository *repo) if (!pb->walk_objects) goto on_error; - if (git_pool_init(&pb->object_pool, sizeof(git_walk_object), 0) < 0) - goto on_error; + git_pool_init(&pb->object_pool, sizeof(git_walk_object)); pb->repo = repo; pb->nr_threads = 1; /* do not spawn any thread by default */ @@ -606,6 +608,7 @@ static git_pobject **compute_write_order(git_packbuilder *pb) } if (wo_end != pb->nr_objects) { + git__free(wo); giterr_set(GITERR_INVALID, "invalid write order"); return NULL; } @@ -626,10 +629,8 @@ static int write_pack(git_packbuilder *pb, int error = 0; write_order = compute_write_order(pb); - if (write_order == NULL) { - error = -1; - goto done; - } + if (write_order == NULL) + return -1; /* Write pack header */ ph.hdr_signature = htonl(PACK_SIGNATURE); @@ -847,9 +848,13 @@ static int try_delta(git_packbuilder *pb, struct unpacked *trg, git_packbuilder__cache_unlock(pb); - if (overflow || - !(trg_object->delta_data = git__realloc(delta_buf, delta_size))) + if (overflow) { + git__free(delta_buf); return -1; + } + + trg_object->delta_data = git__realloc(delta_buf, delta_size); + GITERR_CHECK_ALLOC(trg_object->delta_data); } else { /* create delta when writing the pack */ git_packbuilder__cache_unlock(pb); diff --git a/vendor/libgit2/src/pack.c b/vendor/libgit2/src/pack.c index 45dd4d5be..e7003e66d 100644 --- a/vendor/libgit2/src/pack.c +++ b/vendor/libgit2/src/pack.c @@ -21,7 +21,7 @@ GIT__USE_OIDMAP static int packfile_open(struct git_pack_file *p); static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n); -int packfile_unpack_compressed( +static int packfile_unpack_compressed( git_rawobj *obj, struct git_pack_file *p, git_mwindow **w_curs, @@ -365,9 +365,14 @@ static unsigned char *pack_window_open( * pointless to ask for an offset into the middle of that * hash, and the pack_window_contains function above wouldn't match * don't allow an offset too close to the end of the file. + * + * Don't allow a negative offset, as that means we've wrapped + * around. */ if (offset > (p->mwf.size - 20)) return NULL; + if (offset < 0) + return NULL; return git_mwindow_open(&p->mwf, w_cursor, offset, 20, left); } @@ -489,7 +494,6 @@ int git_packfile_resolve_header( int error; error = git_packfile_unpack_header(&size, &type, &p->mwf, &w_curs, &curpos); - git_mwindow_close(&w_curs); if (error < 0) return error; @@ -512,7 +516,6 @@ int git_packfile_resolve_header( while (type == GIT_OBJ_OFS_DELTA || type == GIT_OBJ_REF_DELTA) { curpos = base_offset; error = git_packfile_unpack_header(&size, &type, &p->mwf, &w_curs, &curpos); - git_mwindow_close(&w_curs); if (error < 0) return error; if (type != GIT_OBJ_OFS_DELTA && type != GIT_OBJ_REF_DELTA) @@ -580,7 +583,6 @@ static int pack_dependency_chain(git_dependency_chain *chain_out, elem->base_key = obj_offset; error = git_packfile_unpack_header(&size, &type, &p->mwf, &w_curs, &curpos); - git_mwindow_close(&w_curs); if (error < 0) goto on_error; @@ -790,7 +792,6 @@ int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, obj->zstream.next_out = Z_NULL; st = inflateInit(&obj->zstream); if (st != Z_OK) { - git__free(obj); giterr_set(GITERR_ZLIB, "failed to init packfile stream"); return -1; } @@ -843,7 +844,7 @@ void git_packfile_stream_free(git_packfile_stream *obj) inflateEnd(&obj->zstream); } -int packfile_unpack_compressed( +static int packfile_unpack_compressed( git_rawobj *obj, struct git_pack_file *p, git_mwindow **w_curs, @@ -1014,7 +1015,7 @@ static int packfile_open(struct git_pack_file *p) unsigned char *idx_sha1; if (p->index_version == -1 && pack_index_open(p) < 0) - return git_odb__error_notfound("failed to open packfile", NULL); + return git_odb__error_notfound("failed to open packfile", NULL, 0); /* if mwf opened by another thread, return now */ if (git_mutex_lock(&p->lock) < 0) @@ -1095,7 +1096,7 @@ int git_packfile__name(char **out, const char *path) path_len = strlen(path); if (path_len < strlen(".idx")) - return git_odb__error_notfound("invalid packfile path", NULL); + return git_odb__error_notfound("invalid packfile path", NULL, 0); if (git_buf_printf(&buf, "%.*s.pack", (int)(path_len - strlen(".idx")), path) < 0) return -1; @@ -1113,7 +1114,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path) *pack_out = NULL; if (path_len < strlen(".idx")) - return git_odb__error_notfound("invalid packfile path", NULL); + return git_odb__error_notfound("invalid packfile path", NULL, 0); GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*p), path_len); GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2); @@ -1139,7 +1140,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path) if (p_stat(p->pack_name, &st) < 0 || !S_ISREG(st.st_mode)) { git__free(p); - return git_odb__error_notfound("packfile not found", NULL); + return git_odb__error_notfound("packfile not found", NULL, 0); } /* ok, it looks sane as far as we can check without @@ -1176,6 +1177,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path) static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n) { const unsigned char *index = p->index_map.data; + const unsigned char *end = index + p->index_map.len; index += 4 * 256; if (p->index_version == 1) { return ntohl(*((uint32_t *)(index + 24 * n))); @@ -1186,6 +1188,11 @@ static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_ if (!(off & 0x80000000)) return off; index += p->num_objects * 4 + (off & 0x7fffffff) * 8; + + /* Make sure we're not being sent out of bounds */ + if (index >= end - 8) + return -1; + return (((uint64_t)ntohl(*((uint32_t *)(index + 0)))) << 32) | ntohl(*((uint32_t *)(index + 4))); } @@ -1265,6 +1272,7 @@ static int pack_entry_find_offset( const unsigned char *index = p->index_map.data; unsigned hi, lo, stride; int pos, found = 0; + git_off_t offset; const unsigned char *current = 0; *offset_out = 0; @@ -1333,11 +1341,16 @@ static int pack_entry_find_offset( } if (!found) - return git_odb__error_notfound("failed to find offset for pack entry", short_oid); + return git_odb__error_notfound("failed to find offset for pack entry", short_oid, len); if (found > 1) return git_odb__error_ambiguous("found multiple offsets for pack entry"); - *offset_out = nth_packed_object_offset(p, pos); + if ((offset = nth_packed_object_offset(p, pos)) < 0) { + giterr_set(GITERR_ODB, "packfile index is corrupt"); + return -1; + } + + *offset_out = offset; git_oid_fromraw(found_oid, current); #ifdef INDEX_DEBUG_LOOKUP diff --git a/vendor/libgit2/src/pack.h b/vendor/libgit2/src/pack.h index b3d5b2993..d15247b74 100644 --- a/vendor/libgit2/src/pack.h +++ b/vendor/libgit2/src/pack.h @@ -138,13 +138,6 @@ int git_packfile_resolve_header( git_off_t offset); int git_packfile_unpack(git_rawobj *obj, struct git_pack_file *p, git_off_t *obj_offset); -int packfile_unpack_compressed( - git_rawobj *obj, - struct git_pack_file *p, - git_mwindow **w_curs, - git_off_t *curpos, - size_t size, - git_otype type); int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, git_off_t curpos); ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t len); diff --git a/vendor/libgit2/src/path.c b/vendor/libgit2/src/path.c index d1454846b..1fd14fcb9 100644 --- a/vendor/libgit2/src/path.c +++ b/vendor/libgit2/src/path.c @@ -526,6 +526,17 @@ bool git_path_isfile(const char *path) return S_ISREG(st.st_mode) != 0; } +bool git_path_islink(const char *path) +{ + struct stat st; + + assert(path); + if (p_lstat(path, &st) < 0) + return false; + + return S_ISLNK(st.st_mode) != 0; +} + #ifdef GIT_WIN32 bool git_path_is_empty_dir(const char *path) @@ -694,8 +705,7 @@ int git_path_resolve_relative(git_buf *path, size_t ceiling) char *base, *to, *from, *next; size_t len; - if (!path || git_buf_oom(path)) - return -1; + GITERR_CHECK_ALLOC_BUF(path); if (ceiling > path->size) ceiling = path->size; @@ -1166,7 +1176,11 @@ static int diriter_update_paths(git_path_diriter *diriter) diriter->path[path_len-1] = L'\0'; git_buf_truncate(&diriter->path_utf8, diriter->parent_utf8_len); - git_buf_putc(&diriter->path_utf8, '/'); + + if (diriter->parent_utf8_len > 0 && + diriter->path_utf8.ptr[diriter->parent_utf8_len-1] != '/') + git_buf_putc(&diriter->path_utf8, '/'); + git_buf_put_w(&diriter->path_utf8, diriter->current.cFileName, filename_len); if (git_buf_oom(&diriter->path_utf8)) @@ -1315,7 +1329,11 @@ int git_path_diriter_next(git_path_diriter *diriter) #endif git_buf_truncate(&diriter->path, diriter->parent_len); - git_buf_putc(&diriter->path, '/'); + + if (diriter->parent_len > 0 && + diriter->path.ptr[diriter->parent_len-1] != '/') + git_buf_putc(&diriter->path, '/'); + git_buf_put(&diriter->path, filename, filename_len); if (git_buf_oom(&diriter->path)) @@ -1380,7 +1398,7 @@ int git_path_dirload( git_vector *contents, const char *path, size_t prefix_len, - unsigned int flags) + uint32_t flags) { git_path_diriter iter = GIT_PATH_DIRITER_INIT; const char *name; @@ -1611,9 +1629,12 @@ static bool verify_component( !verify_dotgit_ntfs(repo, component, len)) return false; + /* don't bother rerunning the `.git` test if we ran the HFS or NTFS + * specific tests, they would have already rejected `.git`. + */ if ((flags & GIT_PATH_REJECT_DOT_GIT_HFS) == 0 && (flags & GIT_PATH_REJECT_DOT_GIT_NTFS) == 0 && - (flags & GIT_PATH_REJECT_DOT_GIT) && + (flags & GIT_PATH_REJECT_DOT_GIT_LITERAL) && len == 4 && component[0] == '.' && (component[1] == 'g' || component[1] == 'G') && @@ -1630,6 +1651,8 @@ GIT_INLINE(unsigned int) dotgit_flags( { int protectHFS = 0, protectNTFS = 0; + flags |= GIT_PATH_REJECT_DOT_GIT_LITERAL; + #ifdef __APPLE__ protectHFS = 1; #endif @@ -1676,3 +1699,19 @@ bool git_path_isvalid( return verify_component(repo, start, (c - start), flags); } + +int git_path_normalize_slashes(git_buf *out, const char *path) +{ + int error; + char *p; + + if ((error = git_buf_puts(out, path)) < 0) + return error; + + for (p = out->ptr; *p; p++) { + if (*p == '\\') + *p = '/'; + } + + return 0; +} diff --git a/vendor/libgit2/src/path.h b/vendor/libgit2/src/path.h index e6be06faa..875c8cb7e 100644 --- a/vendor/libgit2/src/path.h +++ b/vendor/libgit2/src/path.h @@ -72,7 +72,7 @@ extern const char *git_path_topdir(const char *path); * This will return a number >= 0 which is the offset to the start of the * path, if the path is rooted (i.e. "/rooted/path" returns 0 and * "c:/windows/rooted/path" returns 2). If the path is not rooted, this - * returns < 0. + * returns -1. */ extern int git_path_root(const char *path); @@ -168,6 +168,12 @@ extern bool git_path_isdir(const char *path); */ extern bool git_path_isfile(const char *path); +/** + * Check if the given path points to a symbolic link. + * @return true or false + */ +extern bool git_path_islink(const char *path); + /** * Check if the given path is a directory, and is empty. */ @@ -558,15 +564,16 @@ extern int git_path_from_url_or_path(git_buf *local_path_out, const char *url_or #define GIT_PATH_REJECT_TRAILING_COLON (1 << 6) #define GIT_PATH_REJECT_DOS_PATHS (1 << 7) #define GIT_PATH_REJECT_NT_CHARS (1 << 8) -#define GIT_PATH_REJECT_DOT_GIT_HFS (1 << 9) -#define GIT_PATH_REJECT_DOT_GIT_NTFS (1 << 10) +#define GIT_PATH_REJECT_DOT_GIT_LITERAL (1 << 9) +#define GIT_PATH_REJECT_DOT_GIT_HFS (1 << 10) +#define GIT_PATH_REJECT_DOT_GIT_NTFS (1 << 11) /* Default path safety for writing files to disk: since we use the * Win32 "File Namespace" APIs ("\\?\") we need to protect from * paths that the normal Win32 APIs would not write. */ #ifdef GIT_WIN32 -# define GIT_PATH_REJECT_DEFAULTS \ +# define GIT_PATH_REJECT_FILESYSTEM_DEFAULTS \ GIT_PATH_REJECT_TRAVERSAL | \ GIT_PATH_REJECT_BACKSLASH | \ GIT_PATH_REJECT_TRAILING_DOT | \ @@ -575,9 +582,18 @@ extern int git_path_from_url_or_path(git_buf *local_path_out, const char *url_or GIT_PATH_REJECT_DOS_PATHS | \ GIT_PATH_REJECT_NT_CHARS #else -# define GIT_PATH_REJECT_DEFAULTS GIT_PATH_REJECT_TRAVERSAL +# define GIT_PATH_REJECT_FILESYSTEM_DEFAULTS \ + GIT_PATH_REJECT_TRAVERSAL #endif + /* Paths that should never be written into the working directory. */ +#define GIT_PATH_REJECT_WORKDIR_DEFAULTS \ + GIT_PATH_REJECT_FILESYSTEM_DEFAULTS | GIT_PATH_REJECT_DOT_GIT + +/* Paths that should never be written to the index. */ +#define GIT_PATH_REJECT_INDEX_DEFAULTS \ + GIT_PATH_REJECT_TRAVERSAL | GIT_PATH_REJECT_DOT_GIT + /* * Determine whether a path is a valid git path or not - this must not contain * a '.' or '..' component, or a component that is ".git" (in any case). @@ -591,4 +607,9 @@ extern bool git_path_isvalid( const char *path, unsigned int flags); +/** + * Convert any backslashes into slashes + */ +int git_path_normalize_slashes(git_buf *out, const char *path); + #endif diff --git a/vendor/libgit2/src/pathspec.c b/vendor/libgit2/src/pathspec.c index fab6f9a76..8a93cdd50 100644 --- a/vendor/libgit2/src/pathspec.c +++ b/vendor/libgit2/src/pathspec.c @@ -237,9 +237,9 @@ int git_pathspec__init(git_pathspec *ps, const git_strarray *paths) memset(ps, 0, sizeof(*ps)); ps->prefix = git_pathspec_prefix(paths); + git_pool_init(&ps->pool, 1); - if ((error = git_pool_init(&ps->pool, 1, 0)) < 0 || - (error = git_pathspec__vinit(&ps->pathspec, paths, &ps->pool)) < 0) + if ((error = git_pathspec__vinit(&ps->pathspec, paths, &ps->pool)) < 0) git_pathspec__clear(ps); return error; @@ -312,15 +312,11 @@ static git_pathspec_match_list *pathspec_match_alloc( git_pathspec *ps, int datatype) { git_pathspec_match_list *m = git__calloc(1, sizeof(git_pathspec_match_list)); - - if (m != NULL && git_pool_init(&m->pool, 1, 0) < 0) { - pathspec_match_free(m); - m = NULL; - } - if (!m) return NULL; + git_pool_init(&m->pool, 1); + /* need to keep reference to pathspec and increment refcount because * failures array stores pointers to the pattern strings of the * pathspec that had no matches @@ -524,16 +520,16 @@ int git_pathspec_match_workdir( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(repo); - if (!(error = git_iterator_for_workdir( - &iter, repo, NULL, NULL, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_workdir(&iter, repo, NULL, NULL, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } @@ -546,16 +542,16 @@ int git_pathspec_match_index( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(index); - if (!(error = git_iterator_for_index( - &iter, index, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_index(&iter, git_index_owner(index), index, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } @@ -568,16 +564,16 @@ int git_pathspec_match_tree( uint32_t flags, git_pathspec *ps) { - int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; + int error = 0; assert(tree); - if (!(error = git_iterator_for_tree( - &iter, tree, pathspec_match_iter_flags(flags), NULL, NULL))) { + iter_opts.flags = pathspec_match_iter_flags(flags); + if (!(error = git_iterator_for_tree(&iter, tree, &iter_opts))) { error = pathspec_match_from_iterator(out, iter, flags, ps); - git_iterator_free(iter); } @@ -722,4 +718,3 @@ const char * git_pathspec_match_list_failed_entry( return entry ? *entry : NULL; } - diff --git a/vendor/libgit2/src/pool.c b/vendor/libgit2/src/pool.c index c93d78182..b4fc50fca 100644 --- a/vendor/libgit2/src/pool.c +++ b/vendor/libgit2/src/pool.c @@ -11,182 +11,179 @@ struct git_pool_page { GIT_ALIGN(char data[GIT_FLEX_ARRAY], 8); }; -struct pool_freelist { - struct pool_freelist *next; -}; - -#define GIT_POOL_MIN_USABLE 4 -#define GIT_POOL_MIN_PAGESZ 2 * sizeof(void*) - static void *pool_alloc_page(git_pool *pool, uint32_t size); -static void pool_insert_page(git_pool *pool, git_pool_page *page); -int git_pool_init( - git_pool *pool, uint32_t item_size, uint32_t items_per_page) +uint32_t git_pool__system_page_size(void) { - assert(pool); + static uint32_t size = 0; - if (!item_size) - item_size = 1; - /* round up item_size for decent object alignment */ - if (item_size > 4) - item_size = (item_size + 7) & ~7; - else if (item_size == 3) - item_size = 4; + if (!size) { + size_t page_size; + if (git__page_size(&page_size) < 0) + page_size = 4096; + /* allow space for malloc overhead */ + size = page_size - (2 * sizeof(void *)) - sizeof(git_pool_page); + } - if (!items_per_page) - items_per_page = git_pool__suggest_items_per_page(item_size); - if (item_size * items_per_page < GIT_POOL_MIN_PAGESZ) - items_per_page = (GIT_POOL_MIN_PAGESZ + item_size - 1) / item_size; + return size; +} + +#ifndef GIT_DEBUG_POOL +void git_pool_init(git_pool *pool, uint32_t item_size) +{ + assert(pool); + assert(item_size >= 1); memset(pool, 0, sizeof(git_pool)); pool->item_size = item_size; - pool->page_size = item_size * items_per_page; - - return 0; + pool->page_size = git_pool__system_page_size(); } void git_pool_clear(git_pool *pool) { git_pool_page *scan, *next; - for (scan = pool->open; scan != NULL; scan = next) { + for (scan = pool->pages; scan != NULL; scan = next) { next = scan->next; git__free(scan); } - pool->open = NULL; - for (scan = pool->full; scan != NULL; scan = next) { - next = scan->next; - git__free(scan); - } - pool->full = NULL; + pool->pages = NULL; +} - pool->free_list = NULL; +static void *pool_alloc_page(git_pool *pool, uint32_t size) +{ + git_pool_page *page; + const uint32_t new_page_size = (size <= pool->page_size) ? pool->page_size : size; + size_t alloc_size; - pool->items = 0; + if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) || + !(page = git__malloc(alloc_size))) + return NULL; - pool->has_string_alloc = 0; - pool->has_multi_item_alloc = 0; - pool->has_large_page_alloc = 0; + page->size = new_page_size; + page->avail = new_page_size - size; + page->next = pool->pages; + + pool->pages = page; + + return page->data; } -void git_pool_swap(git_pool *a, git_pool *b) +static void *pool_alloc(git_pool *pool, uint32_t size) { - git_pool temp; + git_pool_page *page = pool->pages; + void *ptr = NULL; - if (a == b) - return; + if (!page || page->avail < size) + return pool_alloc_page(pool, size); - memcpy(&temp, a, sizeof(temp)); - memcpy(a, b, sizeof(temp)); - memcpy(b, &temp, sizeof(temp)); + ptr = &page->data[page->size - page->avail]; + page->avail -= size; + + return ptr; } -static void pool_insert_page(git_pool *pool, git_pool_page *page) +uint32_t git_pool__open_pages(git_pool *pool) { + uint32_t ct = 0; git_pool_page *scan; - - /* If there are no open pages or this page has the most open space, - * insert it at the beginning of the list. This is the common case. - */ - if (pool->open == NULL || pool->open->avail < page->avail) { - page->next = pool->open; - pool->open = page; - return; - } - - /* Otherwise insert into sorted position. */ - for (scan = pool->open; - scan->next && scan->next->avail > page->avail; - scan = scan->next); - page->next = scan->next; - scan->next = page; + for (scan = pool->pages; scan != NULL; scan = scan->next) ct++; + return ct; } -static void *pool_alloc_page(git_pool *pool, uint32_t size) +bool git_pool__ptr_in_pool(git_pool *pool, void *ptr) { - git_pool_page *page; - uint32_t new_page_size; - size_t alloc_size; - - if (size <= pool->page_size) - new_page_size = pool->page_size; - else { - new_page_size = size; - pool->has_large_page_alloc = 1; - } - - if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) || - !(page = git__calloc(1, alloc_size))) - return NULL; + git_pool_page *scan; + for (scan = pool->pages; scan != NULL; scan = scan->next) + if ((void *)scan->data <= ptr && + (void *)(((char *)scan->data) + scan->size) > ptr) + return true; + return false; +} - page->size = new_page_size; - page->avail = new_page_size - size; +#else - if (page->avail > 0) - pool_insert_page(pool, page); +static int git_pool__ptr_cmp(const void * a, const void * b) +{ + if(a > b) { + return 1; + } + if(a < b) { + return -1; + } else { - page->next = pool->full; - pool->full = page; + return 0; } +} - pool->items++; +void git_pool_init(git_pool *pool, uint32_t item_size) +{ + assert(pool); + assert(item_size >= 1); - return page->data; + memset(pool, 0, sizeof(git_pool)); + pool->item_size = item_size; + pool->page_size = git_pool__system_page_size(); + git_vector_init(&pool->allocations, 100, git_pool__ptr_cmp); } -GIT_INLINE(void) pool_remove_page( - git_pool *pool, git_pool_page *page, git_pool_page *prev) +void git_pool_clear(git_pool *pool) { - if (prev == NULL) - pool->open = page->next; - else - prev->next = page->next; + git_vector_free_deep(&pool->allocations); } -void *git_pool_malloc(git_pool *pool, uint32_t items) -{ - git_pool_page *scan = pool->open, *prev; - uint32_t size = ((items * pool->item_size) + 7) & ~7; +static void *pool_alloc(git_pool *pool, uint32_t size) { void *ptr = NULL; - - pool->has_string_alloc = 0; - if (items > 1) - pool->has_multi_item_alloc = 1; - else if (pool->free_list != NULL) { - ptr = pool->free_list; - pool->free_list = ((struct pool_freelist *)pool->free_list)->next; - return ptr; + if((ptr = git__malloc(size)) == NULL) { + return NULL; } + git_vector_insert_sorted(&pool->allocations, ptr, NULL); + return ptr; +} - /* just add a block if there is no open one to accommodate this */ - if (size >= pool->page_size || !scan || scan->avail < size) - return pool_alloc_page(pool, size); +bool git_pool__ptr_in_pool(git_pool *pool, void *ptr) +{ + size_t pos; + return git_vector_bsearch(&pos, &pool->allocations, ptr) != GIT_ENOTFOUND; +} +#endif - pool->items++; +void git_pool_swap(git_pool *a, git_pool *b) +{ + git_pool temp; - /* find smallest block in free list with space */ - for (scan = pool->open, prev = NULL; - scan->next && scan->next->avail >= size; - prev = scan, scan = scan->next); + if (a == b) + return; - /* allocate space from the block */ - ptr = &scan->data[scan->size - scan->avail]; - scan->avail -= size; + memcpy(&temp, a, sizeof(temp)); + memcpy(a, b, sizeof(temp)); + memcpy(b, &temp, sizeof(temp)); +} - /* move to full list if there is almost no space left */ - if (scan->avail < pool->item_size || scan->avail < GIT_POOL_MIN_USABLE) { - pool_remove_page(pool, scan, prev); - scan->next = pool->full; - pool->full = scan; - } - /* reorder list if block is now smaller than the one after it */ - else if (scan->next != NULL && scan->next->avail > scan->avail) { - pool_remove_page(pool, scan, prev); - pool_insert_page(pool, scan); +static uint32_t alloc_size(git_pool *pool, uint32_t count) +{ + const uint32_t align = sizeof(void *) - 1; + + if (pool->item_size > 1) { + const uint32_t item_size = (pool->item_size + align) & ~align; + return item_size * count; } + return (count + align) & ~align; +} + +void *git_pool_malloc(git_pool *pool, uint32_t items) +{ + return pool_alloc(pool, alloc_size(pool, items)); +} + +void *git_pool_mallocz(git_pool *pool, uint32_t items) +{ + const uint32_t size = alloc_size(pool, items); + void *ptr = pool_alloc(pool, size); + if (ptr) + memset(ptr, 0x0, size); return ptr; } @@ -204,15 +201,12 @@ char *git_pool_strndup(git_pool *pool, const char *str, size_t n) ptr[n] = '\0'; } - pool->has_string_alloc = 1; - return ptr; } char *git_pool_strdup(git_pool *pool, const char *str) { assert(pool && str && pool->item_size == sizeof(char)); - return git_pool_strndup(pool, str, strlen(str)); } @@ -238,88 +232,5 @@ char *git_pool_strcat(git_pool *pool, const char *a, const char *b) memcpy(((char *)ptr) + len_a, b, len_b); *(((char *)ptr) + len_a + len_b) = '\0'; } - pool->has_string_alloc = 1; - return ptr; } - -void git_pool_free(git_pool *pool, void *ptr) -{ - struct pool_freelist *item = ptr; - - assert(pool && pool->item_size >= sizeof(void*)); - - if (item) { - item->next = pool->free_list; - pool->free_list = item; - } -} - -void git_pool_free_array(git_pool *pool, size_t count, void **ptrs) -{ - struct pool_freelist **items = (struct pool_freelist **)ptrs; - size_t i; - - assert(pool && ptrs && pool->item_size >= sizeof(void*)); - - if (!count) - return; - - for (i = count - 1; i > 0; --i) - items[i]->next = items[i - 1]; - - items[i]->next = pool->free_list; - pool->free_list = items[count - 1]; -} - -uint32_t git_pool__open_pages(git_pool *pool) -{ - uint32_t ct = 0; - git_pool_page *scan; - for (scan = pool->open; scan != NULL; scan = scan->next) ct++; - return ct; -} - -uint32_t git_pool__full_pages(git_pool *pool) -{ - uint32_t ct = 0; - git_pool_page *scan; - for (scan = pool->full; scan != NULL; scan = scan->next) ct++; - return ct; -} - -bool git_pool__ptr_in_pool(git_pool *pool, void *ptr) -{ - git_pool_page *scan; - for (scan = pool->open; scan != NULL; scan = scan->next) - if ((void *)scan->data <= ptr && - (void *)(((char *)scan->data) + scan->size) > ptr) - return true; - for (scan = pool->full; scan != NULL; scan = scan->next) - if ((void *)scan->data <= ptr && - (void *)(((char *)scan->data) + scan->size) > ptr) - return true; - return false; -} - -uint32_t git_pool__system_page_size(void) -{ - static uint32_t size = 0; - - if (!size) { - size_t page_size; - if (git__page_size(&page_size) < 0) - page_size = 4096; - size = page_size - 2 * sizeof(void *); /* allow space for malloc overhead */ - } - - return size; -} - -uint32_t git_pool__suggest_items_per_page(uint32_t item_size) -{ - uint32_t page_bytes = - git_pool__system_page_size() - sizeof(git_pool_page); - return page_bytes / item_size; -} - diff --git a/vendor/libgit2/src/pool.h b/vendor/libgit2/src/pool.h index b0007f315..e0fafa997 100644 --- a/vendor/libgit2/src/pool.h +++ b/vendor/libgit2/src/pool.h @@ -8,9 +8,11 @@ #define INCLUDE_pool_h__ #include "common.h" +#include "vector.h" typedef struct git_pool_page git_pool_page; +#ifndef GIT_DEBUG_POOL /** * Chunked allocator. * @@ -28,37 +30,52 @@ typedef struct git_pool_page git_pool_page; * For examples of how to set up a `git_pool` see `git_pool_init`. */ typedef struct { - git_pool_page *open; /* pages with space left */ - git_pool_page *full; /* pages with no space left */ - void *free_list; /* optional: list of freed blocks */ + git_pool_page *pages; /* allocated pages */ uint32_t item_size; /* size of single alloc unit in bytes */ uint32_t page_size; /* size of page in bytes */ - uint32_t items; - unsigned has_string_alloc : 1; /* was the strdup function used */ - unsigned has_multi_item_alloc : 1; /* was items ever > 1 in malloc */ - unsigned has_large_page_alloc : 1; /* are any pages > page_size */ } git_pool; -#define GIT_POOL_INIT_STRINGPOOL { 0, 0, 0, 1, 4000, 0, 0, 0, 0 } +#else + +/** + * Debug chunked allocator. + * + * Acts just like `git_pool` but instead of actually pooling allocations it + * passes them through to `git__malloc`. This makes it possible to easily debug + * systems that use `git_pool` using valgrind. + * + * In order to track allocations during the lifetime of the pool we use a + * `git_vector`. When the pool is deallocated everything in the vector is + * freed. + * + * `API is exactly the same as the standard `git_pool` with one exception. + * Since we aren't allocating pages to hand out in chunks we can't easily + * implement `git_pool__open_pages`. + */ +typedef struct { + git_vector allocations; + uint32_t item_size; + uint32_t page_size; +} git_pool; +#endif /** * Initialize a pool. * * To allocation strings, use like this: * - * git_pool_init(&string_pool, 1, 0); + * git_pool_init(&string_pool, 1); * my_string = git_pool_strdup(&string_pool, your_string); * * To allocate items of fixed size, use like this: * - * git_pool_init(&pool, sizeof(item), 0); + * git_pool_init(&pool, sizeof(item)); * my_item = git_pool_malloc(&pool, 1); * * Of course, you can use this in other ways, but those are the * two most common patterns. */ -extern int git_pool_init( - git_pool *pool, uint32_t item_size, uint32_t items_per_page); +extern void git_pool_init(git_pool *pool, uint32_t item_size); /** * Free all items in pool @@ -74,17 +91,7 @@ extern void git_pool_swap(git_pool *a, git_pool *b); * Allocate space for one or more items from a pool. */ extern void *git_pool_malloc(git_pool *pool, uint32_t items); - -/** - * Allocate space and zero it out. - */ -GIT_INLINE(void *) git_pool_mallocz(git_pool *pool, uint32_t items) -{ - void *ptr = git_pool_malloc(pool, items); - if (ptr) - memset(ptr, 0, (size_t)items * (size_t)pool->item_size); - return ptr; -} +extern void *git_pool_mallocz(git_pool *pool, uint32_t items); /** * Allocate space and duplicate string data into it. @@ -114,35 +121,12 @@ extern char *git_pool_strdup_safe(git_pool *pool, const char *str); */ extern char *git_pool_strcat(git_pool *pool, const char *a, const char *b); -/** - * Push a block back onto the free list for the pool. - * - * This is allowed only if the item_size is >= sizeof(void*). - * - * In some cases, it is helpful to "release" an allocated block - * for reuse. Pools don't support a general purpose free, but - * they will keep a simple free blocks linked list provided the - * native block size is large enough to hold a void pointer - */ -extern void git_pool_free(git_pool *pool, void *ptr); - -/** - * Push an array of pool allocated blocks efficiently onto the free list. - * - * This has the same constraints as `git_pool_free()` above. - */ -extern void git_pool_free_array(git_pool *pool, size_t count, void **ptrs); - /* * Misc utilities */ - +#ifndef GIT_DEBUG_POOL extern uint32_t git_pool__open_pages(git_pool *pool); - -extern uint32_t git_pool__full_pages(git_pool *pool); - +#endif extern bool git_pool__ptr_in_pool(git_pool *pool, void *ptr); -extern uint32_t git_pool__suggest_items_per_page(uint32_t item_size); - #endif diff --git a/vendor/libgit2/src/posix.c b/vendor/libgit2/src/posix.c index 8d86aa8bf..b3f1a1cd3 100644 --- a/vendor/libgit2/src/posix.c +++ b/vendor/libgit2/src/posix.c @@ -62,8 +62,11 @@ int p_getaddrinfo( ai = ainfo; for (p = 1; ainfo->ai_hostent->h_addr_list[p] != NULL; p++) { - ai->ai_next = malloc(sizeof(struct addrinfo)); - memcpy(&ai->ai_next, ainfo, sizeof(struct addrinfo)); + if (!(ai->ai_next = malloc(sizeof(struct addrinfo)))) { + p_freeaddrinfo(ainfo); + return -1; + } + memcpy(ai->ai_next, ainfo, sizeof(struct addrinfo)); memcpy(&ai->ai_next->ai_addr_in.sin_addr, ainfo->ai_hostent->h_addr_list[p], ainfo->ai_hostent->h_length); @@ -221,6 +224,13 @@ int git__page_size(size_t *page_size) return 0; } +int git__mmap_alignment(size_t *alignment) +{ + /* dummy; here we don't need any alignment anyway */ + *alignment = 4096; + return 0; +} + int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset) { diff --git a/vendor/libgit2/src/posix.h b/vendor/libgit2/src/posix.h index 8785a4c99..f204751cf 100644 --- a/vendor/libgit2/src/posix.h +++ b/vendor/libgit2/src/posix.h @@ -109,6 +109,7 @@ extern int p_getcwd(char *buffer_out, size_t size); extern int p_rename(const char *from, const char *to); extern int git__page_size(size_t *page_size); +extern int git__mmap_alignment(size_t *page_size); /** * Platform-dependent methods diff --git a/vendor/libgit2/src/push.c b/vendor/libgit2/src/push.c index a0d8a0550..0747259c8 100644 --- a/vendor/libgit2/src/push.c +++ b/vendor/libgit2/src/push.c @@ -73,6 +73,7 @@ int git_push_set_options(git_push *push, const git_push_options *opts) GITERR_CHECK_VERSION(opts, GIT_PUSH_OPTIONS_VERSION, "git_push_options"); push->pb_parallelism = opts->pb_parallelism; + push->custom_headers = &opts->custom_headers; return 0; } @@ -373,9 +374,9 @@ static int enqueue_object( case GIT_OBJ_COMMIT: return 0; case GIT_OBJ_TREE: - return git_packbuilder_insert_tree(pb, &entry->oid); + return git_packbuilder_insert_tree(pb, entry->oid); default: - return git_packbuilder_insert(pb, &entry->oid, entry->filename); + return git_packbuilder_insert(pb, entry->oid, entry->filename); } } @@ -395,7 +396,7 @@ static int queue_differences( const git_tree_entry *d_entry = git_tree_entry_byindex(delta, j); int cmp = 0; - if (!git_oid__cmp(&b_entry->oid, &d_entry->oid)) + if (!git_oid__cmp(b_entry->oid, d_entry->oid)) goto loop; cmp = strcmp(b_entry->filename, d_entry->filename); @@ -406,15 +407,15 @@ static int queue_differences( git_tree_entry__is_tree(b_entry) && git_tree_entry__is_tree(d_entry)) { /* Add the right-hand entry */ - if ((error = git_packbuilder_insert(pb, &d_entry->oid, + if ((error = git_packbuilder_insert(pb, d_entry->oid, d_entry->filename)) < 0) goto on_error; /* Acquire the subtrees and recurse */ if ((error = git_tree_lookup(&b_child, - git_tree_owner(base), &b_entry->oid)) < 0 || + git_tree_owner(base), b_entry->oid)) < 0 || (error = git_tree_lookup(&d_child, - git_tree_owner(delta), &d_entry->oid)) < 0 || + git_tree_owner(delta), d_entry->oid)) < 0 || (error = queue_differences(b_child, d_child, pb)) < 0) goto on_error; @@ -638,7 +639,7 @@ int git_push_finish(git_push *push, const git_remote_callbacks *callbacks) int error; if (!git_remote_connected(push->remote) && - (error = git_remote_connect(push->remote, GIT_DIRECTION_PUSH, callbacks)) < 0) + (error = git_remote_connect(push->remote, GIT_DIRECTION_PUSH, callbacks, push->custom_headers)) < 0) return error; if ((error = filter_refs(push->remote)) < 0 || diff --git a/vendor/libgit2/src/push.h b/vendor/libgit2/src/push.h index a847ee0d0..e32ad2f4d 100644 --- a/vendor/libgit2/src/push.h +++ b/vendor/libgit2/src/push.h @@ -38,6 +38,7 @@ struct git_push { /* options */ unsigned pb_parallelism; + const git_strarray *custom_headers; }; /** diff --git a/vendor/libgit2/src/rebase.c b/vendor/libgit2/src/rebase.c index 17536c030..bcad9b7cd 100644 --- a/vendor/libgit2/src/rebase.c +++ b/vendor/libgit2/src/rebase.c @@ -63,17 +63,23 @@ struct git_rebase { char *state_path; int head_detached : 1, + inmemory : 1, quiet : 1, started : 1; - char *orig_head_name; + git_array_t(git_rebase_operation) operations; + size_t current; + + /* Used by in-memory rebase */ + git_index *index; + git_commit *last_commit; + + /* Used by regular (not in-memory) merge-style rebase */ git_oid orig_head_id; + char *orig_head_name; git_oid onto_id; char *onto_name; - - git_array_t(git_rebase_operation) operations; - size_t current; }; #define GIT_REBASE_STATE_INIT {0} @@ -251,12 +257,12 @@ static int rebase_open_merge(git_rebase *rebase) return error; } -static git_rebase *rebase_alloc(const git_rebase_options *rebase_opts) +static int rebase_alloc(git_rebase **out, const git_rebase_options *rebase_opts) { git_rebase *rebase = git__calloc(1, sizeof(git_rebase)); + GITERR_CHECK_ALLOC(rebase); - if (!rebase) - return NULL; + *out = NULL; if (rebase_opts) memcpy(&rebase->options, rebase_opts, sizeof(git_rebase_options)); @@ -264,14 +270,16 @@ static git_rebase *rebase_alloc(const git_rebase_options *rebase_opts) git_rebase_init_options(&rebase->options, GIT_REBASE_OPTIONS_VERSION); if (rebase_opts && rebase_opts->rewrite_notes_ref) { - if ((rebase->options.rewrite_notes_ref = git__strdup(rebase_opts->rewrite_notes_ref)) == NULL) - return NULL; + rebase->options.rewrite_notes_ref = git__strdup(rebase_opts->rewrite_notes_ref); + GITERR_CHECK_ALLOC(rebase->options.rewrite_notes_ref); } if ((rebase->options.checkout_options.checkout_strategy & (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_FORCE)) == 0) rebase->options.checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE; - return rebase; + *out = rebase; + + return 0; } static int rebase_check_versions(const git_rebase_options *given_opts) @@ -299,8 +307,8 @@ int git_rebase_open( if ((error = rebase_check_versions(given_opts)) < 0) return error; - rebase = rebase_alloc(given_opts); - GITERR_CHECK_ALLOC(rebase); + if (rebase_alloc(&rebase, given_opts) < 0) + return -1; rebase->repo = repo; @@ -393,6 +401,9 @@ int git_rebase_open( static int rebase_cleanup(git_rebase *rebase) { + if (!rebase || rebase->inmemory) + return 0; + return git_path_isdir(rebase->state_path) ? git_futils_rmdir_r(rebase->state_path, NULL, GIT_RMDIR_REMOVE_FILES) : 0; @@ -600,62 +611,66 @@ static int rebase_init_merge( const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto) -{ - if (rebase_init_operations(rebase, repo, branch, upstream, onto) < 0) - return -1; - - rebase->onto_name = git__strdup(rebase_onto_name(onto)); - GITERR_CHECK_ALLOC(rebase->onto_name); - - return 0; -} - -static int rebase_init( - git_rebase *rebase, - git_repository *repo, - const git_annotated_commit *branch, - const git_annotated_commit *upstream, - const git_annotated_commit *onto) { git_reference *head_ref = NULL; - git_annotated_commit *head_branch = NULL; + git_commit *onto_commit = NULL; + git_buf reflog = GIT_BUF_INIT; git_buf state_path = GIT_BUF_INIT; int error; + GIT_UNUSED(upstream); + if ((error = git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR)) < 0) goto done; - if (!branch) { - if ((error = git_repository_head(&head_ref, repo)) < 0 || - (error = git_annotated_commit_from_ref(&head_branch, repo, head_ref)) < 0) - goto done; - - branch = head_branch; - } - - rebase->repo = repo; - rebase->type = GIT_REBASE_TYPE_MERGE; rebase->state_path = git_buf_detach(&state_path); + GITERR_CHECK_ALLOC(rebase->state_path); + rebase->orig_head_name = git__strdup(branch->ref_name ? branch->ref_name : ORIG_DETACHED_HEAD); + GITERR_CHECK_ALLOC(rebase->orig_head_name); + + rebase->onto_name = git__strdup(rebase_onto_name(onto)); + GITERR_CHECK_ALLOC(rebase->onto_name); + rebase->quiet = rebase->options.quiet; git_oid_cpy(&rebase->orig_head_id, git_annotated_commit_id(branch)); git_oid_cpy(&rebase->onto_id, git_annotated_commit_id(onto)); - if (!rebase->orig_head_name || !rebase->state_path) - return -1; - - error = rebase_init_merge(rebase, repo, branch, upstream, onto); - - git_buf_free(&state_path); + if ((error = rebase_setupfiles(rebase)) < 0 || + (error = git_buf_printf(&reflog, + "rebase: checkout %s", rebase_onto_name(onto))) < 0 || + (error = git_commit_lookup( + &onto_commit, repo, git_annotated_commit_id(onto))) < 0 || + (error = git_checkout_tree(repo, + (git_object *)onto_commit, &rebase->options.checkout_options)) < 0 || + (error = git_reference_create(&head_ref, repo, GIT_HEAD_FILE, + git_annotated_commit_id(onto), 1, reflog.ptr)) < 0) + goto done; done: git_reference_free(head_ref); - git_annotated_commit_free(head_branch); + git_commit_free(onto_commit); + git_buf_free(&reflog); + git_buf_free(&state_path); return error; } +static int rebase_init_inmemory( + git_rebase *rebase, + git_repository *repo, + const git_annotated_commit *branch, + const git_annotated_commit *upstream, + const git_annotated_commit *onto) +{ + GIT_UNUSED(branch); + GIT_UNUSED(upstream); + + return git_commit_lookup( + &rebase->last_commit, repo, git_annotated_commit_id(onto)); +} + int git_rebase_init( git_rebase **out, git_repository *repo, @@ -665,9 +680,9 @@ int git_rebase_init( const git_rebase_options *given_opts) { git_rebase *rebase = NULL; - git_buf reflog = GIT_BUF_INIT; - git_commit *onto_commit = NULL; + git_annotated_commit *head_branch = NULL; git_reference *head_ref = NULL; + bool inmemory = (given_opts && given_opts->inmemory); int error; assert(repo && (upstream || onto)); @@ -677,39 +692,51 @@ int git_rebase_init( if (!onto) onto = upstream; - if ((error = rebase_check_versions(given_opts)) < 0 || - (error = git_repository__ensure_not_bare(repo, "rebase")) < 0 || - (error = rebase_ensure_not_in_progress(repo)) < 0 || - (error = rebase_ensure_not_dirty(repo, true, true, GIT_ERROR)) < 0 || - (error = git_commit_lookup( - &onto_commit, repo, git_annotated_commit_id(onto))) < 0) - return error; + if ((error = rebase_check_versions(given_opts)) < 0) + goto done; - rebase = rebase_alloc(given_opts); + if (!inmemory) { + if ((error = git_repository__ensure_not_bare(repo, "rebase")) < 0 || + (error = rebase_ensure_not_in_progress(repo)) < 0 || + (error = rebase_ensure_not_dirty(repo, true, true, GIT_ERROR)) < 0) + goto done; + } - if ((error = rebase_init( - rebase, repo, branch, upstream, onto)) < 0 || - (error = rebase_setupfiles(rebase)) < 0 || - (error = git_buf_printf(&reflog, - "rebase: checkout %s", rebase_onto_name(onto))) < 0 || - (error = git_checkout_tree( - repo, (git_object *)onto_commit, &rebase->options.checkout_options)) < 0 || - (error = git_reference_create(&head_ref, repo, GIT_HEAD_FILE, - git_annotated_commit_id(onto), 1, reflog.ptr)) < 0) + if (!branch) { + if ((error = git_repository_head(&head_ref, repo)) < 0 || + (error = git_annotated_commit_from_ref(&head_branch, repo, head_ref)) < 0) + goto done; + + branch = head_branch; + } + + if (rebase_alloc(&rebase, given_opts) < 0) + return -1; + + rebase->repo = repo; + rebase->inmemory = inmemory; + rebase->type = GIT_REBASE_TYPE_MERGE; + + if ((error = rebase_init_operations(rebase, repo, branch, upstream, onto)) < 0) goto done; - *out = rebase; + if (inmemory) + error = rebase_init_inmemory(rebase, repo, branch, upstream, onto); + else + rebase_init_merge(rebase, repo, branch ,upstream, onto); + + if (error == 0) + *out = rebase; done: git_reference_free(head_ref); + git_annotated_commit_free(head_branch); + if (error < 0) { rebase_cleanup(rebase); git_rebase_free(rebase); } - git_commit_free(onto_commit); - git_buf_free(&reflog); - return error; } @@ -764,9 +791,6 @@ static int rebase_next_merge( *out = NULL; - if ((error = rebase_movenext(rebase)) < 0) - goto done; - operation = git_array_get(rebase->operations, rebase->current); if ((error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || @@ -791,7 +815,7 @@ static int rebase_next_merge( if ((error = git_indexwriter_init_for_operation(&indexwriter, rebase->repo, &checkout_opts.checkout_strategy)) < 0 || (error = rebase_setupfile(rebase, MSGNUM_FILE, -1, "%" PRIuZ "\n", rebase->current+1)) < 0 || (error = rebase_setupfile(rebase, CURRENT_FILE, -1, "%.*s\n", GIT_OID_HEXSZ, current_idstr)) < 0 || - (error = git_merge_trees(&index, rebase->repo, parent_tree, head_tree, current_tree, NULL)) < 0 || + (error = git_merge_trees(&index, rebase->repo, parent_tree, head_tree, current_tree, &rebase->options.merge_options)) < 0 || (error = git_merge__check_result(rebase->repo, index)) < 0 || (error = git_checkout_index(rebase->repo, index, &checkout_opts)) < 0 || (error = git_indexwriter_commit(&indexwriter)) < 0) @@ -812,6 +836,49 @@ static int rebase_next_merge( return error; } +static int rebase_next_inmemory( + git_rebase_operation **out, + git_rebase *rebase) +{ + git_commit *current_commit = NULL, *parent_commit = NULL; + git_tree *current_tree = NULL, *head_tree = NULL, *parent_tree = NULL; + git_rebase_operation *operation; + git_index *index = NULL; + int error; + + *out = NULL; + + operation = git_array_get(rebase->operations, rebase->current); + + if ((error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || + (error = git_commit_tree(¤t_tree, current_commit)) < 0 || + (error = git_commit_parent(&parent_commit, current_commit, 0)) < 0 || + (error = git_commit_tree(&parent_tree, parent_commit)) < 0 || + (error = git_commit_tree(&head_tree, rebase->last_commit)) < 0 || + (error = git_merge_trees(&index, rebase->repo, parent_tree, head_tree, current_tree, &rebase->options.merge_options)) < 0) + goto done; + + if (!rebase->index) { + rebase->index = index; + index = NULL; + } else { + if ((error = git_index_read_index(rebase->index, index)) < 0) + goto done; + } + + *out = operation; + +done: + git_commit_free(current_commit); + git_commit_free(parent_commit); + git_tree_free(current_tree); + git_tree_free(head_tree); + git_tree_free(parent_tree); + git_index_free(index); + + return error; +} + int git_rebase_next( git_rebase_operation **out, git_rebase *rebase) @@ -820,66 +887,67 @@ int git_rebase_next( assert(out && rebase); - switch (rebase->type) { - case GIT_REBASE_TYPE_MERGE: + if ((error = rebase_movenext(rebase)) < 0) + return error; + + if (rebase->inmemory) + error = rebase_next_inmemory(out, rebase); + else if (rebase->type == GIT_REBASE_TYPE_MERGE) error = rebase_next_merge(out, rebase); - break; - default: + else abort(); - } return error; } -static int rebase_commit_merge( - git_oid *commit_id, +int git_rebase_inmemory_index( + git_index **out, + git_rebase *rebase) +{ + assert(out && rebase && rebase->index); + + GIT_REFCOUNT_INC(rebase->index); + *out = rebase->index; + + return 0; +} + +static int rebase_commit__create( + git_commit **out, git_rebase *rebase, + git_index *index, + git_commit *parent_commit, const git_signature *author, const git_signature *committer, const char *message_encoding, const char *message) { - git_index *index = NULL; - git_reference *head = NULL; - git_commit *current_commit = NULL, *head_commit = NULL, *commit = NULL; git_rebase_operation *operation; - git_tree *head_tree = NULL, *tree = NULL; - git_diff *diff = NULL; - git_oid tree_id; - git_buf reflog_msg = GIT_BUF_INIT; - char old_idstr[GIT_OID_HEXSZ], new_idstr[GIT_OID_HEXSZ]; + git_commit *current_commit = NULL, *commit = NULL; + git_tree *parent_tree = NULL, *tree = NULL; + git_oid tree_id, commit_id; int error; operation = git_array_get(rebase->operations, rebase->current); - assert(operation); - - if ((error = git_repository_index(&index, rebase->repo)) < 0) - goto done; if (git_index_has_conflicts(index)) { - giterr_set(GITERR_REBASE, "Conflicts have not been resolved"); + giterr_set(GITERR_REBASE, "conflicts have not been resolved"); error = GIT_EUNMERGED; goto done; } - if ((error = rebase_ensure_not_dirty(rebase->repo, false, true, GIT_EUNMERGED)) < 0 || - (error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || - (error = git_repository_head(&head, rebase->repo)) < 0 || - (error = git_reference_peel((git_object **)&head_commit, head, GIT_OBJ_COMMIT)) < 0 || - (error = git_commit_tree(&head_tree, head_commit)) < 0 || - (error = git_diff_tree_to_index(&diff, rebase->repo, head_tree, index, NULL)) < 0) + if ((error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || + (error = git_commit_tree(&parent_tree, parent_commit)) < 0 || + (error = git_index_write_tree_to(&tree_id, index, rebase->repo)) < 0 || + (error = git_tree_lookup(&tree, rebase->repo, &tree_id)) < 0) goto done; - if (git_diff_num_deltas(diff) == 0) { - giterr_set(GITERR_REBASE, "This patch has already been applied"); + if (git_oid_equal(&tree_id, git_tree_id(parent_tree))) { + giterr_set(GITERR_REBASE, "this patch has already been applied"); error = GIT_EAPPLIED; goto done; } - if ((error = git_index_write_tree(&tree_id, index)) < 0 || - (error = git_tree_lookup(&tree, rebase->repo, &tree_id)) < 0) - goto done; - if (!author) author = git_commit_author(current_commit); @@ -888,30 +956,100 @@ static int rebase_commit_merge( message = git_commit_message(current_commit); } - if ((error = git_commit_create(commit_id, rebase->repo, NULL, author, - committer, message_encoding, message, tree, 1, - (const git_commit **)&head_commit)) < 0 || - (error = git_commit_lookup(&commit, rebase->repo, commit_id)) < 0 || + if ((error = git_commit_create(&commit_id, rebase->repo, NULL, author, + committer, message_encoding, message, tree, 1, + (const git_commit **)&parent_commit)) < 0 || + (error = git_commit_lookup(&commit, rebase->repo, &commit_id)) < 0) + goto done; + + *out = commit; + +done: + if (error < 0) + git_commit_free(commit); + + git_commit_free(current_commit); + git_tree_free(parent_tree); + git_tree_free(tree); + + return error; +} + +static int rebase_commit_merge( + git_oid *commit_id, + git_rebase *rebase, + const git_signature *author, + const git_signature *committer, + const char *message_encoding, + const char *message) +{ + git_rebase_operation *operation; + git_reference *head = NULL; + git_commit *head_commit = NULL, *commit = NULL; + git_index *index = NULL; + char old_idstr[GIT_OID_HEXSZ], new_idstr[GIT_OID_HEXSZ]; + int error; + + operation = git_array_get(rebase->operations, rebase->current); + assert(operation); + + if ((error = rebase_ensure_not_dirty(rebase->repo, false, true, GIT_EUNMERGED)) < 0 || + (error = git_repository_head(&head, rebase->repo)) < 0 || + (error = git_reference_peel((git_object **)&head_commit, head, GIT_OBJ_COMMIT)) < 0 || + (error = git_repository_index(&index, rebase->repo)) < 0 || + (error = rebase_commit__create(&commit, rebase, index, head_commit, + author, committer, message_encoding, message)) < 0 || (error = git_reference__update_for_commit( - rebase->repo, NULL, "HEAD", commit_id, "rebase")) < 0) + rebase->repo, NULL, "HEAD", git_commit_id(commit), "rebase")) < 0) goto done; - git_oid_fmt(old_idstr, git_commit_id(current_commit)); - git_oid_fmt(new_idstr, commit_id); + git_oid_fmt(old_idstr, &operation->id); + git_oid_fmt(new_idstr, git_commit_id(commit)); + + if ((error = rebase_setupfile(rebase, REWRITTEN_FILE, O_CREAT|O_WRONLY|O_APPEND, + "%.*s %.*s\n", GIT_OID_HEXSZ, old_idstr, GIT_OID_HEXSZ, new_idstr)) < 0) + goto done; - error = rebase_setupfile(rebase, REWRITTEN_FILE, O_CREAT|O_WRONLY|O_APPEND, - "%.*s %.*s\n", GIT_OID_HEXSZ, old_idstr, GIT_OID_HEXSZ, new_idstr); + git_oid_cpy(commit_id, git_commit_id(commit)); done: - git_buf_free(&reflog_msg); - git_commit_free(commit); - git_diff_free(diff); - git_tree_free(tree); - git_tree_free(head_tree); - git_commit_free(head_commit); - git_commit_free(current_commit); - git_reference_free(head); git_index_free(index); + git_reference_free(head); + git_commit_free(head_commit); + git_commit_free(commit); + return error; +} + +static int rebase_commit_inmemory( + git_oid *commit_id, + git_rebase *rebase, + const git_signature *author, + const git_signature *committer, + const char *message_encoding, + const char *message) +{ + git_rebase_operation *operation; + git_commit *commit = NULL; + int error = 0; + + operation = git_array_get(rebase->operations, rebase->current); + + assert(operation); + assert(rebase->index); + assert(rebase->last_commit); + + if ((error = rebase_commit__create(&commit, rebase, rebase->index, + rebase->last_commit, author, committer, message_encoding, message)) < 0) + goto done; + + git_commit_free(rebase->last_commit); + rebase->last_commit = commit; + + git_oid_cpy(commit_id, git_commit_id(commit)); + +done: + if (error < 0) + git_commit_free(commit); return error; } @@ -928,14 +1066,14 @@ int git_rebase_commit( assert(rebase && committer); - switch (rebase->type) { - case GIT_REBASE_TYPE_MERGE: + if (rebase->inmemory) + error = rebase_commit_inmemory( + id, rebase, author, committer, message_encoding, message); + else if (rebase->type == GIT_REBASE_TYPE_MERGE) error = rebase_commit_merge( id, rebase, author, committer, message_encoding, message); - break; - default: + else abort(); - } return error; } @@ -948,6 +1086,9 @@ int git_rebase_abort(git_rebase *rebase) assert(rebase); + if (rebase->inmemory) + return 0; + error = rebase->head_detached ? git_reference_create(&orig_head_ref, rebase->repo, GIT_HEAD_FILE, &rebase->orig_head_id, 1, "rebase: aborting") : @@ -1125,6 +1266,9 @@ int git_rebase_finish( assert(rebase); + if (rebase->inmemory) + return 0; + git_oid_fmt(onto, &rebase->onto_id); if ((error = git_buf_printf(&branch_msg, "rebase finished: %s onto %.*s", @@ -1182,6 +1326,8 @@ void git_rebase_free(git_rebase *rebase) if (rebase == NULL) return; + git_index_free(rebase->index); + git_commit_free(rebase->last_commit); git__free(rebase->onto_name); git__free(rebase->orig_head_name); git__free(rebase->state_path); diff --git a/vendor/libgit2/src/refdb.c b/vendor/libgit2/src/refdb.c index 16fb519a6..debba1276 100644 --- a/vendor/libgit2/src/refdb.c +++ b/vendor/libgit2/src/refdb.c @@ -61,12 +61,8 @@ int git_refdb_open(git_refdb **out, git_repository *repo) static void refdb_free_backend(git_refdb *db) { - if (db->backend) { - if (db->backend->free) - db->backend->free(db->backend); - else - git__free(db->backend); - } + if (db->backend) + db->backend->free(db->backend); } int git_refdb_set_backend(git_refdb *db, git_refdb_backend *backend) diff --git a/vendor/libgit2/src/refdb_fs.c b/vendor/libgit2/src/refdb_fs.c index 792e4bb0a..f978038e6 100644 --- a/vendor/libgit2/src/refdb_fs.c +++ b/vendor/libgit2/src/refdb_fs.c @@ -63,6 +63,8 @@ typedef struct refdb_fs_backend { uint32_t direach_flags; } refdb_fs_backend; +static int refdb_reflog_fs__delete(git_refdb_backend *_backend, const char *name); + static int packref_cmp(const void *a_, const void *b_) { const struct packref *a = a_, *b = b_; @@ -478,14 +480,16 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter) int error = 0; git_buf path = GIT_BUF_INIT; git_iterator *fsit = NULL; + git_iterator_options fsit_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry = NULL; if (!backend->path) /* do nothing if no path for loose refs */ return 0; + fsit_opts.flags = backend->iterator_flags; + if ((error = git_buf_printf(&path, "%s/refs", backend->path)) < 0 || - (error = git_iterator_for_filesystem( - &fsit, path.ptr, backend->iterator_flags, NULL, NULL)) < 0) { + (error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) { git_buf_free(&path); return error; } @@ -622,8 +626,9 @@ static int refdb_fs_backend__iterator( iter = git__calloc(1, sizeof(refdb_fs_iter)); GITERR_CHECK_ALLOC(iter); - if (git_pool_init(&iter->pool, 1, 0) < 0 || - git_vector_init(&iter->loose, 8, NULL) < 0) + git_pool_init(&iter->pool, 1); + + if (git_vector_init(&iter->loose, 8, NULL) < 0) goto fail; if (glob != NULL && @@ -712,7 +717,7 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char * assert(file && backend && name); - if (!git_path_isvalid(backend->repo, name, GIT_PATH_REJECT_DEFAULTS)) { + if (!git_path_isvalid(backend->repo, name, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", name); return GIT_EINVALIDSPEC; } @@ -728,8 +733,11 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char * error = git_filebuf_open(file, ref_path.ptr, GIT_FILEBUF_FORCE, GIT_REFS_FILE_MODE); + if (error == GIT_EDIRECTORY) + giterr_set(GITERR_REFERENCE, "cannot lock ref '%s', there are refs beneath that folder", name); + git_buf_free(&ref_path); - return error; + return error; } static int loose_commit(git_filebuf *file, const git_reference *ref) @@ -954,6 +962,7 @@ static int packed_write(refdb_fs_backend *backend) for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) { struct packref *ref = git_sortedcache_entry(refcache, i); + assert(ref); if (packed_find_peel(backend, ref) < 0) goto fail; @@ -1217,6 +1226,11 @@ static int refdb_fs_backend__delete( if ((error = loose_lock(&file, backend, ref_name)) < 0) return error; + if ((error = refdb_reflog_fs__delete(_backend, ref_name)) < 0) { + git_filebuf_cleanup(&file); + return error; + } + return refdb_fs_backend__delete_tail(_backend, &file, ref_name, old_id, old_target); } @@ -1404,7 +1418,8 @@ static int setup_namespace(git_buf *path, git_repository *repo) git__free(parts); /* Make sure that the folder with the namespace exists */ - if (git_futils_mkdir_r(git_buf_cstr(path), repo->path_repository, 0777) < 0) + if (git_futils_mkdir_relative(git_buf_cstr(path), repo->path_repository, + 0777, GIT_MKDIR_PATH, NULL) < 0) return -1; /* Return root of the namespaced path, i.e. without the trailing '/refs' */ @@ -1498,8 +1513,7 @@ static int reflog_parse(git_reflog *log, const char *buf, size_t buf_size) #undef seek_forward fail: - if (entry) - git_reflog_entry__free(entry); + git_reflog_entry__free(entry); return -1; } @@ -1658,7 +1672,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char repo = backend->repo; - if (!git_path_isvalid(backend->repo, refname, GIT_PATH_REJECT_DEFAULTS)) { + if (!git_path_isvalid(backend->repo, refname, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { giterr_set(GITERR_INVALID, "Invalid reference name '%s'.", refname); return GIT_EINVALIDSPEC; } @@ -1774,10 +1788,17 @@ static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, co /* If the new branch matches part of the namespace of a previously deleted branch, * there maybe an obsolete/unused directory (or directory hierarchy) in the way. */ - if (git_path_isdir(git_buf_cstr(&path)) && - (git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_RMDIR_SKIP_NONEMPTY) < 0)) { - error = -1; - goto cleanup; + if (git_path_isdir(git_buf_cstr(&path))) { + if ((git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_RMDIR_SKIP_NONEMPTY) < 0)) + error = -1; + else if (git_path_isdir(git_buf_cstr(&path))) { + giterr_set(GITERR_REFERENCE, "cannot create reflog at '%s', there are reflogs beneath that folder", + ref->name); + error = GIT_EDIRECTORY; + } + + if (error != 0) + goto cleanup; } error = git_futils_writebuffer(&buf, git_buf_cstr(&path), O_WRONLY|O_CREAT|O_APPEND, GIT_REFLOG_FILE_MODE); diff --git a/vendor/libgit2/src/refs.c b/vendor/libgit2/src/refs.c index 7b538659d..26c80021f 100644 --- a/vendor/libgit2/src/refs.c +++ b/vendor/libgit2/src/refs.c @@ -289,6 +289,9 @@ int git_reference_dwim(git_reference **out, git_repository *repo, const char *re "Could not use '%s' as valid reference name", git_buf_cstr(&name)); } + if (error == GIT_ENOTFOUND) + giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname); + git_buf_free(&name); git_buf_free(&refnamebuf); return error; @@ -377,15 +380,9 @@ static int reference__create( return error; if (oid != NULL) { - git_odb *odb; - assert(symbolic == NULL); - /* Sanity check the reference being created - target must exist. */ - if ((error = git_repository_odb__weakptr(&odb, repo)) < 0) - return error; - - if (!git_odb_exists(odb, oid)) { + if (!git_object__is_valid(repo, oid, GIT_OBJ_ANY)) { giterr_set(GITERR_REFERENCE, "Target OID for the reference doesn't exist on the repository"); return -1; diff --git a/vendor/libgit2/src/refs.h b/vendor/libgit2/src/refs.h index f78ea06b0..fda9532de 100644 --- a/vendor/libgit2/src/refs.h +++ b/vendor/libgit2/src/refs.h @@ -44,6 +44,11 @@ #define GIT_REBASE_APPLY_APPLYING_FILE GIT_REBASE_APPLY_DIR "applying" #define GIT_REFS_HEADS_MASTER_FILE GIT_REFS_HEADS_DIR "master" +#define GIT_SEQUENCER_DIR "sequencer/" +#define GIT_SEQUENCER_HEAD_FILE GIT_SEQUENCER_DIR "head" +#define GIT_SEQUENCER_OPTIONS_FILE GIT_SEQUENCER_DIR "options" +#define GIT_SEQUENCER_TODO_FILE GIT_SEQUENCER_DIR "todo" + #define GIT_STASH_FILE "stash" #define GIT_REFS_STASH_FILE GIT_REFS_DIR GIT_STASH_FILE diff --git a/vendor/libgit2/src/refspec.c b/vendor/libgit2/src/refspec.c index f92a6d2b6..debde8692 100644 --- a/vendor/libgit2/src/refspec.c +++ b/vendor/libgit2/src/refspec.c @@ -323,8 +323,8 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs) if (git__prefixcmp(spec->src, GIT_REFS_DIR)) { for (j = 0; formatters[j]; j++) { git_buf_clear(&buf); - if (git_buf_printf(&buf, formatters[j], spec->src) < 0) - return -1; + git_buf_printf(&buf, formatters[j], spec->src); + GITERR_CHECK_ALLOC_BUF(&buf); key.name = (char *) git_buf_cstr(&buf); if (!git_vector_search(&pos, refs, &key)) { @@ -348,8 +348,8 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs) git_buf_puts(&buf, GIT_REFS_HEADS_DIR); } - if (git_buf_puts(&buf, spec->dst) < 0) - return -1; + git_buf_puts(&buf, spec->dst); + GITERR_CHECK_ALLOC_BUF(&buf); cur->dst = git_buf_detach(&buf); } diff --git a/vendor/libgit2/src/remote.c b/vendor/libgit2/src/remote.c index 9f82aaea3..8b7203ee2 100644 --- a/vendor/libgit2/src/remote.c +++ b/vendor/libgit2/src/remote.c @@ -153,7 +153,7 @@ static int get_check_cert(int *out, git_repository *repo) * most specific to least specific. */ /* GIT_SSL_NO_VERIFY environment variable */ - if ((val = getenv("GIT_SSL_NO_VERIFY")) != NULL) + if ((val = p_getenv("GIT_SSL_NO_VERIFY")) != NULL) return git_config_parse_bool(out, val); /* http.sslVerify config setting */ @@ -208,8 +208,8 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n remote->repo = repo; - if (git_vector_init(&remote->refs, 32, NULL) < 0 || - canonicalize_url(&canonical_url, url) < 0) + if ((error = git_vector_init(&remote->refs, 32, NULL)) < 0 || + (error = canonicalize_url(&canonical_url, url)) < 0) goto on_error; remote->url = apply_insteadof(repo->_config, canonical_url.ptr, GIT_DIRECTION_FETCH); @@ -687,7 +687,15 @@ int set_transport_callbacks(git_transport *t, const git_remote_callbacks *cbs) cbs->certificate_check, cbs->payload); } -int git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks) +static int set_transport_custom_headers(git_transport *t, const git_strarray *custom_headers) +{ + if (!t->set_custom_headers) + return 0; + + return t->set_custom_headers(t, custom_headers); +} + +int git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_strarray *custom_headers) { git_transport *t; const char *url; @@ -726,6 +734,9 @@ int git_remote_connect(git_remote *remote, git_direction direction, const git_re if (!t && (error = git_transport_new(&t, remote, url)) < 0) return error; + if ((error = set_transport_custom_headers(t, custom_headers)) != 0) + goto on_error; + if ((error = set_transport_callbacks(t, callbacks)) < 0 || (error = t->connect(t, url, credentials, payload, direction, flags)) != 0) goto on_error; @@ -759,7 +770,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur { git_config *cfg; git_config_entry *ce = NULL; - const char *val = NULL; + git_buf val = GIT_BUF_INIT; int error; assert(remote); @@ -789,7 +800,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur return error; if (ce && ce->value) { - val = ce->value; + *proxy_url = git__strdup(ce->value); goto found; } } @@ -797,19 +808,28 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur /* http.proxy config setting */ if ((error = git_config__lookup_entry(&ce, cfg, "http.proxy", false)) < 0) return error; + if (ce && ce->value) { - val = ce->value; + *proxy_url = git__strdup(ce->value); goto found; } /* HTTP_PROXY / HTTPS_PROXY environment variables */ - val = use_ssl ? getenv("HTTPS_PROXY") : getenv("HTTP_PROXY"); + error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY"); -found: - if (val && val[0]) { - *proxy_url = git__strdup(val); - GITERR_CHECK_ALLOC(*proxy_url); + if (error < 0) { + if (error == GIT_ENOTFOUND) { + giterr_clear(); + error = 0; + } + + return error; } + + *proxy_url = git_buf_detach(&val); + +found: + GITERR_CHECK_ALLOC(*proxy_url); git_config_entry_free(ce); return 0; @@ -875,16 +895,18 @@ int git_remote_download(git_remote *remote, const git_strarray *refspecs, const size_t i; git_vector *to_active, specs = GIT_VECTOR_INIT, refs = GIT_VECTOR_INIT; const git_remote_callbacks *cbs = NULL; + const git_strarray *custom_headers = NULL; assert(remote); if (opts) { GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); cbs = &opts->callbacks; + custom_headers = &opts->custom_headers; } if (!git_remote_connected(remote) && - (error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs)) < 0) + (error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs, custom_headers)) < 0) goto on_error; if (ls_to_vector(&refs, remote) < 0) @@ -948,16 +970,18 @@ int git_remote_fetch( bool prune = false; git_buf reflog_msg_buf = GIT_BUF_INIT; const git_remote_callbacks *cbs = NULL; + const git_strarray *custom_headers = NULL; if (opts) { GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); cbs = &opts->callbacks; + custom_headers = &opts->custom_headers; update_fetchhead = opts->update_fetchhead; tagopt = opts->download_tags; } /* Connect and download everything */ - if ((error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs)) != 0) + if ((error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs, custom_headers)) != 0) return error; error = git_remote_download(remote, refspecs, opts); @@ -2368,14 +2392,17 @@ int git_remote_upload(git_remote *remote, const git_strarray *refspecs, const gi git_push *push; git_refspec *spec; const git_remote_callbacks *cbs = NULL; + const git_strarray *custom_headers = NULL; assert(remote); - if (opts) + if (opts) { cbs = &opts->callbacks; + custom_headers = &opts->custom_headers; + } if (!git_remote_connected(remote) && - (error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs)) < 0) + (error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs, custom_headers)) < 0) goto cleanup; free_refspecs(&remote->active_refspecs); @@ -2424,15 +2451,17 @@ int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_ { int error; const git_remote_callbacks *cbs = NULL; + const git_strarray *custom_headers = NULL; if (opts) { GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); cbs = &opts->callbacks; + custom_headers = &opts->custom_headers; } assert(remote && refspecs); - if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs)) < 0) + if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs, custom_headers)) < 0) return error; if ((error = git_remote_upload(remote, refspecs, opts)) < 0) diff --git a/vendor/libgit2/src/repository.c b/vendor/libgit2/src/repository.c index 3476ccadc..8a6fef0f6 100644 --- a/vendor/libgit2/src/repository.c +++ b/vendor/libgit2/src/repository.c @@ -585,7 +585,8 @@ static int load_config( git_repository *repo, const char *global_config_path, const char *xdg_config_path, - const char *system_config_path) + const char *system_config_path, + const char *programdata_path) { int error; git_buf config_path = GIT_BUF_INIT; @@ -626,6 +627,12 @@ static int load_config( error != GIT_ENOTFOUND) goto on_error; + if (programdata_path != NULL && + (error = git_config_add_file_ondisk( + cfg, programdata_path, GIT_CONFIG_LEVEL_PROGRAMDATA, 0)) < 0 && + error != GIT_ENOTFOUND) + goto on_error; + giterr_clear(); /* clear any lingering ENOTFOUND errors */ *out = cfg; @@ -651,11 +658,13 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo) git_buf global_buf = GIT_BUF_INIT; git_buf xdg_buf = GIT_BUF_INIT; git_buf system_buf = GIT_BUF_INIT; + git_buf programdata_buf = GIT_BUF_INIT; git_config *config; git_config_find_global(&global_buf); git_config_find_xdg(&xdg_buf); git_config_find_system(&system_buf); + git_config_find_programdata(&programdata_buf); /* If there is no global file, open a backend for it anyway */ if (git_buf_len(&global_buf) == 0) @@ -665,7 +674,8 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo) &config, repo, path_unless_empty(&global_buf), path_unless_empty(&xdg_buf), - path_unless_empty(&system_buf)); + path_unless_empty(&system_buf), + path_unless_empty(&programdata_buf)); if (!error) { GIT_REFCOUNT_OWN(config, repo); @@ -679,6 +689,7 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo) git_buf_free(&global_buf); git_buf_free(&xdg_buf); git_buf_free(&system_buf); + git_buf_free(&programdata_buf); } *out = repo->_config; @@ -1295,7 +1306,7 @@ static int repo_write_template( #ifdef GIT_WIN32 if (!error && hidden) { - if (git_win32__sethidden(path.ptr) < 0) + if (git_win32__set_hidden(path.ptr, true) < 0) error = -1; } #else @@ -1389,7 +1400,7 @@ static int repo_init_structure( /* Hide the ".git" directory */ #ifdef GIT_WIN32 if ((opts->flags & GIT_REPOSITORY_INIT__HAS_DOTGIT) != 0) { - if (git_win32__sethidden(repo_dir) < 0) { + if (git_win32__set_hidden(repo_dir, true) < 0) { giterr_set(GITERR_OS, "Failed to mark Git repository folder as hidden"); return -1; @@ -1427,7 +1438,9 @@ static int repo_init_structure( } if (tdir) { - uint32_t cpflags = GIT_CPDIR_COPY_SYMLINKS | GIT_CPDIR_SIMPLE_TO_MODE; + uint32_t cpflags = GIT_CPDIR_COPY_SYMLINKS | + GIT_CPDIR_SIMPLE_TO_MODE | + GIT_CPDIR_COPY_DOTFILES; if (opts->mode != GIT_REPOSITORY_INIT_SHARED_UMASK) cpflags |= GIT_CPDIR_CHMOD_DIRS; error = git_futils_cp_r(tdir, repo_dir, cpflags, dmode); @@ -1457,8 +1470,8 @@ static int repo_init_structure( if (chmod) mkdir_flags |= GIT_MKDIR_CHMOD; - error = git_futils_mkdir( - tpl->path, repo_dir, dmode, mkdir_flags); + error = git_futils_mkdir_relative( + tpl->path, repo_dir, dmode, mkdir_flags, NULL); } else if (!external_tpl) { const char *content = tpl->content; @@ -1480,7 +1493,7 @@ static int mkdir_parent(git_buf *buf, uint32_t mode, bool skip2) * don't try to set gid or grant world write access */ return git_futils_mkdir( - buf->ptr, NULL, mode & ~(S_ISGID | 0002), + buf->ptr, mode & ~(S_ISGID | 0002), GIT_MKDIR_PATH | GIT_MKDIR_VERIFY_DIR | (skip2 ? GIT_MKDIR_SKIP_LAST2 : GIT_MKDIR_SKIP_LAST)); } @@ -1584,14 +1597,14 @@ static int repo_init_directories( /* create path #4 */ if (wd_path->size > 0 && (error = git_futils_mkdir( - wd_path->ptr, NULL, dirmode & ~S_ISGID, + wd_path->ptr, dirmode & ~S_ISGID, GIT_MKDIR_VERIFY_DIR)) < 0) return error; /* create path #2 (if not the same as #4) */ if (!natural_wd && (error = git_futils_mkdir( - repo_path->ptr, NULL, dirmode & ~S_ISGID, + repo_path->ptr, dirmode & ~S_ISGID, GIT_MKDIR_VERIFY_DIR | GIT_MKDIR_SKIP_LAST)) < 0) return error; } @@ -1601,7 +1614,7 @@ static int repo_init_directories( has_dotgit) { /* create path #1 */ - error = git_futils_mkdir(repo_path->ptr, NULL, dirmode, + error = git_futils_mkdir(repo_path->ptr, dirmode, GIT_MKDIR_VERIFY_DIR | ((dirmode & S_ISGID) ? GIT_MKDIR_CHMOD : 0)); } @@ -2211,11 +2224,17 @@ int git_repository_state(git_repository *repo) state = GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE; else if (git_path_contains_file(&repo_path, GIT_MERGE_HEAD_FILE)) state = GIT_REPOSITORY_STATE_MERGE; - else if(git_path_contains_file(&repo_path, GIT_REVERT_HEAD_FILE)) + else if (git_path_contains_file(&repo_path, GIT_REVERT_HEAD_FILE)) { state = GIT_REPOSITORY_STATE_REVERT; - else if(git_path_contains_file(&repo_path, GIT_CHERRYPICK_HEAD_FILE)) + if (git_path_contains_file(&repo_path, GIT_SEQUENCER_TODO_FILE)) { + state = GIT_REPOSITORY_STATE_REVERT_SEQUENCE; + } + } else if (git_path_contains_file(&repo_path, GIT_CHERRYPICK_HEAD_FILE)) { state = GIT_REPOSITORY_STATE_CHERRYPICK; - else if(git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE)) + if (git_path_contains_file(&repo_path, GIT_SEQUENCER_TODO_FILE)) { + state = GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE; + } + } else if (git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE)) state = GIT_REPOSITORY_STATE_BISECT; git_buf_free(&repo_path); @@ -2260,6 +2279,7 @@ static const char *state_files[] = { GIT_BISECT_LOG_FILE, GIT_REBASE_MERGE_DIR, GIT_REBASE_APPLY_DIR, + GIT_SEQUENCER_DIR, }; int git_repository_state_cleanup(git_repository *repo) diff --git a/vendor/libgit2/src/reset.c b/vendor/libgit2/src/reset.c index 0ffa51b66..f8a1a1dc8 100644 --- a/vendor/libgit2/src/reset.c +++ b/vendor/libgit2/src/reset.c @@ -145,19 +145,19 @@ static int reset( if ((error = git_buf_printf(&log_message, "reset: moving to %s", to)) < 0) return error; - /* move HEAD to the new target */ - if ((error = git_reference__update_terminal(repo, GIT_HEAD_FILE, - git_object_id(commit), NULL, git_buf_cstr(&log_message))) < 0) - goto cleanup; - if (reset_type == GIT_RESET_HARD) { - /* overwrite working directory with HEAD */ + /* overwrite working directory with the new tree */ opts.checkout_strategy = GIT_CHECKOUT_FORCE; if ((error = git_checkout_tree(repo, (git_object *)tree, &opts)) < 0) goto cleanup; } + /* move HEAD to the new target */ + if ((error = git_reference__update_terminal(repo, GIT_HEAD_FILE, + git_object_id(commit), NULL, git_buf_cstr(&log_message))) < 0) + goto cleanup; + if (reset_type > GIT_RESET_SOFT) { /* reset index to the target content */ diff --git a/vendor/libgit2/src/revwalk.c b/vendor/libgit2/src/revwalk.c index dcdd97915..4815a1089 100644 --- a/vendor/libgit2/src/revwalk.c +++ b/vendor/libgit2/src/revwalk.c @@ -223,8 +223,7 @@ static int push_glob(git_revwalk *walk, const char *glob, int hide) git_buf_joinpath(&buf, GIT_REFS_DIR, glob); else git_buf_puts(&buf, glob); - if (git_buf_oom(&buf)) - return -1; + GITERR_CHECK_ALLOC_BUF(&buf); /* If no '?', '*' or '[' exist, we append '/ *' to the glob */ wildcard = strcspn(glob, "?*["); @@ -535,12 +534,10 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo) walk->commits = git_oidmap_alloc(); GITERR_CHECK_ALLOC(walk->commits); - if (git_pqueue_init( - &walk->iterator_time, 0, 8, git_commit_list_time_cmp) < 0 || - git_pool_init(&walk->commit_pool, 1, - git_pool__suggest_items_per_page(COMMIT_ALLOC) * COMMIT_ALLOC) < 0) + if (git_pqueue_init(&walk->iterator_time, 0, 8, git_commit_list_time_cmp) < 0) return -1; + git_pool_init(&walk->commit_pool, COMMIT_ALLOC); walk->get_next = &revwalk_next_unsorted; walk->enqueue = &revwalk_enqueue_unsorted; diff --git a/vendor/libgit2/src/settings.c b/vendor/libgit2/src/settings.c index 2097ca314..0da19ea03 100644 --- a/vendor/libgit2/src/settings.c +++ b/vendor/libgit2/src/settings.c @@ -14,6 +14,7 @@ #include "sysdir.h" #include "cache.h" #include "global.h" +#include "object.h" void git_libgit2_version(int *major, int *minor, int *rev) { @@ -33,6 +34,9 @@ int git_libgit2_features() #endif #if defined(GIT_SSH) | GIT_FEATURE_SSH +#endif +#if defined(GIT_USE_NSEC) + | GIT_FEATURE_NSEC #endif ; } @@ -46,9 +50,18 @@ static int config_level_to_sysdir(int config_level) int val = -1; switch (config_level) { - case GIT_CONFIG_LEVEL_SYSTEM: val = GIT_SYSDIR_SYSTEM; break; - case GIT_CONFIG_LEVEL_XDG: val = GIT_SYSDIR_XDG; break; - case GIT_CONFIG_LEVEL_GLOBAL: val = GIT_SYSDIR_GLOBAL; break; + case GIT_CONFIG_LEVEL_SYSTEM: + val = GIT_SYSDIR_SYSTEM; + break; + case GIT_CONFIG_LEVEL_XDG: + val = GIT_SYSDIR_XDG; + break; + case GIT_CONFIG_LEVEL_GLOBAL: + val = GIT_SYSDIR_GLOBAL; + break; + case GIT_CONFIG_LEVEL_PROGRAMDATA: + val = GIT_SYSDIR_PROGRAMDATA; + break; default: giterr_set( GITERR_INVALID, "Invalid config path selector %d", config_level); @@ -57,6 +70,19 @@ static int config_level_to_sysdir(int config_level) return val; } +extern char *git__user_agent; +extern char *git__ssl_ciphers; + +const char *git_libgit2__user_agent() +{ + return git__user_agent; +} + +const char *git_libgit2__ssl_ciphers() +{ + return git__ssl_ciphers; +} + int git_libgit2_opts(int key, ...) { int error = 0; @@ -149,10 +175,43 @@ int git_libgit2_opts(int key, ...) } } #else - giterr_set(GITERR_NET, "Cannot set certificate locations: OpenSSL is not enabled"); + giterr_set(GITERR_NET, "cannot set certificate locations: OpenSSL is not enabled"); + error = -1; +#endif + break; + case GIT_OPT_SET_USER_AGENT: + git__free(git__user_agent); + git__user_agent = git__strdup(va_arg(ap, const char *)); + if (!git__user_agent) { + giterr_set_oom(); + error = -1; + } + + break; + + case GIT_OPT_ENABLE_STRICT_OBJECT_CREATION: + git_object__strict_input_validation = (va_arg(ap, int) != 0); + break; + + case GIT_OPT_SET_SSL_CIPHERS: +#ifdef GIT_OPENSSL + { + git__free(git__ssl_ciphers); + git__ssl_ciphers = git__strdup(va_arg(ap, const char *)); + if (!git__ssl_ciphers) { + giterr_set_oom(); + error = -1; + } + } +#else + giterr_set(GITERR_NET, "cannot set custom ciphers: OpenSSL is not enabled"); error = -1; #endif break; + + default: + giterr_set(GITERR_INVALID, "invalid option key"); + error = -1; } va_end(ap); diff --git a/vendor/libgit2/src/signature.c b/vendor/libgit2/src/signature.c index 109476efe..d07c93323 100644 --- a/vendor/libgit2/src/signature.c +++ b/vendor/libgit2/src/signature.c @@ -79,10 +79,9 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema GITERR_CHECK_ALLOC(p); p->name = extract_trimmed(name, strlen(name)); + GITERR_CHECK_ALLOC(p->name); p->email = extract_trimmed(email, strlen(email)); - - if (p->name == NULL || p->email == NULL) - return -1; /* oom */ + GITERR_CHECK_ALLOC(p->email); if (p->name[0] == '\0' || p->email[0] == '\0') { git_signature_free(p); diff --git a/vendor/libgit2/src/sortedcache.c b/vendor/libgit2/src/sortedcache.c index 115175724..5c2a167a7 100644 --- a/vendor/libgit2/src/sortedcache.c +++ b/vendor/libgit2/src/sortedcache.c @@ -20,8 +20,9 @@ int git_sortedcache_new( sc = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(sc); - if (git_pool_init(&sc->pool, 1, 0) < 0 || - git_vector_init(&sc->items, 4, item_cmp) < 0 || + git_pool_init(&sc->pool, 1); + + if (git_vector_init(&sc->items, 4, item_cmp) < 0 || git_strmap_alloc(&sc->map) < 0) goto fail; diff --git a/vendor/libgit2/src/stash.c b/vendor/libgit2/src/stash.c index fcb1112ac..43a464e64 100644 --- a/vendor/libgit2/src/stash.c +++ b/vendor/libgit2/src/stash.c @@ -679,12 +679,14 @@ static int merge_indexes( git_index *theirs_index) { git_iterator *ancestor = NULL, *ours = NULL, *theirs = NULL; - const git_iterator_flag_t flags = GIT_ITERATOR_DONT_IGNORE_CASE; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; int error; - if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, flags, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&ours, ours_index, flags, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&theirs, theirs_index, flags, NULL, NULL)) < 0) + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 || + (error = git_iterator_for_index(&ours, repo, ours_index, &iter_opts)) < 0 || + (error = git_iterator_for_index(&theirs, repo, theirs_index, &iter_opts)) < 0) goto done; error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL); @@ -704,12 +706,14 @@ static int merge_index_and_tree( git_tree *theirs_tree) { git_iterator *ancestor = NULL, *ours = NULL, *theirs = NULL; - const git_iterator_flag_t flags = GIT_ITERATOR_DONT_IGNORE_CASE; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; int error; - if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, flags, NULL, NULL)) < 0 || - (error = git_iterator_for_index(&ours, ours_index, flags, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&theirs, theirs_tree, flags, NULL, NULL)) < 0) + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, &iter_opts)) < 0 || + (error = git_iterator_for_index(&ours, repo, ours_index, &iter_opts)) < 0 || + (error = git_iterator_for_tree(&theirs, theirs_tree, &iter_opts)) < 0) goto done; error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL); @@ -724,7 +728,7 @@ static int merge_index_and_tree( static void normalize_apply_options( git_stash_apply_options *opts, const git_stash_apply_options *given_apply_opts) -{ +{ if (given_apply_opts != NULL) { memcpy(opts, given_apply_opts, sizeof(git_stash_apply_options)); } else { @@ -797,14 +801,15 @@ static int stage_new_files( git_tree *tree) { git_iterator *iterators[2] = { NULL, NULL }; + git_iterator_options iterator_options = GIT_ITERATOR_OPTIONS_INIT; git_index *index = NULL; int error; if ((error = git_index_new(&index)) < 0 || - (error = git_iterator_for_tree(&iterators[0], parent_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&iterators[1], tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + (error = git_iterator_for_tree( + &iterators[0], parent_tree, &iterator_options)) < 0 || + (error = git_iterator_for_tree( + &iterators[1], tree, &iterator_options)) < 0) goto done; error = git_iterator_walk(iterators, 2, stage_new_file, index); diff --git a/vendor/libgit2/src/stransport_stream.c b/vendor/libgit2/src/stransport_stream.c index 10e19166c..33b6c5c38 100644 --- a/vendor/libgit2/src/stransport_stream.c +++ b/vendor/libgit2/src/stransport_stream.c @@ -108,7 +108,7 @@ int stransport_certificate(git_cert **out, git_stream *stream) return -1; } - st->cert_info.cert_type = GIT_CERT_X509; + st->cert_info.parent.cert_type = GIT_CERT_X509; st->cert_info.data = (void *) CFDataGetBytePtr(st->der_data); st->cert_info.len = CFDataGetLength(st->der_data); diff --git a/vendor/libgit2/src/stream.h b/vendor/libgit2/src/stream.h index 43fcc3045..4692c7115 100644 --- a/vendor/libgit2/src/stream.h +++ b/vendor/libgit2/src/stream.h @@ -62,6 +62,9 @@ GIT_INLINE(int) git_stream_close(git_stream *st) GIT_INLINE(void) git_stream_free(git_stream *st) { + if (!st) + return; + st->free(st); } diff --git a/vendor/libgit2/src/submodule.c b/vendor/libgit2/src/submodule.c index 3d028747f..c903cf939 100644 --- a/vendor/libgit2/src/submodule.c +++ b/vendor/libgit2/src/submodule.c @@ -80,7 +80,8 @@ static kh_inline int str_equal_no_trailing_slash(const char *a, const char *b) if (blen > 0 && b[blen - 1] == '/') blen--; - return (alen == blen && strncmp(a, b, alen) == 0); + return (alen == 0 && blen == 0) || + (alen == blen && strncmp(a, b, alen) == 0); } __KHASH_IMPL( @@ -89,9 +90,11 @@ __KHASH_IMPL( static int submodule_alloc(git_submodule **out, git_repository *repo, const char *name); static git_config_backend *open_gitmodules(git_repository *repo, int gitmod); +static git_config *gitmodules_snapshot(git_repository *repo); static int get_url_base(git_buf *url, git_repository *repo); static int lookup_head_remote_key(git_buf *remote_key, git_repository *repo); -static int submodule_load_from_config(const git_config_entry *, void *); +static int submodule_load_each(const git_config_entry *entry, void *payload); +static int submodule_read_config(git_submodule *sm, git_config *cfg); static int submodule_load_from_wd_lite(git_submodule *); static void submodule_get_index_status(unsigned int *, git_submodule *); static void submodule_get_wd_status(unsigned int *, git_submodule *, git_repository *, git_submodule_ignore_t); @@ -144,6 +147,43 @@ static int find_by_path(const git_config_entry *entry, void *payload) return 0; } +/** + * Find out the name of a submodule from its path + */ +static int name_from_path(git_buf *out, git_config *cfg, const char *path) +{ + const char *key = "submodule\\..*\\.path"; + git_config_iterator *iter; + git_config_entry *entry; + int error; + + if ((error = git_config_iterator_glob_new(&iter, cfg, key)) < 0) + return error; + + while ((error = git_config_next(&entry, iter)) == 0) { + const char *fdot, *ldot; + /* TODO: this should maybe be strcasecmp on a case-insensitive fs */ + if (strcmp(path, entry->value) != 0) + continue; + + fdot = strchr(entry->name, '.'); + ldot = strrchr(entry->name, '.'); + + git_buf_clear(out); + git_buf_put(out, fdot + 1, ldot - fdot - 1); + goto cleanup; + } + + if (error == GIT_ITEROVER) { + giterr_set(GITERR_SUBMODULE, "could not find a submodule name for '%s'", path); + error = GIT_ENOTFOUND; + } + +cleanup: + git_config_iterator_free(iter); + return error; +} + int git_submodule_lookup( git_submodule **out, /* NULL if user only wants to test existence */ git_repository *repo, @@ -190,6 +230,7 @@ int git_submodule_lookup( if (error < 0) { git_submodule_free(sm); + git_buf_free(&path); return error; } @@ -280,19 +321,25 @@ static int submodule_get_or_create(git_submodule **out, git_repository *repo, gi return 0; } -static int submodules_from_index(git_strmap *map, git_index *idx) +static int submodules_from_index(git_strmap *map, git_index *idx, git_config *cfg) { int error; git_iterator *i; const git_index_entry *entry; + git_buf name = GIT_BUF_INIT; - if ((error = git_iterator_for_index(&i, idx, 0, NULL, NULL)) < 0) + if ((error = git_iterator_for_index(&i, git_index_owner(idx), idx, NULL)) < 0) return error; while (!(error = git_iterator_advance(&entry, i))) { khiter_t pos = git_strmap_lookup_index(map, entry->path); git_submodule *sm; + git_buf_clear(&name); + if (!name_from_path(&name, cfg, entry->path)) { + git_strmap_lookup_index(map, name.ptr); + } + if (git_strmap_valid_index(map, pos)) { sm = git_strmap_value_at(map, pos); @@ -301,7 +348,7 @@ static int submodules_from_index(git_strmap *map, git_index *idx) else sm->flags |= GIT_SUBMODULE_STATUS__INDEX_NOT_SUBMODULE; } else if (S_ISGITLINK(entry->mode)) { - if (!submodule_get_or_create(&sm, git_index_owner(idx), map, entry->path)) { + if (!submodule_get_or_create(&sm, git_index_owner(idx), map, name.ptr ? name.ptr : entry->path)) { submodule_update_from_index_entry(sm, entry); git_submodule_free(sm); } @@ -311,24 +358,31 @@ static int submodules_from_index(git_strmap *map, git_index *idx) if (error == GIT_ITEROVER) error = 0; + git_buf_free(&name); git_iterator_free(i); return error; } -static int submodules_from_head(git_strmap *map, git_tree *head) +static int submodules_from_head(git_strmap *map, git_tree *head, git_config *cfg) { int error; git_iterator *i; const git_index_entry *entry; + git_buf name = GIT_BUF_INIT; - if ((error = git_iterator_for_tree(&i, head, 0, NULL, NULL)) < 0) + if ((error = git_iterator_for_tree(&i, head, NULL)) < 0) return error; while (!(error = git_iterator_advance(&entry, i))) { khiter_t pos = git_strmap_lookup_index(map, entry->path); git_submodule *sm; + git_buf_clear(&name); + if (!name_from_path(&name, cfg, entry->path)) { + git_strmap_lookup_index(map, name.ptr); + } + if (git_strmap_valid_index(map, pos)) { sm = git_strmap_value_at(map, pos); @@ -337,7 +391,7 @@ static int submodules_from_head(git_strmap *map, git_tree *head) else sm->flags |= GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE; } else if (S_ISGITLINK(entry->mode)) { - if (!submodule_get_or_create(&sm, git_tree_owner(head), map, entry->path)) { + if (!submodule_get_or_create(&sm, git_tree_owner(head), map, name.ptr ? name.ptr : entry->path)) { submodule_update_from_head_data( sm, entry->mode, &entry->id); git_submodule_free(sm); @@ -348,6 +402,7 @@ static int submodules_from_head(git_strmap *map, git_tree *head) if (error == GIT_ITEROVER) error = 0; + git_buf_free(&name); git_iterator_free(i); return error; @@ -355,8 +410,7 @@ static int submodules_from_head(git_strmap *map, git_tree *head) /* If have_sm is true, sm is populated, otherwise map an repo are. */ typedef struct { - int have_sm; - git_submodule *sm; + git_config *mods; git_strmap *map; git_repository *repo; } lfc_data; @@ -369,7 +423,7 @@ static int all_submodules(git_repository *repo, git_strmap *map) const char *wd = NULL; git_buf path = GIT_BUF_INIT; git_submodule *sm; - git_config_backend *mods = NULL; + git_config *mods = NULL; uint32_t mask; assert(repo && map); @@ -400,24 +454,28 @@ static int all_submodules(git_repository *repo, git_strmap *map) GIT_SUBMODULE_STATUS__WD_FLAGS | GIT_SUBMODULE_STATUS__WD_OID_VALID; + /* add submodule information from .gitmodules */ + if (wd) { + lfc_data data = { 0 }; + data.map = map; + data.repo = repo; + + if ((mods = gitmodules_snapshot(repo)) == NULL) + goto cleanup; + + data.mods = mods; + if ((error = git_config_foreach( + mods, submodule_load_each, &data)) < 0) + goto cleanup; + } /* add back submodule information from index */ if (idx) { - if ((error = submodules_from_index(map, idx)) < 0) + if ((error = submodules_from_index(map, idx, mods)) < 0) goto cleanup; } /* add submodule information from HEAD */ if (head) { - if ((error = submodules_from_head(map, head)) < 0) - goto cleanup; - } - /* add submodule information from .gitmodules */ - if (wd) { - lfc_data data = { 0 }; - data.map = map; - data.repo = repo; - if ((mods = open_gitmodules(repo, false)) != NULL && - (error = git_config_file_foreach( - mods, submodule_load_from_config, &data)) < 0) + if ((error = submodules_from_head(map, head, mods)) < 0) goto cleanup; } /* shallow scan submodules in work tree as needed */ @@ -428,7 +486,7 @@ static int all_submodules(git_repository *repo, git_strmap *map) } cleanup: - git_config_file_free(mods); + git_config_free(mods); /* TODO: if we got an error, mark submodule config as invalid? */ git_index_free(idx); git_tree_free(head); @@ -438,7 +496,7 @@ static int all_submodules(git_repository *repo, git_strmap *map) int git_submodule_foreach( git_repository *repo, - int (*callback)(git_submodule *sm, const char *name, void *payload), + git_submodule_cb callback, void *payload) { git_vector snapshot = GIT_VECTOR_INIT; @@ -721,9 +779,9 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index) if ((error = git_commit_lookup(&head, sm_repo, &sm->wd_oid)) < 0) goto cleanup; - entry.ctime.seconds = git_commit_time(head); + entry.ctime.seconds = (int32_t)git_commit_time(head); entry.ctime.nanoseconds = 0; - entry.mtime.seconds = git_commit_time(head); + entry.mtime.seconds = (int32_t)git_commit_time(head); entry.mtime.nanoseconds = 0; git_commit_free(head); @@ -787,19 +845,15 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur git_buf_sanitize(out); + /* We do this in all platforms in case someone on Windows created the .gitmodules */ if (strchr(url, '\\')) { - char *p; - if ((error = git_buf_puts(&normalized, url)) < 0) + if ((error = git_path_normalize_slashes(&normalized, url)) < 0) return error; - for (p = normalized.ptr; *p; p++) { - if (*p == '\\') - *p = '/'; - } - url = normalized.ptr; } + if (git_path_is_relative(url)) { if (!(error = get_url_base(out, repo))) error = git_path_apply_relative(out, url); @@ -984,7 +1038,7 @@ static int submodule_repo_create( /** * Repodir: path to the sub-repo. sub-repo goes in: - * /modules// with a gitlink in the + * /modules// with a gitlink in the * sub-repo workdir directory to that repository. */ error = git_buf_join3( @@ -1101,7 +1155,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio clone_options.repository_cb_payload = sm; /* - * Do not perform checkout as part of clone, instead we + * Do not perform checkout as part of clone, instead we * will checkout the specific commit manually. */ clone_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE; @@ -1363,67 +1417,46 @@ static int submodule_update_head(git_submodule *submodule) git_tree_entry_bypath(&te, head, submodule->path) < 0) giterr_clear(); else - submodule_update_from_head_data(submodule, te->attr, &te->oid); + submodule_update_from_head_data(submodule, te->attr, git_tree_entry_id(te)); git_tree_entry_free(te); git_tree_free(head); return 0; } - int git_submodule_reload(git_submodule *sm, int force) { int error = 0; - git_config_backend *mods; - lfc_data data = { 0 }; + git_config *mods; GIT_UNUSED(force); assert(sm); - /* refresh index data */ - if ((error = submodule_update_index(sm)) < 0) - return error; - - /* refresh HEAD tree data */ - if ((error = submodule_update_head(sm)) < 0) - return error; - - /* done if bare */ - if (git_repository_is_bare(sm->repo)) - return error; - - /* refresh config data */ - mods = open_gitmodules(sm->repo, GITMODULES_EXISTING); - if (mods != NULL) { - git_buf path = GIT_BUF_INIT; - - git_buf_sets(&path, "submodule\\."); - git_buf_text_puts_escape_regex(&path, sm->name); - git_buf_puts(&path, "\\..*"); + if (!git_repository_is_bare(sm->repo)) { + /* refresh config data */ + mods = gitmodules_snapshot(sm->repo); + if (mods != NULL) { + error = submodule_read_config(sm, mods); + git_config_free(mods); - if (git_buf_oom(&path)) { - error = -1; - } else { - data.have_sm = 1; - data.sm = sm; - error = git_config_file_foreach_match( - mods, path.ptr, submodule_load_from_config, &data); + if (error < 0) + return error; } - git_buf_free(&path); - git_config_file_free(mods); + /* refresh wd data */ + sm->flags &= + ~(GIT_SUBMODULE_STATUS_IN_WD | + GIT_SUBMODULE_STATUS__WD_OID_VALID | + GIT_SUBMODULE_STATUS__WD_FLAGS); - if (error < 0) - return error; + error = submodule_load_from_wd_lite(sm); } - /* refresh wd data */ - sm->flags &= - ~(GIT_SUBMODULE_STATUS_IN_WD | GIT_SUBMODULE_STATUS__WD_OID_VALID | - GIT_SUBMODULE_STATUS__WD_FLAGS); + if (error == 0 && (error = submodule_update_index(sm)) == 0) + error = submodule_update_head(sm); - return submodule_load_from_wd_lite(sm); + return error; } static void submodule_copy_oid_maybe( @@ -1631,134 +1664,149 @@ int git_submodule_parse_recurse(git_submodule_recurse_t *out, const char *value) return 0; } -static int submodule_load_from_config( - const git_config_entry *entry, void *payload) +static int get_value(const char **out, git_config *cfg, git_buf *buf, const char *name, const char *field) { - const char *namestart, *property; - const char *key = entry->name, *value = entry->value, *path; - char *alternate = NULL, *replaced = NULL; - git_buf name = GIT_BUF_INIT; - lfc_data *data = payload; - git_submodule *sm; - int error = 0; - - if (git__prefixcmp(key, "submodule.") != 0) - return 0; - - namestart = key + strlen("submodule."); - property = strrchr(namestart, '.'); - - if (!property || (property == namestart)) - return 0; - - property++; - path = !strcasecmp(property, "path") ? value : NULL; + int error; - if ((error = git_buf_set(&name, namestart, property - namestart -1)) < 0) - goto done; + git_buf_clear(buf); - if (data->have_sm) { - sm = data->sm; - } else { - khiter_t pos; - git_strmap *map = data->map; - pos = git_strmap_lookup_index(map, path ? path : name.ptr); - if (git_strmap_valid_index(map, pos)) { - sm = git_strmap_value_at(map, pos); - } else { - if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0) - goto done; + if ((error = git_buf_printf(buf, "submodule.%s.%s", name, field)) < 0 || + (error = git_config_get_string(out, cfg, buf->ptr)) < 0) + return error; - git_strmap_insert(map, sm->name, sm, error); - assert(error != 0); - if (error < 0) - goto done; - error = 0; - } - } + return error; +} - sm->flags |= GIT_SUBMODULE_STATUS_IN_CONFIG; +static int submodule_read_config(git_submodule *sm, git_config *cfg) +{ + git_buf key = GIT_BUF_INIT; + const char *value; + int error, in_config = 0; - /* Only from config might we get differing names & paths. If so, then - * update the submodule and insert under the alternative key. + /* + * TODO: Look up path in index and if it is present but not a GITLINK + * then this should be deleted (at least to match git's behavior) */ - /* TODO: if case insensitive filesystem, then the following strcmps + if ((error = get_value(&value, cfg, &key, sm->name, "path")) == 0) { + in_config = 1; + /* + * TODO: if case insensitive filesystem, then the following strcmp * should be strcasecmp */ - - if (strcmp(sm->name, name.ptr) != 0) { /* name changed */ - if (sm->path && !strcmp(sm->path, name.ptr)) { /* already set as path */ - replaced = sm->name; - sm->name = sm->path; - } else { - if (sm->name != sm->path) - replaced = sm->name; - alternate = sm->name = git_buf_detach(&name); - } - } - else if (path && strcmp(path, sm->path) != 0) { /* path changed */ - if (!strcmp(sm->name, value)) { /* already set as name */ - replaced = sm->path; - sm->path = sm->name; - } else { + if (strcmp(sm->name, value) != 0) { if (sm->path != sm->name) - replaced = sm->path; - if ((alternate = git__strdup(value)) == NULL) { - error = -1; - goto done; - } - sm->path = alternate; + git__free(sm->path); + sm->path = git__strdup(value); + GITERR_CHECK_ALLOC(sm->path); } + } else if (error != GIT_ENOTFOUND) { + goto cleanup; } - /* Deregister under name being replaced */ - if (replaced) { - git__free(replaced); + if ((error = get_value(&value, cfg, &key, sm->name, "url")) == 0) { + in_config = 1; + sm->url = git__strdup(value); + GITERR_CHECK_ALLOC(sm->url); + } else if (error != GIT_ENOTFOUND) { + goto cleanup; } - /* TODO: Look up path in index and if it is present but not a GITLINK - * then this should be deleted (at least to match git's behavior) - */ - - if (path) - goto done; - - /* copy other properties into submodule entry */ - if (strcasecmp(property, "url") == 0) { - git__free(sm->url); - sm->url = NULL; - - if (value != NULL && (sm->url = git__strdup(value)) == NULL) { - error = -1; - goto done; - } + if ((error = get_value(&value, cfg, &key, sm->name, "branch")) == 0) { + in_config = 1; + sm->branch = git__strdup(value); + GITERR_CHECK_ALLOC(sm->branch); + } else if (error != GIT_ENOTFOUND) { + goto cleanup; } - else if (strcasecmp(property, "branch") == 0) { - git__free(sm->branch); - sm->branch = NULL; - if (value != NULL && (sm->branch = git__strdup(value)) == NULL) { - error = -1; - goto done; - } - } - else if (strcasecmp(property, "update") == 0) { + if ((error = get_value(&value, cfg, &key, sm->name, "update")) == 0) { + in_config = 1; if ((error = git_submodule_parse_update(&sm->update, value)) < 0) - goto done; + goto cleanup; sm->update_default = sm->update; + } else if (error != GIT_ENOTFOUND) { + goto cleanup; } - else if (strcasecmp(property, "fetchRecurseSubmodules") == 0) { + + if ((error = get_value(&value, cfg, &key, sm->name, "fetchRecurseSubmodules")) == 0) { + in_config = 1; if ((error = git_submodule_parse_recurse(&sm->fetch_recurse, value)) < 0) - goto done; + goto cleanup; sm->fetch_recurse_default = sm->fetch_recurse; + } else if (error != GIT_ENOTFOUND) { + goto cleanup; } - else if (strcasecmp(property, "ignore") == 0) { + + if ((error = get_value(&value, cfg, &key, sm->name, "ignore")) == 0) { + in_config = 1; if ((error = git_submodule_parse_ignore(&sm->ignore, value)) < 0) - goto done; + goto cleanup; sm->ignore_default = sm->ignore; + } else if (error != GIT_ENOTFOUND) { + goto cleanup; + } + + if (in_config) + sm->flags |= GIT_SUBMODULE_STATUS_IN_CONFIG; + + error = 0; + +cleanup: + git_buf_free(&key); + return error; +} + +static int submodule_load_each(const git_config_entry *entry, void *payload) +{ + lfc_data *data = payload; + const char *namestart, *property; + git_strmap_iter pos; + git_strmap *map = data->map; + git_buf name = GIT_BUF_INIT; + git_submodule *sm; + int error; + + if (git__prefixcmp(entry->name, "submodule.") != 0) + return 0; + + namestart = entry->name + strlen("submodule."); + property = strrchr(namestart, '.'); + + if (!property || (property == namestart)) + return 0; + + property++; + + if ((error = git_buf_set(&name, namestart, property - namestart -1)) < 0) + return error; + + /* + * Now that we have the submodule's name, we can use that to + * figure out whether it's in the map. If it's not, we create + * a new submodule, load the config and insert it. If it's + * already inserted, we've already loaded it, so we skip. + */ + pos = git_strmap_lookup_index(map, name.ptr); + if (git_strmap_valid_index(map, pos)) { + error = 0; + goto done; + } + + if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0) + goto done; + + if ((error = submodule_read_config(sm, data->mods)) < 0) { + git_submodule_free(sm); + goto done; } - /* ignore other unknown submodule properties */ + + git_strmap_insert(map, sm->name, sm, error); + assert(error != 0); + if (error < 0) + goto done; + + error = 0; done: git_buf_free(&name); @@ -1782,6 +1830,35 @@ static int submodule_load_from_wd_lite(git_submodule *sm) return 0; } +/** + * Returns a snapshot of $WORK_TREE/.gitmodules. + * + * We ignore any errors and just pretend the file isn't there. + */ +static git_config *gitmodules_snapshot(git_repository *repo) +{ + const char *workdir = git_repository_workdir(repo); + git_config *mods = NULL, *snap = NULL; + git_buf path = GIT_BUF_INIT; + + if (workdir != NULL) { + if (git_buf_joinpath(&path, workdir, GIT_MODULES_FILE) != 0) + return NULL; + + if (git_config_open_ondisk(&mods, path.ptr) < 0) + mods = NULL; + } + + git_buf_free(&path); + + if (mods) { + git_config_snapshot(&snap, mods); + git_config_free(mods); + } + + return snap; +} + static git_config_backend *open_gitmodules( git_repository *repo, int okay_to_create) diff --git a/vendor/libgit2/src/sysdir.c b/vendor/libgit2/src/sysdir.c index cd94a8b57..bf53d830f 100644 --- a/vendor/libgit2/src/sysdir.c +++ b/vendor/libgit2/src/sysdir.c @@ -15,6 +15,16 @@ #include "win32/findfile.h" #endif +static int git_sysdir_guess_programdata_dirs(git_buf *out) +{ +#ifdef GIT_WIN32 + return git_win32__find_programdata_dirs(out); +#else + git_buf_clear(out); + return 0; +#endif +} + static int git_sysdir_guess_system_dirs(git_buf *out) { #ifdef GIT_WIN32 @@ -29,7 +39,14 @@ static int git_sysdir_guess_global_dirs(git_buf *out) #ifdef GIT_WIN32 return git_win32__find_global_dirs(out); #else - return git_buf_sets(out, getenv("HOME")); + int error = git__getenv(out, "HOME"); + + if (error == GIT_ENOTFOUND) { + giterr_clear(); + error = 0; + } + + return error; #endif } @@ -38,15 +55,22 @@ static int git_sysdir_guess_xdg_dirs(git_buf *out) #ifdef GIT_WIN32 return git_win32__find_xdg_dirs(out); #else - const char *env = NULL; + git_buf env = GIT_BUF_INIT; + int error; - if ((env = getenv("XDG_CONFIG_HOME")) != NULL) - return git_buf_joinpath(out, env, "git"); - else if ((env = getenv("HOME")) != NULL) - return git_buf_joinpath(out, env, ".config/git"); + if ((error = git__getenv(&env, "XDG_CONFIG_HOME")) == 0) + error = git_buf_joinpath(out, env.ptr, "git"); - git_buf_clear(out); - return 0; + if (error == GIT_ENOTFOUND && (error = git__getenv(&env, "HOME")) == 0) + error = git_buf_joinpath(out, env.ptr, ".config/git"); + + if (error == GIT_ENOTFOUND) { + giterr_clear(); + error = 0; + } + + git_buf_free(&env); + return error; #endif } @@ -62,12 +86,13 @@ static int git_sysdir_guess_template_dirs(git_buf *out) typedef int (*git_sysdir_guess_cb)(git_buf *out); static git_buf git_sysdir__dirs[GIT_SYSDIR__MAX] = - { GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT }; + { GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT }; static git_sysdir_guess_cb git_sysdir__dir_guess[GIT_SYSDIR__MAX] = { git_sysdir_guess_system_dirs, git_sysdir_guess_global_dirs, git_sysdir_guess_xdg_dirs, + git_sysdir_guess_programdata_dirs, git_sysdir_guess_template_dirs, }; @@ -244,6 +269,12 @@ int git_sysdir_find_xdg_file(git_buf *path, const char *filename) path, filename, GIT_SYSDIR_XDG, "global/xdg"); } +int git_sysdir_find_programdata_file(git_buf *path, const char *filename) +{ + return git_sysdir_find_in_dirlist( + path, filename, GIT_SYSDIR_PROGRAMDATA, "ProgramData"); +} + int git_sysdir_find_template_dir(git_buf *path) { return git_sysdir_find_in_dirlist( diff --git a/vendor/libgit2/src/sysdir.h b/vendor/libgit2/src/sysdir.h index f1bbf0bae..12874fc85 100644 --- a/vendor/libgit2/src/sysdir.h +++ b/vendor/libgit2/src/sysdir.h @@ -38,6 +38,15 @@ extern int git_sysdir_find_xdg_file(git_buf *path, const char *filename); */ extern int git_sysdir_find_system_file(git_buf *path, const char *filename); +/** + * Find a "ProgramData" file (i.e. one in %PROGRAMDATA%) + * + * @param path buffer to write the full path into + * @param filename name of file to find in the ProgramData directory + * @return 0 if found, GIT_ENOTFOUND if not found, or -1 on other OS error + */ +extern int git_sysdir_find_programdata_file(git_buf *path, const char *filename); + /** * Find template directory. * @@ -50,8 +59,9 @@ typedef enum { GIT_SYSDIR_SYSTEM = 0, GIT_SYSDIR_GLOBAL = 1, GIT_SYSDIR_XDG = 2, - GIT_SYSDIR_TEMPLATE = 3, - GIT_SYSDIR__MAX = 4, + GIT_SYSDIR_PROGRAMDATA = 3, + GIT_SYSDIR_TEMPLATE = 4, + GIT_SYSDIR__MAX = 5, } git_sysdir_t; /** diff --git a/vendor/libgit2/src/tag.c b/vendor/libgit2/src/tag.c index 6e69d760d..c4bce1f22 100644 --- a/vendor/libgit2/src/tag.c +++ b/vendor/libgit2/src/tag.c @@ -358,7 +358,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu git_odb_object_free(target_obj); /** Ensure the tag name doesn't conflict with an already existing - * reference unless overwriting has explictly been requested **/ + * reference unless overwriting has explicitly been requested **/ if (error == 0 && !allow_ref_overwrite) { giterr_set(GITERR_TAG, "Tag already exists"); return GIT_EEXISTS; diff --git a/vendor/libgit2/src/thread-utils.h b/vendor/libgit2/src/thread-utils.h index dd1136caf..14c8a41ff 100644 --- a/vendor/libgit2/src/thread-utils.h +++ b/vendor/libgit2/src/thread-utils.h @@ -275,7 +275,7 @@ GIT_INLINE(int) git_atomic_get(git_atomic *a) extern int git_online_cpus(void); -#if defined(GIT_THREADS) && defined(GIT_WIN32) +#if defined(GIT_THREADS) && defined(_MSC_VER) # define GIT_MEMORY_BARRIER MemoryBarrier() #elif defined(GIT_THREADS) # define GIT_MEMORY_BARRIER __sync_synchronize() diff --git a/vendor/libgit2/src/tls_stream.c b/vendor/libgit2/src/tls_stream.c index 39a8ce343..83e2d064a 100644 --- a/vendor/libgit2/src/tls_stream.c +++ b/vendor/libgit2/src/tls_stream.c @@ -11,8 +11,21 @@ #include "openssl_stream.h" #include "stransport_stream.h" +static git_stream_cb tls_ctor; + +int git_stream_register_tls(git_stream_cb ctor) +{ + tls_ctor = ctor; + + return 0; +} + int git_tls_stream_new(git_stream **out, const char *host, const char *port) { + + if (tls_ctor) + return tls_ctor(out, host, port); + #ifdef GIT_SECURE_TRANSPORT return git_stransport_stream_new(out, host, port); #elif defined(GIT_OPENSSL) diff --git a/vendor/libgit2/src/transaction.c b/vendor/libgit2/src/transaction.c index e8331891c..2c8a1e8bd 100644 --- a/vendor/libgit2/src/transaction.c +++ b/vendor/libgit2/src/transaction.c @@ -12,6 +12,7 @@ #include "pool.h" #include "reflog.h" #include "signature.h" +#include "config.h" #include "git2/transaction.h" #include "git2/signature.h" @@ -20,6 +21,12 @@ GIT__USE_STRMAP +typedef enum { + TRANSACTION_NONE, + TRANSACTION_REFS, + TRANSACTION_CONFIG, +} transaction_t; + typedef struct { const char *name; void *payload; @@ -39,13 +46,29 @@ typedef struct { } transaction_node; struct git_transaction { + transaction_t type; git_repository *repo; git_refdb *db; + git_config *cfg; git_strmap *locks; git_pool pool; }; +int git_transaction_config_new(git_transaction **out, git_config *cfg) +{ + git_transaction *tx; + assert(out && cfg); + + tx = git__calloc(1, sizeof(git_transaction)); + GITERR_CHECK_ALLOC(tx); + + tx->type = TRANSACTION_CONFIG; + tx->cfg = cfg; + *out = tx; + return 0; +} + int git_transaction_new(git_transaction **out, git_repository *repo) { int error; @@ -54,8 +77,7 @@ int git_transaction_new(git_transaction **out, git_repository *repo) assert(out && repo); - if ((error = git_pool_init(&pool, 1, 0)) < 0) - return error; + git_pool_init(&pool, 1); tx = git_pool_mallocz(&pool, sizeof(git_transaction)); if (!tx) { @@ -71,6 +93,7 @@ int git_transaction_new(git_transaction **out, git_repository *repo) if ((error = git_repository_refdb(&tx->db, repo)) < 0) goto on_error; + tx->type = TRANSACTION_REFS; memcpy(&tx->pool, &pool, sizeof(git_pool)); tx->repo = repo; *out = tx; @@ -305,6 +328,13 @@ int git_transaction_commit(git_transaction *tx) assert(tx); + if (tx->type == TRANSACTION_CONFIG) { + error = git_config_unlock(tx->cfg, true); + tx->cfg = NULL; + + return error; + } + for (pos = kh_begin(tx->locks); pos < kh_end(tx->locks); pos++) { if (!git_strmap_has_data(tx->locks, pos)) continue; @@ -332,6 +362,16 @@ void git_transaction_free(git_transaction *tx) assert(tx); + if (tx->type == TRANSACTION_CONFIG) { + if (tx->cfg) { + git_config_unlock(tx->cfg, false); + git_config_free(tx->cfg); + } + + git__free(tx); + return; + } + /* start by unlocking the ones we've left hanging, if any */ for (pos = kh_begin(tx->locks); pos < kh_end(tx->locks); pos++) { if (!git_strmap_has_data(tx->locks, pos)) diff --git a/vendor/libgit2/src/transaction.h b/vendor/libgit2/src/transaction.h new file mode 100644 index 000000000..780c06830 --- /dev/null +++ b/vendor/libgit2/src/transaction.h @@ -0,0 +1,14 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_transaction_h__ +#define INCLUDE_transaction_h__ + +#include "common.h" + +int git_transaction_config_new(git_transaction **out, git_config *cfg); + +#endif diff --git a/vendor/libgit2/src/transport.c b/vendor/libgit2/src/transport.c index 5c65c7c06..327052fa3 100644 --- a/vendor/libgit2/src/transport.c +++ b/vendor/libgit2/src/transport.c @@ -35,6 +35,8 @@ static transport_definition transports[] = { { "file://", git_transport_local, NULL }, #ifdef GIT_SSH { "ssh://", git_transport_smart, &ssh_subtransport_definition }, + { "ssh+git://", git_transport_smart, &ssh_subtransport_definition }, + { "git+ssh://", git_transport_smart, &ssh_subtransport_definition }, #endif { NULL, 0, 0 } }; diff --git a/vendor/libgit2/src/transports/cred.c b/vendor/libgit2/src/transports/cred.c index 044b2a262..49ede48bf 100644 --- a/vendor/libgit2/src/transports/cred.c +++ b/vendor/libgit2/src/transports/cred.c @@ -378,3 +378,11 @@ int git_cred_username_new(git_cred **cred, const char *username) *cred = (git_cred *) c; return 0; } + +void git_cred_free(git_cred *cred) +{ + if (!cred) + return; + + cred->free(cred); +} diff --git a/vendor/libgit2/src/transports/http.c b/vendor/libgit2/src/transports/http.c index 87f3ee816..88b124bf7 100644 --- a/vendor/libgit2/src/transports/http.c +++ b/vendor/libgit2/src/transports/http.c @@ -10,6 +10,7 @@ #include "http_parser.h" #include "buffer.h" #include "netops.h" +#include "global.h" #include "remote.h" #include "smart.h" #include "auth.h" @@ -186,6 +187,16 @@ static int apply_credentials(git_buf *buf, http_subtransport *t) return context->next_token(buf, context, cred); } +static const char *user_agent(void) +{ + const char *custom = git_libgit2__user_agent(); + + if (custom) + return custom; + + return "libgit2 " LIBGIT2_VERSION; +} + static int gen_request( git_buf *buf, http_stream *s, @@ -193,10 +204,11 @@ static int gen_request( { http_subtransport *t = OWNING_SUBTRANSPORT(s); const char *path = t->connection_data.path ? t->connection_data.path : "/"; + size_t i; git_buf_printf(buf, "%s %s%s HTTP/1.1\r\n", s->verb, path, s->service_url); - git_buf_puts(buf, "User-Agent: git/1.0 (libgit2 " LIBGIT2_VERSION ")\r\n"); + git_buf_printf(buf, "User-Agent: git/1.0 (%s)\r\n", user_agent()); git_buf_printf(buf, "Host: %s\r\n", t->connection_data.host); if (s->chunked || content_length > 0) { @@ -210,6 +222,11 @@ static int gen_request( } else git_buf_puts(buf, "Accept: */*\r\n"); + for (i = 0; i < t->owner->custom_headers.count; i++) { + if (t->owner->custom_headers.strings[i]) + git_buf_printf(buf, "%s\r\n", t->owner->custom_headers.strings[i]); + } + /* Apply credentials to the request */ if (apply_credentials(buf, t) < 0) return -1; diff --git a/vendor/libgit2/src/transports/smart.c b/vendor/libgit2/src/transports/smart.c index 85a49e543..b0611c35e 100644 --- a/vendor/libgit2/src/transports/smart.c +++ b/vendor/libgit2/src/transports/smart.c @@ -66,6 +66,84 @@ static int git_smart__set_callbacks( return 0; } +static int http_header_name_length(const char *http_header) +{ + const char *colon = strchr(http_header, ':'); + if (!colon) + return 0; + return colon - http_header; +} + +static bool is_malformed_http_header(const char *http_header) +{ + const char *c; + int name_len; + + // Disallow \r and \n + c = strchr(http_header, '\r'); + if (c) + return true; + c = strchr(http_header, '\n'); + if (c) + return true; + + // Require a header name followed by : + name_len = http_header_name_length(http_header); + if (name_len < 1) + return true; + + return false; +} + +static char *forbidden_custom_headers[] = { + "User-Agent", + "Host", + "Accept", + "Content-Type", + "Transfer-Encoding", + "Content-Length", +}; + +static bool is_forbidden_custom_header(const char *custom_header) +{ + unsigned long i; + int name_len = http_header_name_length(custom_header); + + // Disallow headers that we set + for (i = 0; i < ARRAY_SIZE(forbidden_custom_headers); i++) + if (strncmp(forbidden_custom_headers[i], custom_header, name_len) == 0) + return true; + + return false; +} + +static int git_smart__set_custom_headers( + git_transport *transport, + const git_strarray *custom_headers) +{ + transport_smart *t = (transport_smart *)transport; + size_t i; + + if (t->custom_headers.count) + git_strarray_free(&t->custom_headers); + + if (!custom_headers) + return 0; + + for (i = 0; i < custom_headers->count; i++) { + if (is_malformed_http_header(custom_headers->strings[i])) { + giterr_set(GITERR_INVALID, "custom HTTP header '%s' is malformed", custom_headers->strings[i]); + return -1; + } + if (is_forbidden_custom_header(custom_headers->strings[i])) { + giterr_set(GITERR_INVALID, "custom HTTP header '%s' is already set by libgit2", custom_headers->strings[i]); + return -1; + } + } + + return git_strarray_copy(&t->custom_headers, custom_headers); +} + int git_smart__update_heads(transport_smart *t, git_vector *symrefs) { size_t i; @@ -362,6 +440,8 @@ static void git_smart__free(git_transport *transport) git_vector_free(refs); + git_strarray_free(&t->custom_headers); + git__free(t); } @@ -372,6 +452,20 @@ static int ref_name_cmp(const void *a, const void *b) return strcmp(ref_a->head.name, ref_b->head.name); } +int git_transport_smart_certificate_check(git_transport *transport, git_cert *cert, int valid, const char *hostname) +{ + transport_smart *t = (transport_smart *)transport; + + return t->certificate_check_cb(cert, valid, hostname, t->message_cb_payload); +} + +int git_transport_smart_credentials(git_cred **out, git_transport *transport, const char *user, int methods) +{ + transport_smart *t = (transport_smart *)transport; + + return t->cred_acquire_cb(out, t->url, user, methods, t->cred_acquire_payload); +} + int git_transport_smart(git_transport **out, git_remote *owner, void *param) { transport_smart *t; @@ -385,6 +479,7 @@ int git_transport_smart(git_transport **out, git_remote *owner, void *param) t->parent.version = GIT_TRANSPORT_VERSION; t->parent.set_callbacks = git_smart__set_callbacks; + t->parent.set_custom_headers = git_smart__set_custom_headers; t->parent.connect = git_smart__connect; t->parent.close = git_smart__close; t->parent.free = git_smart__free; diff --git a/vendor/libgit2/src/transports/smart.h b/vendor/libgit2/src/transports/smart.h index 4c728c7cc..800466adf 100644 --- a/vendor/libgit2/src/transports/smart.h +++ b/vendor/libgit2/src/transports/smart.h @@ -139,6 +139,7 @@ typedef struct { git_transport_message_cb error_cb; git_transport_certificate_check_cb certificate_check_cb; void *message_cb_payload; + git_strarray custom_headers; git_smart_subtransport *wrapped; git_smart_subtransport_stream *current_stream; transport_smart_caps caps; diff --git a/vendor/libgit2/src/transports/smart_pkt.c b/vendor/libgit2/src/transports/smart_pkt.c index 9ccbd8085..2ea57bb64 100644 --- a/vendor/libgit2/src/transports/smart_pkt.c +++ b/vendor/libgit2/src/transports/smart_pkt.c @@ -271,6 +271,7 @@ static int ok_pkt(git_pkt **out, const char *line, size_t len) line += 3; /* skip "ok " */ if (!(ptr = strchr(line, '\n'))) { giterr_set(GITERR_NET, "Invalid packet line"); + git__free(pkt); return -1; } len = ptr - line; @@ -295,13 +296,12 @@ static int ng_pkt(git_pkt **out, const char *line, size_t len) pkt = git__malloc(sizeof(*pkt)); GITERR_CHECK_ALLOC(pkt); + pkt->ref = NULL; pkt->type = GIT_PKT_NG; line += 3; /* skip "ng " */ - if (!(ptr = strchr(line, ' '))) { - giterr_set(GITERR_NET, "Invalid packet line"); - return -1; - } + if (!(ptr = strchr(line, ' '))) + goto out_err; len = ptr - line; GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); @@ -312,10 +312,8 @@ static int ng_pkt(git_pkt **out, const char *line, size_t len) pkt->ref[len] = '\0'; line = ptr + 1; - if (!(ptr = strchr(line, '\n'))) { - giterr_set(GITERR_NET, "Invalid packet line"); - return -1; - } + if (!(ptr = strchr(line, '\n'))) + goto out_err; len = ptr - line; GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); @@ -327,6 +325,12 @@ static int ng_pkt(git_pkt **out, const char *line, size_t len) *out = (git_pkt *)pkt; return 0; + +out_err: + giterr_set(GITERR_NET, "Invalid packet line"); + git__free(pkt->ref); + git__free(pkt); + return -1; } static int unpack_pkt(git_pkt **out, const char *line, size_t len) @@ -351,7 +355,7 @@ static int unpack_pkt(git_pkt **out, const char *line, size_t len) static int32_t parse_len(const char *line) { char num[PKT_LEN_SIZE + 1]; - int i, error; + int i, k, error; int32_t len; const char *num_end; @@ -360,7 +364,14 @@ static int32_t parse_len(const char *line) for (i = 0; i < PKT_LEN_SIZE; ++i) { if (!isxdigit(num[i])) { - giterr_set(GITERR_NET, "Found invalid hex digit in length"); + /* Make sure there are no special characters before passing to error message */ + for (k = 0; k < PKT_LEN_SIZE; ++k) { + if(!isprint(num[k])) { + num[k] = '.'; + } + } + + giterr_set(GITERR_NET, "invalid hex digit in length: '%s'", num); return -1; } } @@ -533,7 +544,9 @@ static int buffer_want_with_caps(const git_remote_head *head, transport_smart_ca "%04xwant %s %s\n", (unsigned int)len, oid, git_buf_cstr(&str)); git_buf_free(&str); - return git_buf_oom(buf); + GITERR_CHECK_ALLOC_BUF(buf); + + return 0; } /* diff --git a/vendor/libgit2/src/transports/smart_protocol.c b/vendor/libgit2/src/transports/smart_protocol.c index 1d46d4bc9..02e1ecf74 100644 --- a/vendor/libgit2/src/transports/smart_protocol.c +++ b/vendor/libgit2/src/transports/smart_protocol.c @@ -108,6 +108,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr) if (giterr_last()->klass != GITERR_NOMEMORY) goto on_invalid; + git__free(mapping); return error; } @@ -120,6 +121,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr) on_invalid: giterr_set(GITERR_NET, "remote sent invalid symref"); git_refspec__free(mapping); + git__free(mapping); return -1; } @@ -719,18 +721,39 @@ static int add_push_report_pkt(git_push *push, git_pkt *pkt) return 0; } -static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt) +static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf) { git_pkt *pkt; - const char *line = data_pkt->data, *line_end; - size_t line_len = data_pkt->len; + const char *line, *line_end; + size_t line_len; int error; + int reading_from_buf = data_pkt_buf->size > 0; + + if (reading_from_buf) { + /* We had an existing partial packet, so add the new + * packet to the buffer and parse the whole thing */ + git_buf_put(data_pkt_buf, data_pkt->data, data_pkt->len); + line = data_pkt_buf->ptr; + line_len = data_pkt_buf->size; + } + else { + line = data_pkt->data; + line_len = data_pkt->len; + } while (line_len > 0) { error = git_pkt_parse_line(&pkt, line, &line_end, line_len); - if (error < 0) - return error; + if (error == GIT_EBUFS) { + /* Buffer the data when the inner packet is split + * across multiple sideband packets */ + if (!reading_from_buf) + git_buf_put(data_pkt_buf, line, line_len); + error = 0; + goto done; + } + else if (error < 0) + goto done; /* Advance in the buffer */ line_len -= (line_end - line); @@ -741,10 +764,15 @@ static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt) git_pkt_free(pkt); if (error < 0 && error != GIT_ITEROVER) - return error; + goto done; } - return 0; + error = 0; + +done: + if (reading_from_buf) + git_buf_consume(data_pkt_buf, line_end); + return error; } static int parse_report(transport_smart *transport, git_push *push) @@ -753,6 +781,7 @@ static int parse_report(transport_smart *transport, git_push *push) const char *line_end = NULL; gitno_buffer *buf = &transport->buffer; int error, recvd; + git_buf data_pkt_buf = GIT_BUF_INIT; for (;;) { if (buf->offset > 0) @@ -761,16 +790,21 @@ static int parse_report(transport_smart *transport, git_push *push) else error = GIT_EBUFS; - if (error < 0 && error != GIT_EBUFS) - return -1; + if (error < 0 && error != GIT_EBUFS) { + error = -1; + goto done; + } if (error == GIT_EBUFS) { - if ((recvd = gitno_recv(buf)) < 0) - return recvd; + if ((recvd = gitno_recv(buf)) < 0) { + error = recvd; + goto done; + } if (recvd == 0) { giterr_set(GITERR_NET, "early EOF"); - return GIT_EEOF; + error = GIT_EEOF; + goto done; } continue; } @@ -782,7 +816,7 @@ static int parse_report(transport_smart *transport, git_push *push) switch (pkt->type) { case GIT_PKT_DATA: /* This is a sideband packet which contains other packets */ - error = add_push_report_sideband_pkt(push, (git_pkt_data *)pkt); + error = add_push_report_sideband_pkt(push, (git_pkt_data *)pkt, &data_pkt_buf); break; case GIT_PKT_ERR: giterr_set(GITERR_NET, "report-status: Error reported: %s", @@ -803,12 +837,24 @@ static int parse_report(transport_smart *transport, git_push *push) git_pkt_free(pkt); /* add_push_report_pkt returns GIT_ITEROVER when it receives a flush */ - if (error == GIT_ITEROVER) - return 0; + if (error == GIT_ITEROVER) { + error = 0; + if (data_pkt_buf.size > 0) { + /* If there was data remaining in the pack data buffer, + * then the server sent a partial pkt-line */ + giterr_set(GITERR_NET, "Incomplete pack data pkt-line"); + error = GIT_ERROR; + } + goto done; + } - if (error < 0) - return error; + if (error < 0) { + goto done; + } } +done: + git_buf_free(&data_pkt_buf); + return error; } static int add_ref_from_push_spec(git_vector *refs, push_spec *push_spec) diff --git a/vendor/libgit2/src/transports/ssh.c b/vendor/libgit2/src/transports/ssh.c index 250e588e7..cfd573665 100644 --- a/vendor/libgit2/src/transports/ssh.c +++ b/vendor/libgit2/src/transports/ssh.c @@ -15,12 +15,14 @@ #include "smart.h" #include "cred.h" #include "socket_stream.h" +#include "ssh.h" #ifdef GIT_SSH #define OWNING_SUBTRANSPORT(s) ((ssh_subtransport *)(s)->parent.subtransport) -static const char prefix_ssh[] = "ssh://"; +static const char *ssh_prefixes[] = { "ssh://", "ssh+git://", "git+ssh://" }; + static const char cmd_uploadpack[] = "git-upload-pack"; static const char cmd_receivepack[] = "git-receive-pack"; @@ -62,17 +64,24 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url) { char *repo; int len; + size_t i; - if (!git__prefixcmp(url, prefix_ssh)) { - url = url + strlen(prefix_ssh); - repo = strchr(url, '/'); - if (repo && repo[1] == '~') - ++repo; - } else { - repo = strchr(url, ':'); - if (repo) repo++; + for (i = 0; i < ARRAY_SIZE(ssh_prefixes); ++i) { + const char *p = ssh_prefixes[i]; + + if (!git__prefixcmp(url, p)) { + url = url + strlen(p); + repo = strchr(url, '/'); + if (repo && repo[1] == '~') + ++repo; + + goto done; + } } + repo = strchr(url, ':'); + if (repo) repo++; +done: if (!repo) { giterr_set(GITERR_NET, "Malformed git protocol URL"); return -1; @@ -136,9 +145,14 @@ static int ssh_stream_read( * not-found error, so read from stderr and signal EOF on * stderr. */ - if (rc == 0 && (rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) { - giterr_set(GITERR_SSH, "%*s", rc, buffer); - return GIT_EEOF; + if (rc == 0) { + if ((rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) { + giterr_set(GITERR_SSH, "%*s", rc, buffer); + return GIT_EEOF; + } else if (rc < LIBSSH2_ERROR_NONE) { + ssh_error(s->session, "SSH could not read stderr"); + return -1; + } } @@ -494,6 +508,7 @@ static int _git_ssh_setup_conn( char *host=NULL, *port=NULL, *path=NULL, *user=NULL, *pass=NULL; const char *default_port="22"; int auth_methods, error = 0; + size_t i; ssh_stream *s; git_cred *cred = NULL; LIBSSH2_SESSION* session=NULL; @@ -509,16 +524,22 @@ static int _git_ssh_setup_conn( s->session = NULL; s->channel = NULL; - if (!git__prefixcmp(url, prefix_ssh)) { - if ((error = gitno_extract_url_parts(&host, &port, &path, &user, &pass, url, default_port)) < 0) - goto done; - } else { - if ((error = git_ssh_extract_url_parts(&host, &user, url)) < 0) - goto done; - port = git__strdup(default_port); - GITERR_CHECK_ALLOC(port); + for (i = 0; i < ARRAY_SIZE(ssh_prefixes); ++i) { + const char *p = ssh_prefixes[i]; + + if (!git__prefixcmp(url, p)) { + if ((error = gitno_extract_url_parts(&host, &port, &path, &user, &pass, url, default_port)) < 0) + goto done; + + goto post_extract; + } } + if ((error = git_ssh_extract_url_parts(&host, &user, url)) < 0) + goto done; + port = git__strdup(default_port); + GITERR_CHECK_ALLOC(port); +post_extract: if ((error = git_socket_stream_new(&s->io, host, port)) < 0 || (error = git_stream_connect(s->io)) < 0) goto done; @@ -527,10 +548,10 @@ static int _git_ssh_setup_conn( goto done; if (t->owner->certificate_check_cb != NULL) { - git_cert_hostkey cert = { 0 }, *cert_ptr; + git_cert_hostkey cert = {{ 0 }}, *cert_ptr; const char *key; - cert.cert_type = GIT_CERT_HOSTKEY_LIBSSH2; + cert.parent.cert_type = GIT_CERT_HOSTKEY_LIBSSH2; key = libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1); if (key != NULL) { @@ -871,3 +892,18 @@ int git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *p return -1; #endif } + +int git_transport_ssh_global_init(void) +{ +#ifdef GIT_SSH + + libssh2_init(0); + return 0; + +#else + + /* Nothing to initialize */ + return 0; + +#endif +} diff --git a/vendor/libgit2/src/transports/ssh.h b/vendor/libgit2/src/transports/ssh.h new file mode 100644 index 000000000..2db2cc5df --- /dev/null +++ b/vendor/libgit2/src/transports/ssh.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_ssh_h__ +#define INCLUDE_ssh_h__ + +int git_transport_ssh_global_init(void); + +#endif diff --git a/vendor/libgit2/src/transports/winhttp.c b/vendor/libgit2/src/transports/winhttp.c index da047d690..32b838084 100644 --- a/vendor/libgit2/src/transports/winhttp.c +++ b/vendor/libgit2/src/transports/winhttp.c @@ -15,6 +15,7 @@ #include "smart.h" #include "remote.h" #include "repository.h" +#include "global.h" #include #include @@ -52,10 +53,15 @@ static const int no_check_cert_flags = SECURITY_FLAG_IGNORE_CERT_CN_INVALID | SECURITY_FLAG_IGNORE_UNKNOWN_CA; #if defined(__MINGW32__) -const CLSID CLSID_InternetSecurityManager = { 0x7B8A2D94, 0x0AC9, 0x11D1, +static const CLSID CLSID_InternetSecurityManager_mingw = + { 0x7B8A2D94, 0x0AC9, 0x11D1, { 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4 } }; -const IID IID_IInternetSecurityManager = { 0x79EAC9EE, 0xBAF9, 0x11CE, +static const IID IID_IInternetSecurityManager_mingw = + { 0x79EAC9EE, 0xBAF9, 0x11CE, { 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B } }; + +# define CLSID_InternetSecurityManager CLSID_InternetSecurityManager_mingw +# define IID_IInternetSecurityManager IID_IInternetSecurityManager_mingw #endif #define OWNING_SUBTRANSPORT(s) ((winhttp_subtransport *)(s)->parent.subtransport) @@ -228,7 +234,7 @@ static int certificate_check(winhttp_stream *s, int valid) } giterr_clear(); - cert.cert_type = GIT_CERT_X509; + cert.parent.cert_type = GIT_CERT_X509; cert.data = cert_ctx->pbCertEncoded; cert.len = cert_ctx->cbCertEncoded; error = t->owner->certificate_check_cb((git_cert *) &cert, valid, t->connection_data.host, t->owner->cred_acquire_payload); @@ -277,6 +283,7 @@ static int winhttp_stream_connect(winhttp_stream *s) unsigned long disable_redirects = WINHTTP_DISABLE_REDIRECTS; int default_timeout = TIMEOUT_INFINITE; int default_connect_timeout = DEFAULT_CONNECT_TIMEOUT; + size_t i; /* Prepare URL */ git_buf_printf(&buf, "%s%s", t->connection_data.path, s->service_url); @@ -409,6 +416,23 @@ static int winhttp_stream_connect(winhttp_stream *s) } } + for (i = 0; i < t->owner->custom_headers.count; i++) { + if (t->owner->custom_headers.strings[i]) { + git_buf_clear(&buf); + git_buf_puts(&buf, t->owner->custom_headers.strings[i]); + if (git__utf8_to_16(ct, MAX_CONTENT_TYPE_LEN, git_buf_cstr(&buf)) < 0) { + giterr_set(GITERR_OS, "Failed to convert custom header to wide characters"); + goto on_error; + } + + if (!WinHttpAddRequestHeaders(s->request, ct, (ULONG)-1L, + WINHTTP_ADDREQ_FLAG_ADD | WINHTTP_ADDREQ_FLAG_REPLACE)) { + giterr_set(GITERR_OS, "Failed to add a header to the request"); + goto on_error; + } + } + } + /* If requested, disable certificate validation */ if (t->connection_data.use_ssl) { int flags; @@ -549,12 +573,28 @@ static int winhttp_close_connection(winhttp_subtransport *t) return ret; } +static int user_agent(git_buf *ua) +{ + const char *custom = git_libgit2__user_agent(); + + git_buf_clear(ua); + git_buf_PUTS(ua, "git/1.0 ("); + + if (custom) + git_buf_puts(ua, custom); + else + git_buf_PUTS(ua, "libgit2 " LIBGIT2_VERSION); + + return git_buf_putc(ua, ')'); +} + static int winhttp_connect( winhttp_subtransport *t) { - wchar_t *ua = L"git/1.0 (libgit2 " WIDEN(LIBGIT2_VERSION) L")"; wchar_t *wide_host; int32_t port; + wchar_t *wide_ua; + git_buf ua = GIT_BUF_INIT; int error = -1; int default_timeout = TIMEOUT_INFINITE; int default_connect_timeout = DEFAULT_CONNECT_TIMEOUT; @@ -572,9 +612,23 @@ static int winhttp_connect( return -1; } + if ((error = user_agent(&ua)) < 0) { + git__free(wide_host); + return error; + } + + if (git__utf8_to_16_alloc(&wide_ua, git_buf_cstr(&ua)) < 0) { + giterr_set(GITERR_OS, "Unable to convert host to wide characters"); + git__free(wide_host); + git_buf_free(&ua); + return -1; + } + + git_buf_free(&ua); + /* Establish session */ t->session = WinHttpOpen( - ua, + wide_ua, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, @@ -610,6 +664,7 @@ static int winhttp_connect( winhttp_close_connection(t); git__free(wide_host); + git__free(wide_ua); return error; } @@ -871,16 +926,20 @@ static int winhttp_stream_read( if (parse_unauthorized_response(s->request, &allowed_types, &t->auth_mechanism) < 0) return -1; - if (allowed_types && - (!t->cred || 0 == (t->cred->credtype & allowed_types))) { + if (allowed_types) { int cred_error = 1; + git_cred_free(t->cred); + t->cred = NULL; /* Start with the user-supplied credential callback, if present */ if (t->owner->cred_acquire_cb) { cred_error = t->owner->cred_acquire_cb(&t->cred, t->owner->url, t->connection_data.user, allowed_types, t->owner->cred_acquire_payload); - if (cred_error < 0) + /* Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set */ + if (cred_error == GIT_PASSTHROUGH) + cred_error = 1; + else if (cred_error < 0) return cred_error; } diff --git a/vendor/libgit2/src/tree.c b/vendor/libgit2/src/tree.c index bdd17661b..6ce460c6d 100644 --- a/vendor/libgit2/src/tree.c +++ b/vendor/libgit2/src/tree.c @@ -17,6 +17,9 @@ #define DEFAULT_TREE_SIZE 16 #define MAX_FILEMODE_BYTES 6 +#define TREE_ENTRY_CHECK_NAMELEN(n) \ + if (n > UINT16_MAX) { giterr_set(GITERR_INVALID, "tree entry path too long"); } + GIT__USE_STRMAP static bool valid_filemode(const int filemode) @@ -81,27 +84,47 @@ int git_tree_entry_icmp(const git_tree_entry *e1, const git_tree_entry *e2) git__strncasecmp); } -static git_tree_entry *alloc_entry(const char *filename) +/** + * Allocate a new self-contained entry, with enough space after it to + * store the filename and the id. + */ +static git_tree_entry *alloc_entry(const char *filename, size_t filename_len, const git_oid *id) { git_tree_entry *entry = NULL; - size_t filename_len = strlen(filename), tree_len; + size_t tree_len; + + TREE_ENTRY_CHECK_NAMELEN(filename_len); if (GIT_ADD_SIZET_OVERFLOW(&tree_len, sizeof(git_tree_entry), filename_len) || - GIT_ADD_SIZET_OVERFLOW(&tree_len, tree_len, 1) || - !(entry = git__malloc(tree_len))) + GIT_ADD_SIZET_OVERFLOW(&tree_len, tree_len, 1) || + GIT_ADD_SIZET_OVERFLOW(&tree_len, tree_len, GIT_OID_RAWSZ)) return NULL; - memset(entry, 0x0, sizeof(git_tree_entry)); - memcpy(entry->filename, filename, filename_len); - entry->filename[filename_len] = 0; - entry->filename_len = filename_len; + entry = git__calloc(1, tree_len); + if (!entry) + return NULL; + + { + char *filename_ptr; + void *id_ptr; + + filename_ptr = ((char *) entry) + sizeof(git_tree_entry); + memcpy(filename_ptr, filename, filename_len); + entry->filename = filename_ptr; + + id_ptr = filename_ptr + filename_len + 1; + git_oid_cpy(id_ptr, id); + entry->oid = id_ptr; + } + + entry->filename_len = (uint16_t)filename_len; return entry; } struct tree_key_search { const char *filename; - size_t filename_len; + uint16_t filename_len; }; static int homing_search_cmp(const void *key, const void *array_member) @@ -109,8 +132,8 @@ static int homing_search_cmp(const void *key, const void *array_member) const struct tree_key_search *ksearch = key; const git_tree_entry *entry = array_member; - const size_t len1 = ksearch->filename_len; - const size_t len2 = entry->filename_len; + const uint16_t len1 = ksearch->filename_len; + const uint16_t len2 = entry->filename_len; return memcmp( ksearch->filename, @@ -140,24 +163,31 @@ static int homing_search_cmp(const void *key, const void *array_member) * around the area for our target file. */ static int tree_key_search( - size_t *at_pos, git_vector *entries, const char *filename, size_t filename_len) + size_t *at_pos, + const git_tree *tree, + const char *filename, + size_t filename_len) { struct tree_key_search ksearch; const git_tree_entry *entry; size_t homing, i; + TREE_ENTRY_CHECK_NAMELEN(filename_len); + ksearch.filename = filename; - ksearch.filename_len = filename_len; + ksearch.filename_len = (uint16_t)filename_len; /* Initial homing search; find an entry on the tree with * the same prefix as the filename we're looking for */ - if (git_vector_bsearch2(&homing, entries, &homing_search_cmp, &ksearch) < 0) + + if (git_array_search(&homing, + tree->entries, &homing_search_cmp, &ksearch) < 0) return GIT_ENOTFOUND; /* just a signal error; not passed back to user */ /* We found a common prefix. Look forward as long as * there are entries that share the common prefix */ - for (i = homing; i < entries->length; ++i) { - entry = entries->contents[i]; + for (i = homing; i < tree->entries.size; ++i) { + entry = git_array_get(tree->entries, i); if (homing_search_cmp(&ksearch, entry) < 0) break; @@ -177,7 +207,7 @@ static int tree_key_search( i = homing - 1; do { - entry = entries->contents[i]; + entry = git_array_get(tree->entries, i); if (homing_search_cmp(&ksearch, entry) > 0) break; @@ -206,33 +236,26 @@ void git_tree_entry_free(git_tree_entry *entry) int git_tree_entry_dup(git_tree_entry **dest, const git_tree_entry *source) { - size_t total_size; - git_tree_entry *copy; + git_tree_entry *cpy; assert(source); - GITERR_CHECK_ALLOC_ADD(&total_size, sizeof(git_tree_entry), source->filename_len); - GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1); - - copy = git__malloc(total_size); - GITERR_CHECK_ALLOC(copy); + cpy = alloc_entry(source->filename, source->filename_len, source->oid); + if (cpy == NULL) + return -1; - memcpy(copy, source, total_size); + cpy->attr = source->attr; - *dest = copy; + *dest = cpy; return 0; } void git_tree__free(void *_tree) { git_tree *tree = _tree; - size_t i; - git_tree_entry *e; - git_vector_foreach(&tree->entries, i, e) - git_tree_entry_free(e); - - git_vector_free(&tree->entries); + git_odb_object_free(tree->odb_obj); + git_array_clear(tree->entries); git__free(tree); } @@ -255,7 +278,7 @@ const char *git_tree_entry_name(const git_tree_entry *entry) const git_oid *git_tree_entry_id(const git_tree_entry *entry) { assert(entry); - return &entry->oid; + return entry->oid; } git_otype git_tree_entry_type(const git_tree_entry *entry) @@ -276,7 +299,7 @@ int git_tree_entry_to_object( const git_tree_entry *entry) { assert(entry && object_out); - return git_object_lookup(object_out, repo, &entry->oid, GIT_OBJ_ANY); + return git_object_lookup(object_out, repo, entry->oid, GIT_OBJ_ANY); } static const git_tree_entry *entry_fromname( @@ -284,19 +307,17 @@ static const git_tree_entry *entry_fromname( { size_t idx; - /* be safe when we cast away constness - i.e. don't trigger a sort */ - assert(git_vector_is_sorted(&tree->entries)); - - if (tree_key_search(&idx, (git_vector *)&tree->entries, name, name_len) < 0) + if (tree_key_search(&idx, tree, name, name_len) < 0) return NULL; - return git_vector_get(&tree->entries, idx); + return git_array_get(tree->entries, idx); } const git_tree_entry *git_tree_entry_byname( const git_tree *tree, const char *filename) { assert(tree && filename); + return entry_fromname(tree, filename, strlen(filename)); } @@ -304,7 +325,7 @@ const git_tree_entry *git_tree_entry_byindex( const git_tree *tree, size_t idx) { assert(tree); - return git_vector_get(&tree->entries, idx); + return git_array_get(tree->entries, idx); } const git_tree_entry *git_tree_entry_byid( @@ -315,8 +336,8 @@ const git_tree_entry *git_tree_entry_byid( assert(tree); - git_vector_foreach(&tree->entries, i, e) { - if (memcmp(&e->oid.id, &id->id, sizeof(id->id)) == 0) + git_array_foreach(tree->entries, i, e) { + if (memcmp(&e->oid->id, &id->id, sizeof(id->id)) == 0) return e; } @@ -325,31 +346,32 @@ const git_tree_entry *git_tree_entry_byid( int git_tree__prefix_position(const git_tree *tree, const char *path) { - const git_vector *entries = &tree->entries; struct tree_key_search ksearch; - size_t at_pos; + size_t at_pos, path_len; if (!path) return 0; - ksearch.filename = path; - ksearch.filename_len = strlen(path); + path_len = strlen(path); + TREE_ENTRY_CHECK_NAMELEN(path_len); - /* be safe when we cast away constness - i.e. don't trigger a sort */ - assert(git_vector_is_sorted(&tree->entries)); + ksearch.filename = path; + ksearch.filename_len = (uint16_t)path_len; /* Find tree entry with appropriate prefix */ - git_vector_bsearch2( - &at_pos, (git_vector *)entries, &homing_search_cmp, &ksearch); + git_array_search( + &at_pos, tree->entries, &homing_search_cmp, &ksearch); - for (; at_pos < entries->length; ++at_pos) { - const git_tree_entry *entry = entries->contents[at_pos]; + for (; at_pos < tree->entries.size; ++at_pos) { + const git_tree_entry *entry = git_array_get(tree->entries, at_pos); if (homing_search_cmp(&ksearch, entry) < 0) break; } for (; at_pos > 0; --at_pos) { - const git_tree_entry *entry = entries->contents[at_pos - 1]; + const git_tree_entry *entry = + git_array_get(tree->entries, at_pos - 1); + if (homing_search_cmp(&ksearch, entry) > 0) break; } @@ -360,7 +382,7 @@ int git_tree__prefix_position(const git_tree *tree, const char *path) size_t git_tree_entrycount(const git_tree *tree) { assert(tree); - return tree->entries.length; + return tree->entries.size; } unsigned int git_treebuilder_entrycount(git_treebuilder *bld) @@ -379,52 +401,68 @@ static int tree_error(const char *str, const char *path) return -1; } +static int parse_mode(unsigned int *modep, const char *buffer, const char **buffer_out) +{ + unsigned char c; + unsigned int mode = 0; + + if (*buffer == ' ') + return -1; + + while ((c = *buffer++) != ' ') { + if (c < '0' || c > '7') + return -1; + mode = (mode << 3) + (c - '0'); + } + *modep = mode; + *buffer_out = buffer; + + return 0; +} + int git_tree__parse(void *_tree, git_odb_object *odb_obj) { git_tree *tree = _tree; - const char *buffer = git_odb_object_data(odb_obj); - const char *buffer_end = buffer + git_odb_object_size(odb_obj); + const char *buffer; + const char *buffer_end; - if (git_vector_init(&tree->entries, DEFAULT_TREE_SIZE, entry_sort_cmp) < 0) + if (git_odb_object_dup(&tree->odb_obj, odb_obj) < 0) return -1; + buffer = git_odb_object_data(tree->odb_obj); + buffer_end = buffer + git_odb_object_size(tree->odb_obj); + + git_array_init_to_size(tree->entries, DEFAULT_TREE_SIZE); + GITERR_CHECK_ARRAY(tree->entries); + while (buffer < buffer_end) { git_tree_entry *entry; - int attr; + size_t filename_len; + const char *nul; + unsigned int attr; - if (git__strtol32(&attr, buffer, &buffer, 8) < 0 || !buffer) + if (parse_mode(&attr, buffer, &buffer) < 0 || !buffer) return tree_error("Failed to parse tree. Can't parse filemode", NULL); - if (*buffer++ != ' ') - return tree_error("Failed to parse tree. Object is corrupted", NULL); - - if (memchr(buffer, 0, buffer_end - buffer) == NULL) + if ((nul = memchr(buffer, 0, buffer_end - buffer)) == NULL) return tree_error("Failed to parse tree. Object is corrupted", NULL); - /** Allocate the entry and store it in the entries vector */ + filename_len = nul - buffer; + /* Allocate the entry */ { - entry = alloc_entry(buffer); + entry = git_array_alloc(tree->entries); GITERR_CHECK_ALLOC(entry); - if (git_vector_insert(&tree->entries, entry) < 0) { - git__free(entry); - return -1; - } - entry->attr = attr; + entry->filename_len = filename_len; + entry->filename = buffer; + entry->oid = (git_oid *) ((char *) buffer + filename_len + 1); } - while (buffer < buffer_end && *buffer != 0) - buffer++; - - buffer++; - - git_oid_fromraw(&entry->oid, (const unsigned char *)buffer); + buffer += filename_len + 1; buffer += GIT_OID_RAWSZ; } - git_vector_sort(&tree->entries); - return 0; } @@ -457,10 +495,9 @@ static int append_entry( if (!valid_entry_name(bld->repo, filename)) return tree_error("Failed to insert entry. Invalid name for a tree entry", filename); - entry = alloc_entry(filename); + entry = alloc_entry(filename, strlen(filename), id); GITERR_CHECK_ALLOC(entry); - git_oid_cpy(&entry->oid, id); entry->attr = (uint16_t)filemode; git_strmap_insert(bld->map, entry->filename, entry, error); @@ -649,10 +686,10 @@ int git_treebuilder_new( if (source != NULL) { git_tree_entry *entry_src; - git_vector_foreach(&source->entries, i, entry_src) { + git_array_foreach(source->entries, i, entry_src) { if (append_entry( bld, entry_src->filename, - &entry_src->oid, + entry_src->oid, entry_src->attr) < 0) goto on_error; } @@ -666,6 +703,18 @@ int git_treebuilder_new( return -1; } +static git_otype otype_from_mode(git_filemode_t filemode) +{ + switch (filemode) { + case GIT_FILEMODE_TREE: + return GIT_OBJ_TREE; + case GIT_FILEMODE_COMMIT: + return GIT_OBJ_COMMIT; + default: + return GIT_OBJ_BLOB; + } +} + int git_treebuilder_insert( const git_tree_entry **entry_out, git_treebuilder *bld, @@ -685,11 +734,16 @@ int git_treebuilder_insert( if (!valid_entry_name(bld->repo, filename)) return tree_error("Failed to insert entry. Invalid name for a tree entry", filename); + if (filemode != GIT_FILEMODE_COMMIT && + !git_object__is_valid(bld->repo, id, otype_from_mode(filemode))) + return tree_error("Failed to insert entry; invalid object specified", filename); + pos = git_strmap_lookup_index(bld->map, filename); if (git_strmap_valid_index(bld->map, pos)) { entry = git_strmap_value_at(bld->map, pos); + git_oid_cpy((git_oid *) entry->oid, id); } else { - entry = alloc_entry(filename); + entry = alloc_entry(filename, strlen(filename), id); GITERR_CHECK_ALLOC(entry); git_strmap_insert(bld->map, entry->filename, entry, error); @@ -701,7 +755,6 @@ int git_treebuilder_insert( } } - git_oid_cpy(&entry->oid, id); entry->attr = filemode; if (entry_out) @@ -772,19 +825,20 @@ int git_treebuilder_write(git_oid *oid, git_treebuilder *bld) git_buf_printf(&tree, "%o ", entry->attr); git_buf_put(&tree, entry->filename, entry->filename_len + 1); - git_buf_put(&tree, (char *)entry->oid.id, GIT_OID_RAWSZ); + git_buf_put(&tree, (char *)entry->oid->id, GIT_OID_RAWSZ); if (git_buf_oom(&tree)) error = -1; } - git_vector_free(&entries); if (!error && !(error = git_repository_odb__weakptr(&odb, bld->repo))) error = git_odb_write(oid, odb, tree.ptr, tree.size, GIT_OBJ_TREE); git_buf_free(&tree); + git_vector_free(&entries); + return error; } @@ -884,7 +938,7 @@ int git_tree_entry_bypath( return git_tree_entry_dup(entry_out, entry); } - if (git_tree_lookup(&subtree, root->object.repo, &entry->oid) < 0) + if (git_tree_lookup(&subtree, root->object.repo, entry->oid) < 0) return -1; error = git_tree_entry_bypath( @@ -908,7 +962,7 @@ static int tree_walk( size_t i; const git_tree_entry *entry; - git_vector_foreach(&tree->entries, i, entry) { + git_array_foreach(tree->entries, i, entry) { if (preorder) { error = callback(path->ptr, entry, payload); if (error < 0) { /* negative value stops iteration */ @@ -925,7 +979,7 @@ static int tree_walk( git_tree *subtree; size_t path_len = git_buf_len(path); - error = git_tree_lookup(&subtree, tree->object.repo, &entry->oid); + error = git_tree_lookup(&subtree, tree->object.repo, entry->oid); if (error < 0) break; diff --git a/vendor/libgit2/src/tree.h b/vendor/libgit2/src/tree.h index d01b6fd41..5e7a66e04 100644 --- a/vendor/libgit2/src/tree.h +++ b/vendor/libgit2/src/tree.h @@ -12,17 +12,19 @@ #include "odb.h" #include "vector.h" #include "strmap.h" +#include "pool.h" struct git_tree_entry { uint16_t attr; - git_oid oid; - size_t filename_len; - char filename[1]; + uint16_t filename_len; + const git_oid *oid; + const char *filename; }; struct git_tree { git_object object; - git_vector entries; + git_odb_object *odb_obj; + git_array_t(git_tree_entry) entries; }; struct git_treebuilder { diff --git a/vendor/libgit2/src/unix/map.c b/vendor/libgit2/src/unix/map.c index 87ee6594b..c55ad1aa7 100644 --- a/vendor/libgit2/src/unix/map.c +++ b/vendor/libgit2/src/unix/map.c @@ -17,13 +17,18 @@ int git__page_size(size_t *page_size) { long sc_page_size = sysconf(_SC_PAGE_SIZE); if (sc_page_size < 0) { - giterr_set_str(GITERR_OS, "Can't determine system page size"); + giterr_set(GITERR_OS, "can't determine system page size"); return -1; } *page_size = (size_t) sc_page_size; return 0; } +int git__mmap_alignment(size_t *alignment) +{ + return git__page_size(alignment); +} + int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset) { int mprot = PROT_READ; diff --git a/vendor/libgit2/src/unix/posix.h b/vendor/libgit2/src/unix/posix.h index 6633689bc..482d2c803 100644 --- a/vendor/libgit2/src/unix/posix.h +++ b/vendor/libgit2/src/unix/posix.h @@ -21,6 +21,18 @@ typedef int GIT_SOCKET; #define p_lstat(p,b) lstat(p,b) #define p_stat(p,b) stat(p, b) +#if defined(GIT_USE_STAT_MTIMESPEC) +# define st_atime_nsec st_atimespec.tv_nsec +# define st_mtime_nsec st_mtimespec.tv_nsec +# define st_ctime_nsec st_ctimespec.tv_nsec +#elif defined(GIT_USE_STAT_MTIM) +# define st_atime_nsec st_atim.tv_nsec +# define st_mtime_nsec st_mtim.tv_nsec +# define st_ctime_nsec st_ctim.tv_nsec +#elif !defined(GIT_USE_STAT_MTIME_NSEC) && defined(GIT_USE_NEC) +# error GIT_USE_NSEC defined but unknown struct stat nanosecond type +#endif + #define p_utimes(f, t) utimes(f, t) #define p_readlink(a, b, c) readlink(a, b, c) @@ -52,8 +64,10 @@ extern char *p_realpath(const char *, char *); #define p_localtime_r(c, r) localtime_r(c, r) #define p_gmtime_r(c, r) gmtime_r(c, r) +#define p_timeval timeval + #ifdef HAVE_FUTIMENS -GIT_INLINE(int) p_futimes(int f, const struct timeval t[2]) +GIT_INLINE(int) p_futimes(int f, const struct p_timeval t[2]) { struct timespec s[2]; s[0].tv_sec = t[0].tv_sec; diff --git a/vendor/libgit2/src/util.c b/vendor/libgit2/src/util.c index 49d491dd3..9e67f4347 100644 --- a/vendor/libgit2/src/util.c +++ b/vendor/libgit2/src/util.c @@ -10,6 +10,10 @@ #include #include "posix.h" +#ifdef GIT_WIN32 +# include "win32/w32_buffer.h" +#endif + #ifdef _MSC_VER # include #endif @@ -760,3 +764,47 @@ int git__utf8_iterate(const uint8_t *str, int str_len, int32_t *dst) *dst = uc; return length; } + +#ifdef GIT_WIN32 +int git__getenv(git_buf *out, const char *name) +{ + wchar_t *wide_name = NULL, *wide_value = NULL; + DWORD value_len; + int error = -1; + + git_buf_clear(out); + + if (git__utf8_to_16_alloc(&wide_name, name) < 0) + return -1; + + if ((value_len = GetEnvironmentVariableW(wide_name, NULL, 0)) > 0) { + wide_value = git__malloc(value_len * sizeof(wchar_t)); + GITERR_CHECK_ALLOC(wide_value); + + value_len = GetEnvironmentVariableW(wide_name, wide_value, value_len); + } + + if (value_len) + error = git_buf_put_w(out, wide_value, value_len); + else if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) + error = GIT_ENOTFOUND; + else + giterr_set(GITERR_OS, "could not read environment variable '%s'", name); + + git__free(wide_name); + git__free(wide_value); + return error; +} +#else +int git__getenv(git_buf *out, const char *name) +{ + const char *val = getenv(name); + + git_buf_clear(out); + + if (!val) + return GIT_ENOTFOUND; + + return git_buf_puts(out, val); +} +#endif diff --git a/vendor/libgit2/src/util.h b/vendor/libgit2/src/util.h index b2abbe6a6..d0c3cd04a 100644 --- a/vendor/libgit2/src/util.h +++ b/vendor/libgit2/src/util.h @@ -7,6 +7,9 @@ #ifndef INCLUDE_util_h__ #define INCLUDE_util_h__ +#include "git2/buffer.h" +#include "buffer.h" + #if defined(GIT_MSVC_CRTDBG) /* Enable MSVC CRTDBG memory leak reporting. * @@ -35,6 +38,7 @@ */ #include #include +#include "win32/w32_crtdbg_stacktrace.h" #endif #include "common.h" @@ -62,23 +66,24 @@ #define CONST_STRLEN(x) ((sizeof(x)/sizeof(x[0])) - 1) #if defined(GIT_MSVC_CRTDBG) + GIT_INLINE(void *) git__crtdbg__malloc(size_t len, const char *file, int line) { - void *ptr = _malloc_dbg(len, _NORMAL_BLOCK, file, line); + void *ptr = _malloc_dbg(len, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line); if (!ptr) giterr_set_oom(); return ptr; } GIT_INLINE(void *) git__crtdbg__calloc(size_t nelem, size_t elsize, const char *file, int line) { - void *ptr = _calloc_dbg(nelem, elsize, _NORMAL_BLOCK, file, line); + void *ptr = _calloc_dbg(nelem, elsize, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line); if (!ptr) giterr_set_oom(); return ptr; } GIT_INLINE(char *) git__crtdbg__strdup(const char *str, const char *file, int line) { - char *ptr = _strdup_dbg(str, _NORMAL_BLOCK, file, line); + char *ptr = _strdup_dbg(str, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line); if (!ptr) giterr_set_oom(); return ptr; } @@ -118,7 +123,7 @@ GIT_INLINE(char *) git__crtdbg__substrdup(const char *start, size_t n, const cha GIT_INLINE(void *) git__crtdbg__realloc(void *ptr, size_t size, const char *file, int line) { - void *new_ptr = _realloc_dbg(ptr, size, _NORMAL_BLOCK, file, line); + void *new_ptr = _realloc_dbg(ptr, size, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line); if (!new_ptr) giterr_set_oom(); return new_ptr; } @@ -126,8 +131,9 @@ GIT_INLINE(void *) git__crtdbg__realloc(void *ptr, size_t size, const char *file GIT_INLINE(void *) git__crtdbg__reallocarray(void *ptr, size_t nelem, size_t elsize, const char *file, int line) { size_t newsize; + return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ? - NULL : _realloc_dbg(ptr, newsize, _NORMAL_BLOCK, file, line); + NULL : _realloc_dbg(ptr, newsize, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line); } GIT_INLINE(void *) git__crtdbg__mallocarray(size_t nelem, size_t elsize, const char *file, int line) @@ -596,4 +602,6 @@ GIT_INLINE(double) git__timer(void) #endif +extern int git__getenv(git_buf *out, const char *name); + #endif /* INCLUDE_util_h__ */ diff --git a/vendor/libgit2/src/vector.c b/vendor/libgit2/src/vector.c index 93d09bb5b..a81d463ef 100644 --- a/vendor/libgit2/src/vector.c +++ b/vendor/libgit2/src/vector.c @@ -40,6 +40,13 @@ GIT_INLINE(int) resize_vector(git_vector *v, size_t new_size) return 0; } +int git_vector_size_hint(git_vector *v, size_t size_hint) +{ + if (v->_alloc_size >= size_hint) + return 0; + return resize_vector(v, size_hint); +} + int git_vector_dup(git_vector *v, const git_vector *src, git_vector_cmp cmp) { size_t bytes; diff --git a/vendor/libgit2/src/vector.h b/vendor/libgit2/src/vector.h index aac46c4b3..b7500ded3 100644 --- a/vendor/libgit2/src/vector.h +++ b/vendor/libgit2/src/vector.h @@ -32,6 +32,7 @@ void git_vector_free_deep(git_vector *v); /* free each entry and self */ void git_vector_clear(git_vector *v); int git_vector_dup(git_vector *v, const git_vector *src, git_vector_cmp cmp); void git_vector_swap(git_vector *a, git_vector *b); +int git_vector_size_hint(git_vector *v, size_t size_hint); void **git_vector_detach(size_t *size, size_t *asize, git_vector *v); diff --git a/vendor/libgit2/src/win32/findfile.c b/vendor/libgit2/src/win32/findfile.c index de27dd060..58c22279e 100644 --- a/vendor/libgit2/src/win32/findfile.c +++ b/vendor/libgit2/src/win32/findfile.c @@ -215,3 +215,13 @@ int git_win32__find_xdg_dirs(git_buf *out) return win32_find_existing_dirs(out, global_tmpls); } + +int git_win32__find_programdata_dirs(git_buf *out) +{ + static const wchar_t *programdata_tmpls[2] = { + L"%PROGRAMDATA%\\Git", + NULL, + }; + + return win32_find_existing_dirs(out, programdata_tmpls); +} diff --git a/vendor/libgit2/src/win32/findfile.h b/vendor/libgit2/src/win32/findfile.h index a50319b9a..3d5fff439 100644 --- a/vendor/libgit2/src/win32/findfile.h +++ b/vendor/libgit2/src/win32/findfile.h @@ -11,6 +11,7 @@ extern int git_win32__find_system_dirs(git_buf *out, const wchar_t *subpath); extern int git_win32__find_global_dirs(git_buf *out); extern int git_win32__find_xdg_dirs(git_buf *out); +extern int git_win32__find_programdata_dirs(git_buf *out); #endif diff --git a/vendor/libgit2/src/win32/map.c b/vendor/libgit2/src/win32/map.c index a99c30f7e..03a3646a6 100644 --- a/vendor/libgit2/src/win32/map.c +++ b/vendor/libgit2/src/win32/map.c @@ -17,22 +17,41 @@ static DWORD get_page_size(void) if (!page_size) { GetSystemInfo(&sys); - page_size = sys.dwAllocationGranularity; + page_size = sys.dwPageSize; } return page_size; } +static DWORD get_allocation_granularity(void) +{ + static DWORD granularity; + SYSTEM_INFO sys; + + if (!granularity) { + GetSystemInfo(&sys); + granularity = sys.dwAllocationGranularity; + } + + return granularity; +} + int git__page_size(size_t *page_size) { *page_size = get_page_size(); return 0; } +int git__mmap_alignment(size_t *page_size) +{ + *page_size = get_allocation_granularity(); + return 0; +} + int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offset) { HANDLE fh = (HANDLE)_get_osfhandle(fd); - DWORD page_size = get_page_size(); + DWORD alignment = get_allocation_granularity(); DWORD fmap_prot = 0; DWORD view_prot = 0; DWORD off_low = 0; @@ -62,12 +81,12 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs if (prot & GIT_PROT_READ) view_prot |= FILE_MAP_READ; - page_start = (offset / page_size) * page_size; + page_start = (offset / alignment) * alignment; page_offset = offset - page_start; - if (page_offset != 0) { /* offset must be multiple of page size */ + if (page_offset != 0) { /* offset must be multiple of the allocation granularity */ errno = EINVAL; - giterr_set(GITERR_OS, "Failed to mmap. Offset must be multiple of page size"); + giterr_set(GITERR_OS, "Failed to mmap. Offset must be multiple of allocation granularity"); return -1; } diff --git a/vendor/libgit2/src/win32/mingw-compat.h b/vendor/libgit2/src/win32/mingw-compat.h index a4a5a31c7..698ebed1a 100644 --- a/vendor/libgit2/src/win32/mingw-compat.h +++ b/vendor/libgit2/src/win32/mingw-compat.h @@ -11,12 +11,6 @@ #undef stat -#if _WIN32_WINNT >= 0x0601 -#define stat __stat64 -#else -#define stat _stati64 -#endif - #if _WIN32_WINNT < 0x0600 && !defined(__MINGW64_VERSION_MAJOR) #undef MemoryBarrier void __mingworg_MemoryBarrier(void); diff --git a/vendor/libgit2/src/win32/msvc-compat.h b/vendor/libgit2/src/win32/msvc-compat.h index 8004bc1f8..12b50d981 100644 --- a/vendor/libgit2/src/win32/msvc-compat.h +++ b/vendor/libgit2/src/win32/msvc-compat.h @@ -9,9 +9,6 @@ #if defined(_MSC_VER) -/* 64-bit stat information, regardless of USE_32BIT_TIME_T define */ -#define stat __stat64 - typedef unsigned short mode_t; typedef SSIZE_T ssize_t; diff --git a/vendor/libgit2/src/win32/posix.h b/vendor/libgit2/src/win32/posix.h index ac98fd864..5fab267c2 100644 --- a/vendor/libgit2/src/win32/posix.h +++ b/vendor/libgit2/src/win32/posix.h @@ -9,6 +9,7 @@ #include "common.h" #include "../posix.h" +#include "win32-compat.h" #include "path_w32.h" #include "utf-conv.h" #include "dir.h" @@ -16,12 +17,13 @@ typedef SOCKET GIT_SOCKET; #define p_lseek(f,n,w) _lseeki64(f, n, w) -#define p_fstat(f,b) _fstat64(f, b) + +extern int p_fstat(int fd, struct stat *buf); extern int p_lstat(const char *file_name, struct stat *buf); -extern int p_stat(const char* path, struct stat* buf); +extern int p_stat(const char* path, struct stat *buf); -extern int p_utimes(const char *filename, const struct timeval times[2]); -extern int p_futimes(int fd, const struct timeval times[2]); +extern int p_utimes(const char *filename, const struct p_timeval times[2]); +extern int p_futimes(int fd, const struct p_timeval times[2]); extern int p_readlink(const char *path, char *buf, size_t bufsiz); extern int p_symlink(const char *old, const char *new); diff --git a/vendor/libgit2/src/win32/posix_w32.c b/vendor/libgit2/src/win32/posix_w32.c index e7aa6fc7c..fea634b00 100644 --- a/vendor/libgit2/src/win32/posix_w32.c +++ b/vendor/libgit2/src/win32/posix_w32.c @@ -11,6 +11,8 @@ #include "utf-conv.h" #include "repository.h" #include "reparse.h" +#include "global.h" +#include "buffer.h" #include #include #include @@ -208,7 +210,7 @@ int p_lstat_posixly(const char *filename, struct stat *buf) return do_lstat(filename, buf, true); } -int p_utimes(const char *filename, const struct timeval times[2]) +int p_utimes(const char *filename, const struct p_timeval times[2]) { int fd, error; @@ -221,7 +223,7 @@ int p_utimes(const char *filename, const struct timeval times[2]) return error; } -int p_futimes(int fd, const struct timeval times[2]) +int p_futimes(int fd, const struct p_timeval times[2]) { HANDLE handle; FILETIME atime = {0}, mtime = {0}; @@ -396,6 +398,22 @@ static int follow_and_lstat_link(git_win32_path path, struct stat* buf) return lstat_w(target_w, buf, false); } +int p_fstat(int fd, struct stat *buf) +{ + BY_HANDLE_FILE_INFORMATION fhInfo; + + HANDLE fh = (HANDLE)_get_osfhandle(fd); + + if (fh == INVALID_HANDLE_VALUE || + !GetFileInformationByHandle(fh, &fhInfo)) { + errno = EBADF; + return -1; + } + + git_win32__file_information_to_stat(buf, &fhInfo); + return 0; +} + int p_stat(const char* path, struct stat* buf) { git_win32_path path_w; diff --git a/vendor/libgit2/src/win32/utf-conv.c b/vendor/libgit2/src/win32/utf-conv.c index f1b674ea0..96fd4606e 100644 --- a/vendor/libgit2/src/win32/utf-conv.c +++ b/vendor/libgit2/src/win32/utf-conv.c @@ -8,20 +8,6 @@ #include "common.h" #include "utf-conv.h" -GIT_INLINE(DWORD) get_wc_flags(void) -{ - static char inited = 0; - static DWORD flags; - - /* Invalid code point check supported on Vista+ only */ - if (!inited) { - flags = git_has_win32_version(6, 0, 0) ? WC_ERR_INVALID_CHARS : 0; - inited = 1; - } - - return flags; -} - GIT_INLINE(void) git__set_errno(void) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) @@ -66,7 +52,7 @@ int git__utf16_to_8(char *dest, size_t dest_size, const wchar_t *src) /* Length of -1 indicates NULL termination of the input string. Subtract 1 from the result to * turn 0 into -1 (an error code) and to not count the NULL terminator as part of the string's * length. WideCharToMultiByte never returns int's minvalue, so underflow is not possible */ - if ((len = WideCharToMultiByte(CP_UTF8, get_wc_flags(), src, -1, dest, (int)dest_size, NULL, NULL) - 1) < 0) + if ((len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, src, -1, dest, (int)dest_size, NULL, NULL) - 1) < 0) git__set_errno(); return len; @@ -127,12 +113,11 @@ int git__utf8_to_16_alloc(wchar_t **dest, const char *src) int git__utf16_to_8_alloc(char **dest, const wchar_t *src) { int utf8_size; - DWORD dwFlags = get_wc_flags(); *dest = NULL; /* Length of -1 indicates NULL termination of the input string */ - utf8_size = WideCharToMultiByte(CP_UTF8, dwFlags, src, -1, NULL, 0, NULL, NULL); + utf8_size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, src, -1, NULL, 0, NULL, NULL); if (!utf8_size) { git__set_errno(); @@ -146,7 +131,7 @@ int git__utf16_to_8_alloc(char **dest, const wchar_t *src) return -1; } - utf8_size = WideCharToMultiByte(CP_UTF8, dwFlags, src, -1, *dest, utf8_size, NULL, NULL); + utf8_size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, src, -1, *dest, utf8_size, NULL, NULL); if (!utf8_size) { git__set_errno(); diff --git a/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c b/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c new file mode 100644 index 000000000..a778f4164 --- /dev/null +++ b/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c @@ -0,0 +1,343 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#if defined(GIT_MSVC_CRTDBG) +#include "w32_stack.h" +#include "w32_crtdbg_stacktrace.h" + +#define CRTDBG_STACKTRACE__UID_LEN (15) + +/** + * The stacktrace of an allocation can be distilled + * to a unique id based upon the stackframe pointers + * and ignoring any size arguments. We will use these + * UIDs as the (char const*) __FILE__ argument we + * give to the CRT malloc routines. + */ +typedef struct { + char uid[CRTDBG_STACKTRACE__UID_LEN + 1]; +} git_win32__crtdbg_stacktrace__uid; + +/** + * All mallocs with the same stacktrace will be de-duped + * and aggregated into this row. + */ +typedef struct { + git_win32__crtdbg_stacktrace__uid uid; /* must be first */ + git_win32__stack__raw_data raw_data; + unsigned int count_allocs; /* times this alloc signature seen since init */ + unsigned int count_allocs_at_last_checkpoint; /* times since last mark */ + unsigned int transient_count_leaks; /* sum of leaks */ +} git_win32__crtdbg_stacktrace__row; + +static CRITICAL_SECTION g_crtdbg_stacktrace_cs; + +/** + * CRTDBG memory leak tracking takes a "char const * const file_name" + * and stores the pointer in the heap data (instead of allocing a copy + * for itself). Normally, this is not a problem, since we usually pass + * in __FILE__. But I'm going to lie to it and pass in the address of + * the UID in place of the file_name. Also, I do not want to alloc the + * stacktrace data (because we are called from inside our alloc routines). + * Therefore, I'm creating a very large static pool array to store row + * data. This also eliminates the temptation to realloc it (and move the + * UID pointers). + * + * And to efficiently look for duplicates we need an index on the rows + * so we can bsearch it. Again, without mallocing. + * + * If we observe more than MY_ROW_LIMIT unique malloc signatures, we + * fall through and use the traditional __FILE__ processing and don't + * try to de-dup them. If your testing hits this limit, just increase + * it and try again. + */ + +#define MY_ROW_LIMIT (1024 * 1024) +static git_win32__crtdbg_stacktrace__row g_cs_rows[MY_ROW_LIMIT]; +static git_win32__crtdbg_stacktrace__row *g_cs_index[MY_ROW_LIMIT]; + +static unsigned int g_cs_end = MY_ROW_LIMIT; +static unsigned int g_cs_ins = 0; /* insertion point == unique allocs seen */ +static unsigned int g_count_total_allocs = 0; /* number of allocs seen */ +static unsigned int g_transient_count_total_leaks = 0; /* number of total leaks */ +static unsigned int g_transient_count_dedup_leaks = 0; /* number of unique leaks */ +static bool g_limit_reached = false; /* had allocs after we filled row table */ + +static unsigned int g_checkpoint_id = 0; /* to better label leak checkpoints */ +static bool g_transient_leaks_since_mark = false; /* payload for hook */ + +/** + * Compare function for bsearch on g_cs_index table. + */ +static int row_cmp(const void *v1, const void *v2) +{ + git_win32__stack__raw_data *d1 = (git_win32__stack__raw_data*)v1; + git_win32__crtdbg_stacktrace__row *r2 = (git_win32__crtdbg_stacktrace__row *)v2; + + return (git_win32__stack_compare(d1, &r2->raw_data)); +} + +/** + * Unique insert the new data into the row and index tables. + * We have to sort by the stackframe data itself, not the uid. + */ +static git_win32__crtdbg_stacktrace__row * insert_unique( + const git_win32__stack__raw_data *pdata) +{ + size_t pos; + if (git__bsearch(g_cs_index, g_cs_ins, pdata, row_cmp, &pos) < 0) { + /* Append new unique item to row table. */ + memcpy(&g_cs_rows[g_cs_ins].raw_data, pdata, sizeof(*pdata)); + sprintf(g_cs_rows[g_cs_ins].uid.uid, "##%08lx", g_cs_ins); + + /* Insert pointer to it into the proper place in the index table. */ + if (pos < g_cs_ins) + memmove(&g_cs_index[pos+1], &g_cs_index[pos], (g_cs_ins - pos)*sizeof(g_cs_index[0])); + g_cs_index[pos] = &g_cs_rows[g_cs_ins]; + + g_cs_ins++; + } + + g_cs_index[pos]->count_allocs++; + + return g_cs_index[pos]; +} + +/** + * Hook function to receive leak data from the CRT. (This includes + * both ":()" data, but also each of the + * various headers and fields. + * + * Scan this for the special "##" UID forms that we substituted + * for the "". Map back to the row data and + * increment its leak count. + * + * See https://msdn.microsoft.com/en-us/library/74kabxyx.aspx + * + * We suppress the actual crtdbg output. + */ +static int __cdecl report_hook(int nRptType, char *szMsg, int *retVal) +{ + static int hook_result = TRUE; /* FALSE to get stock dump; TRUE to suppress. */ + unsigned int pos; + + *retVal = 0; /* do not invoke debugger */ + + if ((szMsg[0] != '#') || (szMsg[1] != '#')) + return hook_result; + + if (sscanf(&szMsg[2], "%08lx", &pos) < 1) + return hook_result; + if (pos >= g_cs_ins) + return hook_result; + + if (g_transient_leaks_since_mark) { + if (g_cs_rows[pos].count_allocs == g_cs_rows[pos].count_allocs_at_last_checkpoint) + return hook_result; + } + + g_cs_rows[pos].transient_count_leaks++; + + if (g_cs_rows[pos].transient_count_leaks == 1) + g_transient_count_dedup_leaks++; + + g_transient_count_total_leaks++; + + return hook_result; +} + +/** + * Write leak data to all of the various places we need. + * We force the caller to sprintf() the message first + * because we want to avoid fprintf() because it allocs. + */ +static void my_output(const char *buf) +{ + fwrite(buf, strlen(buf), 1, stderr); + OutputDebugString(buf); +} + +/** + * For each row with leaks, dump a stacktrace for it. + */ +static void dump_summary(const char *label) +{ + unsigned int k; + char buf[10 * 1024]; + + if (g_transient_count_total_leaks == 0) + return; + + fflush(stdout); + fflush(stderr); + my_output("\n"); + + if (g_limit_reached) { + sprintf(buf, + "LEAK SUMMARY: de-dup row table[%d] filled. Increase MY_ROW_LIMIT.\n", + MY_ROW_LIMIT); + my_output(buf); + } + + if (!label) + label = ""; + + if (g_transient_leaks_since_mark) { + sprintf(buf, "LEAK CHECKPOINT %d: leaks %d unique %d: %s\n", + g_checkpoint_id, g_transient_count_total_leaks, g_transient_count_dedup_leaks, label); + my_output(buf); + } else { + sprintf(buf, "LEAK SUMMARY: TOTAL leaks %d de-duped %d: %s\n", + g_transient_count_total_leaks, g_transient_count_dedup_leaks, label); + my_output(buf); + } + my_output("\n"); + + for (k = 0; k < g_cs_ins; k++) { + if (g_cs_rows[k].transient_count_leaks > 0) { + sprintf(buf, "LEAK: %s leaked %d of %d times:\n", + g_cs_rows[k].uid.uid, + g_cs_rows[k].transient_count_leaks, + g_cs_rows[k].count_allocs); + my_output(buf); + + if (git_win32__stack_format( + buf, sizeof(buf), &g_cs_rows[k].raw_data, + NULL, NULL) >= 0) { + my_output(buf); + } + + my_output("\n"); + } + } + + fflush(stderr); +} + +void git_win32__crtdbg_stacktrace_init(void) +{ + InitializeCriticalSection(&g_crtdbg_stacktrace_cs); + + EnterCriticalSection(&g_crtdbg_stacktrace_cs); + + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); + + LeaveCriticalSection(&g_crtdbg_stacktrace_cs); +} + +int git_win32__crtdbg_stacktrace__dump( + git_win32__crtdbg_stacktrace_options opt, + const char *label) +{ + _CRT_REPORT_HOOK old; + unsigned int k; + int r = 0; + +#define IS_BIT_SET(o,b) (((o) & (b)) != 0) + + bool b_set_mark = IS_BIT_SET(opt, GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK); + bool b_leaks_since_mark = IS_BIT_SET(opt, GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK); + bool b_leaks_total = IS_BIT_SET(opt, GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL); + bool b_quiet = IS_BIT_SET(opt, GIT_WIN32__CRTDBG_STACKTRACE__QUIET); + + if (b_leaks_since_mark && b_leaks_total) { + giterr_set(GITERR_INVALID, "Cannot combine LEAKS_SINCE_MARK and LEAKS_TOTAL."); + return GIT_ERROR; + } + if (!b_set_mark && !b_leaks_since_mark && !b_leaks_total) { + giterr_set(GITERR_INVALID, "Nothing to do."); + return GIT_ERROR; + } + + EnterCriticalSection(&g_crtdbg_stacktrace_cs); + + if (b_leaks_since_mark || b_leaks_total) { + /* All variables with "transient" in the name are per-dump counters + * and reset before each dump. This lets us handle checkpoints. + */ + g_transient_count_total_leaks = 0; + g_transient_count_dedup_leaks = 0; + for (k = 0; k < g_cs_ins; k++) { + g_cs_rows[k].transient_count_leaks = 0; + } + } + + g_transient_leaks_since_mark = b_leaks_since_mark; + + old = _CrtSetReportHook(report_hook); + _CrtDumpMemoryLeaks(); + _CrtSetReportHook(old); + + if (b_leaks_since_mark || b_leaks_total) { + r = g_transient_count_dedup_leaks; + + if (!b_quiet) + dump_summary(label); + } + + if (b_set_mark) { + for (k = 0; k < g_cs_ins; k++) { + g_cs_rows[k].count_allocs_at_last_checkpoint = g_cs_rows[k].count_allocs; + } + + g_checkpoint_id++; + } + + LeaveCriticalSection(&g_crtdbg_stacktrace_cs); + + return r; +} + +void git_win32__crtdbg_stacktrace_cleanup(void) +{ + /* At shutdown/cleanup, dump cummulative leak info + * with everything since startup. This might generate + * extra noise if the caller has been doing checkpoint + * dumps, but it might also eliminate some false + * positives for resources previously reported during + * checkpoints. + */ + git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL, + "CLEANUP"); + + DeleteCriticalSection(&g_crtdbg_stacktrace_cs); +} + +const char *git_win32__crtdbg_stacktrace(int skip, const char *file) +{ + git_win32__stack__raw_data new_data; + git_win32__crtdbg_stacktrace__row *row; + const char * result = file; + + if (git_win32__stack_capture(&new_data, skip+1) < 0) + return result; + + EnterCriticalSection(&g_crtdbg_stacktrace_cs); + + if (g_cs_ins < g_cs_end) { + row = insert_unique(&new_data); + result = row->uid.uid; + } else { + g_limit_reached = true; + } + + g_count_total_allocs++; + + LeaveCriticalSection(&g_crtdbg_stacktrace_cs); + + return result; +} +#endif diff --git a/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h b/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h new file mode 100644 index 000000000..40ca60d53 --- /dev/null +++ b/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h @@ -0,0 +1,93 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_w32_crtdbg_stacktrace_h__ +#define INCLUDE_w32_crtdbg_stacktrace_h__ + +#if defined(GIT_MSVC_CRTDBG) + +/** + * Initialize our memory leak tracking and de-dup data structures. + * This should ONLY be called by git_libgit2_init(). + */ +void git_win32__crtdbg_stacktrace_init(void); + +/** + * Shutdown our memory leak tracking and dump summary data. + * This should ONLY be called by git_libgit2_shutdown(). + * + * We explicitly call _CrtDumpMemoryLeaks() during here so + * that we can compute summary data for the leaks. We print + * the stacktrace of each unique leak. + * + * This cleanup does not happen if the app calls exit() + * without calling the libgit2 shutdown code. + * + * This info we print here is independent of any automatic + * reporting during exit() caused by _CRTDBG_LEAK_CHECK_DF. + * Set it in your app if you also want traditional reporting. + */ +void git_win32__crtdbg_stacktrace_cleanup(void); + +/** + * Checkpoint options. + */ +typedef enum git_win32__crtdbg_stacktrace_options { + /** + * Set checkpoint marker. + */ + GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK = (1 << 0), + + /** + * Dump leaks since last checkpoint marker. + * May not be combined with __LEAKS_TOTAL. + * + * Note that this may generate false positives for global TLS + * error state and other global caches that aren't cleaned up + * until the thread/process terminates. So when using this + * around a region of interest, also check the final (at exit) + * dump before digging into leaks reported here. + */ + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK = (1 << 1), + + /** + * Dump leaks since init. May not be combined + * with __LEAKS_SINCE_MARK. + */ + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL = (1 << 2), + + /** + * Suppress printing during dumps. + * Just return leak count. + */ + GIT_WIN32__CRTDBG_STACKTRACE__QUIET = (1 << 3), + +} git_win32__crtdbg_stacktrace_options; + +/** + * Checkpoint memory state and/or dump unique stack traces of + * current memory leaks. + * + * @return number of unique leaks (relative to requested starting + * point) or error. + */ +GIT_EXTERN(int) git_win32__crtdbg_stacktrace__dump( + git_win32__crtdbg_stacktrace_options opt, + const char *label); + +/** + * Construct stacktrace and append it to the global buffer. + * Return pointer to start of this string. On any error or + * lack of buffer space, just return the given file buffer + * so it will behave as usual. + * + * This should ONLY be called by our internal memory allocations + * routines. + */ +const char *git_win32__crtdbg_stacktrace(int skip, const char *file); + +#endif +#endif diff --git a/vendor/libgit2/src/win32/w32_stack.c b/vendor/libgit2/src/win32/w32_stack.c new file mode 100644 index 000000000..15af3dcb7 --- /dev/null +++ b/vendor/libgit2/src/win32/w32_stack.c @@ -0,0 +1,192 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#if defined(GIT_MSVC_CRTDBG) +#include "Windows.h" +#include "Dbghelp.h" +#include "win32/posix.h" +#include "w32_stack.h" +#include "hash.h" + +/** + * This is supposedly defined in WinBase.h (from Windows.h) but there were linker issues. + */ +USHORT WINAPI RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG); + +static bool g_win32_stack_initialized = false; +static HANDLE g_win32_stack_process = INVALID_HANDLE_VALUE; +static git_win32__stack__aux_cb_alloc g_aux_cb_alloc = NULL; +static git_win32__stack__aux_cb_lookup g_aux_cb_lookup = NULL; + +int git_win32__stack__set_aux_cb( + git_win32__stack__aux_cb_alloc cb_alloc, + git_win32__stack__aux_cb_lookup cb_lookup) +{ + g_aux_cb_alloc = cb_alloc; + g_aux_cb_lookup = cb_lookup; + + return 0; +} + +void git_win32__stack_init(void) +{ + if (!g_win32_stack_initialized) { + g_win32_stack_process = GetCurrentProcess(); + SymSetOptions(SYMOPT_LOAD_LINES); + SymInitialize(g_win32_stack_process, NULL, TRUE); + g_win32_stack_initialized = true; + } +} + +void git_win32__stack_cleanup(void) +{ + if (g_win32_stack_initialized) { + SymCleanup(g_win32_stack_process); + g_win32_stack_process = INVALID_HANDLE_VALUE; + g_win32_stack_initialized = false; + } +} + +int git_win32__stack_capture(git_win32__stack__raw_data *pdata, int skip) +{ + if (!g_win32_stack_initialized) { + giterr_set(GITERR_INVALID, "git_win32_stack not initialized."); + return GIT_ERROR; + } + + memset(pdata, 0, sizeof(*pdata)); + pdata->nr_frames = RtlCaptureStackBackTrace( + skip+1, GIT_WIN32__STACK__MAX_FRAMES, pdata->frames, NULL); + + /* If an "aux" data provider was registered, ask it to capture + * whatever data it needs and give us an "aux_id" to it so that + * we can refer to it later when reporting. + */ + if (g_aux_cb_alloc) + (g_aux_cb_alloc)(&pdata->aux_id); + + return 0; +} + +int git_win32__stack_compare( + git_win32__stack__raw_data *d1, + git_win32__stack__raw_data *d2) +{ + return memcmp(d1, d2, sizeof(*d1)); +} + +int git_win32__stack_format( + char *pbuf, int buf_len, + const git_win32__stack__raw_data *pdata, + const char *prefix, const char *suffix) +{ +#define MY_MAX_FILENAME 255 + + /* SYMBOL_INFO has char FileName[1] at the end. The docs say to + * to malloc it with extra space for your desired max filename. + */ + struct { + SYMBOL_INFO symbol; + char extra[MY_MAX_FILENAME + 1]; + } s; + + IMAGEHLP_LINE64 line; + int buf_used = 0; + unsigned int k; + char detail[MY_MAX_FILENAME * 2]; /* filename plus space for function name and formatting */ + int detail_len; + + if (!g_win32_stack_initialized) { + giterr_set(GITERR_INVALID, "git_win32_stack not initialized."); + return GIT_ERROR; + } + + if (!prefix) + prefix = "\t"; + if (!suffix) + suffix = "\n"; + + memset(pbuf, 0, buf_len); + + memset(&s, 0, sizeof(s)); + s.symbol.MaxNameLen = MY_MAX_FILENAME; + s.symbol.SizeOfStruct = sizeof(SYMBOL_INFO); + + memset(&line, 0, sizeof(line)); + line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); + + for (k=0; k < pdata->nr_frames; k++) { + DWORD64 frame_k = (DWORD64)pdata->frames[k]; + DWORD dwUnused; + + if (SymFromAddr(g_win32_stack_process, frame_k, 0, &s.symbol) && + SymGetLineFromAddr64(g_win32_stack_process, frame_k, &dwUnused, &line)) { + const char *pslash; + const char *pfile; + + pslash = strrchr(line.FileName, '\\'); + pfile = ((pslash) ? (pslash+1) : line.FileName); + p_snprintf(detail, sizeof(detail), "%s%s:%d> %s%s", + prefix, pfile, line.LineNumber, s.symbol.Name, suffix); + } else { + /* This happens when we cross into another module. + * For example, in CLAR tests, this is typically + * the CRT startup code. Just print an unknown + * frame and continue. + */ + p_snprintf(detail, sizeof(detail), "%s??%s", prefix, suffix); + } + detail_len = strlen(detail); + + if (buf_len < (buf_used + detail_len + 1)) { + /* we don't have room for this frame in the buffer, so just stop. */ + break; + } + + memcpy(&pbuf[buf_used], detail, detail_len); + buf_used += detail_len; + } + + /* "aux_id" 0 is reserved to mean no aux data. This is needed to handle + * allocs that occur before the aux callbacks were registered. + */ + if (pdata->aux_id > 0) { + p_snprintf(detail, sizeof(detail), "%saux_id: %d%s", + prefix, pdata->aux_id, suffix); + detail_len = strlen(detail); + if ((buf_used + detail_len + 1) < buf_len) { + memcpy(&pbuf[buf_used], detail, detail_len); + buf_used += detail_len; + } + + /* If an "aux" data provider is still registered, ask it to append its detailed + * data to the end of ours using the "aux_id" it gave us when this de-duped + * item was created. + */ + if (g_aux_cb_lookup) + (g_aux_cb_lookup)(pdata->aux_id, &pbuf[buf_used], (buf_len - buf_used - 1)); + } + + return GIT_OK; +} + +int git_win32__stack( + char * pbuf, int buf_len, + int skip, + const char *prefix, const char *suffix) +{ + git_win32__stack__raw_data data; + int error; + + if ((error = git_win32__stack_capture(&data, skip)) < 0) + return error; + if ((error = git_win32__stack_format(pbuf, buf_len, &data, prefix, suffix)) < 0) + return error; + return 0; +} + +#endif diff --git a/vendor/libgit2/src/win32/w32_stack.h b/vendor/libgit2/src/win32/w32_stack.h new file mode 100644 index 000000000..21170bd2f --- /dev/null +++ b/vendor/libgit2/src/win32/w32_stack.h @@ -0,0 +1,138 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#ifndef INCLUDE_w32_stack_h__ +#define INCLUDE_w32_stack_h__ + +#if defined(GIT_MSVC_CRTDBG) + +/** + * This type defines a callback to be used to augment a C stacktrace + * with "aux" data. This can be used, for example, to allow LibGit2Sharp + * (or other interpreted consumer libraries) to give us C# stacktrace + * data for the PInvoke. + * + * This callback will be called during crtdbg-instrumented allocs. + * + * @param aux_id [out] A returned "aux_id" representing a unique + * (de-duped at the C# layer) stacktrace. "aux_id" 0 is reserved + * to mean no aux stacktrace data. + */ +typedef void (*git_win32__stack__aux_cb_alloc)(unsigned int *aux_id); + +/** + * This type defines a callback to be used to augment the output of + * a stacktrace. This will be used to request the C# layer format + * the C# stacktrace associated with "aux_id" into the provided + * buffer. + * + * This callback will be called during leak reporting. + * + * @param aux_id The "aux_id" key associated with a stacktrace. + * @param aux_msg A buffer where a formatted message should be written. + * @param aux_msg_len The size of the buffer. + */ +typedef void (*git_win32__stack__aux_cb_lookup)(unsigned int aux_id, char *aux_msg, unsigned int aux_msg_len); + +/** + * Register an "aux" data provider to augment our C stacktrace data. + * + * This can be used, for example, to allow LibGit2Sharp (or other + * interpreted consumer libraries) to give us the C# stacktrace of + * the PInvoke. + * + * If you choose to use this feature, it should be registered during + * initialization and not changed for the duration of the process. + */ +GIT_EXTERN(int) git_win32__stack__set_aux_cb( + git_win32__stack__aux_cb_alloc cb_alloc, + git_win32__stack__aux_cb_lookup cb_lookup); + +/** + * Maximum number of stackframes to record for a + * single stacktrace. + */ +#define GIT_WIN32__STACK__MAX_FRAMES 30 + +/** + * Wrapper containing the raw unprocessed stackframe + * data for a single stacktrace and any "aux_id". + * + * I put the aux_id first so leaks will be sorted by it. + * So, for example, if a specific callstack in C# leaks + * a repo handle, all of the pointers within the associated + * repo pointer will be grouped together. + */ +typedef struct { + unsigned int aux_id; + unsigned int nr_frames; + void *frames[GIT_WIN32__STACK__MAX_FRAMES]; +} git_win32__stack__raw_data; + + +/** + * Load symbol table data. This should be done in the primary + * thread at startup (under a lock if there are other threads + * active). + */ +void git_win32__stack_init(void); + +/** + * Cleanup symbol table data. This should be done in the + * primary thead at shutdown (under a lock if there are other + * threads active). + */ +void git_win32__stack_cleanup(void); + + +/** + * Capture raw stack trace data for the current process/thread. + * + * @param skip Number of initial frames to skip. Pass 0 to + * begin with the caller of this routine. Pass 1 to begin + * with its caller. And so on. + */ +int git_win32__stack_capture(git_win32__stack__raw_data *pdata, int skip); + +/** + * Compare 2 raw stacktraces with the usual -1,0,+1 result. + * This includes any "aux_id" values in the comparison, so that + * our de-dup is also "aux" context relative. + */ +int git_win32__stack_compare( + git_win32__stack__raw_data *d1, + git_win32__stack__raw_data *d2); + +/** + * Format raw stacktrace data into buffer WITHOUT using any mallocs. + * + * @param prefix String written before each frame; defaults to "\t". + * @param suffix String written after each frame; defaults to "\n". + */ +int git_win32__stack_format( + char *pbuf, int buf_len, + const git_win32__stack__raw_data *pdata, + const char *prefix, const char *suffix); + +/** + * Convenience routine to capture and format stacktrace into + * a buffer WITHOUT using any mallocs. This is primarily a + * wrapper for testing. + * + * @param skip Number of initial frames to skip. Pass 0 to + * begin with the caller of this routine. Pass 1 to begin + * with its caller. And so on. + * @param prefix String written before each frame; defaults to "\t". + * @param suffix String written after each frame; defaults to "\n". + */ +int git_win32__stack( + char * pbuf, int buf_len, + int skip, + const char *prefix, const char *suffix); + +#endif /* GIT_MSVC_CRTDBG */ +#endif /* INCLUDE_w32_stack_h__ */ diff --git a/vendor/libgit2/src/win32/w32_util.c b/vendor/libgit2/src/win32/w32_util.c index 2e52525d5..60311bb50 100644 --- a/vendor/libgit2/src/win32/w32_util.c +++ b/vendor/libgit2/src/win32/w32_util.c @@ -48,10 +48,10 @@ bool git_win32__findfirstfile_filter(git_win32_path dest, const char *src) * @param path The path which should receive the +H bit. * @return 0 on success; -1 on failure */ -int git_win32__sethidden(const char *path) +int git_win32__set_hidden(const char *path, bool hidden) { git_win32_path buf; - DWORD attrs; + DWORD attrs, newattrs; if (git_win32_path_from_utf8(buf, path) < 0) return -1; @@ -62,11 +62,35 @@ int git_win32__sethidden(const char *path) if (attrs == INVALID_FILE_ATTRIBUTES) return -1; - /* If the item isn't already +H, add the bit */ - if ((attrs & FILE_ATTRIBUTE_HIDDEN) == 0 && - !SetFileAttributesW(buf, attrs | FILE_ATTRIBUTE_HIDDEN)) + if (hidden) + newattrs = attrs | FILE_ATTRIBUTE_HIDDEN; + else + newattrs = attrs & ~FILE_ATTRIBUTE_HIDDEN; + + if (attrs != newattrs && !SetFileAttributesW(buf, newattrs)) { + giterr_set(GITERR_OS, "Failed to %s hidden bit for '%s'", + hidden ? "set" : "unset", path); + return -1; + } + + return 0; +} + +int git_win32__hidden(bool *out, const char *path) +{ + git_win32_path buf; + DWORD attrs; + + if (git_win32_path_from_utf8(buf, path) < 0) + return -1; + + attrs = GetFileAttributesW(buf); + + /* Ensure the path exists */ + if (attrs == INVALID_FILE_ATTRIBUTES) return -1; + *out = (attrs & FILE_ATTRIBUTE_HIDDEN) ? true : false; return 0; } diff --git a/vendor/libgit2/src/win32/w32_util.h b/vendor/libgit2/src/win32/w32_util.h index 377d651a8..2e475e5e9 100644 --- a/vendor/libgit2/src/win32/w32_util.h +++ b/vendor/libgit2/src/win32/w32_util.h @@ -40,12 +40,22 @@ GIT_INLINE(bool) git_win32__isalpha(wchar_t c) bool git_win32__findfirstfile_filter(git_win32_path dest, const char *src); /** - * Ensures the given path (file or folder) has the +H (hidden) attribute set. + * Ensures the given path (file or folder) has the +H (hidden) attribute set + * or unset. * - * @param path The path which should receive the +H bit. + * @param path The path that should receive the +H bit. + * @param hidden true to set +H, false to unset it * @return 0 on success; -1 on failure */ -int git_win32__sethidden(const char *path); +extern int git_win32__set_hidden(const char *path, bool hidden); + +/** + * Determines if the given file or folder has the hidden attribute set. + * @param hidden pointer to store hidden value + * @param path The path that should be queried for hiddenness. + * @return 0 on success or an error code. + */ +extern int git_win32__hidden(bool *hidden, const char *path); /** * Removes any trailing backslashes from a path, except in the case of a drive @@ -66,21 +76,27 @@ size_t git_win32__path_trim_end(wchar_t *str, size_t len); size_t git_win32__canonicalize_path(wchar_t *str, size_t len); /** - * Converts a FILETIME structure to a time_t. + * Converts a FILETIME structure to a struct timespec. * * @param FILETIME A pointer to a FILETIME - * @return A time_t containing the same time + * @param ts A pointer to the timespec structure to fill in */ -GIT_INLINE(time_t) git_win32__filetime_to_time_t(const FILETIME *ft) +GIT_INLINE(void) git_win32__filetime_to_timespec( + const FILETIME *ft, + struct timespec *ts) { long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime; winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */ - winTime /= 10000000; /* Nano to seconds resolution */ - return (time_t)winTime; + ts->tv_sec = (time_t)(winTime / 10000000); +#ifdef GIT_USE_NSEC + ts->tv_nsec = (winTime % 10000000) * 100; +#else + ts->tv_nsec = 0; +#endif } GIT_INLINE(void) git_win32__timeval_to_filetime( - FILETIME *ft, const struct timeval tv) + FILETIME *ft, const struct p_timeval tv) { long long ticks = (tv.tv_sec * 10000000LL) + (tv.tv_usec * 10LL) + 116444736000000000LL; @@ -89,19 +105,25 @@ GIT_INLINE(void) git_win32__timeval_to_filetime( ft->dwLowDateTime = (ticks & 0xffffffffLL); } -GIT_INLINE(int) git_win32__file_attribute_to_stat( +GIT_INLINE(void) git_win32__stat_init( struct stat *st, - const WIN32_FILE_ATTRIBUTE_DATA *attrdata, - const wchar_t *path) + DWORD dwFileAttributes, + DWORD nFileSizeHigh, + DWORD nFileSizeLow, + FILETIME ftCreationTime, + FILETIME ftLastAccessTime, + FILETIME ftLastWriteTime) { mode_t mode = S_IREAD; - if (attrdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + memset(st, 0, sizeof(struct stat)); + + if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) mode |= S_IFDIR; else mode |= S_IFREG; - if ((attrdata->dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0) + if ((dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0) mode |= S_IWRITE; st->st_ino = 0; @@ -109,12 +131,39 @@ GIT_INLINE(int) git_win32__file_attribute_to_stat( st->st_uid = 0; st->st_nlink = 1; st->st_mode = mode; - st->st_size = ((git_off_t)attrdata->nFileSizeHigh << 32) + attrdata->nFileSizeLow; + st->st_size = ((git_off_t)nFileSizeHigh << 32) + nFileSizeLow; st->st_dev = _getdrive() - 1; st->st_rdev = st->st_dev; - st->st_atime = git_win32__filetime_to_time_t(&(attrdata->ftLastAccessTime)); - st->st_mtime = git_win32__filetime_to_time_t(&(attrdata->ftLastWriteTime)); - st->st_ctime = git_win32__filetime_to_time_t(&(attrdata->ftCreationTime)); + git_win32__filetime_to_timespec(&ftLastAccessTime, &(st->st_atim)); + git_win32__filetime_to_timespec(&ftLastWriteTime, &(st->st_mtim)); + git_win32__filetime_to_timespec(&ftCreationTime, &(st->st_ctim)); +} + +GIT_INLINE(void) git_win32__file_information_to_stat( + struct stat *st, + const BY_HANDLE_FILE_INFORMATION *fileinfo) +{ + git_win32__stat_init(st, + fileinfo->dwFileAttributes, + fileinfo->nFileSizeHigh, + fileinfo->nFileSizeLow, + fileinfo->ftCreationTime, + fileinfo->ftLastAccessTime, + fileinfo->ftLastWriteTime); +} + +GIT_INLINE(int) git_win32__file_attribute_to_stat( + struct stat *st, + const WIN32_FILE_ATTRIBUTE_DATA *attrdata, + const wchar_t *path) +{ + git_win32__stat_init(st, + attrdata->dwFileAttributes, + attrdata->nFileSizeHigh, + attrdata->nFileSizeLow, + attrdata->ftCreationTime, + attrdata->ftLastAccessTime, + attrdata->ftLastWriteTime); if (attrdata->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && path) { git_win32_path target; @@ -123,7 +172,7 @@ GIT_INLINE(int) git_win32__file_attribute_to_stat( st->st_mode = (st->st_mode & ~S_IFMT) | S_IFLNK; /* st_size gets the UTF-8 length of the target name, in bytes, - * not counting the NULL terminator */ + * not counting the NULL terminator */ if ((st->st_size = git__utf16_to_8(NULL, 0, target)) < 0) { giterr_set(GITERR_OS, "Could not convert reparse point name for '%s'", path); return -1; diff --git a/vendor/libgit2/src/win32/win32-compat.h b/vendor/libgit2/src/win32/win32-compat.h new file mode 100644 index 000000000..f888fd69e --- /dev/null +++ b/vendor/libgit2/src/win32/win32-compat.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_win32_compat__ +#define INCLUDE_win32_compat__ + +#include +#include +#include +#include +#include + +typedef long suseconds_t; + +struct p_timeval { + time_t tv_sec; + suseconds_t tv_usec; +}; + +struct p_timespec { + time_t tv_sec; + long tv_nsec; +}; + +#define timespec p_timespec + +struct p_stat { + _dev_t st_dev; + _ino_t st_ino; + mode_t st_mode; + short st_nlink; + short st_uid; + short st_gid; + _dev_t st_rdev; + __int64 st_size; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; +#define st_atime st_atim.tv_sec +#define st_mtime st_mtim.tv_sec +#define st_ctime st_ctim.tv_sec +#define st_atime_nsec st_atim.tv_nsec +#define st_mtime_nsec st_mtim.tv_nsec +#define st_ctime_nsec st_ctim.tv_nsec +}; + +#define stat p_stat + +#endif /* INCLUDE_win32_compat__ */ diff --git a/vendor/libgit2/src/xdiff/xmerge.c b/vendor/libgit2/src/xdiff/xmerge.c index 7b7e0e2d3..6448b5542 100644 --- a/vendor/libgit2/src/xdiff/xmerge.c +++ b/vendor/libgit2/src/xdiff/xmerge.c @@ -633,8 +633,11 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, mmfile_t *mf2, result->ptr = NULL; result->size = 0; - if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0 || - xdl_do_diff(orig, mf2, xpp, &xe2) < 0) { + if (xdl_do_diff(orig, mf1, xpp, &xe1) < 0) { + return -1; + } + if (xdl_do_diff(orig, mf2, xpp, &xe2) < 0) { + xdl_free_env(&xe1); return -1; } if (xdl_change_compact(&xe1.xdf1, &xe1.xdf2, xpp->flags) < 0 || @@ -646,6 +649,8 @@ int xdl_merge(mmfile_t *orig, mmfile_t *mf1, mmfile_t *mf2, if (xdl_change_compact(&xe2.xdf1, &xe2.xdf2, xpp->flags) < 0 || xdl_change_compact(&xe2.xdf2, &xe2.xdf1, xpp->flags) < 0 || xdl_build_script(&xe2, &xscr2) < 0) { + xdl_free_script(xscr1); + xdl_free_env(&xe1); xdl_free_env(&xe2); return -1; } diff --git a/vendor/libgit2/src/xdiff/xprepare.c b/vendor/libgit2/src/xdiff/xprepare.c index 63a22c630..13b55aba7 100644 --- a/vendor/libgit2/src/xdiff/xprepare.c +++ b/vendor/libgit2/src/xdiff/xprepare.c @@ -301,10 +301,11 @@ int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdl_free_ctx(&xe->xdf2); xdl_free_ctx(&xe->xdf1); + xdl_free_classifier(&cf); return -1; } - if (!(xpp->flags & XDF_HISTOGRAM_DIFF)) + if (XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF) xdl_free_classifier(&cf); return 0; diff --git a/vendor/libgit2/tests/attr/ignore.c b/vendor/libgit2/tests/attr/ignore.c index 27fed2539..91bf984a1 100644 --- a/vendor/libgit2/tests/attr/ignore.c +++ b/vendor/libgit2/tests/attr/ignore.c @@ -252,3 +252,16 @@ void test_attr_ignore__dont_ignore_files_for_folder(void) if (cl_repo_get_bool(g_repo, "core.ignorecase")) assert_is_ignored(false, "dir/TeSt"); } + +void test_attr_ignore__symlink_to_outside(void) +{ +#ifdef GIT_WIN32 + cl_skip(); +#endif + + cl_git_rewritefile("attr/.gitignore", "symlink\n"); + cl_git_mkfile("target", "target"); + cl_git_pass(p_symlink("../target", "attr/symlink")); + assert_is_ignored(true, "symlink"); + assert_is_ignored(true, "lala/../symlink"); +} diff --git a/vendor/libgit2/tests/blame/blame_helpers.c b/vendor/libgit2/tests/blame/blame_helpers.c index b305ba1e3..61e87350c 100644 --- a/vendor/libgit2/tests/blame/blame_helpers.c +++ b/vendor/libgit2/tests/blame/blame_helpers.c @@ -4,7 +4,7 @@ void hunk_message(size_t idx, const git_blame_hunk *hunk, const char *fmt, ...) { va_list arglist; - printf("Hunk %"PRIuZ" (line %d +%d): ", idx, + printf("Hunk %"PRIuZ" (line %"PRIuZ" +%"PRIuZ"): ", idx, hunk->final_start_line_number, hunk->lines_in_hunk-1); va_start(arglist, fmt); @@ -15,7 +15,7 @@ void hunk_message(size_t idx, const git_blame_hunk *hunk, const char *fmt, ...) } void check_blame_hunk_index(git_repository *repo, git_blame *blame, int idx, - int start_line, int len, char boundary, const char *commit_id, const char *orig_path) + size_t start_line, size_t len, char boundary, const char *commit_id, const char *orig_path) { char expected[GIT_OID_HEXSZ+1] = {0}, actual[GIT_OID_HEXSZ+1] = {0}; const git_blame_hunk *hunk = git_blame_get_hunk_byindex(blame, idx); diff --git a/vendor/libgit2/tests/blame/blame_helpers.h b/vendor/libgit2/tests/blame/blame_helpers.h index 94321a5b5..fd5a35d2c 100644 --- a/vendor/libgit2/tests/blame/blame_helpers.h +++ b/vendor/libgit2/tests/blame/blame_helpers.h @@ -7,10 +7,8 @@ void check_blame_hunk_index( git_repository *repo, git_blame *blame, int idx, - int start_line, - int len, + size_t start_line, + size_t len, char boundary, const char *commit_id, const char *orig_path); - - diff --git a/vendor/libgit2/tests/blame/simple.c b/vendor/libgit2/tests/blame/simple.c index 83e5e056b..30b78168f 100644 --- a/vendor/libgit2/tests/blame/simple.c +++ b/vendor/libgit2/tests/blame/simple.c @@ -281,6 +281,18 @@ void test_blame_simple__can_restrict_lines_both(void) check_blame_hunk_index(g_repo, g_blame, 2, 6, 2, 0, "63d671eb", "b.txt"); } +void test_blame_simple__can_blame_huge_file(void) +{ + git_blame_options opts = GIT_BLAME_OPTIONS_INIT; + + cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git"))); + + cl_git_pass(git_blame_file(&g_blame, g_repo, "huge.txt", &opts)); + cl_assert_equal_i(2, git_blame_get_hunk_count(g_blame)); + check_blame_hunk_index(g_repo, g_blame, 0, 1, 65536, 0, "4eecfea", "huge.txt"); + check_blame_hunk_index(g_repo, g_blame, 1, 65537, 1, 0, "6653ff4", "huge.txt"); +} + /* * $ git blame -n branch_file.txt be3563a..HEAD * orig line no final line no diff --git a/vendor/libgit2/tests/checkout/checkout_helpers.c b/vendor/libgit2/tests/checkout/checkout_helpers.c index 92a454d12..d7d24f33f 100644 --- a/vendor/libgit2/tests/checkout/checkout_helpers.c +++ b/vendor/libgit2/tests/checkout/checkout_helpers.c @@ -132,8 +132,8 @@ int checkout_count_callback( void tick_index(git_index *index) { - git_time_t ts; - struct timeval times[2]; + struct timespec ts; + struct p_timeval times[2]; cl_assert(index->on_disk); cl_assert(git_index_path(index)); @@ -141,10 +141,10 @@ void tick_index(git_index *index) cl_git_pass(git_index_read(index, true)); ts = index->stamp.mtime; - times[0].tv_sec = ts; - times[0].tv_usec = 0; - times[1].tv_sec = ts + 5; - times[1].tv_usec = 0; + times[0].tv_sec = ts.tv_sec; + times[0].tv_usec = ts.tv_nsec / 1000; + times[1].tv_sec = ts.tv_sec + 5; + times[1].tv_usec = ts.tv_nsec / 1000; cl_git_pass(p_utimes(git_index_path(index), times)); cl_git_pass(git_index_read(index, true)); diff --git a/vendor/libgit2/tests/checkout/crlf.c b/vendor/libgit2/tests/checkout/crlf.c index 8e77d0845..d467eaadd 100644 --- a/vendor/libgit2/tests/checkout/crlf.c +++ b/vendor/libgit2/tests/checkout/crlf.c @@ -278,6 +278,7 @@ void test_checkout_crlf__autocrlf_true_index_size_is_filtered_size(void) void test_checkout_crlf__with_ident(void) { git_index *index; + const git_index_entry *entry; git_blob *blob; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_FORCE; @@ -310,14 +311,14 @@ void test_checkout_crlf__with_ident(void) /* check that blobs have $Id$ */ - cl_git_pass(git_blob_lookup(&blob, g_repo, - & git_index_get_bypath(index, "lf.ident", 0)->id)); + cl_assert((entry = git_index_get_bypath(index, "lf.ident", 0))); + cl_git_pass(git_blob_lookup(&blob, g_repo, &entry->id)); cl_assert_equal_s( ALL_LF_TEXT_RAW "\n$Id$\n", git_blob_rawcontent(blob)); git_blob_free(blob); - cl_git_pass(git_blob_lookup(&blob, g_repo, - & git_index_get_bypath(index, "more2.identcrlf", 0)->id)); + cl_assert((entry = git_index_get_bypath(index, "more2.identcrlf", 0))); + cl_git_pass(git_blob_lookup(&blob, g_repo, &entry->id)); cl_assert_equal_s( "\n$Id$\n" MORE_CRLF_TEXT_AS_LF, git_blob_rawcontent(blob)); git_blob_free(blob); diff --git a/vendor/libgit2/tests/checkout/index.c b/vendor/libgit2/tests/checkout/index.c index 0d220e141..8af3e5684 100644 --- a/vendor/libgit2/tests/checkout/index.c +++ b/vendor/libgit2/tests/checkout/index.c @@ -63,7 +63,7 @@ void test_checkout_index__can_remove_untracked_files(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - git_futils_mkdir("./testrepo/dir/subdir/subsubdir", NULL, 0755, GIT_MKDIR_PATH); + git_futils_mkdir("./testrepo/dir/subdir/subsubdir", 0755, GIT_MKDIR_PATH); cl_git_mkfile("./testrepo/dir/one", "one\n"); cl_git_mkfile("./testrepo/dir/subdir/two", "two\n"); @@ -298,7 +298,7 @@ void test_checkout_index__options_dir_modes(void) /* File-mode test, since we're on the 'dir' branch */ cl_git_pass(p_stat("./testrepo/a/b.txt", &st)); - cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_BLOB_EXECUTABLE, "%07o"); + cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_BLOB_EXECUTABLE & ~um, "%07o"); git_commit_free(commit); } diff --git a/vendor/libgit2/tests/cherrypick/workdir.c b/vendor/libgit2/tests/cherrypick/workdir.c index 787f1f4d4..2b45f5a33 100644 --- a/vendor/libgit2/tests/cherrypick/workdir.c +++ b/vendor/libgit2/tests/cherrypick/workdir.c @@ -300,7 +300,7 @@ void test_cherrypick_workdir__rename(void) { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 0, "file3.txt.renamed" }, }; - opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15"); @@ -335,7 +335,7 @@ void test_cherrypick_workdir__both_renamed(void) { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 2, "file3.txt.renamed_on_branch" }, }; - opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70"); diff --git a/vendor/libgit2/tests/clar_libgit2.c b/vendor/libgit2/tests/clar_libgit2.c index b14af44a9..314d3441e 100644 --- a/vendor/libgit2/tests/clar_libgit2.c +++ b/vendor/libgit2/tests/clar_libgit2.c @@ -58,31 +58,38 @@ void cl_git_rmfile(const char *filename) cl_must_pass(p_unlink(filename)); } -#ifdef GIT_WIN32 - -#include "win32/utf-conv.h" - char *cl_getenv(const char *name) { - wchar_t *wide_name, *wide_value; - char *utf8_value = NULL; - DWORD value_len; + git_buf out = GIT_BUF_INIT; + int error = git__getenv(&out, name); - cl_assert(git__utf8_to_16_alloc(&wide_name, name) >= 0); + cl_assert(error >= 0 || error == GIT_ENOTFOUND); + + if (error == GIT_ENOTFOUND) + return NULL; - value_len = GetEnvironmentVariableW(wide_name, NULL, 0); + if (out.size == 0) { + char *dup = git__strdup(""); + cl_assert(dup); - if (value_len) { - cl_assert(wide_value = git__malloc(value_len * sizeof(wchar_t))); - cl_assert(GetEnvironmentVariableW(wide_name, wide_value, value_len)); - cl_assert(git__utf16_to_8_alloc(&utf8_value, wide_value) >= 0); - git__free(wide_value); + return dup; } - git__free(wide_name); - return utf8_value; + return git_buf_detach(&out); +} + +bool cl_is_env_set(const char *name) +{ + char *env = cl_getenv(name); + bool result = (env != NULL); + git__free(env); + return result; } +#ifdef GIT_WIN32 + +#include "win32/utf-conv.h" + int cl_setenv(const char *name, const char *value) { wchar_t *wide_name, *wide_value = NULL; @@ -138,10 +145,6 @@ int cl_rename(const char *source, const char *dest) #else #include -char *cl_getenv(const char *name) -{ - return getenv(name); -} int cl_setenv(const char *name, const char *value) { @@ -296,6 +299,8 @@ const char* cl_git_path_url(const char *path) in_buf++; } + cl_assert(url_buf.size < 4096); + strncpy(url, git_buf_cstr(&url_buf), 4096); git_buf_free(&url_buf); git_buf_free(&path_buf); @@ -536,14 +541,23 @@ void cl_fake_home(void) void cl_sandbox_set_search_path_defaults(void) { - const char *sandbox_path = clar_sandbox_path(); + git_buf path = GIT_BUF_INIT; + + git_buf_joinpath(&path, clar_sandbox_path(), "__config"); + + if (!git_path_exists(path.ptr)) + cl_must_pass(p_mkdir(path.ptr, 0777)); git_libgit2_opts( - GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, sandbox_path); + GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, path.ptr); git_libgit2_opts( - GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, sandbox_path); + GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr); git_libgit2_opts( - GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, sandbox_path); + GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, path.ptr); + git_libgit2_opts( + GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_PROGRAMDATA, path.ptr); + + git_buf_free(&path); } #ifdef GIT_WIN32 diff --git a/vendor/libgit2/tests/clar_libgit2.h b/vendor/libgit2/tests/clar_libgit2.h index 9ab0da4f6..d7e635302 100644 --- a/vendor/libgit2/tests/clar_libgit2.h +++ b/vendor/libgit2/tests/clar_libgit2.h @@ -119,6 +119,7 @@ bool cl_is_chmod_supported(void); /* Environment wrappers */ char *cl_getenv(const char *name); +bool cl_is_env_set(const char *name); int cl_setenv(const char *name, const char *value); /* Reliable rename */ diff --git a/vendor/libgit2/tests/clar_libgit2_trace.c b/vendor/libgit2/tests/clar_libgit2_trace.c index ae582d1cb..aaeeb7810 100644 --- a/vendor/libgit2/tests/clar_libgit2_trace.c +++ b/vendor/libgit2/tests/clar_libgit2_trace.c @@ -142,9 +142,28 @@ void _cl_trace_cb__event_handler( switch (ev) { case CL_TRACE__SUITE_BEGIN: git_trace(GIT_TRACE_TRACE, "\n\n%s\n%s: Begin Suite", HR, suite_name); +#if 0 && defined(GIT_MSVC_CRTDBG) + git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK, + suite_name); +#endif break; case CL_TRACE__SUITE_END: +#if 0 && defined(GIT_MSVC_CRTDBG) + /* As an example of checkpointing, dump leaks within this suite. + * This may generate false positives for things like the global + * TLS error state and maybe the odb cache since they aren't + * freed until the global shutdown and outside the scope of this + * set of tests. + * + * This may under-report if the test itself uses a checkpoint. + * See tests/trace/windows/stacktrace.c + */ + git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + suite_name); +#endif git_trace(GIT_TRACE_TRACE, "\n\n%s: End Suite\n%s", suite_name, HR); break; diff --git a/vendor/libgit2/tests/clone/nonetwork.c b/vendor/libgit2/tests/clone/nonetwork.c index 44a503818..7ebf19f46 100644 --- a/vendor/libgit2/tests/clone/nonetwork.c +++ b/vendor/libgit2/tests/clone/nonetwork.c @@ -297,16 +297,19 @@ static void assert_correct_reflog(const char *name) { git_reflog *log; const git_reflog_entry *entry; - char expected_log_message[128] = {0}; + git_buf expected_message = GIT_BUF_INIT; - sprintf(expected_log_message, "clone: from %s", cl_git_fixture_url("testrepo.git")); + git_buf_printf(&expected_message, + "clone: from %s", cl_git_fixture_url("testrepo.git")); cl_git_pass(git_reflog_read(&log, g_repo, name)); cl_assert_equal_i(1, git_reflog_entrycount(log)); entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s(expected_log_message, git_reflog_entry_message(entry)); + cl_assert_equal_s(expected_message.ptr, git_reflog_entry_message(entry)); git_reflog_free(log); + + git_buf_free(&expected_message); } void test_clone_nonetwork__clone_updates_reflog_properly(void) diff --git a/vendor/libgit2/tests/commit/commit.c b/vendor/libgit2/tests/commit/commit.c index f5461cfd3..c052cd568 100644 --- a/vendor/libgit2/tests/commit/commit.c +++ b/vendor/libgit2/tests/commit/commit.c @@ -63,6 +63,18 @@ void assert_commit_summary(const char *expected, const char *given) git_commit__free(dummy); } +void assert_commit_body(const char *expected, const char *given) +{ + git_commit *dummy; + + cl_assert(dummy = git__calloc(1, sizeof(struct git_commit))); + + dummy->raw_message = git__strdup(given); + cl_assert_equal_s(expected, git_commit_body(dummy)); + + git_commit__free(dummy); +} + void test_commit_commit__summary(void) { assert_commit_summary("One-liner with no trailing newline", "One-liner with no trailing newline"); @@ -70,14 +82,45 @@ void test_commit_commit__summary(void) assert_commit_summary("Trimmed leading&trailing newlines", "\n\nTrimmed leading&trailing newlines\n\n"); assert_commit_summary("First paragraph only", "\nFirst paragraph only\n\n(There are more!)"); assert_commit_summary("First paragraph with unwrapped trailing\tlines", "\nFirst paragraph\nwith unwrapped\ntrailing\tlines\n\n(Yes, unwrapped!)"); - assert_commit_summary("\tLeading \ttabs", "\tLeading\n\ttabs\n\nis preserved"); - assert_commit_summary(" Leading Spaces", " Leading\n Spaces\n\nare preserved"); + assert_commit_summary("\tLeading tabs", "\tLeading\n\ttabs\n\nare preserved"); /* tabs around newlines are collapsed down to a single space */ + assert_commit_summary(" Leading Spaces", " Leading\n Spaces\n\nare preserved"); /* spaces around newlines are collapsed down to a single space */ assert_commit_summary("Trailing tabs\tare removed", "Trailing tabs\tare removed\t\t"); assert_commit_summary("Trailing spaces are removed", "Trailing spaces are removed "); assert_commit_summary("Trailing tabs", "Trailing tabs\t\n\nare removed"); assert_commit_summary("Trailing spaces", "Trailing spaces \n\nare removed"); + assert_commit_summary("Newlines are replaced by spaces", "Newlines\nare\nreplaced by spaces\n"); + assert_commit_summary(" Spaces after newlines are collapsed", "\n Spaces after newlines\n are\n collapsed\n "); /* newlines at the very beginning are ignored and not collapsed */ + assert_commit_summary(" Spaces before newlines are collapsed", " \nSpaces before newlines \nare \ncollapsed \n"); + assert_commit_summary(" Spaces around newlines are collapsed", " \n Spaces around newlines \n are \n collapsed \n "); + assert_commit_summary(" Trailing newlines are" , " \n Trailing newlines \n are \n\n collapsed \n "); + assert_commit_summary(" Trailing spaces are stripped", " \n Trailing spaces \n are stripped \n\n \n \t "); assert_commit_summary("", ""); assert_commit_summary("", " "); assert_commit_summary("", "\n"); assert_commit_summary("", "\n \n"); } + +void test_commit_commit__body(void) +{ + assert_commit_body(NULL, "One-liner with no trailing newline"); + assert_commit_body(NULL, "One-liner with trailing newline\n"); + assert_commit_body(NULL, "\n\nTrimmed leading&trailing newlines\n\n"); + assert_commit_body("(There are more!)", "\nFirst paragraph only\n\n(There are more!)"); + assert_commit_body("(Yes, unwrapped!)", "\nFirst paragraph\nwith unwrapped\ntrailing\tlines\n\n(Yes, unwrapped!)"); + assert_commit_body("are preserved", "\tLeading\n\ttabs\n\nare preserved"); /* tabs around newlines are collapsed down to a single space */ + assert_commit_body("are preserved", " Leading\n Spaces\n\nare preserved"); /* spaces around newlines are collapsed down to a single space */ + assert_commit_body(NULL, "Trailing tabs\tare removed\t\t"); + assert_commit_body(NULL, "Trailing spaces are removed "); + assert_commit_body("are removed", "Trailing tabs\t\n\nare removed"); + assert_commit_body("are removed", "Trailing spaces \n\nare removed"); + assert_commit_body(NULL,"Newlines\nare\nreplaced by spaces\n"); + assert_commit_body(NULL , "\n Spaces after newlines\n are\n collapsed\n "); /* newlines at the very beginning are ignored and not collapsed */ + assert_commit_body(NULL , " \nSpaces before newlines \nare \ncollapsed \n"); + assert_commit_body(NULL , " \n Spaces around newlines \n are \n collapsed \n "); + assert_commit_body("collapsed" , " \n Trailing newlines \n are \n\n collapsed \n "); + assert_commit_body(NULL, " \n Trailing spaces \n are stripped \n\n \n \t "); + assert_commit_body(NULL , ""); + assert_commit_body(NULL , " "); + assert_commit_body(NULL , "\n"); + assert_commit_body(NULL , "\n \n"); +} diff --git a/vendor/libgit2/tests/commit/parse.c b/vendor/libgit2/tests/commit/parse.c index 388da078a..297fccc6b 100644 --- a/vendor/libgit2/tests/commit/parse.c +++ b/vendor/libgit2/tests/commit/parse.c @@ -443,16 +443,111 @@ cpxtDQQMGYFpXK/71stq\n\ cl_git_pass(parse_commit(&commit, passing_commit_cases[4])); + cl_git_pass(git_commit_header_field(&buf, commit, "tree")); + cl_assert_equal_s("6b79e22d69bf46e289df0345a14ca059dfc9bdf6", buf.ptr); + git_buf_clear(&buf); + cl_git_pass(git_commit_header_field(&buf, commit, "parent")); cl_assert_equal_s("34734e478d6cf50c27c9d69026d93974d052c454", buf.ptr); git_buf_clear(&buf); cl_git_pass(git_commit_header_field(&buf, commit, "gpgsig")); cl_assert_equal_s(gpgsig, buf.ptr); + git_buf_clear(&buf); cl_git_fail_with(GIT_ENOTFOUND, git_commit_header_field(&buf, commit, "awesomeness")); cl_git_fail_with(GIT_ENOTFOUND, git_commit_header_field(&buf, commit, "par")); + git_commit__free(commit); + cl_git_pass(parse_commit(&commit, passing_commit_cases[0])); + + cl_git_pass(git_commit_header_field(&buf, commit, "committer")); + cl_assert_equal_s("Vicent Marti 1273848544 +0200", buf.ptr); + git_buf_free(&buf); git_commit__free(commit); } + +void test_commit_parse__extract_signature(void) +{ + git_odb *odb; + git_oid commit_id; + git_buf signature = GIT_BUF_INIT, signed_data = GIT_BUF_INIT; + const char *gpgsig = "-----BEGIN PGP SIGNATURE-----\n\ +Version: GnuPG v1.4.12 (Darwin)\n\ +\n\ +iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n\ +o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n\ +JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n\ +AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n\ +SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n\ +who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n\ +6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n\ +cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n\ +c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n\ +ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n\ +7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n\ +cpxtDQQMGYFpXK/71stq\n\ +=ozeK\n\ +-----END PGP SIGNATURE-----"; + + const char *data = "tree 6b79e22d69bf46e289df0345a14ca059dfc9bdf6\n\ +parent 34734e478d6cf50c27c9d69026d93974d052c454\n\ +author Ben Burkert 1358451456 -0800\n\ +committer Ben Burkert 1358451456 -0800\n\ +\n\ +a simple commit which works\n"; + + const char *oneline_signature = "tree 51832e6397b30309c8bcad9c55fa6ae67778f378\n\ +parent a1b6decaaac768b5e01e1b5dbf5b2cc081bed1eb\n\ +author Some User 1454537944 -0700\n\ +committer Some User 1454537944 -0700\n\ +gpgsig bad\n\ +\n\ +corrupt signature\n"; + + const char *oneline_data = "tree 51832e6397b30309c8bcad9c55fa6ae67778f378\n\ +parent a1b6decaaac768b5e01e1b5dbf5b2cc081bed1eb\n\ +author Some User 1454537944 -0700\n\ +committer Some User 1454537944 -0700\n\ +\n\ +corrupt signature\n"; + + + cl_git_pass(git_repository_odb__weakptr(&odb, g_repo)); + cl_git_pass(git_odb_write(&commit_id, odb, passing_commit_cases[4], strlen(passing_commit_cases[4]), GIT_OBJ_COMMIT)); + + cl_git_pass(git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, NULL)); + cl_assert_equal_s(gpgsig, signature.ptr); + cl_assert_equal_s(data, signed_data.ptr); + + git_buf_clear(&signature); + git_buf_clear(&signed_data); + + cl_git_pass(git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, "gpgsig")); + cl_assert_equal_s(gpgsig, signature.ptr); + cl_assert_equal_s(data, signed_data.ptr); + + /* Try to parse a tree */ + cl_git_pass(git_oid_fromstr(&commit_id, "45dd856fdd4d89b884c340ba0e047752d9b085d6")); + cl_git_fail_with(GIT_ENOTFOUND, git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, NULL)); + cl_assert_equal_i(GITERR_INVALID, giterr_last()->klass); + + /* Try to parse an unsigned commit */ + cl_git_pass(git_odb_write(&commit_id, odb, passing_commit_cases[1], strlen(passing_commit_cases[1]), GIT_OBJ_COMMIT)); + cl_git_fail_with(GIT_ENOTFOUND, git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, NULL)); + cl_assert_equal_i(GITERR_OBJECT, giterr_last()->klass); + + /* Parse the commit with a single-line signature */ + git_buf_clear(&signature); + git_buf_clear(&signed_data); + cl_git_pass(git_odb_write(&commit_id, odb, oneline_signature, strlen(oneline_signature), GIT_OBJ_COMMIT)); + cl_git_pass(git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, NULL)); + cl_assert_equal_s("bad", signature.ptr); + cl_assert_equal_s(oneline_data, signed_data.ptr); + + + git_buf_free(&signature); + git_buf_free(&signed_data); + +} diff --git a/vendor/libgit2/tests/commit/write.c b/vendor/libgit2/tests/commit/write.c index ee9eb8237..96b7cc321 100644 --- a/vendor/libgit2/tests/commit/write.c +++ b/vendor/libgit2/tests/commit/write.c @@ -1,14 +1,16 @@ #include "clar_libgit2.h" +#include "git2/sys/commit.h" static const char *committer_name = "Vicent Marti"; static const char *committer_email = "vicent@github.com"; static const char *commit_message = "This commit has been created in memory\n\ This is a commit created in memory and it will be written back to disk\n"; -static const char *tree_oid = "1810dff58d8a660512d4832e740f692884338ccd"; +static const char *tree_id_str = "1810dff58d8a660512d4832e740f692884338ccd"; +static const char *parent_id_str = "8496071c1b46c854b31185ea97743be6a8774479"; static const char *root_commit_message = "This is a root commit\n\ This is a root commit and should be the only one in this branch\n"; static const char *root_reflog_message = "commit (initial): This is a root commit \ - This is a root commit and should be the only one in this branch"; +This is a root commit and should be the only one in this branch"; static char *head_old; static git_reference *head, *branch; static git_commit *commit; @@ -35,6 +37,8 @@ void test_commit_write__cleanup(void) head_old = NULL; cl_git_sandbox_cleanup(); + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1)); } @@ -46,12 +50,11 @@ void test_commit_write__from_memory(void) const git_signature *author1, *committer1; git_commit *parent; git_tree *tree; - const char *commit_id_str = "8496071c1b46c854b31185ea97743be6a8774479"; - git_oid_fromstr(&tree_id, tree_oid); + git_oid_fromstr(&tree_id, tree_id_str); cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); - git_oid_fromstr(&parent_id, commit_id_str); + git_oid_fromstr(&parent_id, parent_id_str); cl_git_pass(git_commit_lookup(&parent, g_repo, &parent_id)); /* create signatures */ @@ -106,7 +109,7 @@ void test_commit_write__root(void) git_reflog *log; const git_reflog_entry *entry; - git_oid_fromstr(&tree_id, tree_oid); + git_oid_fromstr(&tree_id, tree_id_str); cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); /* create signatures */ @@ -158,3 +161,101 @@ void test_commit_write__root(void) git_signature_free(committer); git_reflog_free(log); } + +static int create_commit_from_ids( + git_oid *result, + const git_oid *tree_id, + const git_oid *parent_id) +{ + git_signature *author, *committer; + const git_oid *parent_ids[1]; + int ret; + + cl_git_pass(git_signature_new( + &committer, committer_name, committer_email, 123456789, 60)); + cl_git_pass(git_signature_new( + &author, committer_name, committer_email, 987654321, 90)); + + parent_ids[0] = parent_id; + + ret = git_commit_create_from_ids( + result, + g_repo, + NULL, + author, + committer, + NULL, + root_commit_message, + tree_id, + 1, + parent_ids); + + git_signature_free(committer); + git_signature_free(author); + + return ret; +} + +void test_commit_write__can_write_invalid_objects(void) +{ + git_oid expected_id, tree_id, parent_id, commit_id; + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0)); + + /* this is a valid tree and parent */ + git_oid_fromstr(&tree_id, tree_id_str); + git_oid_fromstr(&parent_id, parent_id_str); + + git_oid_fromstr(&expected_id, "c8571bbec3a72c4bcad31648902e5a453f1adece"); + cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + cl_assert_equal_oid(&expected_id, &commit_id); + + /* this is a wholly invented tree id */ + git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890"); + git_oid_fromstr(&parent_id, parent_id_str); + + git_oid_fromstr(&expected_id, "996008340b8e68d69bf3c28d7c57fb7ec3c8e202"); + cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + cl_assert_equal_oid(&expected_id, &commit_id); + + /* this is a wholly invented parent id */ + git_oid_fromstr(&tree_id, tree_id_str); + git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890"); + + git_oid_fromstr(&expected_id, "d78f660cab89d9791ca6714b57978bf2a7e709fd"); + cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + cl_assert_equal_oid(&expected_id, &commit_id); + + /* these are legitimate objects, but of the wrong type */ + git_oid_fromstr(&tree_id, parent_id_str); + git_oid_fromstr(&parent_id, tree_id_str); + + git_oid_fromstr(&expected_id, "5d80c07414e3f18792949699dfcacadf7748f361"); + cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + cl_assert_equal_oid(&expected_id, &commit_id); +} + +void test_commit_write__can_validate_objects(void) +{ + git_oid tree_id, parent_id, commit_id; + + /* this is a valid tree and parent */ + git_oid_fromstr(&tree_id, tree_id_str); + git_oid_fromstr(&parent_id, parent_id_str); + cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + + /* this is a wholly invented tree id */ + git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890"); + git_oid_fromstr(&parent_id, parent_id_str); + cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + + /* this is a wholly invented parent id */ + git_oid_fromstr(&tree_id, tree_id_str); + git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890"); + cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); + + /* these are legitimate objects, but of the wrong type */ + git_oid_fromstr(&tree_id, parent_id_str); + git_oid_fromstr(&parent_id, tree_id_str); + cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id)); +} diff --git a/vendor/libgit2/tests/config/global.c b/vendor/libgit2/tests/config/global.c index 4481308d6..a149dc0be 100644 --- a/vendor/libgit2/tests/config/global.c +++ b/vendor/libgit2/tests/config/global.c @@ -6,17 +6,17 @@ void test_config_global__initialize(void) { git_buf path = GIT_BUF_INIT; - cl_git_pass(git_futils_mkdir_r("home", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("home", 0777)); cl_git_pass(git_path_prettify(&path, "home", NULL)); cl_git_pass(git_libgit2_opts( GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, path.ptr)); - cl_git_pass(git_futils_mkdir_r("xdg/git", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("xdg/git", 0777)); cl_git_pass(git_path_prettify(&path, "xdg/git", NULL)); cl_git_pass(git_libgit2_opts( GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr)); - cl_git_pass(git_futils_mkdir_r("etc", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("etc", 0777)); cl_git_pass(git_path_prettify(&path, "etc", NULL)); cl_git_pass(git_libgit2_opts( GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, path.ptr)); @@ -65,3 +65,45 @@ void test_config_global__open_xdg(void) git_config_free(xdg); git_config_free(cfg); } + +void test_config_global__open_programdata(void) +{ + git_config *cfg; + git_repository *repo; + git_buf config_path = GIT_BUF_INIT; + git_buf var_contents = GIT_BUF_INIT; + + if (cl_is_env_set("GITTEST_INVASIVE_FS_STRUCTURE")) + cl_skip(); + + cl_git_pass(git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, + GIT_CONFIG_LEVEL_PROGRAMDATA, &config_path)); + + if (!git_path_isdir(config_path.ptr)) + cl_git_pass(p_mkdir(config_path.ptr, 0777)); + + cl_git_pass(git_buf_puts(&config_path, "/config")); + + cl_git_pass(git_config_open_ondisk(&cfg, config_path.ptr)); + cl_git_pass(git_config_set_string(cfg, "programdata.var", "even higher level")); + + git_buf_free(&config_path); + git_config_free(cfg); + + git_config_open_default(&cfg); + cl_git_pass(git_config_get_string_buf(&var_contents, cfg, "programdata.var")); + cl_assert_equal_s("even higher level", var_contents.ptr); + + git_config_free(cfg); + git_buf_free(&var_contents); + + cl_git_pass(git_repository_init(&repo, "./foo.git", true)); + cl_git_pass(git_repository_config(&cfg, repo)); + cl_git_pass(git_config_get_string_buf(&var_contents, cfg, "programdata.var")); + cl_assert_equal_s("even higher level", var_contents.ptr); + + git_config_free(cfg); + git_buf_free(&var_contents); + git_repository_free(repo); + cl_fixture_cleanup("./foo.git"); +} diff --git a/vendor/libgit2/tests/config/multivar.c b/vendor/libgit2/tests/config/multivar.c index 015008992..d1b8c4cda 100644 --- a/vendor/libgit2/tests/config/multivar.c +++ b/vendor/libgit2/tests/config/multivar.c @@ -163,7 +163,7 @@ void test_config_multivar__add_new(void) cl_git_pass(git_config_open_ondisk(&cfg, "config/config11")); - cl_git_pass(git_config_set_multivar(cfg, var, "", "variable")); + cl_git_pass(git_config_set_multivar(cfg, var, "$^", "variable")); n = 0; cl_git_pass(git_config_get_multivar_foreach(cfg, var, NULL, cb, &n)); cl_assert_equal_i(n, 1); diff --git a/vendor/libgit2/tests/config/stress.c b/vendor/libgit2/tests/config/stress.c index 503f44f03..a6b665590 100644 --- a/vendor/libgit2/tests/config/stress.c +++ b/vendor/libgit2/tests/config/stress.c @@ -107,3 +107,26 @@ void test_config_stress__complex(void) git_config_free(config); } + +void test_config_stress__quick_write(void) +{ + git_config *config_w, *config_r; + const char *path = "./config-quick-write"; + const char *key = "quick.write"; + int32_t i; + + /* Create an external writer for one instance with the other one */ + cl_git_pass(git_config_open_ondisk(&config_w, path)); + cl_git_pass(git_config_open_ondisk(&config_r, path)); + + /* Write and read in the same second (repeat to increase the chance of it happening) */ + for (i = 0; i < 10; i++) { + int32_t val; + cl_git_pass(git_config_set_int32(config_w, key, i)); + cl_git_pass(git_config_get_int32(&val, config_r, key)); + cl_assert_equal_i(i, val); + } + + git_config_free(config_r); + git_config_free(config_w); +} diff --git a/vendor/libgit2/tests/config/write.c b/vendor/libgit2/tests/config/write.c index 2e7b8182a..56ef2e9fb 100644 --- a/vendor/libgit2/tests/config/write.c +++ b/vendor/libgit2/tests/config/write.c @@ -1,6 +1,9 @@ #include "clar_libgit2.h" #include "buffer.h" #include "fileops.h" +#include "git2/sys/config.h" +#include "config_file.h" +#include "config.h" void test_config_write__initialize(void) { @@ -527,6 +530,9 @@ void test_config_write__outside_change(void) git_config_free(cfg); } +#define FOO_COMMENT \ + "; another comment!\n" + #define SECTION_FOO \ "\n" \ " \n" \ @@ -534,7 +540,8 @@ void test_config_write__outside_change(void) " # here's a comment\n" \ "\tname = \"value\"\n" \ " name2 = \"value2\"\n" \ - "; another comment!\n" + +#define SECTION_FOO_WITH_COMMENT SECTION_FOO FOO_COMMENT #define SECTION_BAR \ "[section \"bar\"]\t\n" \ @@ -550,7 +557,7 @@ void test_config_write__preserves_whitespace_and_comments(void) git_buf newfile = GIT_BUF_INIT; /* This config can occur after removing and re-adding the origin remote */ - const char *file_content = SECTION_FOO SECTION_BAR; + const char *file_content = SECTION_FOO_WITH_COMMENT SECTION_BAR; /* Write the test config and make sure the expected entry exists */ cl_git_mkfile(file_name, file_content); @@ -564,9 +571,10 @@ void test_config_write__preserves_whitespace_and_comments(void) cl_assert_equal_strn(SECTION_FOO, n, strlen(SECTION_FOO)); n += strlen(SECTION_FOO); - cl_assert_equal_strn("\tother = otherval\n", n, strlen("\tother = otherval\n")); n += strlen("\tother = otherval\n"); + cl_assert_equal_strn(FOO_COMMENT, n, strlen(FOO_COMMENT)); + n += strlen(FOO_COMMENT); cl_assert_equal_strn(SECTION_BAR, n, strlen(SECTION_BAR)); n += strlen(SECTION_BAR); @@ -630,3 +638,87 @@ void test_config_write__to_file_with_only_comment(void) git_buf_free(&result); } +void test_config_write__locking(void) +{ + git_config *cfg, *cfg2; + git_config_entry *entry; + git_transaction *tx; + const char *filename = "locked-file"; + + /* Open the config and lock it */ + cl_git_mkfile(filename, "[section]\n\tname = value\n"); + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + cl_git_pass(git_config_get_entry(&entry, cfg, "section.name")); + cl_assert_equal_s("value", entry->value); + git_config_entry_free(entry); + cl_git_pass(git_config_lock(&tx, cfg)); + + /* Change entries in the locked backend */ + cl_git_pass(git_config_set_string(cfg, "section.name", "other value")); + cl_git_pass(git_config_set_string(cfg, "section2.name3", "more value")); + + /* We can see that the file we read from hasn't changed */ + cl_git_pass(git_config_open_ondisk(&cfg2, filename)); + cl_git_pass(git_config_get_entry(&entry, cfg2, "section.name")); + cl_assert_equal_s("value", entry->value); + git_config_entry_free(entry); + cl_git_fail_with(GIT_ENOTFOUND, git_config_get_entry(&entry, cfg2, "section2.name3")); + git_config_free(cfg2); + + /* And we also get the old view when we read from the locked config */ + cl_git_pass(git_config_get_entry(&entry, cfg, "section.name")); + cl_assert_equal_s("value", entry->value); + git_config_entry_free(entry); + cl_git_fail_with(GIT_ENOTFOUND, git_config_get_entry(&entry, cfg, "section2.name3")); + + cl_git_pass(git_transaction_commit(tx)); + git_transaction_free(tx); + + /* Now that we've unlocked it, we should see both updates */ + cl_git_pass(git_config_get_entry(&entry, cfg, "section.name")); + cl_assert_equal_s("other value", entry->value); + git_config_entry_free(entry); + cl_git_pass(git_config_get_entry(&entry, cfg, "section2.name3")); + cl_assert_equal_s("more value", entry->value); + git_config_entry_free(entry); + + git_config_free(cfg); + + /* We should also see the changes after reopening the config */ + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + cl_git_pass(git_config_get_entry(&entry, cfg, "section.name")); + cl_assert_equal_s("other value", entry->value); + git_config_entry_free(entry); + cl_git_pass(git_config_get_entry(&entry, cfg, "section2.name3")); + cl_assert_equal_s("more value", entry->value); + git_config_entry_free(entry); + + git_config_free(cfg); +} + +void test_config_write__repeated(void) +{ + const char *filename = "config-repeated"; + git_config *cfg; + git_buf result = GIT_BUF_INIT; + const char *expected = "[sample \"prefix\"]\n\ +\tsetting1 = someValue1\n\ +\tsetting2 = someValue2\n\ +\tsetting3 = someValue3\n\ +\tsetting4 = someValue4\n\ +"; + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + cl_git_pass(git_config_set_string(cfg, "sample.prefix.setting1", "someValue1")); + cl_git_pass(git_config_set_string(cfg, "sample.prefix.setting2", "someValue2")); + cl_git_pass(git_config_set_string(cfg, "sample.prefix.setting3", "someValue3")); + cl_git_pass(git_config_set_string(cfg, "sample.prefix.setting4", "someValue4")); + git_config_free(cfg); + + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + + cl_git_pass(git_futils_readbuffer(&result, filename)); + cl_assert_equal_s(expected, result.ptr); + git_buf_free(&result); + + git_config_free(cfg); +} diff --git a/vendor/libgit2/tests/core/array.c b/vendor/libgit2/tests/core/array.c new file mode 100644 index 000000000..8e626a506 --- /dev/null +++ b/vendor/libgit2/tests/core/array.c @@ -0,0 +1,57 @@ +#include "clar_libgit2.h" +#include "array.h" + +static int int_lookup(const void *k, const void *a) +{ + const int *one = (const int *)k; + int *two = (int *)a; + + return *one - *two; +} + +#define expect_pos(k, n, ret) \ + key = (k); \ + cl_assert_equal_i((ret), \ + git_array_search(&p, integers, int_lookup, &key)); \ + cl_assert_equal_i((n), p); + +void test_core_array__bsearch2(void) +{ + git_array_t(int) integers = GIT_ARRAY_INIT; + int *i, key; + size_t p; + + i = git_array_alloc(integers); *i = 2; + i = git_array_alloc(integers); *i = 3; + i = git_array_alloc(integers); *i = 5; + i = git_array_alloc(integers); *i = 7; + i = git_array_alloc(integers); *i = 7; + i = git_array_alloc(integers); *i = 8; + i = git_array_alloc(integers); *i = 13; + i = git_array_alloc(integers); *i = 21; + i = git_array_alloc(integers); *i = 25; + i = git_array_alloc(integers); *i = 42; + i = git_array_alloc(integers); *i = 69; + i = git_array_alloc(integers); *i = 121; + i = git_array_alloc(integers); *i = 256; + i = git_array_alloc(integers); *i = 512; + i = git_array_alloc(integers); *i = 513; + i = git_array_alloc(integers); *i = 514; + i = git_array_alloc(integers); *i = 516; + i = git_array_alloc(integers); *i = 516; + i = git_array_alloc(integers); *i = 517; + + /* value to search for, expected position, return code */ + expect_pos(3, 1, GIT_OK); + expect_pos(2, 0, GIT_OK); + expect_pos(1, 0, GIT_ENOTFOUND); + expect_pos(25, 8, GIT_OK); + expect_pos(26, 9, GIT_ENOTFOUND); + expect_pos(42, 9, GIT_OK); + expect_pos(50, 10, GIT_ENOTFOUND); + expect_pos(68, 10, GIT_ENOTFOUND); + expect_pos(256, 12, GIT_OK); + + git_array_clear(integers); +} + diff --git a/vendor/libgit2/tests/core/buffer.c b/vendor/libgit2/tests/core/buffer.c index 0e7026a9c..9872af7f4 100644 --- a/vendor/libgit2/tests/core/buffer.c +++ b/vendor/libgit2/tests/core/buffer.c @@ -929,7 +929,7 @@ void test_core_buffer__similarity_metric(void) cl_git_pass(git_buf_sets(&buf, SIMILARITY_TEST_DATA_1)); cl_git_pass(git_hashsig_create(&a, buf.ptr, buf.size, GIT_HASHSIG_NORMAL)); - cl_git_pass(git_futils_mkdir("scratch", NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("scratch", 0755, GIT_MKDIR_PATH)); cl_git_mkfile("scratch/testdata", SIMILARITY_TEST_DATA_1); cl_git_pass(git_hashsig_create_fromfile( &b, "scratch/testdata", GIT_HASHSIG_NORMAL)); diff --git a/vendor/libgit2/tests/core/copy.c b/vendor/libgit2/tests/core/copy.c index 04b2dfab5..967748cc5 100644 --- a/vendor/libgit2/tests/core/copy.c +++ b/vendor/libgit2/tests/core/copy.c @@ -25,7 +25,7 @@ void test_core_copy__file_in_dir(void) struct stat st; const char *content = "This is some other stuff to copy\n"; - cl_git_pass(git_futils_mkdir("an_dir/in_a_dir", NULL, 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("an_dir/in_a_dir", 0775, GIT_MKDIR_PATH)); cl_git_mkfile("an_dir/in_a_dir/copy_me", content); cl_assert(git_path_isdir("an_dir")); @@ -60,9 +60,9 @@ void test_core_copy__tree(void) struct stat st; const char *content = "File content\n"; - cl_git_pass(git_futils_mkdir("src/b", NULL, 0775, GIT_MKDIR_PATH)); - cl_git_pass(git_futils_mkdir("src/c/d", NULL, 0775, GIT_MKDIR_PATH)); - cl_git_pass(git_futils_mkdir("src/c/e", NULL, 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("src/b", 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("src/c/d", 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("src/c/e", 0775, GIT_MKDIR_PATH)); cl_git_mkfile("src/f1", content); cl_git_mkfile("src/b/f2", content); diff --git a/vendor/libgit2/tests/core/dirent.c b/vendor/libgit2/tests/core/dirent.c index d95e44196..2bd60269d 100644 --- a/vendor/libgit2/tests/core/dirent.c +++ b/vendor/libgit2/tests/core/dirent.c @@ -275,3 +275,32 @@ void test_core_dirent__diriter_with_fullname(void) check_counts(&sub); } + +void test_core_dirent__diriter_at_directory_root(void) +{ + git_path_diriter diriter = GIT_PATH_DIRITER_INIT; + const char *sandbox_path, *path; + char *root_path; + size_t path_len; + int root_offset, error; + + sandbox_path = clar_sandbox_path(); + cl_assert((root_offset = git_path_root(sandbox_path)) >= 0); + + cl_assert(root_path = git__calloc(1, root_offset + 2)); + strncpy(root_path, sandbox_path, root_offset + 1); + + cl_git_pass(git_path_diriter_init(&diriter, root_path, 0)); + + while ((error = git_path_diriter_next(&diriter)) == 0) { + cl_git_pass(git_path_diriter_fullpath(&path, &path_len, &diriter)); + + cl_assert(path_len > (size_t)(root_offset + 1)); + cl_assert(path[root_offset+1] != '/'); + } + + cl_assert_equal_i(error, GIT_ITEROVER); + + git_path_diriter_free(&diriter); + git__free(root_path); +} diff --git a/vendor/libgit2/tests/core/env.c b/vendor/libgit2/tests/core/env.c index 293b786db..ee08258a6 100644 --- a/vendor/libgit2/tests/core/env.c +++ b/vendor/libgit2/tests/core/env.c @@ -30,14 +30,8 @@ static char *home_values[] = { void test_core_env__initialize(void) { int i; - for (i = 0; i < NUM_VARS; ++i) { - const char *original = cl_getenv(env_vars[i]); -#ifdef GIT_WIN32 - env_save[i] = (char *)original; -#else - env_save[i] = original ? git__strdup(original) : NULL; -#endif - } + for (i = 0; i < NUM_VARS; ++i) + env_save[i] = cl_getenv(env_vars[i]); } static void set_global_search_path_from_env(void) @@ -77,12 +71,14 @@ static void setenv_and_check(const char *name, const char *value) char *check; cl_git_pass(cl_setenv(name, value)); - check = cl_getenv(name); - cl_assert_equal_s(value, check); -#ifdef GIT_WIN32 + + if (value) + cl_assert_equal_s(value, check); + else + cl_assert(check == NULL); + git__free(check); -#endif } void test_core_env__0(void) diff --git a/vendor/libgit2/tests/core/errors.c b/vendor/libgit2/tests/core/errors.c index a06ec4abc..ab18951a6 100644 --- a/vendor/libgit2/tests/core/errors.c +++ b/vendor/libgit2/tests/core/errors.c @@ -93,23 +93,69 @@ void test_core_errors__restore(void) giterr_clear(); cl_assert(giterr_last() == NULL); - cl_assert_equal_i(0, giterr_capture(&err_state, 0)); + cl_assert_equal_i(0, giterr_state_capture(&err_state, 0)); memset(&err_state, 0x0, sizeof(git_error_state)); giterr_set(42, "Foo: %s", "bar"); - cl_assert_equal_i(-1, giterr_capture(&err_state, -1)); + cl_assert_equal_i(-1, giterr_state_capture(&err_state, -1)); cl_assert(giterr_last() == NULL); giterr_set(99, "Bar: %s", "foo"); - giterr_restore(&err_state); + giterr_state_restore(&err_state); cl_assert_equal_i(42, giterr_last()->klass); cl_assert_equal_s("Foo: bar", giterr_last()->message); } +void test_core_errors__free_state(void) +{ + git_error_state err_state = {0}; + + giterr_clear(); + + giterr_set(42, "Foo: %s", "bar"); + cl_assert_equal_i(-1, giterr_state_capture(&err_state, -1)); + + giterr_set(99, "Bar: %s", "foo"); + + giterr_state_free(&err_state); + + cl_assert_equal_i(99, giterr_last()->klass); + cl_assert_equal_s("Bar: foo", giterr_last()->message); + + giterr_state_restore(&err_state); + + cl_assert(giterr_last() == NULL); +} + +void test_core_errors__restore_oom(void) +{ + git_error_state err_state = {0}; + const git_error *oom_error = NULL; + + giterr_clear(); + + giterr_set_oom(); /* internal fn */ + oom_error = giterr_last(); + cl_assert(oom_error); + + cl_assert_equal_i(-1, giterr_state_capture(&err_state, -1)); + + cl_assert(giterr_last() == NULL); + cl_assert_equal_i(GITERR_NOMEMORY, err_state.error_msg.klass); + cl_assert_equal_s("Out of memory", err_state.error_msg.message); + + giterr_state_restore(&err_state); + + cl_assert(giterr_last()->klass == GITERR_NOMEMORY); + cl_assert_(giterr_last() == oom_error, "static oom error not restored"); + + giterr_clear(); +} + static int test_arraysize_multiply(size_t nelem, size_t size) { size_t out; diff --git a/vendor/libgit2/tests/core/features.c b/vendor/libgit2/tests/core/features.c index 5eeb05e81..85cddfeff 100644 --- a/vendor/libgit2/tests/core/features.c +++ b/vendor/libgit2/tests/core/features.c @@ -28,4 +28,10 @@ void test_core_features__0(void) #else cl_assert((caps & GIT_FEATURE_SSH) == 0); #endif + +#if defined(GIT_USE_NSEC) + cl_assert((caps & GIT_FEATURE_NSEC) != 0); +#else + cl_assert((caps & GIT_FEATURE_NSEC) == 0); +#endif } diff --git a/vendor/libgit2/tests/core/filebuf.c b/vendor/libgit2/tests/core/filebuf.c index 39d98ff7e..04a380b20 100644 --- a/vendor/libgit2/tests/core/filebuf.c +++ b/vendor/libgit2/tests/core/filebuf.c @@ -204,3 +204,38 @@ void test_core_filebuf__symlink_depth(void) cl_git_pass(git_futils_rmdir_r(dir, NULL, GIT_RMDIR_REMOVE_FILES)); } + +void test_core_filebuf__hidden_file(void) +{ +#ifndef GIT_WIN32 + cl_skip(); +#else + git_filebuf file = GIT_FILEBUF_INIT; + char *dir = "hidden", *test = "hidden/test"; + bool hidden; + + cl_git_pass(p_mkdir(dir, 0666)); + cl_git_mkfile(test, "dummy content"); + + cl_git_pass(git_win32__set_hidden(test, true)); + cl_git_pass(git_win32__hidden(&hidden, test)); + cl_assert(hidden); + + cl_git_pass(git_filebuf_open(&file, test, 0, 0666)); + + cl_git_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks")); + + cl_git_pass(git_filebuf_commit(&file)); + + git_filebuf_cleanup(&file); +#endif +} + +void test_core_filebuf__detects_directory(void) +{ + git_filebuf file = GIT_FILEBUF_INIT; + + cl_must_pass(p_mkdir("foo", 0777)); + cl_git_fail_with(GIT_EDIRECTORY, git_filebuf_open(&file, "foo", 0, 0666)); + cl_must_pass(p_rmdir("foo")); +} diff --git a/vendor/libgit2/tests/core/ftruncate.c b/vendor/libgit2/tests/core/ftruncate.c index 21981d677..2f4729fc2 100644 --- a/vendor/libgit2/tests/core/ftruncate.c +++ b/vendor/libgit2/tests/core/ftruncate.c @@ -10,7 +10,7 @@ static int fd = -1; void test_core_ftruncate__initialize(void) { - if (!cl_getenv("GITTEST_INVASIVE_FS_SIZE")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) cl_skip(); cl_must_pass((fd = p_open(filename, O_CREAT | O_RDWR, 0644))); diff --git a/vendor/libgit2/tests/core/futils.c b/vendor/libgit2/tests/core/futils.c new file mode 100644 index 000000000..e7f7154ed --- /dev/null +++ b/vendor/libgit2/tests/core/futils.c @@ -0,0 +1,68 @@ +#include "clar_libgit2.h" +#include "fileops.h" + +// Fixture setup and teardown +void test_core_futils__initialize(void) +{ + cl_must_pass(p_mkdir("futils", 0777)); +} + +void test_core_futils__cleanup(void) +{ + cl_fixture_cleanup("futils"); +} + +void test_core_futils__writebuffer(void) +{ + git_buf out = GIT_BUF_INIT, + append = GIT_BUF_INIT; + + /* create a new file */ + git_buf_puts(&out, "hello!\n"); + git_buf_printf(&out, "this is a %s\n", "test"); + + cl_git_pass(git_futils_writebuffer(&out, "futils/test-file", O_RDWR|O_CREAT, 0666)); + + cl_assert_equal_file(out.ptr, out.size, "futils/test-file"); + + /* append some more data */ + git_buf_puts(&append, "And some more!\n"); + git_buf_put(&out, append.ptr, append.size); + + cl_git_pass(git_futils_writebuffer(&append, "futils/test-file", O_RDWR|O_APPEND, 0666)); + + cl_assert_equal_file(out.ptr, out.size, "futils/test-file"); + + git_buf_free(&out); + git_buf_free(&append); +} + +void test_core_futils__write_hidden_file(void) +{ +#ifndef GIT_WIN32 + cl_skip(); +#else + git_buf out = GIT_BUF_INIT, append = GIT_BUF_INIT; + bool hidden; + + git_buf_puts(&out, "hidden file.\n"); + git_futils_writebuffer(&out, "futils/test-file", O_RDWR | O_CREAT, 0666); + + cl_git_pass(git_win32__set_hidden("futils/test-file", true)); + + /* append some more data */ + git_buf_puts(&append, "And some more!\n"); + git_buf_put(&out, append.ptr, append.size); + + cl_git_pass(git_futils_writebuffer(&append, "futils/test-file", O_RDWR | O_APPEND, 0666)); + + cl_assert_equal_file(out.ptr, out.size, "futils/test-file"); + + cl_git_pass(git_win32__hidden(&hidden, "futils/test-file")); + cl_assert(hidden); + + git_buf_free(&out); + git_buf_free(&append); +#endif +} + diff --git a/vendor/libgit2/tests/core/mkdir.c b/vendor/libgit2/tests/core/mkdir.c index f76fe1da9..96c972396 100644 --- a/vendor/libgit2/tests/core/mkdir.c +++ b/vendor/libgit2/tests/core/mkdir.c @@ -13,43 +13,82 @@ static void cleanup_basic_dirs(void *ref) git_futils_rmdir_r("d4", NULL, GIT_RMDIR_EMPTY_HIERARCHY); } +void test_core_mkdir__absolute(void) +{ + git_buf path = GIT_BUF_INIT; + + cl_set_cleanup(cleanup_basic_dirs, NULL); + + git_buf_joinpath(&path, clar_sandbox_path(), "d0"); + + /* make a directory */ + cl_assert(!git_path_isdir(path.ptr)); + cl_git_pass(git_futils_mkdir(path.ptr, 0755, 0)); + cl_assert(git_path_isdir(path.ptr)); + + git_buf_joinpath(&path, path.ptr, "subdir"); + cl_assert(!git_path_isdir(path.ptr)); + cl_git_pass(git_futils_mkdir(path.ptr, 0755, 0)); + cl_assert(git_path_isdir(path.ptr)); + + /* ensure mkdir_r works for a single subdir */ + git_buf_joinpath(&path, path.ptr, "another"); + cl_assert(!git_path_isdir(path.ptr)); + cl_git_pass(git_futils_mkdir_r(path.ptr, 0755)); + cl_assert(git_path_isdir(path.ptr)); + + /* ensure mkdir_r works */ + git_buf_joinpath(&path, clar_sandbox_path(), "d1/foo/bar/asdf"); + cl_assert(!git_path_isdir(path.ptr)); + cl_git_pass(git_futils_mkdir_r(path.ptr, 0755)); + cl_assert(git_path_isdir(path.ptr)); + + /* ensure we don't imply recursive */ + git_buf_joinpath(&path, clar_sandbox_path(), "d2/foo/bar/asdf"); + cl_assert(!git_path_isdir(path.ptr)); + cl_git_fail(git_futils_mkdir(path.ptr, 0755, 0)); + cl_assert(!git_path_isdir(path.ptr)); + + git_buf_free(&path); +} + void test_core_mkdir__basic(void) { cl_set_cleanup(cleanup_basic_dirs, NULL); /* make a directory */ cl_assert(!git_path_isdir("d0")); - cl_git_pass(git_futils_mkdir("d0", NULL, 0755, 0)); + cl_git_pass(git_futils_mkdir("d0", 0755, 0)); cl_assert(git_path_isdir("d0")); /* make a path */ cl_assert(!git_path_isdir("d1")); - cl_git_pass(git_futils_mkdir("d1/d1.1/d1.2", NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("d1/d1.1/d1.2", 0755, GIT_MKDIR_PATH)); cl_assert(git_path_isdir("d1")); cl_assert(git_path_isdir("d1/d1.1")); cl_assert(git_path_isdir("d1/d1.1/d1.2")); /* make a dir exclusively */ cl_assert(!git_path_isdir("d2")); - cl_git_pass(git_futils_mkdir("d2", NULL, 0755, GIT_MKDIR_EXCL)); + cl_git_pass(git_futils_mkdir("d2", 0755, GIT_MKDIR_EXCL)); cl_assert(git_path_isdir("d2")); /* make exclusive failure */ - cl_git_fail(git_futils_mkdir("d2", NULL, 0755, GIT_MKDIR_EXCL)); + cl_git_fail(git_futils_mkdir("d2", 0755, GIT_MKDIR_EXCL)); /* make a path exclusively */ cl_assert(!git_path_isdir("d3")); - cl_git_pass(git_futils_mkdir("d3/d3.1/d3.2", NULL, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_pass(git_futils_mkdir("d3/d3.1/d3.2", 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); cl_assert(git_path_isdir("d3")); cl_assert(git_path_isdir("d3/d3.1/d3.2")); /* make exclusive path failure */ - cl_git_fail(git_futils_mkdir("d3/d3.1/d3.2", NULL, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_fail(git_futils_mkdir("d3/d3.1/d3.2", 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); /* ??? Should EXCL only apply to the last item in the path? */ /* path with trailing slash? */ cl_assert(!git_path_isdir("d4")); - cl_git_pass(git_futils_mkdir("d4/d4.1/", NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("d4/d4.1/", 0755, GIT_MKDIR_PATH)); cl_assert(git_path_isdir("d4/d4.1")); } @@ -65,38 +104,38 @@ void test_core_mkdir__with_base(void) cl_set_cleanup(cleanup_basedir, NULL); - cl_git_pass(git_futils_mkdir(BASEDIR, NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir(BASEDIR, 0755, GIT_MKDIR_PATH)); - cl_git_pass(git_futils_mkdir("a", BASEDIR, 0755, 0)); + cl_git_pass(git_futils_mkdir_relative("a", BASEDIR, 0755, 0, NULL)); cl_assert(git_path_isdir(BASEDIR "/a")); - cl_git_pass(git_futils_mkdir("b/b1/b2", BASEDIR, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir_relative("b/b1/b2", BASEDIR, 0755, GIT_MKDIR_PATH, NULL)); cl_assert(git_path_isdir(BASEDIR "/b/b1/b2")); /* exclusive with existing base */ - cl_git_pass(git_futils_mkdir("c/c1/c2", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_pass(git_futils_mkdir_relative("c/c1/c2", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL, NULL)); /* fail: exclusive with duplicated suffix */ - cl_git_fail(git_futils_mkdir("c/c1/c3", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_fail(git_futils_mkdir_relative("c/c1/c3", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL, NULL)); /* fail: exclusive with any duplicated component */ - cl_git_fail(git_futils_mkdir("c/cz/cz", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_fail(git_futils_mkdir_relative("c/cz/cz", BASEDIR, 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL, NULL)); /* success: exclusive without path */ - cl_git_pass(git_futils_mkdir("c/c1/c3", BASEDIR, 0755, GIT_MKDIR_EXCL)); + cl_git_pass(git_futils_mkdir_relative("c/c1/c3", BASEDIR, 0755, GIT_MKDIR_EXCL, NULL)); /* path with shorter base and existing dirs */ - cl_git_pass(git_futils_mkdir("dir/here/d/", "base", 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir_relative("dir/here/d/", "base", 0755, GIT_MKDIR_PATH, NULL)); cl_assert(git_path_isdir("base/dir/here/d")); /* fail: path with shorter base and existing dirs */ - cl_git_fail(git_futils_mkdir("dir/here/e/", "base", 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL)); + cl_git_fail(git_futils_mkdir_relative("dir/here/e/", "base", 0755, GIT_MKDIR_PATH | GIT_MKDIR_EXCL, NULL)); /* fail: base with missing components */ - cl_git_fail(git_futils_mkdir("f/", "base/missing", 0755, GIT_MKDIR_PATH)); + cl_git_fail(git_futils_mkdir_relative("f/", "base/missing", 0755, GIT_MKDIR_PATH, NULL)); /* success: shift missing component to path */ - cl_git_pass(git_futils_mkdir("missing/f/", "base/", 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir_relative("missing/f/", "base/", 0755, GIT_MKDIR_PATH, NULL)); } static void cleanup_chmod_root(void *ref) @@ -135,9 +174,9 @@ void test_core_mkdir__chmods(void) cl_set_cleanup(cleanup_chmod_root, old); - cl_git_pass(git_futils_mkdir("r", NULL, 0777, 0)); + cl_git_pass(git_futils_mkdir("r", 0777, 0)); - cl_git_pass(git_futils_mkdir("mode/is/important", "r", 0777, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir_relative("mode/is/important", "r", 0777, GIT_MKDIR_PATH, NULL)); cl_git_pass(git_path_lstat("r/mode", &st)); check_mode(0755, st.st_mode); @@ -146,7 +185,7 @@ void test_core_mkdir__chmods(void) cl_git_pass(git_path_lstat("r/mode/is/important", &st)); check_mode(0755, st.st_mode); - cl_git_pass(git_futils_mkdir("mode2/is2/important2", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD)); + cl_git_pass(git_futils_mkdir_relative("mode2/is2/important2", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD, NULL)); cl_git_pass(git_path_lstat("r/mode2", &st)); check_mode(0755, st.st_mode); @@ -155,7 +194,7 @@ void test_core_mkdir__chmods(void) cl_git_pass(git_path_lstat("r/mode2/is2/important2", &st)); check_mode(0777, st.st_mode); - cl_git_pass(git_futils_mkdir("mode3/is3/important3", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD_PATH)); + cl_git_pass(git_futils_mkdir_relative("mode3/is3/important3", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD_PATH, NULL)); cl_git_pass(git_path_lstat("r/mode3", &st)); check_mode(0777, st.st_mode); @@ -166,7 +205,7 @@ void test_core_mkdir__chmods(void) /* test that we chmod existing dir */ - cl_git_pass(git_futils_mkdir("mode/is/important", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD)); + cl_git_pass(git_futils_mkdir_relative("mode/is/important", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD, NULL)); cl_git_pass(git_path_lstat("r/mode", &st)); check_mode(0755, st.st_mode); @@ -177,7 +216,7 @@ void test_core_mkdir__chmods(void) /* test that we chmod even existing dirs if CHMOD_PATH is set */ - cl_git_pass(git_futils_mkdir("mode2/is2/important2.1", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD_PATH)); + cl_git_pass(git_futils_mkdir_relative("mode2/is2/important2.1", "r", 0777, GIT_MKDIR_PATH | GIT_MKDIR_CHMOD_PATH, NULL)); cl_git_pass(git_path_lstat("r/mode2", &st)); check_mode(0777, st.st_mode); @@ -187,6 +226,40 @@ void test_core_mkdir__chmods(void) check_mode(0777, st.st_mode); } +void test_core_mkdir__keeps_parent_symlinks(void) +{ +#ifndef GIT_WIN32 + git_buf path = GIT_BUF_INIT; + + cl_set_cleanup(cleanup_basic_dirs, NULL); + + /* make a directory */ + cl_assert(!git_path_isdir("d0")); + cl_git_pass(git_futils_mkdir("d0", 0755, 0)); + cl_assert(git_path_isdir("d0")); + + cl_must_pass(symlink("d0", "d1")); + cl_assert(git_path_islink("d1")); + + cl_git_pass(git_futils_mkdir("d1/foo/bar", 0755, GIT_MKDIR_PATH|GIT_MKDIR_REMOVE_SYMLINKS)); + cl_assert(git_path_islink("d1")); + cl_assert(git_path_isdir("d1/foo/bar")); + cl_assert(git_path_isdir("d0/foo/bar")); + + cl_must_pass(symlink("d0", "d2")); + cl_assert(git_path_islink("d2")); + + git_buf_joinpath(&path, clar_sandbox_path(), "d2/other/dir"); + + cl_git_pass(git_futils_mkdir(path.ptr, 0755, GIT_MKDIR_PATH|GIT_MKDIR_REMOVE_SYMLINKS)); + cl_assert(git_path_islink("d2")); + cl_assert(git_path_isdir("d2/other/dir")); + cl_assert(git_path_isdir("d0/other/dir")); + + git_buf_free(&path); +#endif +} + void test_core_mkdir__mkdir_path_inside_unwriteable_parent(void) { struct stat st; @@ -200,8 +273,8 @@ void test_core_mkdir__mkdir_path_inside_unwriteable_parent(void) *old = p_umask(022); cl_set_cleanup(cleanup_chmod_root, old); - cl_git_pass(git_futils_mkdir("r", NULL, 0777, 0)); - cl_git_pass(git_futils_mkdir("mode/is/important", "r", 0777, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("r", 0777, 0)); + cl_git_pass(git_futils_mkdir_relative("mode/is/important", "r", 0777, GIT_MKDIR_PATH, NULL)); cl_git_pass(git_path_lstat("r/mode", &st)); check_mode(0755, st.st_mode); @@ -210,10 +283,9 @@ void test_core_mkdir__mkdir_path_inside_unwriteable_parent(void) check_mode(0111, st.st_mode); cl_git_pass( - git_futils_mkdir("mode/is/okay/inside", "r", 0777, GIT_MKDIR_PATH)); + git_futils_mkdir_relative("mode/is/okay/inside", "r", 0777, GIT_MKDIR_PATH, NULL)); cl_git_pass(git_path_lstat("r/mode/is/okay/inside", &st)); check_mode(0755, st.st_mode); cl_must_pass(p_chmod("r/mode", 0777)); } - diff --git a/vendor/libgit2/tests/core/opts.c b/vendor/libgit2/tests/core/opts.c index 3173c648b..72408cbe8 100644 --- a/vendor/libgit2/tests/core/opts.c +++ b/vendor/libgit2/tests/core/opts.c @@ -17,3 +17,9 @@ void test_core_opts__readwrite(void) cl_assert(new_val == old_val); } + +void test_core_opts__invalid_option(void) +{ + cl_git_fail(git_libgit2_opts(-1, "foobar")); +} + diff --git a/vendor/libgit2/tests/core/pool.c b/vendor/libgit2/tests/core/pool.c index a7ec8801b..b07da0abd 100644 --- a/vendor/libgit2/tests/core/pool.c +++ b/vendor/libgit2/tests/core/pool.c @@ -8,7 +8,7 @@ void test_core_pool__0(void) git_pool p; void *ptr; - cl_git_pass(git_pool_init(&p, 1, 4000)); + git_pool_init(&p, 1); for (i = 1; i < 10000; i *= 2) { ptr = git_pool_malloc(&p, i); @@ -17,13 +17,6 @@ void test_core_pool__0(void) cl_assert(!git_pool__ptr_in_pool(&p, &i)); } - /* 1+2+4+8+16+32+64+128+256+512+1024 -> original block */ - /* 2048 -> 1 block */ - /* 4096 -> 1 block */ - /* 8192 -> 1 block */ - - cl_assert(git_pool__open_pages(&p) + git_pool__full_pages(&p) == 4); - git_pool_clear(&p); } @@ -32,26 +25,28 @@ void test_core_pool__1(void) int i; git_pool p; - cl_git_pass(git_pool_init(&p, 1, 4000)); + git_pool_init(&p, 1); + p.page_size = 4000; for (i = 2010; i > 0; i--) cl_assert(git_pool_malloc(&p, i) != NULL); +#ifndef GIT_DEBUG_POOL /* with fixed page size, allocation must end up with these values */ - cl_assert_equal_i(1, git_pool__open_pages(&p)); - cl_assert_equal_i(507, git_pool__full_pages(&p)); - + cl_assert_equal_i(591, git_pool__open_pages(&p)); +#endif git_pool_clear(&p); - cl_git_pass(git_pool_init(&p, 1, 4120)); + git_pool_init(&p, 1); + p.page_size = 4120; for (i = 2010; i > 0; i--) cl_assert(git_pool_malloc(&p, i) != NULL); +#ifndef GIT_DEBUG_POOL /* with fixed page size, allocation must end up with these values */ - cl_assert_equal_i(1, git_pool__open_pages(&p)); - cl_assert_equal_i(492, git_pool__full_pages(&p)); - + cl_assert_equal_i(sizeof(void *) == 8 ? 575 : 573, git_pool__open_pages(&p)); +#endif git_pool_clear(&p); } @@ -66,7 +61,8 @@ void test_core_pool__2(void) memset(oid_hex, '0', sizeof(oid_hex)); - cl_git_pass(git_pool_init(&p, sizeof(git_oid), 100)); + git_pool_init(&p, sizeof(git_oid)); + p.page_size = 4000; for (i = 1000; i < 10000; i++) { oid = git_pool_malloc(&p, 1); @@ -77,60 +73,10 @@ void test_core_pool__2(void) cl_git_pass(git_oid_fromstr(oid, oid_hex)); } +#ifndef GIT_DEBUG_POOL /* with fixed page size, allocation must end up with these values */ - cl_assert(git_pool__open_pages(&p) == 0); - cl_assert(git_pool__full_pages(&p) == 90); - - git_pool_clear(&p); -} - -void test_core_pool__free_list(void) -{ - int i; - git_pool p; - void *ptr, *ptrs[50]; - - cl_git_pass(git_pool_init(&p, 100, 100)); - - for (i = 0; i < 10; ++i) { - ptr = git_pool_malloc(&p, 1); - cl_assert(ptr != NULL); - } - cl_assert_equal_i(10, (int)p.items); - - for (i = 0; i < 50; ++i) { - ptrs[i] = git_pool_malloc(&p, 1); - cl_assert(ptrs[i] != NULL); - } - cl_assert_equal_i(60, (int)p.items); - - git_pool_free(&p, ptr); - cl_assert_equal_i(60, (int)p.items); - - git_pool_free_array(&p, 50, ptrs); - cl_assert_equal_i(60, (int)p.items); - - for (i = 0; i < 50; ++i) { - ptrs[i] = git_pool_malloc(&p, 1); - cl_assert(ptrs[i] != NULL); - } - cl_assert_equal_i(60, (int)p.items); - - for (i = 0; i < 111; ++i) { - ptr = git_pool_malloc(&p, 1); - cl_assert(ptr != NULL); - } - cl_assert_equal_i(170, (int)p.items); - - git_pool_free_array(&p, 50, ptrs); - cl_assert_equal_i(170, (int)p.items); - - for (i = 0; i < 50; ++i) { - ptrs[i] = git_pool_malloc(&p, 1); - cl_assert(ptrs[i] != NULL); - } - cl_assert_equal_i(170, (int)p.items); - + cl_assert_equal_i(sizeof(void *) == 8 ? 55 : 45, git_pool__open_pages(&p)); +#endif git_pool_clear(&p); } @@ -138,7 +84,7 @@ void test_core_pool__strndup_limit(void) { git_pool p; - cl_git_pass(git_pool_init(&p, 1, 100)); + git_pool_init(&p, 1); /* ensure 64 bit doesn't overflow */ cl_assert(git_pool_strndup(&p, "foo", (size_t)-1) == NULL); git_pool_clear(&p); diff --git a/vendor/libgit2/tests/core/posix.c b/vendor/libgit2/tests/core/posix.c index 5a9e24899..34a67bf47 100644 --- a/vendor/libgit2/tests/core/posix.c +++ b/vendor/libgit2/tests/core/posix.c @@ -100,7 +100,7 @@ void test_core_posix__inet_pton(void) void test_core_posix__utimes(void) { - struct timeval times[2]; + struct p_timeval times[2]; struct stat st; time_t curtime; int fd; diff --git a/vendor/libgit2/tests/core/stat.c b/vendor/libgit2/tests/core/stat.c index bd9b990e3..ef2e45a15 100644 --- a/vendor/libgit2/tests/core/stat.c +++ b/vendor/libgit2/tests/core/stat.c @@ -5,7 +5,7 @@ void test_core_stat__initialize(void) { - cl_git_pass(git_futils_mkdir("root/d1/d2", NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("root/d1/d2", 0755, GIT_MKDIR_PATH)); cl_git_mkfile("root/file", "whatever\n"); cl_git_mkfile("root/d1/file", "whatever\n"); } diff --git a/vendor/libgit2/tests/core/stream.c b/vendor/libgit2/tests/core/stream.c new file mode 100644 index 000000000..0cbf44230 --- /dev/null +++ b/vendor/libgit2/tests/core/stream.c @@ -0,0 +1,51 @@ +#include "clar_libgit2.h" +#include "git2/sys/stream.h" +#include "tls_stream.h" +#include "stream.h" + +static git_stream test_stream; +static int ctor_called; + +static int test_ctor(git_stream **out, const char *host, const char *port) +{ + GIT_UNUSED(host); + GIT_UNUSED(port); + + ctor_called = 1; + *out = &test_stream; + + return 0; +} + +void test_core_stream__register_tls(void) +{ + git_stream *stream; + int error; + + ctor_called = 0; + cl_git_pass(git_stream_register_tls(test_ctor)); + cl_git_pass(git_tls_stream_new(&stream, "localhost", "443")); + cl_assert_equal_i(1, ctor_called); + cl_assert_equal_p(&test_stream, stream); + + ctor_called = 0; + stream = NULL; + cl_git_pass(git_stream_register_tls(NULL)); + error = git_tls_stream_new(&stream, "localhost", "443"); + + /* We don't have arbitrary TLS stream support on Windows + * or when openssl support is disabled (except on OSX + * with Security framework). + */ +#if defined(GIT_WIN32) || \ + (!defined(GIT_SECURE_TRANSPORT) && !defined(GIT_OPENSSL)) + cl_git_fail_with(-1, error); +#else + cl_git_pass(error); +#endif + + cl_assert_equal_i(0, ctor_called); + cl_assert(&test_stream != stream); + + git_stream_free(stream); +} diff --git a/vendor/libgit2/tests/core/useragent.c b/vendor/libgit2/tests/core/useragent.c new file mode 100644 index 000000000..6d06693a8 --- /dev/null +++ b/vendor/libgit2/tests/core/useragent.c @@ -0,0 +1,11 @@ +#include "clar_libgit2.h" +#include "global.h" + +void test_core_useragent__get(void) +{ + const char *custom_name = "super duper git"; + + cl_assert_equal_p(NULL, git_libgit2__user_agent()); + cl_git_pass(git_libgit2_opts(GIT_OPT_SET_USER_AGENT, custom_name)); + cl_assert_equal_s(custom_name, git_libgit2__user_agent()); +} diff --git a/vendor/libgit2/tests/diff/format_email.c b/vendor/libgit2/tests/diff/format_email.c index 18ad99bd5..e55afe958 100644 --- a/vendor/libgit2/tests/diff/format_email.c +++ b/vendor/libgit2/tests/diff/format_email.c @@ -97,6 +97,47 @@ void test_diff_format_email__simple(void) email, "9264b96c6d104d0e07ae33d3007b6a48246c6f92", &opts); } +void test_diff_format_email__with_message(void) +{ + git_diff_format_email_options opts = GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT; + const char *email = "From 627e7e12d87e07a83fad5b6bfa25e86ead4a5270 Mon Sep 17 00:00:00 2001\n" \ + "From: Patrick Steinhardt \n" \ + "Date: Tue, 24 Nov 2015 13:34:39 +0100\n" \ + "Subject: [PATCH] Modify content with message\n" \ + "\n" \ + "Modify content of file3.txt by appending a new line. Make this\n" \ + "commit message somewhat longer to test behavior with newlines\n" \ + "embedded in the message body.\n" \ + "\n" \ + "Also test if new paragraphs are included correctly.\n" \ + "---\n" \ + " file3.txt | 1 +\n" \ + " 1 file changed, 1 insertion(+), 0 deletions(-)\n" \ + "\n" \ + "diff --git a/file3.txt b/file3.txt\n" \ + "index 9a2d780..7309653 100644\n" \ + "--- a/file3.txt\n" \ + "+++ b/file3.txt\n" \ + "@@ -3,3 +3,4 @@ file3!\n" \ + " file3\n" \ + " file3\n" \ + " file3\n" \ + "+file3\n" \ + "--\n" \ + "libgit2 " LIBGIT2_VERSION "\n" \ + "\n"; + + opts.body = "Modify content of file3.txt by appending a new line. Make this\n" \ + "commit message somewhat longer to test behavior with newlines\n" \ + "embedded in the message body.\n" \ + "\n" \ + "Also test if new paragraphs are included correctly."; + + assert_email_match( + email, "627e7e12d87e07a83fad5b6bfa25e86ead4a5270", &opts); +} + + void test_diff_format_email__multiple(void) { git_oid oid; diff --git a/vendor/libgit2/tests/diff/index.c b/vendor/libgit2/tests/diff/index.c index f702568bf..0293b7821 100644 --- a/vendor/libgit2/tests/diff/index.c +++ b/vendor/libgit2/tests/diff/index.c @@ -185,9 +185,9 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags) ancestor.path = ours.path = theirs.path = "staged_changes"; ancestor.mode = ours.mode = theirs.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&ancestor.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); - git_oid_fromstr(&ours.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); - git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46"); + git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); + git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs)); cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, &opts)); @@ -255,7 +255,7 @@ void test_diff_index__not_in_head_conflicted(void) theirs.path = "file_not_in_head"; theirs.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); cl_git_pass(git_index_conflict_add(index, NULL, NULL, &theirs)); cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, NULL)); @@ -268,3 +268,35 @@ void test_diff_index__not_in_head_conflicted(void) git_index_free(index); git_tree_free(a); } + +void test_diff_index__to_index(void) +{ + const char *a_commit = "26a125ee1bf"; /* the current HEAD */ + git_tree *old_tree; + git_index *old_index; + git_index *new_index; + git_diff *diff; + diff_expects exp; + + cl_git_pass(git_index_new(&old_index)); + old_tree = resolve_commit_oid_to_tree(g_repo, a_commit); + cl_git_pass(git_index_read_tree(old_index, old_tree)); + + cl_git_pass(git_repository_index(&new_index, g_repo)); + + cl_git_pass(git_diff_index_to_index(&diff, g_repo, old_index, new_index, NULL)); + + memset(&exp, 0, sizeof(diff_expects)); + cl_git_pass(git_diff_foreach( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); + cl_assert_equal_i(8, exp.files); + cl_assert_equal_i(3, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(3, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_CONFLICTED]); + + git_diff_free(diff); + git_index_free(new_index); + git_index_free(old_index); + git_tree_free(old_tree); +} diff --git a/vendor/libgit2/tests/diff/iterator.c b/vendor/libgit2/tests/diff/iterator.c index 6011c6a9b..25a23eda7 100644 --- a/vendor/libgit2/tests/diff/iterator.c +++ b/vendor/libgit2/tests/diff/iterator.c @@ -30,13 +30,17 @@ static void tree_iterator_test( { git_tree *t; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; int error, count = 0, count_post_reset = 0; git_repository *repo = cl_git_sandbox_init(sandbox); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + i_opts.start = start; + i_opts.end = end; + cl_assert(t = resolve_commit_oid_to_tree(repo, treeish)); - cl_git_pass(git_iterator_for_tree( - &i, t, GIT_ITERATOR_DONT_IGNORE_CASE, start, end)); + cl_git_pass(git_iterator_for_tree(&i, t, &i_opts)); /* test loop */ while (!(error = git_iterator_advance(&entry, i))) { @@ -264,7 +268,7 @@ static void check_tree_entry( cl_git_pass(git_iterator_current_tree_entry(&te, i)); cl_assert(te); - cl_assert(git_oid_streq(&te->oid, oid) == 0); + cl_assert(git_oid_streq(te->oid, oid) == 0); cl_git_pass(git_iterator_current(&ie, i)); cl_git_pass(git_buf_sets(&path, ie->path)); @@ -297,6 +301,7 @@ void test_diff_iterator__tree_special_functions(void) { git_tree *t; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; git_repository *repo = cl_git_sandbox_init("attr"); int error, cases = 0; @@ -306,8 +311,9 @@ void test_diff_iterator__tree_special_functions(void) repo, "24fa9a9fc4e202313e24b648087495441dab432b"); cl_assert(t != NULL); - cl_git_pass(git_iterator_for_tree( - &i, t, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + cl_git_pass(git_iterator_for_tree(&i, t, &i_opts)); while (!(error = git_iterator_advance(&entry, i))) { cl_assert(entry); @@ -365,11 +371,16 @@ static void index_iterator_test( const git_index_entry *entry; int error, count = 0, caps; git_repository *repo = cl_git_sandbox_init(sandbox); + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; cl_git_pass(git_repository_index(&index, repo)); caps = git_index_caps(index); - cl_git_pass(git_iterator_for_index(&i, index, flags, start, end)); + iter_opts.flags = flags; + iter_opts.start = start; + iter_opts.end = end; + + cl_git_pass(git_iterator_for_index(&i, repo, index, &iter_opts)); while (!(error = git_iterator_advance(&entry, i))) { cl_assert(entry); @@ -581,12 +592,16 @@ static void workdir_iterator_test( const char *an_ignored_name) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; int error, count = 0, count_all = 0, count_all_post_reset = 0; git_repository *repo = cl_git_sandbox_init(sandbox); - cl_git_pass(git_iterator_for_workdir( - &i, repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, start, end)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + i_opts.start = start; + i_opts.end = end; + + cl_git_pass(git_iterator_for_workdir(&i, repo, NULL, NULL, &i_opts)); error = git_iterator_current(&entry, i); cl_assert((error == 0 && entry != NULL) || @@ -765,6 +780,7 @@ void test_diff_iterator__workdir_builtin_ignores(void) { git_repository *repo = cl_git_sandbox_init("attr"); git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; int idx; static struct { @@ -796,8 +812,12 @@ void test_diff_iterator__workdir_builtin_ignores(void) cl_git_pass(p_mkdir("attr/sub/sub/.git", 0777)); cl_git_mkfile("attr/sub/.git", "whatever"); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + i_opts.start = "dir"; + i_opts.end = "sub/sub/file"; + cl_git_pass(git_iterator_for_workdir( - &i, repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, "dir", "sub/sub/file")); + &i, repo, NULL, NULL, &i_opts)); cl_git_pass(git_iterator_current(&entry, i)); for (idx = 0; entry != NULL; ++idx) { @@ -827,12 +847,17 @@ static void check_wd_first_through_third_range( git_repository *repo, const char *start, const char *end) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; int error, idx; static const char *expected[] = { "FIRST", "second", "THIRD", NULL }; + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + i_opts.start = start; + i_opts.end = end; + cl_git_pass(git_iterator_for_workdir( - &i, repo, NULL, NULL, GIT_ITERATOR_IGNORE_CASE, start, end)); + &i, repo, NULL, NULL, &i_opts)); cl_git_pass(git_iterator_current(&entry, i)); for (idx = 0; entry != NULL; ++idx) { @@ -877,14 +902,16 @@ static void check_tree_range( { git_tree *head; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; int error, count; + i_opts.flags = ignore_case ? GIT_ITERATOR_IGNORE_CASE : GIT_ITERATOR_DONT_IGNORE_CASE; + i_opts.start = start; + i_opts.end = end; + cl_git_pass(git_repository_head_tree(&head, repo)); - cl_git_pass(git_iterator_for_tree( - &i, head, - ignore_case ? GIT_ITERATOR_IGNORE_CASE : GIT_ITERATOR_DONT_IGNORE_CASE, - start, end)); + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); for (count = 0; !(error = git_iterator_advance(NULL, i)); ++count) /* count em up */; @@ -931,6 +958,7 @@ static void check_index_range( { git_index *index; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; int error, count, caps; bool is_ignoring_case; @@ -942,7 +970,11 @@ static void check_index_range( if (ignore_case != is_ignoring_case) cl_git_pass(git_index_set_caps(index, caps ^ GIT_INDEXCAP_IGNORE_CASE)); - cl_git_pass(git_iterator_for_index(&i, index, 0, start, end)); + i_opts.flags = 0; + i_opts.start = start; + i_opts.end = end; + + cl_git_pass(git_iterator_for_index(&i, repo, index, &i_opts)); cl_assert(git_iterator_ignore_case(i) == ignore_case); diff --git a/vendor/libgit2/tests/diff/notify.c b/vendor/libgit2/tests/diff/notify.c index 6ef4af573..653512795 100644 --- a/vendor/libgit2/tests/diff/notify.c +++ b/vendor/libgit2/tests/diff/notify.c @@ -55,7 +55,7 @@ static void test_notify( opts.pathspec.strings = searched_pathspecs; opts.pathspec.count = pathspecs_count; - opts.notify_payload = expected_matched_pathspecs; + opts.payload = expected_matched_pathspecs; memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); @@ -228,3 +228,31 @@ void test_diff_notify__notify_cb_can_be_used_as_filtering_function(void) git_diff_free(diff); } + +static int progress_abort_diff( + const git_diff *diff_so_far, + const char *old_path, + const char *new_path, + void *payload) +{ + GIT_UNUSED(diff_so_far); + GIT_UNUSED(old_path); + GIT_UNUSED(new_path); + GIT_UNUSED(payload); + + return -42; +} + +void test_diff_notify__progress_cb_can_abort_diff(void) +{ + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + + g_repo = cl_git_sandbox_init("status"); + + opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED; + opts.progress_cb = progress_abort_diff; + + cl_git_fail_with( + git_diff_index_to_workdir(&diff, g_repo, NULL, &opts), -42); +} diff --git a/vendor/libgit2/tests/diff/tree.c b/vendor/libgit2/tests/diff/tree.c index 2bc9e6a55..e4b2a8bbe 100644 --- a/vendor/libgit2/tests/diff/tree.c +++ b/vendor/libgit2/tests/diff/tree.c @@ -90,7 +90,7 @@ void test_diff_tree__0(void) #define DIFF_OPTS(FLAGS, CTXT) \ {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_UNSPECIFIED, \ - {NULL,0}, NULL, NULL, (CTXT), 1} + {NULL,0}, NULL, NULL, NULL, (CTXT), 1} void test_diff_tree__options(void) { diff --git a/vendor/libgit2/tests/diff/workdir.c b/vendor/libgit2/tests/diff/workdir.c index 8a23f53ae..e1bbce8fb 100644 --- a/vendor/libgit2/tests/diff/workdir.c +++ b/vendor/libgit2/tests/diff/workdir.c @@ -85,9 +85,11 @@ void test_diff_workdir__to_index_with_conflicts(void) /* Adding an entry that represents a rename gets two files in conflict */ our_entry.path = "subdir/modified_file"; our_entry.mode = 0100644; + git_oid_fromstr(&our_entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); their_entry.path = "subdir/rename_conflict"; their_entry.mode = 0100644; + git_oid_fromstr(&their_entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); cl_git_pass(git_repository_index(&index, g_repo)); cl_git_pass(git_index_conflict_add(index, NULL, &our_entry, &their_entry)); @@ -444,6 +446,216 @@ void test_diff_workdir__to_index_with_pathspec(void) git_diff_free(diff); } +void test_diff_workdir__to_index_with_pathlist_disabling_fnmatch(void) +{ + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + diff_expects exp; + char *pathspec = NULL; + int use_iterator; + + g_repo = cl_git_sandbox_init("status"); + + opts.context_lines = 3; + opts.interhunk_lines = 1; + opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED | + GIT_DIFF_DISABLE_PATHSPEC_MATCH; + opts.pathspec.strings = &pathspec; + opts.pathspec.count = 0; + + /* ensure that an empty pathspec list is ignored */ + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(13, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that a single NULL pathspec is filtered out (like when using + * fnmatch filtering) + */ + + opts.pathspec.count = 1; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(13, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + pathspec = "modified_file"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(1, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that subdirs can be specified */ + pathspec = "subdir"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(3, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that subdirs can be specified with a trailing slash */ + pathspec = "subdir/"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(3, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that fnmatching is completely disabled */ + pathspec = "subdir/*"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(0, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that the prefix matching isn't completely braindead */ + pathspec = "subdi"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(0, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); + + /* ensure that fnmatching isn't working at all */ + pathspec = "*_deleted"; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + + for (use_iterator = 0; use_iterator <= 1; use_iterator++) { + memset(&exp, 0, sizeof(exp)); + + if (use_iterator) + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, NULL, NULL, NULL, &exp)); + else + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); + + cl_assert_equal_i(0, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_UNTRACKED]); + } + + git_diff_free(diff); +} + void test_diff_workdir__filemode_changes(void) { git_diff *diff = NULL; @@ -1545,7 +1757,7 @@ void test_diff_workdir__with_stale_index(void) static int touch_file(void *payload, git_buf *path) { struct stat st; - struct timeval times[2]; + struct p_timeval times[2]; GIT_UNUSED(payload); if (git_path_isdir(path->ptr)) @@ -1765,9 +1977,9 @@ void test_diff_workdir__to_index_conflicted(void) { ancestor.path = ours.path = theirs.path = "_file"; ancestor.mode = ours.mode = theirs.mode = 0100644; - git_oid_fromstr(&ancestor.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); - git_oid_fromstr(&ours.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); - git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46"); + git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); + git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs)); cl_git_pass(git_diff_tree_to_index(&diff1, g_repo, a, index, NULL)); @@ -1796,7 +2008,7 @@ void test_diff_workdir__only_writes_index_when_necessary(void) git_oid initial, first, second; git_buf path = GIT_BUF_INIT; struct stat st; - struct timeval times[2]; + struct p_timeval times[2]; opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | GIT_DIFF_UPDATE_INDEX; @@ -1844,3 +2056,107 @@ void test_diff_workdir__only_writes_index_when_necessary(void) git_index_free(index); } +void test_diff_workdir__to_index_pathlist(void) +{ + git_index *index; + git_diff *diff; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_vector pathlist = GIT_VECTOR_INIT; + + git_vector_insert(&pathlist, "foobar/asdf"); + git_vector_insert(&pathlist, "subdir/asdf"); + git_vector_insert(&pathlist, "ignored/asdf"); + + g_repo = cl_git_sandbox_init("status"); + + cl_git_mkfile("status/.gitignore", ".gitignore\n" "ignored/\n"); + + cl_must_pass(p_mkdir("status/foobar", 0777)); + cl_git_mkfile("status/foobar/one", "one\n"); + + cl_must_pass(p_mkdir("status/ignored", 0777)); + cl_git_mkfile("status/ignored/one", "one\n"); + cl_git_mkfile("status/ignored/two", "two\n"); + cl_git_mkfile("status/ignored/three", "three\n"); + + cl_git_pass(git_repository_index(&index, g_repo)); + + opts.flags = GIT_DIFF_INCLUDE_IGNORED; + opts.pathspec.strings = (char **)pathlist.contents; + opts.pathspec.count = pathlist.length; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, &opts)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + + opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, &opts)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + + git_index_free(index); + git_vector_free(&pathlist); +} + +void test_diff_workdir__symlink_changed_on_non_symlink_platform(void) +{ + git_tree *tree; + git_diff *diff; + diff_expects exp = {0}; + const git_diff_delta *delta; + const char *commit = "7fccd7"; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_vector pathlist = GIT_VECTOR_INIT; + int symlinks; + + g_repo = cl_git_sandbox_init("unsymlinked.git"); + + cl_git_pass(git_repository__cvar(&symlinks, g_repo, GIT_CVAR_SYMLINKS)); + + if (symlinks) + cl_skip(); + + cl_git_pass(git_vector_insert(&pathlist, "include/Nu/Nu.h")); + + opts.pathspec.strings = (char **)pathlist.contents; + opts.pathspec.count = pathlist.length; + + cl_must_pass(p_mkdir("symlink", 0777)); + cl_git_pass(git_repository_set_workdir(g_repo, "symlink", false)); + + cl_assert((tree = resolve_commit_oid_to_tree(g_repo, commit)) != NULL); + + /* first, do the diff with the original contents */ + + cl_git_pass(git_futils_mkpath2file("symlink/include/Nu/Nu.h", 0755)); + cl_git_mkfile("symlink/include/Nu/Nu.h", "../../objc/Nu.h"); + + cl_git_pass(git_diff_tree_to_workdir(&diff, g_repo, tree, &opts)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + + /* now update the contents and expect a difference, but that the file + * mode has persisted as a symbolic link. + */ + + cl_git_rewritefile("symlink/include/Nu/Nu.h", "awesome content\n"); + + cl_git_pass(git_diff_tree_to_workdir(&diff, g_repo, tree, &opts)); + + cl_git_pass(git_diff_foreach( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); + cl_assert_equal_i(1, exp.files); + + cl_assert_equal_i(1, git_diff_num_deltas(diff)); + delta = git_diff_get_delta(diff, 0); + cl_assert_equal_i(GIT_FILEMODE_LINK, delta->old_file.mode); + cl_assert_equal_i(GIT_FILEMODE_LINK, delta->new_file.mode); + + git_diff_free(diff); + + cl_git_pass(git_futils_rmdir_r("symlink", NULL, GIT_RMDIR_REMOVE_FILES)); + + git_tree_free(tree); + git_vector_free(&pathlist); +} diff --git a/vendor/libgit2/tests/filter/custom.c b/vendor/libgit2/tests/filter/custom.c index 493d26c80..fd1cd271c 100644 --- a/vendor/libgit2/tests/filter/custom.c +++ b/vendor/libgit2/tests/filter/custom.c @@ -5,6 +5,7 @@ #include "buf_text.h" #include "git2/sys/filter.h" #include "git2/sys/repository.h" +#include "custom_helpers.h" /* going TO_WORKDIR, filters are executed low to high * going TO_ODB, filters are executed high to low @@ -12,8 +13,6 @@ #define BITFLIP_FILTER_PRIORITY -1 #define REVERSE_FILTER_PRIORITY -2 -#define VERY_SECURE_ENCRYPTION(b) ((b) ^ 0xff) - #ifdef GIT_WIN32 # define NEWLINE "\r\n" #else @@ -27,6 +26,8 @@ static char workdir_data[] = "trivially" NEWLINE "scrambled." NEWLINE; +#define REVERSED_DATA_LEN 51 + /* Represents the data above scrambled (bits flipped) after \r\n -> \n * conversion, then bytewise reversed */ @@ -63,107 +64,6 @@ void test_filter_custom__cleanup(void) g_repo = NULL; } -static int bitflip_filter_apply( - git_filter *self, - void **payload, - git_buf *to, - const git_buf *from, - const git_filter_source *source) -{ - const unsigned char *src = (const unsigned char *)from->ptr; - unsigned char *dst; - size_t i; - - GIT_UNUSED(self); GIT_UNUSED(payload); - - /* verify that attribute path match worked as expected */ - cl_assert_equal_i( - 0, git__strncmp("hero", git_filter_source_path(source), 4)); - - if (!from->size) - return 0; - - cl_git_pass(git_buf_grow(to, from->size)); - - dst = (unsigned char *)to->ptr; - - for (i = 0; i < from->size; i++) - dst[i] = VERY_SECURE_ENCRYPTION(src[i]); - - to->size = from->size; - - return 0; -} - -static void bitflip_filter_free(git_filter *f) -{ - git__free(f); -} - -static git_filter *create_bitflip_filter(void) -{ - git_filter *filter = git__calloc(1, sizeof(git_filter)); - cl_assert(filter); - - filter->version = GIT_FILTER_VERSION; - filter->attributes = "+bitflip"; - filter->shutdown = bitflip_filter_free; - filter->apply = bitflip_filter_apply; - - return filter; -} - - -static int reverse_filter_apply( - git_filter *self, - void **payload, - git_buf *to, - const git_buf *from, - const git_filter_source *source) -{ - const unsigned char *src = (const unsigned char *)from->ptr; - const unsigned char *end = src + from->size; - unsigned char *dst; - - GIT_UNUSED(self); GIT_UNUSED(payload); GIT_UNUSED(source); - - /* verify that attribute path match worked as expected */ - cl_assert_equal_i( - 0, git__strncmp("hero", git_filter_source_path(source), 4)); - - if (!from->size) - return 0; - - cl_git_pass(git_buf_grow(to, from->size)); - - dst = (unsigned char *)to->ptr + from->size - 1; - - while (src < end) - *dst-- = *src++; - - to->size = from->size; - - return 0; -} - -static void reverse_filter_free(git_filter *f) -{ - git__free(f); -} - -static git_filter *create_reverse_filter(const char *attrs) -{ - git_filter *filter = git__calloc(1, sizeof(git_filter)); - cl_assert(filter); - - filter->version = GIT_FILTER_VERSION; - filter->attributes = attrs; - filter->shutdown = reverse_filter_free; - filter->apply = reverse_filter_apply; - - return filter; -} - static void register_custom_filters(void) { static int filters_registered = 0; @@ -186,7 +86,6 @@ static void register_custom_filters(void) } } - void test_filter_custom__to_odb(void) { git_filter_list *fl; diff --git a/vendor/libgit2/tests/filter/custom_helpers.c b/vendor/libgit2/tests/filter/custom_helpers.c new file mode 100644 index 000000000..2c80212be --- /dev/null +++ b/vendor/libgit2/tests/filter/custom_helpers.c @@ -0,0 +1,108 @@ +#include "clar_libgit2.h" +#include "posix.h" +#include "filter.h" +#include "buf_text.h" +#include "git2/sys/filter.h" + +#define VERY_SECURE_ENCRYPTION(b) ((b) ^ 0xff) + +int bitflip_filter_apply( + git_filter *self, + void **payload, + git_buf *to, + const git_buf *from, + const git_filter_source *source) +{ + const unsigned char *src = (const unsigned char *)from->ptr; + unsigned char *dst; + size_t i; + + GIT_UNUSED(self); GIT_UNUSED(payload); + + /* verify that attribute path match worked as expected */ + cl_assert_equal_i( + 0, git__strncmp("hero", git_filter_source_path(source), 4)); + + if (!from->size) + return 0; + + cl_git_pass(git_buf_grow(to, from->size)); + + dst = (unsigned char *)to->ptr; + + for (i = 0; i < from->size; i++) + dst[i] = VERY_SECURE_ENCRYPTION(src[i]); + + to->size = from->size; + + return 0; +} + +static void bitflip_filter_free(git_filter *f) +{ + git__free(f); +} + +git_filter *create_bitflip_filter(void) +{ + git_filter *filter = git__calloc(1, sizeof(git_filter)); + cl_assert(filter); + + filter->version = GIT_FILTER_VERSION; + filter->attributes = "+bitflip"; + filter->shutdown = bitflip_filter_free; + filter->apply = bitflip_filter_apply; + + return filter; +} + + +int reverse_filter_apply( + git_filter *self, + void **payload, + git_buf *to, + const git_buf *from, + const git_filter_source *source) +{ + const unsigned char *src = (const unsigned char *)from->ptr; + const unsigned char *end = src + from->size; + unsigned char *dst; + + GIT_UNUSED(self); GIT_UNUSED(payload); GIT_UNUSED(source); + + /* verify that attribute path match worked as expected */ + cl_assert_equal_i( + 0, git__strncmp("hero", git_filter_source_path(source), 4)); + + if (!from->size) + return 0; + + cl_git_pass(git_buf_grow(to, from->size)); + + dst = (unsigned char *)to->ptr + from->size - 1; + + while (src < end) + *dst-- = *src++; + + to->size = from->size; + + return 0; +} + +static void reverse_filter_free(git_filter *f) +{ + git__free(f); +} + +git_filter *create_reverse_filter(const char *attrs) +{ + git_filter *filter = git__calloc(1, sizeof(git_filter)); + cl_assert(filter); + + filter->version = GIT_FILTER_VERSION; + filter->attributes = attrs; + filter->shutdown = reverse_filter_free; + filter->apply = reverse_filter_apply; + + return filter; +} diff --git a/vendor/libgit2/tests/filter/custom_helpers.h b/vendor/libgit2/tests/filter/custom_helpers.h new file mode 100644 index 000000000..13cfb23ae --- /dev/null +++ b/vendor/libgit2/tests/filter/custom_helpers.h @@ -0,0 +1,18 @@ +#include "git2/sys/filter.h" + +extern git_filter *create_bitflip_filter(void); +extern git_filter *create_reverse_filter(const char *attr); + +extern int bitflip_filter_apply( + git_filter *self, + void **payload, + git_buf *to, + const git_buf *from, + const git_filter_source *source); + +extern int reverse_filter_apply( + git_filter *self, + void **payload, + git_buf *to, + const git_buf *from, + const git_filter_source *source); diff --git a/vendor/libgit2/tests/filter/stream.c b/vendor/libgit2/tests/filter/stream.c index 6bf540ce7..30f5e5027 100644 --- a/vendor/libgit2/tests/filter/stream.c +++ b/vendor/libgit2/tests/filter/stream.c @@ -209,7 +209,7 @@ void test_filter_stream__smallfile(void) /* optionally write a 500 MB file through the compression stream */ void test_filter_stream__bigfile(void) { - if (!cl_getenv("GITTEST_INVASIVE_FS_SIZE")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_SIZE")) cl_skip(); test_stream(51200); diff --git a/vendor/libgit2/tests/filter/wildcard.c b/vendor/libgit2/tests/filter/wildcard.c new file mode 100644 index 000000000..999b33653 --- /dev/null +++ b/vendor/libgit2/tests/filter/wildcard.c @@ -0,0 +1,184 @@ +#include "clar_libgit2.h" +#include "posix.h" +#include "blob.h" +#include "filter.h" +#include "buf_text.h" +#include "git2/sys/filter.h" +#include "git2/sys/repository.h" +#include "custom_helpers.h" + +static git_repository *g_repo = NULL; + +static git_filter *create_wildcard_filter(void); + +#define DATA_LEN 32 + +static unsigned char input[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, +}; + +static unsigned char reversed[] = { + 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, + 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, +}; + +static unsigned char flipped[] = { + 0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, + 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2, 0xf1, 0xf0, + 0xef, 0xee, 0xed, 0xec, 0xeb, 0xea, 0xe9, 0xe8, + 0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, 0xe1, 0xe0, +}; + +void test_filter_wildcard__initialize(void) +{ + cl_git_pass(git_filter_register( + "wildcard", create_wildcard_filter(), GIT_FILTER_DRIVER_PRIORITY)); + + g_repo = cl_git_sandbox_init("empty_standard_repo"); + + cl_git_rewritefile( + "empty_standard_repo/.gitattributes", + "* binary\n" + "hero-flip-* filter=wcflip\n" + "hero-reverse-* filter=wcreverse\n" + "none-* filter=unregistered\n"); +} + +void test_filter_wildcard__cleanup(void) +{ + cl_git_pass(git_filter_unregister("wildcard")); + + cl_git_sandbox_cleanup(); + g_repo = NULL; +} + +static int wildcard_filter_check( + git_filter *self, + void **payload, + const git_filter_source *src, + const char **attr_values) +{ + GIT_UNUSED(self); + GIT_UNUSED(src); + + if (strcmp(attr_values[0], "wcflip") == 0 || + strcmp(attr_values[0], "wcreverse") == 0) { + *payload = git__strdup(attr_values[0]); + GITERR_CHECK_ALLOC(*payload); + return 0; + } + + return GIT_PASSTHROUGH; +} + +static int wildcard_filter_apply( + git_filter *self, + void **payload, + git_buf *to, + const git_buf *from, + const git_filter_source *source) +{ + const char *filtername = *payload; + + if (filtername && strcmp(filtername, "wcflip") == 0) + return bitflip_filter_apply(self, payload, to, from, source); + else if (filtername && strcmp(filtername, "wcreverse") == 0) + return reverse_filter_apply(self, payload, to, from, source); + + cl_fail("Unexpected attribute"); + return GIT_PASSTHROUGH; +} + +static void wildcard_filter_cleanup(git_filter *self, void *payload) +{ + GIT_UNUSED(self); + git__free(payload); +} + +static void wildcard_filter_free(git_filter *f) +{ + git__free(f); +} + +static git_filter *create_wildcard_filter(void) +{ + git_filter *filter = git__calloc(1, sizeof(git_filter)); + cl_assert(filter); + + filter->version = GIT_FILTER_VERSION; + filter->attributes = "filter=*"; + filter->check = wildcard_filter_check; + filter->apply = wildcard_filter_apply; + filter->cleanup = wildcard_filter_cleanup; + filter->shutdown = wildcard_filter_free; + + return filter; +} + +void test_filter_wildcard__reverse(void) +{ + git_filter_list *fl; + git_buf in = GIT_BUF_INIT, out = GIT_BUF_INIT; + + cl_git_pass(git_filter_list_load( + &fl, g_repo, NULL, "hero-reverse-foo", GIT_FILTER_TO_ODB, 0)); + + cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN)); + cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); + + cl_assert_equal_i(DATA_LEN, out.size); + + cl_assert_equal_i( + 0, memcmp(reversed, out.ptr, out.size)); + + git_filter_list_free(fl); + git_buf_free(&out); + git_buf_free(&in); +} + +void test_filter_wildcard__flip(void) +{ + git_filter_list *fl; + git_buf in = GIT_BUF_INIT, out = GIT_BUF_INIT; + + cl_git_pass(git_filter_list_load( + &fl, g_repo, NULL, "hero-flip-foo", GIT_FILTER_TO_ODB, 0)); + + cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN)); + cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); + + cl_assert_equal_i(DATA_LEN, out.size); + + cl_assert_equal_i( + 0, memcmp(flipped, out.ptr, out.size)); + + git_filter_list_free(fl); + git_buf_free(&out); + git_buf_free(&in); +} + +void test_filter_wildcard__none(void) +{ + git_filter_list *fl; + git_buf in = GIT_BUF_INIT, out = GIT_BUF_INIT; + + cl_git_pass(git_filter_list_load( + &fl, g_repo, NULL, "none-foo", GIT_FILTER_TO_ODB, 0)); + + cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN)); + cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); + + cl_assert_equal_i(DATA_LEN, out.size); + + cl_assert_equal_i( + 0, memcmp(input, out.ptr, out.size)); + + git_filter_list_free(fl); + git_buf_free(&out); + git_buf_free(&in); +} diff --git a/vendor/libgit2/tests/index/add.c b/vendor/libgit2/tests/index/add.c new file mode 100644 index 000000000..f101ea266 --- /dev/null +++ b/vendor/libgit2/tests/index/add.c @@ -0,0 +1,84 @@ +#include "clar_libgit2.h" + +static git_repository *g_repo = NULL; +static git_index *g_index = NULL; + +static const char *valid_blob_id = "fa49b077972391ad58037050f2a75f74e3671e92"; +static const char *valid_tree_id = "181037049a54a1eb5fab404658a3a250b44335d7"; +static const char *valid_commit_id = "763d71aadf09a7951596c9746c024e7eece7c7af"; +static const char *invalid_id = "1234567890123456789012345678901234567890"; + +void test_index_add__initialize(void) +{ + g_repo = cl_git_sandbox_init("testrepo"); + cl_git_pass(git_repository_index(&g_index, g_repo)); +} + +void test_index_add__cleanup(void) +{ + git_index_free(g_index); + cl_git_sandbox_cleanup(); + g_repo = NULL; + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1)); +} + +static void test_add_entry( + bool should_succeed, const char *idstr, git_filemode_t mode) +{ + git_index_entry entry = {{0}}; + + cl_git_pass(git_oid_fromstr(&entry.id, idstr)); + + entry.path = mode == GIT_FILEMODE_TREE ? "test_folder" : "test_file"; + entry.mode = mode; + + if (should_succeed) + cl_git_pass(git_index_add(g_index, &entry)); + else + cl_git_fail(git_index_add(g_index, &entry)); +} + +void test_index_add__invalid_entries_succeeds_by_default(void) +{ + /* + * Ensure that there is validation on object ids by default + */ + + /* ensure that we can add some actually good entries */ + test_add_entry(true, valid_blob_id, GIT_FILEMODE_BLOB); + test_add_entry(true, valid_blob_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(true, valid_blob_id, GIT_FILEMODE_LINK); + + /* test that we fail to add some invalid (missing) blobs and trees */ + test_add_entry(false, invalid_id, GIT_FILEMODE_BLOB); + test_add_entry(false, invalid_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(false, invalid_id, GIT_FILEMODE_LINK); + + /* test that we validate the types of objects */ + test_add_entry(false, valid_commit_id, GIT_FILEMODE_BLOB); + test_add_entry(false, valid_tree_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(false, valid_commit_id, GIT_FILEMODE_LINK); + + /* + * Ensure that there we can disable validation + */ + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0)); + + /* ensure that we can add some actually good entries */ + test_add_entry(true, valid_blob_id, GIT_FILEMODE_BLOB); + test_add_entry(true, valid_blob_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(true, valid_blob_id, GIT_FILEMODE_LINK); + + /* test that we can now add some invalid (missing) blobs and trees */ + test_add_entry(true, invalid_id, GIT_FILEMODE_BLOB); + test_add_entry(true, invalid_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(true, invalid_id, GIT_FILEMODE_LINK); + + /* test that we do not validate the types of objects */ + test_add_entry(true, valid_commit_id, GIT_FILEMODE_BLOB); + test_add_entry(true, valid_tree_id, GIT_FILEMODE_BLOB_EXECUTABLE); + test_add_entry(true, valid_commit_id, GIT_FILEMODE_LINK); +} + diff --git a/vendor/libgit2/tests/index/addall.c b/vendor/libgit2/tests/index/addall.c index 9ddb27f95..7b7a178d1 100644 --- a/vendor/libgit2/tests/index/addall.c +++ b/vendor/libgit2/tests/index/addall.c @@ -307,6 +307,41 @@ void test_index_addall__files_in_folders(void) git_index_free(index); } +void test_index_addall__hidden_files(void) +{ + git_index *index; + + GIT_UNUSED(index); + +#ifdef GIT_WIN32 + addall_create_test_repo(true); + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_stat_data(index, TEST_DIR "/file.bar", true); + check_status(g_repo, 2, 0, 0, 0, 0, 0, 1, 0); + + cl_git_mkfile(TEST_DIR "/file.zzz", "yet another one"); + cl_git_mkfile(TEST_DIR "/more.zzz", "yet another one"); + cl_git_mkfile(TEST_DIR "/other.zzz", "yet another one"); + + check_status(g_repo, 2, 0, 0, 3, 0, 0, 1, 0); + + cl_git_pass(git_win32__set_hidden(TEST_DIR "/file.zzz", true)); + cl_git_pass(git_win32__set_hidden(TEST_DIR "/more.zzz", true)); + cl_git_pass(git_win32__set_hidden(TEST_DIR "/other.zzz", true)); + + check_status(g_repo, 2, 0, 0, 3, 0, 0, 1, 0); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_stat_data(index, TEST_DIR "/file.bar", true); + check_status(g_repo, 5, 0, 0, 0, 0, 0, 1, 0); + + git_index_free(index); +#endif +} + static int addall_match_prefix( const char *path, const char *matched_pathspec, void *payload) { diff --git a/vendor/libgit2/tests/index/bypath.c b/vendor/libgit2/tests/index/bypath.c index 9706a8833..34a7412a8 100644 --- a/vendor/libgit2/tests/index/bypath.c +++ b/vendor/libgit2/tests/index/bypath.c @@ -46,3 +46,317 @@ void test_index_bypath__add_submodule_unregistered(void) cl_assert_equal_s(sm_head, git_oid_tostr_s(&entry->id)); cl_assert_equal_s(sm_name, entry->path); } + +void test_index_bypath__add_hidden(void) +{ + const git_index_entry *entry; + bool hidden; + + GIT_UNUSED(entry); + GIT_UNUSED(hidden); + +#ifdef GIT_WIN32 + cl_git_mkfile("submod2/hidden_file", "you can't see me"); + + cl_git_pass(git_win32__hidden(&hidden, "submod2/hidden_file")); + cl_assert(!hidden); + + cl_git_pass(git_win32__set_hidden("submod2/hidden_file", true)); + + cl_git_pass(git_win32__hidden(&hidden, "submod2/hidden_file")); + cl_assert(hidden); + + cl_git_pass(git_index_add_bypath(g_idx, "hidden_file")); + + cl_assert(entry = git_index_get_bypath(g_idx, "hidden_file", 0)); + cl_assert_equal_i(GIT_FILEMODE_BLOB, entry->mode); +#endif +} + +void test_index_bypath__add_keeps_existing_case(void) +{ + const git_index_entry *entry; + + if (!cl_repo_get_bool(g_repo, "core.ignorecase")) + clar__skip(); + + cl_git_mkfile("submod2/just_a_dir/file1.txt", "This is a file"); + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/file1.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "just_a_dir/file1.txt", 0)); + cl_assert_equal_s("just_a_dir/file1.txt", entry->path); + + cl_git_rewritefile("submod2/just_a_dir/file1.txt", "Updated!"); + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/FILE1.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "just_a_dir/FILE1.txt", 0)); + cl_assert_equal_s("just_a_dir/file1.txt", entry->path); +} + +void test_index_bypath__add_honors_existing_case(void) +{ + const git_index_entry *entry; + + if (!cl_repo_get_bool(g_repo, "core.ignorecase")) + clar__skip(); + + cl_git_mkfile("submod2/just_a_dir/file1.txt", "This is a file"); + cl_git_mkfile("submod2/just_a_dir/file2.txt", "This is another file"); + cl_git_mkfile("submod2/just_a_dir/file3.txt", "This is another file"); + cl_git_mkfile("submod2/just_a_dir/file4.txt", "And another file"); + + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/File1.txt")); + cl_git_pass(git_index_add_bypath(g_idx, "JUST_A_DIR/file2.txt")); + cl_git_pass(git_index_add_bypath(g_idx, "Just_A_Dir/FILE3.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "just_a_dir/File1.txt", 0)); + cl_assert_equal_s("just_a_dir/File1.txt", entry->path); + + cl_assert(entry = git_index_get_bypath(g_idx, "JUST_A_DIR/file2.txt", 0)); + cl_assert_equal_s("just_a_dir/file2.txt", entry->path); + + cl_assert(entry = git_index_get_bypath(g_idx, "Just_A_Dir/FILE3.txt", 0)); + cl_assert_equal_s("just_a_dir/FILE3.txt", entry->path); + + cl_git_rewritefile("submod2/just_a_dir/file3.txt", "Rewritten"); + cl_git_pass(git_index_add_bypath(g_idx, "Just_A_Dir/file3.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "Just_A_Dir/file3.txt", 0)); + cl_assert_equal_s("just_a_dir/FILE3.txt", entry->path); +} + +void test_index_bypath__add_honors_existing_case_2(void) +{ + git_index_entry dummy = { { 0 } }; + const git_index_entry *entry; + + if (!cl_repo_get_bool(g_repo, "core.ignorecase")) + clar__skip(); + + dummy.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + + /* note that `git_index_add` does no checking to canonical directories */ + dummy.path = "Just_a_dir/file0.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "just_a_dir/fileA.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "Just_A_Dir/fileB.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "JUST_A_DIR/fileC.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "just_A_dir/fileD.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "JUST_a_DIR/fileE.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + cl_git_mkfile("submod2/just_a_dir/file1.txt", "This is a file"); + cl_git_mkfile("submod2/just_a_dir/file2.txt", "This is another file"); + cl_git_mkfile("submod2/just_a_dir/file3.txt", "This is another file"); + cl_git_mkfile("submod2/just_a_dir/file4.txt", "And another file"); + + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/File1.txt")); + cl_git_pass(git_index_add_bypath(g_idx, "JUST_A_DIR/file2.txt")); + cl_git_pass(git_index_add_bypath(g_idx, "Just_A_Dir/FILE3.txt")); + cl_git_pass(git_index_add_bypath(g_idx, "JusT_A_DIR/FILE4.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "just_a_dir/File1.txt", 0)); + cl_assert_equal_s("just_a_dir/File1.txt", entry->path); + + cl_assert(entry = git_index_get_bypath(g_idx, "JUST_A_DIR/file2.txt", 0)); + cl_assert_equal_s("JUST_A_DIR/file2.txt", entry->path); + + cl_assert(entry = git_index_get_bypath(g_idx, "Just_A_Dir/FILE3.txt", 0)); + cl_assert_equal_s("Just_A_Dir/FILE3.txt", entry->path); + + cl_git_rewritefile("submod2/just_a_dir/file3.txt", "Rewritten"); + cl_git_pass(git_index_add_bypath(g_idx, "Just_A_Dir/file3.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "Just_A_Dir/file3.txt", 0)); + cl_assert_equal_s("Just_A_Dir/FILE3.txt", entry->path); +} + +void test_index_bypath__add_honors_existing_case_3(void) +{ + git_index_entry dummy = { { 0 } }; + const git_index_entry *entry; + + if (!cl_repo_get_bool(g_repo, "core.ignorecase")) + clar__skip(); + + dummy.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + + dummy.path = "just_a_dir/filea.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "Just_A_Dir/fileB.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "just_A_DIR/FILEC.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "Just_a_DIR/FileD.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + cl_git_mkfile("submod2/JuSt_A_DiR/fILEE.txt", "This is a file"); + + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/fILEE.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "JUST_A_DIR/fILEE.txt", 0)); + cl_assert_equal_s("just_a_dir/fILEE.txt", entry->path); +} + +void test_index_bypath__add_honors_existing_case_4(void) +{ + git_index_entry dummy = { { 0 } }; + const git_index_entry *entry; + + if (!cl_repo_get_bool(g_repo, "core.ignorecase")) + clar__skip(); + + dummy.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b")); + + dummy.path = "just_a_dir/a/b/c/d/e/file1.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + dummy.path = "just_a_dir/a/B/C/D/E/file2.txt"; + cl_git_pass(git_index_add(g_idx, &dummy)); + + cl_must_pass(p_mkdir("submod2/just_a_dir/a", 0777)); + cl_must_pass(p_mkdir("submod2/just_a_dir/a/b", 0777)); + cl_must_pass(p_mkdir("submod2/just_a_dir/a/b/z", 0777)); + cl_must_pass(p_mkdir("submod2/just_a_dir/a/b/z/y", 0777)); + cl_must_pass(p_mkdir("submod2/just_a_dir/a/b/z/y/x", 0777)); + + cl_git_mkfile("submod2/just_a_dir/a/b/z/y/x/FOO.txt", "This is a file"); + + cl_git_pass(git_index_add_bypath(g_idx, "just_a_dir/A/b/Z/y/X/foo.txt")); + + cl_assert(entry = git_index_get_bypath(g_idx, "just_a_dir/A/b/Z/y/X/foo.txt", 0)); + cl_assert_equal_s("just_a_dir/a/b/Z/y/X/foo.txt", entry->path); +} + +void test_index_bypath__add_honors_mode(void) +{ + const git_index_entry *entry; + git_index_entry new_entry; + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + + memcpy(&new_entry, entry, sizeof(git_index_entry)); + new_entry.path = "README.txt"; + new_entry.mode = GIT_FILEMODE_BLOB_EXECUTABLE; + + cl_must_pass(p_chmod("submod2/README.txt", GIT_FILEMODE_BLOB_EXECUTABLE)); + + cl_git_pass(git_index_add(g_idx, &new_entry)); + cl_git_pass(git_index_write(g_idx)); + + cl_git_rewritefile("submod2/README.txt", "Modified but still executable"); + + cl_git_pass(git_index_add_bypath(g_idx, "README.txt")); + cl_git_pass(git_index_write(g_idx)); + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + cl_assert_equal_i(GIT_FILEMODE_BLOB_EXECUTABLE, entry->mode); +} + +void test_index_bypath__add_honors_conflict_mode(void) +{ + const git_index_entry *entry; + git_index_entry new_entry; + int stage = 0; + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + + memcpy(&new_entry, entry, sizeof(git_index_entry)); + new_entry.path = "README.txt"; + new_entry.mode = GIT_FILEMODE_BLOB_EXECUTABLE; + + cl_must_pass(p_chmod("submod2/README.txt", GIT_FILEMODE_BLOB_EXECUTABLE)); + + cl_git_pass(git_index_remove_bypath(g_idx, "README.txt")); + + for (stage = 1; stage <= 3; stage++) { + new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT; + cl_git_pass(git_index_add(g_idx, &new_entry)); + } + + cl_git_pass(git_index_write(g_idx)); + + cl_git_rewritefile("submod2/README.txt", "Modified but still executable"); + + cl_git_pass(git_index_add_bypath(g_idx, "README.txt")); + cl_git_pass(git_index_write(g_idx)); + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + cl_assert_equal_i(GIT_FILEMODE_BLOB_EXECUTABLE, entry->mode); +} + +void test_index_bypath__add_honors_conflict_case(void) +{ + const git_index_entry *entry; + git_index_entry new_entry; + int stage = 0; + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + + memcpy(&new_entry, entry, sizeof(git_index_entry)); + new_entry.path = "README.txt"; + new_entry.mode = GIT_FILEMODE_BLOB_EXECUTABLE; + + cl_must_pass(p_chmod("submod2/README.txt", GIT_FILEMODE_BLOB_EXECUTABLE)); + + cl_git_pass(git_index_remove_bypath(g_idx, "README.txt")); + + for (stage = 1; stage <= 3; stage++) { + new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT; + cl_git_pass(git_index_add(g_idx, &new_entry)); + } + + cl_git_pass(git_index_write(g_idx)); + + cl_git_rewritefile("submod2/README.txt", "Modified but still executable"); + + cl_git_pass(git_index_add_bypath(g_idx, "README.txt")); + cl_git_pass(git_index_write(g_idx)); + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + cl_assert_equal_i(GIT_FILEMODE_BLOB_EXECUTABLE, entry->mode); +} + +void test_index_bypath__add_honors_symlink(void) +{ + const git_index_entry *entry; + git_index_entry new_entry; + int symlinks; + + cl_git_pass(git_repository__cvar(&symlinks, g_repo, GIT_CVAR_SYMLINKS)); + + if (symlinks) + cl_skip(); + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + + memcpy(&new_entry, entry, sizeof(git_index_entry)); + new_entry.path = "README.txt"; + new_entry.mode = GIT_FILEMODE_LINK; + + cl_git_pass(git_index_add(g_idx, &new_entry)); + cl_git_pass(git_index_write(g_idx)); + + cl_git_rewritefile("submod2/README.txt", "Modified but still a (fake) symlink"); + + cl_git_pass(git_index_add_bypath(g_idx, "README.txt")); + cl_git_pass(git_index_write(g_idx)); + + cl_assert((entry = git_index_get_bypath(g_idx, "README.txt", 0)) != NULL); + cl_assert_equal_i(GIT_FILEMODE_LINK, entry->mode); +} diff --git a/vendor/libgit2/tests/index/cache.c b/vendor/libgit2/tests/index/cache.c index 3982bf183..56885aff7 100644 --- a/vendor/libgit2/tests/index/cache.c +++ b/vendor/libgit2/tests/index/cache.c @@ -111,7 +111,7 @@ void test_index_cache__read_tree_no_children(void) memset(&entry, 0x0, sizeof(git_index_entry)); entry.path = "new.txt"; entry.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057"); + git_oid_fromstr(&entry.id, "d4bcc68acd4410bf836a39f20afb2c2ece09584e"); cl_git_pass(git_index_add(index, &entry)); cl_assert_equal_i(-1, index->tree->entry_count); @@ -191,7 +191,7 @@ void test_index_cache__read_tree_children(void) memset(&entry, 0x0, sizeof(git_index_entry)); entry.path = "top-level"; entry.mode = GIT_FILEMODE_BLOB; - git_oid_fromstr(&entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057"); + git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); cl_git_pass(git_index_add(index, &entry)); @@ -217,7 +217,7 @@ void test_index_cache__read_tree_children(void) /* override with a slightly different id, also dummy */ entry.path = "subdir/some-file"; - git_oid_fromstr(&entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb058"); + git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); cl_git_pass(git_index_add(index, &entry)); cl_assert_equal_i(-1, index->tree->entry_count); diff --git a/vendor/libgit2/tests/index/conflicts.c b/vendor/libgit2/tests/index/conflicts.c index b7a2456eb..d4004686f 100644 --- a/vendor/libgit2/tests/index/conflicts.c +++ b/vendor/libgit2/tests/index/conflicts.c @@ -16,11 +16,6 @@ static git_index *repo_index; #define CONFLICTS_TWO_OUR_OID "8b3f43d2402825c200f835ca1762413e386fd0b2" #define CONFLICTS_TWO_THEIR_OID "220bd62631c8cf7a83ef39c6b94595f00517211e" -#define TEST_STAGED_OID "beefdadafeedabedcafedeedbabedeadbeaddeaf" -#define TEST_ANCESTOR_OID "f00ff00ff00ff00ff00ff00ff00ff00ff00ff00f" -#define TEST_OUR_OID "b44bb44bb44bb44bb44bb44bb44bb44bb44bb44b" -#define TEST_THEIR_OID "0123456789abcdef0123456789abcdef01234567" - // Fixture setup and teardown void test_index_conflicts__initialize(void) { @@ -49,17 +44,17 @@ void test_index_conflicts__add(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1); - git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&our_entry, 2); - git_oid_fromstr(&our_entry.id, TEST_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2); - git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -80,17 +75,17 @@ void test_index_conflicts__add_fixes_incorrect_stage(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3); - git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&our_entry, 1); - git_oid_fromstr(&our_entry.id, TEST_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&their_entry, 2); - git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -105,36 +100,33 @@ void test_index_conflicts__add_fixes_incorrect_stage(void) void test_index_conflicts__add_removes_stage_zero(void) { - git_index_entry staged, ancestor_entry, our_entry, their_entry; + git_index_entry ancestor_entry, our_entry, their_entry; const git_index_entry *conflict_entry[3]; cl_assert(git_index_entrycount(repo_index) == 8); - memset(&staged, 0x0, sizeof(git_index_entry)); memset(&ancestor_entry, 0x0, sizeof(git_index_entry)); memset(&our_entry, 0x0, sizeof(git_index_entry)); memset(&their_entry, 0x0, sizeof(git_index_entry)); - staged.path = "test-one.txt"; - staged.mode = 0100644; - git_oid_fromstr(&staged.id, TEST_STAGED_OID); - cl_git_pass(git_index_add(repo_index, &staged)); + cl_git_mkfile("./mergedrepo/test-one.txt", "new-file\n"); + cl_git_pass(git_index_add_bypath(repo_index, "test-one.txt")); cl_assert(git_index_entrycount(repo_index) == 9); ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3); - git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); our_entry.path = "test-one.txt"; our_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&our_entry, 1); - git_oid_fromstr(&our_entry.id, TEST_OUR_OID); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); their_entry.path = "test-one.txt"; their_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&their_entry, 2); - git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -330,7 +322,7 @@ void test_index_conflicts__partial(void) ancestor_entry.path = "test-one.txt"; ancestor_entry.mode = 0100644; GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1); - git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL)); cl_assert(git_index_entrycount(repo_index) == 9); @@ -342,3 +334,94 @@ void test_index_conflicts__partial(void) cl_assert(conflict_entry[1] == NULL); cl_assert(conflict_entry[2] == NULL); } + +void test_index_conflicts__case_matters(void) +{ + const git_index_entry *conflict_entry[3]; + git_oid oid; + const char *upper_case = "DIFFERS-IN-CASE.TXT"; + const char *mixed_case = "Differs-In-Case.txt"; + const char *correct_case; + bool ignorecase = cl_repo_get_bool(repo, "core.ignorecase"); + + git_index_entry ancestor_entry, our_entry, their_entry; + + memset(&ancestor_entry, 0x0, sizeof(git_index_entry)); + memset(&our_entry, 0x0, sizeof(git_index_entry)); + memset(&their_entry, 0x0, sizeof(git_index_entry)); + + ancestor_entry.path = upper_case; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID); + ancestor_entry.mode = GIT_FILEMODE_BLOB; + + our_entry.path = upper_case; + GIT_IDXENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS); + git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID); + our_entry.mode = GIT_FILEMODE_BLOB; + + their_entry.path = upper_case; + GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS); + git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID); + their_entry.mode = GIT_FILEMODE_BLOB; + + cl_git_pass(git_index_conflict_add(repo_index, + &ancestor_entry, &our_entry, &their_entry)); + + ancestor_entry.path = mixed_case; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); + git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID); + ancestor_entry.mode = GIT_FILEMODE_BLOB; + + our_entry.path = mixed_case; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR); + git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID); + ancestor_entry.mode = GIT_FILEMODE_BLOB; + + their_entry.path = mixed_case; + GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS); + git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID); + their_entry.mode = GIT_FILEMODE_BLOB; + + cl_git_pass(git_index_conflict_add(repo_index, + &ancestor_entry, &our_entry, &their_entry)); + + cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], + &conflict_entry[2], repo_index, upper_case)); + + /* + * We inserted with mixed case last, so on a case-insensitive + * fs we should get the mixed case. + */ + if (ignorecase) + correct_case = mixed_case; + else + correct_case = upper_case; + + cl_assert_equal_s(correct_case, conflict_entry[0]->path); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_ANCESTOR_OID : CONFLICTS_ONE_ANCESTOR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); + + cl_assert_equal_s(correct_case, conflict_entry[1]->path); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_OUR_OID : CONFLICTS_ONE_OUR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); + + cl_assert_equal_s(correct_case, conflict_entry[2]->path); + git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_THEIR_OID : CONFLICTS_ONE_THEIR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); + + cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], + &conflict_entry[2], repo_index, mixed_case)); + + cl_assert_equal_s(mixed_case, conflict_entry[0]->path); + git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[0]->id); + + cl_assert_equal_s(mixed_case, conflict_entry[1]->path); + git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[1]->id); + + cl_assert_equal_s(mixed_case, conflict_entry[2]->path); + git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID); + cl_assert_equal_oid(&oid, &conflict_entry[2]->id); +} diff --git a/vendor/libgit2/tests/index/filemodes.c b/vendor/libgit2/tests/index/filemodes.c index b3907996b..2efad5b33 100644 --- a/vendor/libgit2/tests/index/filemodes.c +++ b/vendor/libgit2/tests/index/filemodes.c @@ -236,11 +236,19 @@ void test_index_filemodes__invalid(void) { git_index *index; git_index_entry entry; + const git_index_entry *dummy; cl_git_pass(git_repository_index(&index, g_repo)); + /* add a dummy file so that we have a valid id */ + cl_git_mkfile("./filemodes/dummy-file.txt", "new-file\n"); + cl_git_pass(git_index_add_bypath(index, "dummy-file.txt")); + cl_assert((dummy = git_index_get_bypath(index, "dummy-file.txt", 0))); + + GIT_IDXENTRY_STAGE_SET(&entry, 0); entry.path = "foo"; entry.mode = GIT_OBJ_BLOB; + git_oid_cpy(&entry.id, &dummy->id); cl_git_fail(git_index_add(index, &entry)); entry.mode = GIT_FILEMODE_BLOB; diff --git a/vendor/libgit2/tests/index/nsec.c b/vendor/libgit2/tests/index/nsec.c index 5004339f0..244ab6362 100644 --- a/vendor/libgit2/tests/index/nsec.c +++ b/vendor/libgit2/tests/index/nsec.c @@ -61,8 +61,17 @@ void test_index_nsec__staging_maintains_other_nanos(void) cl_assert_equal_b(true, has_nsecs()); cl_assert((entry = git_index_get_bypath(repo_index, "a.txt", 0))); + + /* if we are writing nanoseconds to the index, expect them to be + * nonzero. if we are *not*, expect that we truncated the entry. + */ +#ifdef GIT_USE_NSEC + cl_assert(entry->ctime.nanoseconds != 0); + cl_assert(entry->mtime.nanoseconds != 0); +#else cl_assert_equal_i(0, entry->ctime.nanoseconds); cl_assert_equal_i(0, entry->mtime.nanoseconds); +#endif } void test_index_nsec__status_doesnt_clear_nsecs(void) diff --git a/vendor/libgit2/tests/index/racy.c b/vendor/libgit2/tests/index/racy.c index 3b26aabf4..1768f5efd 100644 --- a/vendor/libgit2/tests/index/racy.c +++ b/vendor/libgit2/tests/index/racy.c @@ -54,7 +54,7 @@ void test_index_racy__write_index_just_after_file(void) git_index *index; git_diff *diff; git_buf path = GIT_BUF_INIT; - struct timeval times[2]; + struct p_timeval times[2]; /* Make sure we do have a timestamp */ cl_git_pass(git_repository_index(&index, g_repo)); @@ -63,10 +63,10 @@ void test_index_racy__write_index_just_after_file(void) cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); cl_git_mkfile(path.ptr, "A"); /* Force the file's timestamp to be a second after we wrote the index */ - times[0].tv_sec = index->stamp.mtime + 1; - times[0].tv_usec = 0; - times[1].tv_sec = index->stamp.mtime + 1; - times[1].tv_usec = 0; + times[0].tv_sec = index->stamp.mtime.tv_sec + 1; + times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000; + times[1].tv_sec = index->stamp.mtime.tv_sec + 1; + times[1].tv_usec = index->stamp.mtime.tv_nsec / 1000; cl_git_pass(p_utimes(path.ptr, times)); /* @@ -79,13 +79,13 @@ void test_index_racy__write_index_just_after_file(void) cl_git_mkfile(path.ptr, "B"); /* - * Pretend this index' modification happend a second after the + * Pretend this index' modification happened a second after the * file update, and rewrite the file in that same second. */ - times[0].tv_sec = index->stamp.mtime + 2; - times[0].tv_usec = 0; - times[1].tv_sec = index->stamp.mtime + 2; - times[0].tv_usec = 0; + times[0].tv_sec = index->stamp.mtime.tv_sec + 2; + times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000; + times[1].tv_sec = index->stamp.mtime.tv_sec + 2; + times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000; cl_git_pass(p_utimes(git_index_path(index), times)); cl_git_pass(p_utimes(path.ptr, times)); @@ -100,13 +100,13 @@ void test_index_racy__write_index_just_after_file(void) git_index_free(index); } -void test_index_racy__empty_file_after_smudge(void) + +static void setup_race(void) { - git_index *index; - git_diff *diff; git_buf path = GIT_BUF_INIT; - int i, found_race = 0; - const git_index_entry *entry; + git_index *index; + git_index_entry *entry; + struct stat st; /* Make sure we do have a timestamp */ cl_git_pass(git_repository_index__weakptr(&index, g_repo)); @@ -114,34 +114,211 @@ void test_index_racy__empty_file_after_smudge(void) cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); - /* Make sure writing the file, adding and rewriting happen in the same second */ - for (i = 0; i < 10; i++) { - struct stat st; - cl_git_mkfile(path.ptr, "A"); + cl_git_mkfile(path.ptr, "A"); + cl_git_pass(git_index_add_bypath(index, "A")); - cl_git_pass(git_index_add_bypath(index, "A")); - cl_git_mkfile(path.ptr, "B"); - cl_git_pass(git_index_write(index)); + cl_git_mkfile(path.ptr, "B"); + cl_git_pass(git_index_write(index)); + + cl_git_mkfile(path.ptr, ""); + + cl_git_pass(p_stat(path.ptr, &st)); + cl_assert(entry = (git_index_entry *)git_index_get_bypath(index, "A", 0)); + + /* force a race */ + entry->mtime.seconds = st.st_mtime; + entry->mtime.nanoseconds = st.st_mtime_nsec; + + git_buf_free(&path); +} - cl_git_mkfile(path.ptr, ""); +void test_index_racy__smudges_index_entry_on_save(void) +{ + git_index *index; + const git_index_entry *entry; - cl_git_pass(p_stat(path.ptr, &st)); - cl_assert(entry = git_index_get_bypath(index, "A", 0)); - if (entry->mtime.seconds == (int32_t) st.st_mtime) { - found_race = 1; - break; - } + setup_race(); - } + /* write the index, which will smudge anything that had the same timestamp + * as the index when the index was loaded. that way future loads of the + * index (with the new timestamp) will know that these files were not + * clean. + */ - if (!found_race) - cl_fail("failed to find race after 10 attempts"); + cl_git_pass(git_repository_index__weakptr(&index, g_repo)); + cl_git_pass(git_index_write(index)); + cl_assert(entry = git_index_get_bypath(index, "A", 0)); cl_assert_equal_i(0, entry->file_size); +} + +void test_index_racy__detects_diff_of_change_in_identical_timestamp(void) +{ + git_index *index; + git_diff *diff; + + cl_git_pass(git_repository_index__weakptr(&index, g_repo)); + + setup_race(); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL)); cl_assert_equal_i(1, git_diff_num_deltas(diff)); - git_buf_free(&path); git_diff_free(diff); } + +static void setup_uptodate_files(void) +{ + git_buf path = GIT_BUF_INIT; + git_index *index; + const git_index_entry *a_entry; + git_index_entry new_entry = {{0}}; + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); + cl_git_mkfile(path.ptr, "A"); + + /* Put 'A' into the index */ + cl_git_pass(git_index_add_bypath(index, "A")); + + cl_assert((a_entry = git_index_get_bypath(index, "A", 0))); + + /* Put 'B' into the index */ + new_entry.path = "B"; + new_entry.mode = GIT_FILEMODE_BLOB; + git_oid_cpy(&new_entry.id, &a_entry->id); + cl_git_pass(git_index_add(index, &new_entry)); + + /* Put 'C' into the index */ + new_entry.path = "C"; + new_entry.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_index_add_frombuffer(index, &new_entry, "hello!\n", 7)); + + git_index_free(index); + git_buf_free(&path); +} + +void test_index_racy__adding_to_index_is_uptodate(void) +{ + git_index *index; + const git_index_entry *entry; + + setup_uptodate_files(); + + cl_git_pass(git_repository_index(&index, g_repo)); + + /* ensure that they're all uptodate */ + cl_assert((entry = git_index_get_bypath(index, "A", 0))); + cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "B", 0))); + cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "C", 0))); + cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_git_pass(git_index_write(index)); + + git_index_free(index); +} + +void test_index_racy__reading_clears_uptodate_bit(void) +{ + git_index *index; + const git_index_entry *entry; + + setup_uptodate_files(); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_index_read(index, true)); + + /* ensure that no files are uptodate */ + cl_assert((entry = git_index_get_bypath(index, "A", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "B", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "C", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + git_index_free(index); +} + +void test_index_racy__read_tree_clears_uptodate_bit(void) +{ + git_index *index; + git_tree *tree; + const git_index_entry *entry; + git_oid id; + + setup_uptodate_files(); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write_tree_to(&id, index, g_repo)); + cl_git_pass(git_tree_lookup(&tree, g_repo, &id)); + cl_git_pass(git_index_read_tree(index, tree)); + + /* ensure that no files are uptodate */ + cl_assert((entry = git_index_get_bypath(index, "A", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "B", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(index, "C", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + git_tree_free(tree); + git_index_free(index); +} + +void test_index_racy__read_index_smudges(void) +{ + git_index *index, *newindex; + const git_index_entry *entry; + + /* if we are reading an index into our new index, ensure that any + * racy entries in the index that we're reading are smudged so that + * we don't propagate their timestamps without further investigation. + */ + setup_race(); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_new(&newindex)); + cl_git_pass(git_index_read_index(newindex, index)); + + cl_assert(entry = git_index_get_bypath(newindex, "A", 0)); + cl_assert_equal_i(0, entry->file_size); + + git_index_free(index); + git_index_free(newindex); +} + +void test_index_racy__read_index_clears_uptodate_bit(void) +{ + git_index *index, *newindex; + const git_index_entry *entry; + + setup_uptodate_files(); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_new(&newindex)); + cl_git_pass(git_index_read_index(newindex, index)); + + /* ensure that files brought in from the other index are not uptodate */ + cl_assert((entry = git_index_get_bypath(newindex, "A", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(newindex, "B", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + cl_assert((entry = git_index_get_bypath(newindex, "C", 0))); + cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE)); + + git_index_free(index); + git_index_free(newindex); +} diff --git a/vendor/libgit2/tests/index/rename.c b/vendor/libgit2/tests/index/rename.c index dd3cfa732..86eaf0053 100644 --- a/vendor/libgit2/tests/index/rename.c +++ b/vendor/libgit2/tests/index/rename.c @@ -48,3 +48,39 @@ void test_index_rename__single_file(void) cl_fixture_cleanup("rename"); } + +void test_index_rename__casechanging(void) +{ + git_repository *repo; + git_index *index; + const git_index_entry *entry; + git_index_entry new = {{0}}; + + p_mkdir("rename", 0700); + + cl_git_pass(git_repository_init(&repo, "./rename", 0)); + cl_git_pass(git_repository_index(&index, repo)); + + cl_git_mkfile("./rename/lame.name.txt", "new_file\n"); + + cl_git_pass(git_index_add_bypath(index, "lame.name.txt")); + cl_assert_equal_i(1, git_index_entrycount(index)); + cl_assert((entry = git_index_get_bypath(index, "lame.name.txt", 0))); + + memcpy(&new, entry, sizeof(git_index_entry)); + new.path = "LAME.name.TXT"; + + cl_git_pass(git_index_add(index, &new)); + cl_assert((entry = git_index_get_bypath(index, "LAME.name.TXT", 0))); + + if (cl_repo_get_bool(repo, "core.ignorecase")) + cl_assert_equal_i(1, git_index_entrycount(index)); + else + cl_assert_equal_i(2, git_index_entrycount(index)); + + git_index_free(index); + git_repository_free(repo); + + cl_fixture_cleanup("rename"); +} + diff --git a/vendor/libgit2/tests/index/tests.c b/vendor/libgit2/tests/index/tests.c index e1ff12ad0..1498196b2 100644 --- a/vendor/libgit2/tests/index/tests.c +++ b/vendor/libgit2/tests/index/tests.c @@ -155,6 +155,27 @@ void test_index_tests__find_in_empty(void) git_index_free(index); } +void test_index_tests__find_prefix(void) +{ + git_index *index; + const git_index_entry *entry; + size_t pos; + + cl_git_pass(git_index_open(&index, TEST_INDEX_PATH)); + + cl_git_pass(git_index_find_prefix(&pos, index, "src")); + entry = git_index_get_byindex(index, pos); + cl_assert(git__strcmp(entry->path, "src/block-sha1/sha1.c") == 0); + + cl_git_pass(git_index_find_prefix(&pos, index, "src/co")); + entry = git_index_get_byindex(index, pos); + cl_assert(git__strcmp(entry->path, "src/commit.c") == 0); + + cl_assert(GIT_ENOTFOUND == git_index_find_prefix(NULL, index, "blah")); + + git_index_free(index); +} + void test_index_tests__write(void) { git_index *index; @@ -731,7 +752,7 @@ void test_index_tests__reload_from_disk(void) cl_set_cleanup(&cleanup_myrepo, NULL); - cl_git_pass(git_futils_mkdir("./myrepo", NULL, 0777, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir("./myrepo", 0777, GIT_MKDIR_PATH)); cl_git_mkfile("./myrepo/a.txt", "a\n"); cl_git_mkfile("./myrepo/b.txt", "b\n"); @@ -792,10 +813,43 @@ void test_index_tests__reload_while_ignoring_case(void) cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE)); cl_git_pass(git_index_read(index, true)); cl_git_pass(git_vector_verify_sorted(&index->entries)); + cl_assert(git_index_get_bypath(index, ".HEADER", 0)); + cl_assert_equal_p(NULL, git_index_get_bypath(index, ".header", 0)); cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE)); cl_git_pass(git_index_read(index, true)); cl_git_pass(git_vector_verify_sorted(&index->entries)); + cl_assert(git_index_get_bypath(index, ".HEADER", 0)); + cl_assert(git_index_get_bypath(index, ".header", 0)); + + git_index_free(index); +} + +void test_index_tests__change_icase_on_instance(void) +{ + git_index *index; + unsigned int caps; + const git_index_entry *e; + + cl_git_pass(git_index_open(&index, TEST_INDEX_PATH)); + cl_git_pass(git_vector_verify_sorted(&index->entries)); + + caps = git_index_caps(index); + cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE)); + cl_assert_equal_i(false, index->ignore_case); + cl_git_pass(git_vector_verify_sorted(&index->entries)); + cl_assert(e = git_index_get_bypath(index, "src/common.h", 0)); + cl_assert_equal_p(NULL, e = git_index_get_bypath(index, "SRC/Common.h", 0)); + cl_assert(e = git_index_get_bypath(index, "COPYING", 0)); + cl_assert_equal_p(NULL, e = git_index_get_bypath(index, "copying", 0)); + + cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE)); + cl_assert_equal_i(true, index->ignore_case); + cl_git_pass(git_vector_verify_sorted(&index->entries)); + cl_assert(e = git_index_get_bypath(index, "COPYING", 0)); + cl_assert_equal_s("COPYING", e->path); + cl_assert(e = git_index_get_bypath(index, "copying", 0)); + cl_assert_equal_s("COPYING", e->path); git_index_free(index); } diff --git a/vendor/libgit2/tests/main.c b/vendor/libgit2/tests/main.c index 56326da1c..f67c8ffbc 100644 --- a/vendor/libgit2/tests/main.c +++ b/vendor/libgit2/tests/main.c @@ -1,10 +1,3 @@ - -#if defined(GIT_MSVC_CRTDBG) -/* Enable MSVC CRTDBG memory leak reporting. See src/util.h for details. */ -#include -#include -#endif - #include "clar_libgit2.h" #include "clar_libgit2_trace.h" @@ -16,18 +9,6 @@ int main(int argc, char *argv[]) { int res; -#if defined(GIT_MSVC_CRTDBG) - _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); - - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); - _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); - _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); - - _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); - _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); - _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); -#endif - clar_test_init(argc, argv); git_libgit2_init(); diff --git a/vendor/libgit2/tests/merge/conflict_data.h b/vendor/libgit2/tests/merge/conflict_data.h new file mode 100644 index 000000000..e6394a9e8 --- /dev/null +++ b/vendor/libgit2/tests/merge/conflict_data.h @@ -0,0 +1,103 @@ +#define AUTOMERGEABLE_MERGED_FILE \ + "this file is changed in master\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is automergeable\n" \ + "this file is changed in branch\n" + +#define AUTOMERGEABLE_MERGED_FILE_CRLF \ + "this file is changed in master\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is automergeable\r\n" \ + "this file is changed in branch\r\n" + +#define CONFLICTING_MERGE_FILE \ + "<<<<<<< HEAD\n" \ + "this file is changed in master and branch\n" \ + "=======\n" \ + "this file is changed in branch and master\n" \ + ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n" + +#define CONFLICTING_DIFF3_FILE \ + "<<<<<<< HEAD\n" \ + "this file is changed in master and branch\n" \ + "||||||| initial\n" \ + "this file is a conflict\n" \ + "=======\n" \ + "this file is changed in branch and master\n" \ + ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n" + +#define CONFLICTING_UNION_FILE \ + "this file is changed in master and branch\n" \ + "this file is changed in branch and master\n" + +#define CONFLICTING_RECURSIVE_F1_TO_F2 \ + "VEAL SOUP.\n" \ + "\n" \ + "<<<<<<< HEAD\n" \ + "PUT INTO A POT THREE QUARTS OF WATER, three onions cut small, ONE\n" \ + "=======\n" \ + "PUT INTO A POT THREE QUARTS OF WATER, three onions cut not too small, one\n" \ + ">>>>>>> branchF-2\n" \ + "spoonful of black pepper pounded, and two of salt, with two or three\n" \ + "slices of lean ham; let it boil steadily two hours; skim it\n" \ + "occasionally, then put into it a shin of veal, let it boil two hours\n" \ + "longer; take out the slices of ham, and skim off the grease if any\n" \ + "should rise, take a gill of good cream, mix with it two table-spoonsful\n" \ + "of flour very nicely, and the yelks of two eggs beaten well, strain this\n" \ + "mixture, and add some chopped parsley; pour some soup on by degrees,\n" \ + "stir it well, and pour it into the pot, continuing to stir until it has\n" \ + "boiled two or three minutes to take off the raw taste of the eggs. If\n" \ + "the cream be not perfectly sweet, and the eggs quite new, the thickening\n" \ + "will curdle in the soup. For a change you may put a dozen ripe tomatos\n" \ + "in, first taking off their skins, by letting them stand a few minutes in\n" \ + "hot water, when they may be easily peeled. When made in this way you\n" \ + "must thicken it with the flour only. Any part of the veal may be used,\n" \ + "but the shin or knuckle is the nicest.\n" \ + "\n" \ + "<<<<<<< HEAD\n" \ + "This certainly is a mighty fine recipe.\n" \ + "=======\n" \ + "This is a mighty fine recipe!\n" \ + ">>>>>>> branchF-2\n" + +#define CONFLICTING_RECURSIVE_H1_TO_H2_WITH_DIFF3 \ + "VEAL SOUP.\n" \ + "\n" \ + "<<<<<<< HEAD\n" \ + "put into a pot three quarts of water, three onions cut small, one\n" \ + "||||||| merged common ancestors\n" \ + "<<<<<<< Temporary merge branch 1\n" \ + "Put into a pot three quarts of water, THREE ONIONS CUT SMALL, one\n" \ + "||||||| merged common ancestors\n" \ + "Put into a pot three quarts of water, three onions cut small, one\n" \ + "=======\n" \ + "PUT INTO A POT three quarts of water, three onions cut small, one\n" \ + ">>>>>>> Temporary merge branch 2\n" \ + "=======\n" \ + "Put Into A Pot Three Quarts of Water, Three Onions Cut Small, One\n" \ + ">>>>>>> branchH-2\n" \ + "spoonful of black pepper pounded, and two of salt, with two or three\n" \ + "slices of lean ham; let it boil steadily two hours; skim it\n" \ + "occasionally, then put into it a shin of veal, let it boil two hours\n" \ + "longer; take out the slices of ham, and skim off the grease if any\n" \ + "should rise, take a gill of good cream, mix with it two table-spoonsful\n" \ + "of flour very nicely, and the yelks of two eggs beaten well, strain this\n" \ + "mixture, and add some chopped parsley; pour some soup on by degrees,\n" \ + "stir it well, and pour it into the pot, continuing to stir until it has\n" \ + "boiled two or three minutes to take off the raw taste of the eggs. If\n" \ + "the cream be not perfectly sweet, and the eggs quite new, the thickening\n" \ + "will curdle in the soup. For a change you may put a dozen ripe tomatos\n" \ + "in, first taking off their skins, by letting them stand a few minutes in\n" \ + "hot water, when they may be easily peeled. When made in this way you\n" \ + "must thicken it with the flour only. Any part of the veal may be used,\n" \ + "but the shin or knuckle is the nicest.\n" diff --git a/vendor/libgit2/tests/merge/files.c b/vendor/libgit2/tests/merge/files.c index 2d55df2b2..daa73fada 100644 --- a/vendor/libgit2/tests/merge/files.c +++ b/vendor/libgit2/tests/merge/files.c @@ -4,6 +4,7 @@ #include "buffer.h" #include "merge.h" #include "merge_helpers.h" +#include "conflict_data.h" #include "refs.h" #include "fileops.h" #include "diff_xdiff.h" diff --git a/vendor/libgit2/tests/merge/merge_helpers.c b/vendor/libgit2/tests/merge/merge_helpers.c index f81471424..4b1b7d262 100644 --- a/vendor/libgit2/tests/merge/merge_helpers.c +++ b/vendor/libgit2/tests/merge/merge_helpers.c @@ -4,6 +4,7 @@ #include "tree.h" #include "merge_helpers.h" #include "merge.h" +#include "index.h" #include "git2/merge.h" #include "git2/sys/index.h" #include "git2/annotated_commit.h" @@ -40,7 +41,7 @@ int merge_trees_from_branches( cl_git_pass(git_commit_tree(&our_tree, our_commit)); cl_git_pass(git_commit_tree(&their_tree, their_commit)); - cl_git_pass(git_merge_trees(index, repo, ancestor_tree, our_tree, their_tree, opts)); + error = git_merge_trees(index, repo, ancestor_tree, our_tree, their_tree, opts); git_buf_free(&branch_buf); git_tree_free(our_tree); @@ -50,7 +51,7 @@ int merge_trees_from_branches( git_commit_free(their_commit); git_commit_free(ancestor_commit); - return 0; + return error; } int merge_commits_from_branches( @@ -61,6 +62,7 @@ int merge_commits_from_branches( git_commit *our_commit, *their_commit; git_oid our_oid, their_oid; git_buf branch_buf = GIT_BUF_INIT; + int error; git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours_name); cl_git_pass(git_reference_name_to_id(&our_oid, repo, branch_buf.ptr)); @@ -71,13 +73,13 @@ int merge_commits_from_branches( cl_git_pass(git_reference_name_to_id(&their_oid, repo, branch_buf.ptr)); cl_git_pass(git_commit_lookup(&their_commit, repo, &their_oid)); - cl_git_pass(git_merge_commits(index, repo, our_commit, their_commit, opts)); + error = git_merge_commits(index, repo, our_commit, their_commit, opts); git_buf_free(&branch_buf); git_commit_free(our_commit); git_commit_free(their_commit); - return 0; + return error; } int merge_branches(git_repository *repo, @@ -238,7 +240,7 @@ int merge_test_index(git_index *index, const struct merge_index_entry expected[] const git_index_entry *index_entry; /* - dump_index_entries(&index->entries); + merge__dump_index_entries(&index->entries); */ if (git_index_entrycount(index) != expected_len) diff --git a/vendor/libgit2/tests/merge/merge_helpers.h b/vendor/libgit2/tests/merge/merge_helpers.h index 554c24b7c..e407c7d13 100644 --- a/vendor/libgit2/tests/merge/merge_helpers.h +++ b/vendor/libgit2/tests/merge/merge_helpers.h @@ -4,49 +4,6 @@ #include "merge.h" #include "git2/merge.h" -#define AUTOMERGEABLE_MERGED_FILE \ - "this file is changed in master\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is automergeable\n" \ - "this file is changed in branch\n" - -#define AUTOMERGEABLE_MERGED_FILE_CRLF \ - "this file is changed in master\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is automergeable\r\n" \ - "this file is changed in branch\r\n" - -#define CONFLICTING_MERGE_FILE \ - "<<<<<<< HEAD\n" \ - "this file is changed in master and branch\n" \ - "=======\n" \ - "this file is changed in branch and master\n" \ - ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n" - -#define CONFLICTING_DIFF3_FILE \ - "<<<<<<< HEAD\n" \ - "this file is changed in master and branch\n" \ - "||||||| initial\n" \ - "this file is a conflict\n" \ - "=======\n" \ - "this file is changed in branch and master\n" \ - ">>>>>>> 7cb63eed597130ba4abb87b3e544b85021905520\n" - -#define CONFLICTING_UNION_FILE \ - "this file is changed in master and branch\n" \ - "this file is changed in branch and master\n" - - struct merge_index_entry { uint16_t mode; char oid_str[GIT_OID_HEXSZ+1]; diff --git a/vendor/libgit2/tests/merge/trees/automerge.c b/vendor/libgit2/tests/merge/trees/automerge.c index c18881d7c..67f2cf786 100644 --- a/vendor/libgit2/tests/merge/trees/automerge.c +++ b/vendor/libgit2/tests/merge/trees/automerge.c @@ -3,8 +3,9 @@ #include "git2/merge.h" #include "buffer.h" #include "merge.h" -#include "../merge_helpers.h" #include "fileops.h" +#include "../merge_helpers.h" +#include "../conflict_data.h" static git_repository *repo; diff --git a/vendor/libgit2/tests/merge/trees/commits.c b/vendor/libgit2/tests/merge/trees/commits.c index c4e470997..786a77a8b 100644 --- a/vendor/libgit2/tests/merge/trees/commits.c +++ b/vendor/libgit2/tests/merge/trees/commits.c @@ -3,6 +3,7 @@ #include "git2/merge.h" #include "merge.h" #include "../merge_helpers.h" +#include "../conflict_data.h" static git_repository *repo; @@ -94,7 +95,6 @@ void test_merge_trees_commits__no_ancestor(void) git_index_free(index); } - void test_merge_trees_commits__df_conflict(void) { git_index *index; @@ -129,3 +129,20 @@ void test_merge_trees_commits__df_conflict(void) git_index_free(index); } + +void test_merge_trees_commits__fail_on_conflict(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + opts.flags |= GIT_MERGE_FAIL_ON_CONFLICT; + + cl_git_fail_with(GIT_EMERGECONFLICT, + merge_trees_from_branches(&index, repo, "df_side1", "df_side2", &opts)); + + cl_git_fail_with(GIT_EMERGECONFLICT, + merge_commits_from_branches(&index, repo, "master", "unrelated", &opts)); + cl_git_fail_with(GIT_EMERGECONFLICT, + merge_commits_from_branches(&index, repo, "master", "branch", &opts)); +} + diff --git a/vendor/libgit2/tests/merge/trees/recursive.c b/vendor/libgit2/tests/merge/trees/recursive.c new file mode 100644 index 000000000..c5b129bf8 --- /dev/null +++ b/vendor/libgit2/tests/merge/trees/recursive.c @@ -0,0 +1,410 @@ +#include "clar_libgit2.h" +#include "git2/repository.h" +#include "git2/merge.h" +#include "merge.h" +#include "../merge_helpers.h" + +static git_repository *repo; + +#define TEST_REPO_PATH "merge-recursive" + +void test_merge_trees_recursive__initialize(void) +{ + repo = cl_git_sandbox_init(TEST_REPO_PATH); +} + +void test_merge_trees_recursive__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_merge_trees_recursive__one_base_commit(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__one_base_commit_norecursive(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "dea7215f259b2cced87d1bda6c72f8b4ce37a2ff", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" }, + }; + + opts.flags |= GIT_MERGE_NO_RECURSIVE; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchA-1", "branchA-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__two_base_commits(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "666ffdfcf1eaa5641fa31064bf2607327e843c09", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__two_base_commits_norecursive(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "cb49ad76147f5f9439cbd6133708b76142660660", 1, "veal.txt" }, + { 0100644, "b2a81ead9e722af0099fccfb478cea88eea749a2", 2, "veal.txt" }, + { 0100644, "4e21d2d63357bde5027d1625f5ec6b430cdeb143", 3, "veal.txt" }, + }; + + opts.flags |= GIT_MERGE_NO_RECURSIVE; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchB-1", "branchB-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +void test_merge_trees_recursive__two_levels_of_multiple_bases(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "15faa0c9991f2d65686e844651faa2ff9827887b", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchC-1", "branchC-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__two_levels_of_multiple_bases_norecursive(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "b2a81ead9e722af0099fccfb478cea88eea749a2", 1, "veal.txt" }, + { 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 2, "veal.txt" }, + { 0100644, "68a2e1ee61a23a4728fe6b35580fbbbf729df370", 3, "veal.txt" }, + }; + + opts.flags |= GIT_MERGE_NO_RECURSIVE; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchC-1", "branchC-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +void test_merge_trees_recursive__three_levels_of_multiple_bases(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "d55e5dc038c52f1a36548625bcb666cbc06db9e6", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchD-2", "branchD-1", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__three_levels_of_multiple_bases_norecursive(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 1, "veal.txt" }, + { 0100644, "f1b44c04989a3a1c14b036cfadfa328d53a7bc5e", 2, "veal.txt" }, + { 0100644, "5e8747f5200fac0f945a07daf6163ca9cb1a8da9", 3, "veal.txt" }, + }; + + opts.flags |= GIT_MERGE_NO_RECURSIVE; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchD-2", "branchD-1", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +void test_merge_trees_recursive__three_base_commits(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4f7269b07c76d02755d75ccaf05c0b4c36cdc6c", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +void test_merge_trees_recursive__three_base_commits_norecursive(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "9e12bce04446d097ae1782967a5888c2e2a0d35b", 1, "gravy.txt" }, + { 0100644, "d8dd349b78f19a4ebe3357bacb8138f00bf5ed41", 2, "gravy.txt" }, + { 0100644, "e50fbbd701458757bdfe9815f58ed717c588d1b5", 3, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" }, + }; + + opts.flags |= GIT_MERGE_NO_RECURSIVE; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +void test_merge_trees_recursive__conflict(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "fa567f568ed72157c0c617438d077695b99d9aac", 1, "veal.txt" }, + { 0100644, "21950d5e4e4d1a871b4dfcf72ecb6b9c162c434e", 2, "veal.txt" }, + { 0100644, "3855170cef875708da06ab9ad7fc6a73b531cda1", 3, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchF-1", "branchF-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +/* + * Branch G-1 and G-2 have three common ancestors (815b5a1, ad2ace9, 483065d). + * The merge-base of the first two has two common ancestors (723181f, a34e5a1) + * which themselves have two common ancestors (8f35f30, 3a3f5a6), which + * finally has a common ancestor of 7c7bf85. This virtual merge base will + * be computed and merged with 483065d which also has a common ancestor of + * 7c7bf85. + */ +void test_merge_trees_recursive__oh_so_many_levels_of_recursion(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "7c7e08f9559d9e1551b91e1cf68f1d0066109add", 0, "oyster.txt" }, + { 0100644, "898d12687fb35be271c27c795a6b32c8b51da79e", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchG-1", "branchG-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +/* Branch H-1 and H-2 have two common ancestors (aa9e263, 6ef31d3). The two + * ancestors themselves conflict. + */ +void test_merge_trees_recursive__conflicting_merge_base(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "3a66812fed1e03ea4a6a7ee28d8a57aec1ca6537", 1, "veal.txt" }, + { 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" }, + { 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchH-1", "branchH-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +/* Branch H-1 and H-2 have two common ancestors (aa9e263, 6ef31d3). The two + * ancestors themselves conflict. The generated common ancestor file will + * have diff3 style conflicts inside it. + */ +void test_merge_trees_recursive__conflicting_merge_base_with_diff3(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "cd17a91513f3aee9e44114d1ede67932dd41d2fc", 1, "veal.txt" }, + { 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" }, + { 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" }, + }; + + opts.file_flags |= GIT_MERGE_FILE_STYLE_DIFF3; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchH-1", "branchH-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + +/* Branch I-1 and I-2 have two common ancestors (aa9e263, 6ef31d3). The two + * ancestors themselves conflict, but when each was merged, the conflicts were + * resolved identically, thus merging I-1 into I-2 does not conflict. + */ +void test_merge_trees_recursive__conflicting_merge_base_since_resolved(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "a02d4fd126e0cc8fb46ee48cf38bad36d44f2dbc", 0, "veal.txt" }, + }; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchI-1", "branchI-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 6)); + + git_index_free(index); +} + +/* There are multiple levels of criss-cross merges, and multiple recursive + * merges would create a common ancestor that allows the merge to complete + * successfully. Test that we can build a single virtual base, then stop, + * which will produce a conflicting merge. + */ +void test_merge_trees_recursive__recursionlimit(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "ce7e553c6feb6e5f3bd67e3c3be04182fe3094b4", 1, "gravy.txt" }, + { 0100644, "d8dd349b78f19a4ebe3357bacb8138f00bf5ed41", 2, "gravy.txt" }, + { 0100644, "e50fbbd701458757bdfe9815f58ed717c588d1b5", 3, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" }, + }; + + opts.recursion_limit = 1; + + cl_git_pass(merge_commits_from_branches(&index, repo, "branchE-1", "branchE-2", &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + git_index_free(index); +} + diff --git a/vendor/libgit2/tests/merge/trees/treediff.c b/vendor/libgit2/tests/merge/trees/treediff.c index b96c4c4db..3634568de 100644 --- a/vendor/libgit2/tests/merge/trees/treediff.c +++ b/vendor/libgit2/tests/merge/trees/treediff.c @@ -44,9 +44,10 @@ static void test_find_differences( git_oid ancestor_oid, ours_oid, theirs_oid; git_tree *ancestor_tree, *ours_tree, *theirs_tree; git_iterator *ancestor_iter, *ours_iter, *theirs_iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; git_merge_options opts = GIT_MERGE_OPTIONS_INIT; - opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.flags |= GIT_MERGE_FIND_RENAMES; opts.target_limit = 1000; opts.rename_threshold = 50; @@ -67,12 +68,11 @@ static void test_find_differences( cl_git_pass(git_tree_lookup(&ours_tree, repo, &ours_oid)); cl_git_pass(git_tree_lookup(&theirs_tree, repo, &theirs_oid)); - cl_git_pass(git_iterator_for_tree(&ancestor_iter, ancestor_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); - cl_git_pass(git_iterator_for_tree(&ours_iter, ours_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); - cl_git_pass(git_iterator_for_tree(&theirs_iter, theirs_tree, - GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + iter_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + cl_git_pass(git_iterator_for_tree(&ancestor_iter, ancestor_tree, &iter_opts)); + cl_git_pass(git_iterator_for_tree(&ours_iter, ours_tree, &iter_opts)); + cl_git_pass(git_iterator_for_tree(&theirs_iter, theirs_tree, &iter_opts)); cl_git_pass(git_merge_diff_list__find_differences(merge_diff_list, ancestor_iter, ours_iter, theirs_iter)); cl_git_pass(git_merge_diff_list__find_renames(repo, merge_diff_list, &opts)); diff --git a/vendor/libgit2/tests/merge/workdir/dirty.c b/vendor/libgit2/tests/merge/workdir/dirty.c index 4bf984c23..99e33e0cd 100644 --- a/vendor/libgit2/tests/merge/workdir/dirty.c +++ b/vendor/libgit2/tests/merge/workdir/dirty.c @@ -133,7 +133,7 @@ static void hack_index(char *files[]) struct stat statbuf; git_buf path = GIT_BUF_INIT; git_index_entry *entry; - struct timeval times[2]; + struct p_timeval times[2]; time_t now; size_t i; @@ -162,15 +162,20 @@ static void hack_index(char *files[]) cl_git_pass(p_utimes(path.ptr, times)); cl_git_pass(p_stat(path.ptr, &statbuf)); - entry->ctime.seconds = (git_time_t)statbuf.st_ctime; + entry->ctime.seconds = (int32_t)statbuf.st_ctime; + entry->mtime.seconds = (int32_t)statbuf.st_mtime; +#if defined(GIT_USE_NSEC) + entry->ctime.nanoseconds = statbuf.st_ctim.tv_nsec; + entry->mtime.nanoseconds = statbuf.st_mtim.tv_nsec; +#else entry->ctime.nanoseconds = 0; - entry->mtime.seconds = (git_time_t)statbuf.st_mtime; entry->mtime.nanoseconds = 0; +#endif entry->dev = statbuf.st_dev; entry->ino = statbuf.st_ino; entry->uid = statbuf.st_uid; entry->gid = statbuf.st_gid; - entry->file_size = statbuf.st_size; + entry->file_size = (uint32_t)statbuf.st_size; } git_buf_free(&path); diff --git a/vendor/libgit2/tests/merge/workdir/recursive.c b/vendor/libgit2/tests/merge/workdir/recursive.c new file mode 100644 index 000000000..795126255 --- /dev/null +++ b/vendor/libgit2/tests/merge/workdir/recursive.c @@ -0,0 +1,84 @@ +#include "clar_libgit2.h" +#include "git2/repository.h" +#include "git2/merge.h" +#include "merge.h" +#include "../merge_helpers.h" +#include "../conflict_data.h" + +static git_repository *repo; + +#define TEST_REPO_PATH "merge-recursive" + +void test_merge_workdir_recursive__initialize(void) +{ + repo = cl_git_sandbox_init(TEST_REPO_PATH); +} + +void test_merge_workdir_recursive__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_merge_workdir_recursive__writes_conflict_with_virtual_base(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + git_buf conflicting_buf = GIT_BUF_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "fa567f568ed72157c0c617438d077695b99d9aac", 1, "veal.txt" }, + { 0100644, "21950d5e4e4d1a871b4dfcf72ecb6b9c162c434e", 2, "veal.txt" }, + { 0100644, "3855170cef875708da06ab9ad7fc6a73b531cda1", 3, "veal.txt" }, + }; + + cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR "branchF-1", GIT_REFS_HEADS_DIR "branchF-2", &opts, NULL)); + + cl_git_pass(git_repository_index(&index, repo)); + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + cl_git_pass(git_futils_readbuffer(&conflicting_buf, "merge-recursive/veal.txt")); + + cl_assert_equal_s(CONFLICTING_RECURSIVE_F1_TO_F2, conflicting_buf.ptr); + + git_index_free(index); + git_buf_free(&conflicting_buf); +} + +void test_merge_workdir_recursive__conflicting_merge_base_with_diff3(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + git_buf conflicting_buf = GIT_BUF_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", 0, "asparagus.txt" }, + { 0100644, "68f6182f4c85d39e1309d97c7e456156dc9c0096", 0, "beef.txt" }, + { 0100644, "4b7c5650008b2e747fe1809eeb5a1dde0e80850a", 0, "bouilli.txt" }, + { 0100644, "c4e6cca3ec6ae0148ed231f97257df8c311e015f", 0, "gravy.txt" }, + { 0100644, "68af1fc7407fd9addf1701a87eb1c95c7494c598", 0, "oyster.txt" }, + { 0100644, "cd17a91513f3aee9e44114d1ede67932dd41d2fc", 1, "veal.txt" }, + { 0100644, "d604c75019c282144bdbbf3fd3462ba74b240efc", 2, "veal.txt" }, + { 0100644, "37a5054a9f9b4628e3924c5cb8f2147c6e2a3efc", 3, "veal.txt" }, + }; + + opts.file_flags |= GIT_MERGE_FILE_STYLE_DIFF3; + checkout_opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_DIFF3; + + cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR "branchH-1", GIT_REFS_HEADS_DIR "branchH-2", &opts, &checkout_opts)); + + cl_git_pass(git_repository_index(&index, repo)); + cl_assert(merge_test_index(index, merge_index_entries, 8)); + + cl_git_pass(git_futils_readbuffer(&conflicting_buf, "merge-recursive/veal.txt")); + + cl_assert_equal_s(CONFLICTING_RECURSIVE_H1_TO_H2_WITH_DIFF3, conflicting_buf.ptr); + + git_index_free(index); + git_buf_free(&conflicting_buf); +} diff --git a/vendor/libgit2/tests/merge/workdir/renames.c b/vendor/libgit2/tests/merge/workdir/renames.c index 83006a703..fabcda2a8 100644 --- a/vendor/libgit2/tests/merge/workdir/renames.c +++ b/vendor/libgit2/tests/merge/workdir/renames.c @@ -63,7 +63,7 @@ void test_merge_workdir_renames__renames(void) { 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" }, }; - merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.flags |= GIT_MERGE_FIND_RENAMES; merge_opts.rename_threshold = 50; cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL)); @@ -99,7 +99,7 @@ void test_merge_workdir_renames__ours(void) { 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 0, "7-both-renamed.txt" }, }; - merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.flags |= GIT_MERGE_FIND_RENAMES; merge_opts.rename_threshold = 50; checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS; @@ -147,7 +147,7 @@ void test_merge_workdir_renames__similar(void) { 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" }, }; - merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.flags |= GIT_MERGE_FIND_RENAMES; merge_opts.rename_threshold = 50; cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL)); diff --git a/vendor/libgit2/tests/merge/workdir/simple.c b/vendor/libgit2/tests/merge/workdir/simple.c index abc0777f7..3cdd15b5a 100644 --- a/vendor/libgit2/tests/merge/workdir/simple.c +++ b/vendor/libgit2/tests/merge/workdir/simple.c @@ -4,6 +4,7 @@ #include "buffer.h" #include "merge.h" #include "../merge_helpers.h" +#include "../conflict_data.h" #include "refs.h" #include "fileops.h" diff --git a/vendor/libgit2/tests/network/fetchlocal.c b/vendor/libgit2/tests/network/fetchlocal.c index 06ee3dd36..17c8f26e3 100644 --- a/vendor/libgit2/tests/network/fetchlocal.c +++ b/vendor/libgit2/tests/network/fetchlocal.c @@ -369,17 +369,46 @@ void test_network_fetchlocal__clone_into_mirror(void) { git_clone_options opts = GIT_CLONE_OPTIONS_INIT; git_repository *repo; - git_reference *head; + git_reference *ref; opts.bare = true; opts.remote_cb = remote_mirror_cb; cl_git_pass(git_clone(&repo, cl_git_fixture_url("testrepo.git"), "./foo.git", &opts)); - cl_git_pass(git_reference_lookup(&head, repo, "HEAD")); - cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head)); - cl_assert_equal_s("refs/heads/master", git_reference_symbolic_target(head)); + cl_git_pass(git_reference_lookup(&ref, repo, "HEAD")); + cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(ref)); + cl_assert_equal_s("refs/heads/master", git_reference_symbolic_target(ref)); + + git_reference_free(ref); + cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/test/master")); + + git_reference_free(ref); + git_repository_free(repo); + cl_fixture_cleanup("./foo.git"); +} - git_reference_free(head); +void test_network_fetchlocal__all_refs(void) +{ + git_repository *repo; + git_remote *remote; + git_reference *ref; + char *allrefs = "+refs/*:refs/*"; + git_strarray refspecs = { + &allrefs, + 1, + }; + + cl_git_pass(git_repository_init(&repo, "./foo.git", true)); + cl_git_pass(git_remote_create_anonymous(&remote, repo, cl_git_fixture_url("testrepo.git"))); + cl_git_pass(git_remote_fetch(remote, &refspecs, NULL, NULL)); + + cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/test/master")); + git_reference_free(ref); + + cl_git_pass(git_reference_lookup(&ref, repo, "refs/tags/test")); + git_reference_free(ref); + + git_remote_free(remote); git_repository_free(repo); cl_fixture_cleanup("./foo.git"); } diff --git a/vendor/libgit2/tests/network/remote/defaultbranch.c b/vendor/libgit2/tests/network/remote/defaultbranch.c index e83755ef6..5edd79fb8 100644 --- a/vendor/libgit2/tests/network/remote/defaultbranch.c +++ b/vendor/libgit2/tests/network/remote/defaultbranch.c @@ -26,7 +26,7 @@ static void assert_default_branch(const char *should) { git_buf name = GIT_BUF_INIT; - cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_pass(git_remote_default_branch(&name, g_remote)); cl_assert_equal_s(should, name.ptr); git_buf_free(&name); @@ -57,7 +57,7 @@ void test_network_remote_defaultbranch__no_default_branch(void) git_buf buf = GIT_BUF_INIT; cl_git_pass(git_remote_create(&remote_b, g_repo_b, "self", git_repository_path(g_repo_b))); - cl_git_pass(git_remote_connect(remote_b, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote_b, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_pass(git_remote_ls(&heads, &len, remote_b)); cl_assert_equal_i(0, len); @@ -80,7 +80,7 @@ void test_network_remote_defaultbranch__detached_sharing_nonbranch_id(void) cl_git_pass(git_reference_create(&ref, g_repo_a, "refs/foo/bar", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_fail_with(GIT_ENOTFOUND, git_remote_default_branch(&buf, g_remote)); cl_git_pass(git_clone(&cloned_repo, git_repository_path(g_repo_a), "./local-detached", NULL)); diff --git a/vendor/libgit2/tests/network/remote/local.c b/vendor/libgit2/tests/network/remote/local.c index 5d726c958..4d990ab71 100644 --- a/vendor/libgit2/tests/network/remote/local.c +++ b/vendor/libgit2/tests/network/remote/local.c @@ -40,7 +40,7 @@ static void connect_to_local_repository(const char *local_repository) git_buf_sets(&file_path_buf, cl_git_path_url(local_repository)); cl_git_pass(git_remote_create_anonymous(&remote, repo, git_buf_cstr(&file_path_buf))); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); } void test_network_remote_local__connected(void) @@ -214,7 +214,7 @@ void test_network_remote_local__push_to_bare_remote(void) /* Connect to the bare repo */ cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localbare.git")); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL)); /* Try to push */ cl_git_pass(git_remote_upload(localremote, &push_array, NULL)); @@ -253,7 +253,7 @@ void test_network_remote_local__push_to_bare_remote_with_file_url(void) /* Connect to the bare repo */ cl_git_pass(git_remote_create_anonymous(&localremote, repo, url)); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL)); /* Try to push */ cl_git_pass(git_remote_upload(localremote, &push_array, NULL)); @@ -290,7 +290,7 @@ void test_network_remote_local__push_to_non_bare_remote(void) /* Connect to the bare repo */ cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localnonbare")); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL)); /* Try to push */ cl_git_fail_with(GIT_EBAREREPO, git_remote_upload(localremote, &push_array, NULL)); diff --git a/vendor/libgit2/tests/network/remote/remotes.c b/vendor/libgit2/tests/network/remote/remotes.c index 2fa21d460..46abc6d33 100644 --- a/vendor/libgit2/tests/network/remote/remotes.c +++ b/vendor/libgit2/tests/network/remote/remotes.c @@ -93,7 +93,7 @@ void test_network_remote_remotes__error_when_no_push_available(void) cl_git_pass(git_remote_create_anonymous(&r, _repo, cl_fixture("testrepo.git"))); callbacks.transport = git_transport_local; - cl_git_pass(git_remote_connect(r, GIT_DIRECTION_PUSH, &callbacks)); + cl_git_pass(git_remote_connect(r, GIT_DIRECTION_PUSH, &callbacks, NULL)); /* Make sure that push is really not available */ r->transport->push = NULL; @@ -359,7 +359,7 @@ void test_network_remote_remotes__can_load_with_an_empty_url(void) cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); - cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_assert(giterr_last() != NULL); cl_assert(giterr_last()->klass == GITERR_INVALID); @@ -376,7 +376,7 @@ void test_network_remote_remotes__can_load_with_only_an_empty_pushurl(void) cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); - cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); git_remote_free(remote); } diff --git a/vendor/libgit2/tests/object/tree/attributes.c b/vendor/libgit2/tests/object/tree/attributes.c index 413514c48..8654dfa31 100644 --- a/vendor/libgit2/tests/object/tree/attributes.c +++ b/vendor/libgit2/tests/object/tree/attributes.c @@ -82,6 +82,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from cl_git_pass(git_treebuilder_new(&builder, repo, tree)); entry = git_treebuilder_get(builder, "old_mode.txt"); + cl_assert(entry != NULL); cl_assert_equal_i( GIT_FILEMODE_BLOB, git_tree_entry_filemode(entry)); @@ -92,6 +93,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from cl_git_pass(git_tree_lookup(&tree, repo, &tid2)); entry = git_tree_entry_byname(tree, "old_mode.txt"); + cl_assert(entry != NULL); cl_assert_equal_i( GIT_FILEMODE_BLOB, git_tree_entry_filemode(entry)); diff --git a/vendor/libgit2/tests/object/tree/write.c b/vendor/libgit2/tests/object/tree/write.c index 5433e5f03..a9decf9c1 100644 --- a/vendor/libgit2/tests/object/tree/write.c +++ b/vendor/libgit2/tests/object/tree/write.c @@ -18,6 +18,8 @@ void test_object_tree_write__initialize(void) void test_object_tree_write__cleanup(void) { cl_git_sandbox_cleanup(); + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1)); } void test_object_tree_write__from_memory(void) @@ -131,15 +133,18 @@ void test_object_tree_write__sorted_subtrees(void) { GIT_FILEMODE_TREE, "vendors"} }; - git_oid blank_oid, tree_oid; + git_oid bid, tid, tree_oid; - memset(&blank_oid, 0x0, sizeof(blank_oid)); + cl_git_pass(git_oid_fromstr(&bid, blob_oid)); + cl_git_pass(git_oid_fromstr(&tid, first_tree)); cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL)); for (i = 0; i < ARRAY_SIZE(entries); ++i) { + git_oid *id = entries[i].attr == GIT_FILEMODE_TREE ? &tid : &bid; + cl_git_pass(git_treebuilder_insert(NULL, - builder, entries[i].filename, &blank_oid, entries[i].attr)); + builder, entries[i].filename, id, entries[i].attr)); } cl_git_pass(git_treebuilder_write(&tree_oid, builder)); @@ -187,10 +192,10 @@ void test_object_tree_write__removing_and_re_adding_in_treebuilder(void) { git_treebuilder *builder; int i, aardvark_i, apple_i, apple_after_i, apple_extra_i, last_i; - git_oid blank_oid, tree_oid; + git_oid entry_oid, tree_oid; git_tree *tree; - memset(&blank_oid, 0x0, sizeof(blank_oid)); + cl_git_pass(git_oid_fromstr(&entry_oid, blob_oid)); cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL)); @@ -198,7 +203,7 @@ void test_object_tree_write__removing_and_re_adding_in_treebuilder(void) for (i = 0; _entries[i].filename; ++i) cl_git_pass(git_treebuilder_insert(NULL, - builder, _entries[i].filename, &blank_oid, _entries[i].attr)); + builder, _entries[i].filename, &entry_oid, _entries[i].attr)); cl_assert_equal_i(6, (int)git_treebuilder_entrycount(builder)); @@ -209,12 +214,12 @@ void test_object_tree_write__removing_and_re_adding_in_treebuilder(void) cl_assert_equal_i(4, (int)git_treebuilder_entrycount(builder)); cl_git_pass(git_treebuilder_insert( - NULL, builder, "before_last", &blank_oid, GIT_FILEMODE_BLOB)); + NULL, builder, "before_last", &entry_oid, GIT_FILEMODE_BLOB)); cl_assert_equal_i(5, (int)git_treebuilder_entrycount(builder)); /* reinsert apple_after */ cl_git_pass(git_treebuilder_insert( - NULL, builder, "apple_after", &blank_oid, GIT_FILEMODE_BLOB)); + NULL, builder, "apple_after", &entry_oid, GIT_FILEMODE_BLOB)); cl_assert_equal_i(6, (int)git_treebuilder_entrycount(builder)); cl_git_pass(git_treebuilder_remove(builder, "last")); @@ -222,11 +227,11 @@ void test_object_tree_write__removing_and_re_adding_in_treebuilder(void) /* reinsert last */ cl_git_pass(git_treebuilder_insert( - NULL, builder, "last", &blank_oid, GIT_FILEMODE_BLOB)); + NULL, builder, "last", &entry_oid, GIT_FILEMODE_BLOB)); cl_assert_equal_i(6, (int)git_treebuilder_entrycount(builder)); cl_git_pass(git_treebuilder_insert( - NULL, builder, "apple_extra", &blank_oid, GIT_FILEMODE_BLOB)); + NULL, builder, "apple_extra", &entry_oid, GIT_FILEMODE_BLOB)); cl_assert_equal_i(7, (int)git_treebuilder_entrycount(builder)); cl_git_pass(git_treebuilder_write(&tree_oid, builder)); @@ -278,16 +283,16 @@ void test_object_tree_write__filtering(void) { git_treebuilder *builder; int i; - git_oid blank_oid, tree_oid; + git_oid entry_oid, tree_oid; git_tree *tree; - memset(&blank_oid, 0x0, sizeof(blank_oid)); + git_oid_fromstr(&entry_oid, blob_oid); cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL)); for (i = 0; _entries[i].filename; ++i) cl_git_pass(git_treebuilder_insert(NULL, - builder, _entries[i].filename, &blank_oid, _entries[i].attr)); + builder, _entries[i].filename, &entry_oid, _entries[i].attr)); cl_assert_equal_i(6, (int)git_treebuilder_entrycount(builder)); @@ -406,6 +411,8 @@ void test_object_tree_write__protect_filesystems(void) git_treebuilder *builder; git_oid bid; + cl_git_pass(git_oid_fromstr(&bid, "fa49b077972391ad58037050f2a75f74e3671e92")); + /* Ensure that (by default) we can write objects with funny names on * platforms that are not affected. */ @@ -440,3 +447,68 @@ void test_object_tree_write__protect_filesystems(void) git_treebuilder_free(builder); } + +static void test_invalid_objects(bool should_allow_invalid) +{ + git_treebuilder *builder; + git_oid valid_blob_id, invalid_blob_id, valid_tree_id, invalid_tree_id; + +#define assert_allowed(expr) \ + clar__assert(!(expr) == should_allow_invalid, __FILE__, __LINE__, \ + (should_allow_invalid ? \ + "Expected function call to succeed: " #expr : \ + "Expected function call to fail: " #expr), \ + NULL, 1) + + cl_git_pass(git_oid_fromstr(&valid_blob_id, blob_oid)); + cl_git_pass(git_oid_fromstr(&invalid_blob_id, + "1234567890123456789012345678901234567890")); + cl_git_pass(git_oid_fromstr(&valid_tree_id, first_tree)); + cl_git_pass(git_oid_fromstr(&invalid_tree_id, + "0000000000111111111122222222223333333333")); + + cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL)); + + /* test valid blobs and trees (these should always pass) */ + cl_git_pass(git_treebuilder_insert(NULL, builder, "file.txt", &valid_blob_id, GIT_FILEMODE_BLOB)); + cl_git_pass(git_treebuilder_insert(NULL, builder, "folder", &valid_tree_id, GIT_FILEMODE_TREE)); + + /* replace valid files and folders with invalid ones */ + assert_allowed(git_treebuilder_insert(NULL, builder, "file.txt", &invalid_blob_id, GIT_FILEMODE_BLOB)); + assert_allowed(git_treebuilder_insert(NULL, builder, "folder", &invalid_blob_id, GIT_FILEMODE_BLOB)); + + /* insert new invalid files and folders */ + assert_allowed(git_treebuilder_insert(NULL, builder, "invalid_file.txt", &invalid_blob_id, GIT_FILEMODE_BLOB)); + assert_allowed(git_treebuilder_insert(NULL, builder, "invalid_folder", &invalid_blob_id, GIT_FILEMODE_BLOB)); + + /* insert valid blobs as trees and trees as blobs */ + assert_allowed(git_treebuilder_insert(NULL, builder, "file_as_folder", &valid_blob_id, GIT_FILEMODE_TREE)); + assert_allowed(git_treebuilder_insert(NULL, builder, "folder_as_file.txt", &valid_tree_id, GIT_FILEMODE_BLOB)); + +#undef assert_allowed + + git_treebuilder_free(builder); +} + +static void test_inserting_submodule(void) +{ + git_treebuilder *bld; + git_oid sm_id; + + cl_git_pass(git_treebuilder_new(&bld, g_repo, NULL)); + cl_git_pass(git_treebuilder_insert(NULL, bld, "sm", &sm_id, GIT_FILEMODE_COMMIT)); + git_treebuilder_free(bld); +} + +void test_object_tree_write__object_validity(void) +{ + /* Ensure that we cannot add invalid objects by default */ + test_invalid_objects(false); + test_inserting_submodule(); + + /* Ensure that we can turn off validation */ + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0)); + test_invalid_objects(true); + test_inserting_submodule(); +} + diff --git a/vendor/libgit2/tests/odb/alternates.c b/vendor/libgit2/tests/odb/alternates.c index c75f6feaa..b5c0e79c0 100644 --- a/vendor/libgit2/tests/odb/alternates.c +++ b/vendor/libgit2/tests/odb/alternates.c @@ -29,7 +29,7 @@ static void init_linked_repo(const char *path, const char *alternate) cl_git_pass(git_path_prettify(&destpath, alternate, NULL)); cl_git_pass(git_buf_joinpath(&destpath, destpath.ptr, "objects")); cl_git_pass(git_buf_joinpath(&filepath, git_repository_path(repo), "objects/info")); - cl_git_pass(git_futils_mkdir(filepath.ptr, NULL, 0755, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir(filepath.ptr, 0755, GIT_MKDIR_PATH)); cl_git_pass(git_buf_joinpath(&filepath, filepath.ptr , "alternates")); cl_git_pass(git_filebuf_open(&file, git_buf_cstr(&filepath), 0, 0666)); diff --git a/vendor/libgit2/tests/odb/sorting.c b/vendor/libgit2/tests/odb/sorting.c index 22d057b3b..6af8b0d1b 100644 --- a/vendor/libgit2/tests/odb/sorting.c +++ b/vendor/libgit2/tests/odb/sorting.c @@ -14,6 +14,7 @@ static git_odb_backend *new_backend(size_t position) if (b == NULL) return NULL; + b->base.free = (void (*)(git_odb_backend *)) git__free; b->base.version = GIT_ODB_BACKEND_VERSION; b->position = position; return (git_odb_backend *)b; diff --git a/vendor/libgit2/tests/online/badssl.c b/vendor/libgit2/tests/online/badssl.c new file mode 100644 index 000000000..66b090df4 --- /dev/null +++ b/vendor/libgit2/tests/online/badssl.c @@ -0,0 +1,46 @@ +#include "clar_libgit2.h" + +#include "git2/clone.h" + +static git_repository *g_repo; + +#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) +static bool g_has_ssl = true; +#else +static bool g_has_ssl = false; +#endif + +void test_online_badssl__expired(void) +{ + if (!g_has_ssl) + cl_skip(); + + cl_git_fail_with(GIT_ECERTIFICATE, + git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL)); +} + +void test_online_badssl__wrong_host(void) +{ + if (!g_has_ssl) + cl_skip(); + + cl_git_fail_with(GIT_ECERTIFICATE, + git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL)); +} + +void test_online_badssl__self_signed(void) +{ + if (!g_has_ssl) + cl_skip(); + + cl_git_fail_with(GIT_ECERTIFICATE, + git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL)); +} + +void test_online_badssl__old_cipher(void) +{ + if (!g_has_ssl) + cl_skip(); + + cl_git_fail(git_clone(&g_repo, "https://rc4.badssl.com/fake.git", "./fake", NULL)); +} diff --git a/vendor/libgit2/tests/online/clone.c b/vendor/libgit2/tests/online/clone.c index e63cf55f1..b84be405c 100644 --- a/vendor/libgit2/tests/online/clone.c +++ b/vendor/libgit2/tests/online/clone.c @@ -17,6 +17,15 @@ static git_repository *g_repo; static git_clone_options g_options; +static char *_remote_url = NULL; +static char *_remote_user = NULL; +static char *_remote_pass = NULL; +static char *_remote_ssh_pubkey = NULL; +static char *_remote_ssh_privkey = NULL; +static char *_remote_ssh_passphrase = NULL; +static char *_remote_ssh_fingerprint = NULL; + + void test_online_clone__initialize(void) { git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; @@ -29,6 +38,14 @@ void test_online_clone__initialize(void) g_options.checkout_opts = dummy_opts; g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; g_options.fetch_opts = dummy_fetch; + + _remote_url = cl_getenv("GITTEST_REMOTE_URL"); + _remote_user = cl_getenv("GITTEST_REMOTE_USER"); + _remote_pass = cl_getenv("GITTEST_REMOTE_PASS"); + _remote_ssh_pubkey = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY"); + _remote_ssh_privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY"); + _remote_ssh_passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE"); + _remote_ssh_fingerprint = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT"); } void test_online_clone__cleanup(void) @@ -38,6 +55,14 @@ void test_online_clone__cleanup(void) g_repo = NULL; } cl_fixture_cleanup("./foo"); + + git__free(_remote_url); + git__free(_remote_user); + git__free(_remote_pass); + git__free(_remote_ssh_pubkey); + git__free(_remote_ssh_privkey); + git__free(_remote_ssh_passphrase); + git__free(_remote_ssh_fingerprint); } void test_online_clone__network_full(void) @@ -188,6 +213,33 @@ void test_online_clone__custom_remote_callbacks(void) cl_assert(callcount > 0); } +void test_online_clone__custom_headers(void) +{ + char *empty_header = ""; + char *unnamed_header = "this is a header about nothing"; + char *newlines = "X-Custom: almost OK\n"; + char *conflict = "Accept: defined-by-git"; + char *ok = "X-Custom: this should be ok"; + + g_options.fetch_opts.custom_headers.count = 1; + + g_options.fetch_opts.custom_headers.strings = &empty_header; + cl_git_fail(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); + + g_options.fetch_opts.custom_headers.strings = &unnamed_header; + cl_git_fail(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); + + g_options.fetch_opts.custom_headers.strings = &newlines; + cl_git_fail(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); + + g_options.fetch_opts.custom_headers.strings = &conflict; + cl_git_fail(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); + + /* Finally, we got it right! */ + g_options.fetch_opts.custom_headers.strings = &ok; + cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); +} + static int cred_failure_cb( git_cred **cred, const char *url, @@ -202,15 +254,12 @@ static int cred_failure_cb( void test_online_clone__cred_callback_failure_return_code_is_tunnelled(void) { - const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); - - if (!remote_url || !remote_user) + if (!_remote_url || !_remote_user) clar__skip(); g_options.fetch_opts.callbacks.credentials = cred_failure_cb; - cl_git_fail_with(-172, git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_fail_with(-172, git_clone(&g_repo, _remote_url, "./foo", &g_options)); } static int cred_count_calls_cb(git_cred **cred, const char *url, const char *user, @@ -233,17 +282,15 @@ static int cred_count_calls_cb(git_cred **cred, const char *url, const char *use void test_online_clone__cred_callback_called_again_on_auth_failure(void) { - const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); size_t counter = 0; - if (!remote_url || !remote_user) + if (!_remote_url || !_remote_user) clar__skip(); g_options.fetch_opts.callbacks.credentials = cred_count_calls_cb; g_options.fetch_opts.callbacks.payload = &counter; - cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, _remote_url, "./foo", &g_options)); cl_assert_equal_i(3, counter); } @@ -269,22 +316,22 @@ void test_online_clone__credentials(void) /* Remote URL environment variable must be set. * User and password are optional. */ - const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); git_cred_userpass_payload user_pass = { - cl_getenv("GITTEST_REMOTE_USER"), - cl_getenv("GITTEST_REMOTE_PASS") + _remote_user, + _remote_pass }; - if (!remote_url) return; + if (!_remote_url) + clar__skip(); - if (cl_getenv("GITTEST_REMOTE_DEFAULT")) { + if (cl_is_env_set("GITTEST_REMOTE_DEFAULT")) { g_options.fetch_opts.callbacks.credentials = cred_default; } else { g_options.fetch_opts.callbacks.credentials = git_cred_userpass; g_options.fetch_opts.callbacks.payload = &user_pass; } - cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_pass(git_clone(&g_repo, _remote_url, "./foo", &g_options)); git_repository_free(g_repo); g_repo = NULL; cl_fixture_cleanup("./foo"); } @@ -335,18 +382,15 @@ void test_online_clone__can_cancel(void) static int cred_cb(git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload) { - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); - const char *pubkey = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY"); - const char *privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY"); - const char *passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE"); - GIT_UNUSED(url); GIT_UNUSED(user_from_url); GIT_UNUSED(payload); if (allowed_types & GIT_CREDTYPE_USERNAME) - return git_cred_username_new(cred, remote_user); + return git_cred_username_new(cred, _remote_user); if (allowed_types & GIT_CREDTYPE_SSH_KEY) - return git_cred_ssh_key_new(cred, remote_user, pubkey, privkey, passphrase); + return git_cred_ssh_key_new(cred, + _remote_user, _remote_ssh_pubkey, + _remote_ssh_privkey, _remote_ssh_passphrase); giterr_set(GITERR_NET, "unexpected cred type"); return -1; @@ -417,13 +461,10 @@ void test_online_clone__ssh_with_paths(void) 2, }; - const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); - #ifndef GIT_SSH clar__skip(); #endif - if (!remote_url || !remote_user || strncmp(remote_url, "ssh://", 5) != 0) + if (!_remote_url || !_remote_user || strncmp(_remote_url, "ssh://", 5) != 0) clar__skip(); g_options.remote_cb = custom_remote_ssh_with_paths; @@ -431,10 +472,10 @@ void test_online_clone__ssh_with_paths(void) g_options.fetch_opts.callbacks.credentials = cred_cb; g_options.fetch_opts.callbacks.payload = &arr; - cl_git_fail(git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_fail(git_clone(&g_repo, _remote_url, "./foo", &g_options)); arr.strings = good_paths; - cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_pass(git_clone(&g_repo, _remote_url, "./foo", &g_options)); } static int cred_foo_bar(git_cred **cred, const char *url, const char *username_from_url, @@ -460,15 +501,13 @@ int ssh_certificate_check(git_cert *cert, int valid, const char *host, void *pay { git_cert_hostkey *key; git_oid expected = {{0}}, actual = {{0}}; - const char *expected_str; GIT_UNUSED(valid); GIT_UNUSED(payload); - expected_str = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT"); - cl_assert(expected_str); + cl_assert(_remote_ssh_fingerprint); - cl_git_pass(git_oid_fromstrp(&expected, expected_str)); + cl_git_pass(git_oid_fromstrp(&expected, _remote_ssh_fingerprint)); cl_assert_equal_i(GIT_CERT_HOSTKEY_LIBSSH2, cert->cert_type); key = (git_cert_hostkey *) cert; @@ -477,9 +516,9 @@ int ssh_certificate_check(git_cert *cert, int valid, const char *host, void *pay * the type. Here we abuse the fact that both hashes fit into * our git_oid type. */ - if (strlen(expected_str) == 32 && key->type & GIT_CERT_SSH_MD5) { + if (strlen(_remote_ssh_fingerprint) == 32 && key->type & GIT_CERT_SSH_MD5) { memcpy(&actual.id, key->hash_md5, 16); - } else if (strlen(expected_str) == 40 && key->type & GIT_CERT_SSH_SHA1) { + } else if (strlen(_remote_ssh_fingerprint) == 40 && key->type & GIT_CERT_SSH_SHA1) { memcpy(&actual, key->hash_sha1, 20); } else { cl_fail("Cannot find a usable SSH hash"); @@ -496,7 +535,7 @@ void test_online_clone__ssh_cert(void) { g_options.fetch_opts.callbacks.certificate_check = ssh_certificate_check; - if (!cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT")) + if (!_remote_ssh_fingerprint) cl_skip(); cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, "ssh://localhost/foo", "./foo", &g_options)); @@ -525,22 +564,17 @@ static char *read_key_file(const char *path) static int ssh_memory_cred_cb(git_cred **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload) { - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); - const char *pubkey_path = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY"); - const char *privkey_path = cl_getenv("GITTEST_REMOTE_SSH_KEY"); - const char *passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE"); - GIT_UNUSED(url); GIT_UNUSED(user_from_url); GIT_UNUSED(payload); if (allowed_types & GIT_CREDTYPE_USERNAME) - return git_cred_username_new(cred, remote_user); + return git_cred_username_new(cred, _remote_user); if (allowed_types & GIT_CREDTYPE_SSH_KEY) { - char *pubkey = read_key_file(pubkey_path); - char *privkey = read_key_file(privkey_path); + char *pubkey = read_key_file(_remote_ssh_pubkey); + char *privkey = read_key_file(_remote_ssh_privkey); - int ret = git_cred_ssh_key_memory_new(cred, remote_user, pubkey, privkey, passphrase); + int ret = git_cred_ssh_key_memory_new(cred, _remote_user, pubkey, privkey, _remote_ssh_passphrase); if (privkey) free(privkey); @@ -555,19 +589,15 @@ static int ssh_memory_cred_cb(git_cred **cred, const char *url, const char *user void test_online_clone__ssh_memory_auth(void) { - const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); - const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); - const char *privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY"); - #ifndef GIT_SSH_MEMORY_CREDENTIALS clar__skip(); #endif - if (!remote_url || !remote_user || !privkey || strncmp(remote_url, "ssh://", 5) != 0) + if (!_remote_url || !_remote_user || !_remote_ssh_privkey || strncmp(_remote_url, "ssh://", 5) != 0) clar__skip(); g_options.fetch_opts.callbacks.credentials = ssh_memory_cred_cb; - cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); + cl_git_pass(git_clone(&g_repo, _remote_url, "./foo", &g_options)); } void test_online_clone__url_with_no_path_returns_EINVALIDSPEC(void) diff --git a/vendor/libgit2/tests/online/fetch.c b/vendor/libgit2/tests/online/fetch.c index 72e7c24e3..c12df069f 100644 --- a/vendor/libgit2/tests/online/fetch.c +++ b/vendor/libgit2/tests/online/fetch.c @@ -81,11 +81,11 @@ void test_online_fetch__fetch_twice(void) { git_remote *remote; cl_git_pass(git_remote_create(&remote, _repo, "test", "git://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_pass(git_remote_download(remote, NULL, NULL)); git_remote_disconnect(remote); - git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL); + git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL); cl_git_pass(git_remote_download(remote, NULL, NULL)); git_remote_disconnect(remote); @@ -117,7 +117,7 @@ void test_online_fetch__doesnt_retrieve_a_pack_when_the_repository_is_up_to_date cl_git_pass(git_repository_open(&_repository, "./fetch/lg2")); cl_git_pass(git_remote_lookup(&remote, _repository, "origin")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_assert_equal_i(false, invoked); @@ -155,7 +155,7 @@ void test_online_fetch__can_cancel(void) options.callbacks.transfer_progress = cancel_at_half; options.callbacks.payload = &bytes_received; - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_fail_with(git_remote_download(remote, NULL, &options), -4321); git_remote_disconnect(remote); git_remote_free(remote); @@ -169,7 +169,7 @@ void test_online_fetch__ls_disconnected(void) cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); cl_git_pass(git_remote_ls(&refs, &refs_len_before, remote)); git_remote_disconnect(remote); cl_git_pass(git_remote_ls(&refs, &refs_len_after, remote)); @@ -187,7 +187,7 @@ void test_online_fetch__remote_symrefs(void) cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL)); git_remote_disconnect(remote); cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); diff --git a/vendor/libgit2/tests/online/push.c b/vendor/libgit2/tests/online/push.c index 6cd444320..77c437622 100644 --- a/vendor/libgit2/tests/online/push.c +++ b/vendor/libgit2/tests/online/push.c @@ -9,16 +9,16 @@ static git_repository *_repo; -static char *_remote_url; +static char *_remote_url = NULL; -static char *_remote_ssh_key; -static char *_remote_ssh_pubkey; -static char *_remote_ssh_passphrase; +static char *_remote_user = NULL; +static char *_remote_pass = NULL; -static char *_remote_user; -static char *_remote_pass; +static char *_remote_ssh_key = NULL; +static char *_remote_ssh_pubkey = NULL; +static char *_remote_ssh_passphrase = NULL; -static char *_remote_default; +static char *_remote_default = NULL; static int cred_acquire_cb(git_cred **, const char *, const char *, unsigned int, void *); @@ -91,7 +91,6 @@ static int cred_acquire_cb( /** * git_push_status_foreach callback that records status entries. - * @param data (git_vector *) of push_status instances */ static int record_push_status_cb(const char *ref, const char *msg, void *payload) { @@ -299,7 +298,7 @@ static void verify_update_tips_callback(git_remote *remote, expected_ref expecte goto failed; } - if (git_oid_cmp(expected_refs[i].oid, tip->new_oid) != 0) { + if (git_oid_cmp(expected_refs[i].oid, &tip->new_oid) != 0) { git_buf_printf(&msg, "Updated tip ID does not match expected ID"); failed = 1; goto failed; @@ -355,6 +354,7 @@ void test_online_push__initialize(void) git_oid_fromstr(&_tag_tag, "eea4f2705eeec2db3813f2430829afce99cd00b5"); /* Remote URL environment variable must be set. User and password are optional. */ + _remote_url = cl_getenv("GITTEST_REMOTE_URL"); _remote_user = cl_getenv("GITTEST_REMOTE_USER"); _remote_pass = cl_getenv("GITTEST_REMOTE_PASS"); @@ -372,7 +372,7 @@ void test_online_push__initialize(void) record_callbacks_data_clear(&_record_cbs_data); - cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_PUSH, &_record_cbs)); + cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_PUSH, &_record_cbs, NULL)); /* Clean up previously pushed branches. Fails if receive.denyDeletes is * set on the remote. Also, on Git 1.7.0 and newer, you must run @@ -406,6 +406,14 @@ void test_online_push__cleanup(void) git_remote_free(_remote); _remote = NULL; + git__free(_remote_url); + git__free(_remote_user); + git__free(_remote_pass); + git__free(_remote_ssh_key); + git__free(_remote_ssh_pubkey); + git__free(_remote_ssh_passphrase); + git__free(_remote_default); + /* Freed by cl_git_sandbox_cleanup */ _repo = NULL; diff --git a/vendor/libgit2/tests/online/push_util.c b/vendor/libgit2/tests/online/push_util.c index cd483c7c0..eafec2f05 100644 --- a/vendor/libgit2/tests/online/push_util.c +++ b/vendor/libgit2/tests/online/push_util.c @@ -9,8 +9,6 @@ const git_oid OID_ZERO = {{ 0 }}; void updated_tip_free(updated_tip *t) { git__free(t->name); - git__free(t->old_oid); - git__free(t->new_oid); git__free(t); } @@ -46,14 +44,11 @@ int record_update_tips_cb(const char *refname, const git_oid *a, const git_oid * updated_tip *t; record_callbacks_data *record_data = (record_callbacks_data *)data; - cl_assert(t = git__malloc(sizeof(*t))); + cl_assert(t = git__calloc(1, sizeof(*t))); cl_assert(t->name = git__strdup(refname)); - cl_assert(t->old_oid = git__malloc(sizeof(*t->old_oid))); - git_oid_cpy(t->old_oid, a); - - cl_assert(t->new_oid = git__malloc(sizeof(*t->new_oid))); - git_oid_cpy(t->new_oid, b); + git_oid_cpy(&t->old_oid, a); + git_oid_cpy(&t->new_oid, b); git_vector_insert(&record_data->updated_tips, t); diff --git a/vendor/libgit2/tests/online/push_util.h b/vendor/libgit2/tests/online/push_util.h index 822341bd2..570873cfe 100644 --- a/vendor/libgit2/tests/online/push_util.h +++ b/vendor/libgit2/tests/online/push_util.h @@ -16,8 +16,8 @@ extern const git_oid OID_ZERO; typedef struct { char *name; - git_oid *old_oid; - git_oid *new_oid; + git_oid old_oid; + git_oid new_oid; } updated_tip; typedef struct { diff --git a/vendor/libgit2/tests/path/core.c b/vendor/libgit2/tests/path/core.c index 064f1492a..3dccfe5fb 100644 --- a/vendor/libgit2/tests/path/core.c +++ b/vendor/libgit2/tests/path/core.c @@ -105,12 +105,12 @@ void test_path_core__isvalid_dot_git(void) cl_assert_equal_b(true, git_path_isvalid(NULL, "foo/.GIT/bar", 0)); cl_assert_equal_b(true, git_path_isvalid(NULL, "foo/bar/.Git", 0)); - cl_assert_equal_b(false, git_path_isvalid(NULL, ".git", GIT_PATH_REJECT_DOT_GIT)); - cl_assert_equal_b(false, git_path_isvalid(NULL, ".git/foo", GIT_PATH_REJECT_DOT_GIT)); - cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.git", GIT_PATH_REJECT_DOT_GIT)); - cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.git/bar", GIT_PATH_REJECT_DOT_GIT)); - cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.GIT/bar", GIT_PATH_REJECT_DOT_GIT)); - cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/bar/.Git", GIT_PATH_REJECT_DOT_GIT)); + cl_assert_equal_b(false, git_path_isvalid(NULL, ".git", GIT_PATH_REJECT_DOT_GIT_LITERAL)); + cl_assert_equal_b(false, git_path_isvalid(NULL, ".git/foo", GIT_PATH_REJECT_DOT_GIT_LITERAL)); + cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.git", GIT_PATH_REJECT_DOT_GIT_LITERAL)); + cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.git/bar", GIT_PATH_REJECT_DOT_GIT_LITERAL)); + cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/.GIT/bar", GIT_PATH_REJECT_DOT_GIT_LITERAL)); + cl_assert_equal_b(false, git_path_isvalid(NULL, "foo/bar/.Git", GIT_PATH_REJECT_DOT_GIT_LITERAL)); cl_assert_equal_b(true, git_path_isvalid(NULL, "!git", 0)); cl_assert_equal_b(true, git_path_isvalid(NULL, "foo/!git", 0)); diff --git a/vendor/libgit2/tests/rebase/inmemory.c b/vendor/libgit2/tests/rebase/inmemory.c new file mode 100644 index 000000000..d5d89c719 --- /dev/null +++ b/vendor/libgit2/tests/rebase/inmemory.c @@ -0,0 +1,116 @@ +#include "clar_libgit2.h" +#include "git2/rebase.h" +#include "posix.h" + +#include + +static git_repository *repo; + +// Fixture setup and teardown +void test_rebase_inmemory__initialize(void) +{ + repo = cl_git_sandbox_init("rebase"); +} + +void test_rebase_inmemory__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_rebase_inmemory__not_in_rebase_state(void) +{ + git_rebase *rebase; + git_reference *branch_ref, *upstream_ref; + git_annotated_commit *branch_head, *upstream_head; + git_rebase_options opts = GIT_REBASE_OPTIONS_INIT; + + opts.inmemory = true; + + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, &opts)); + + cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); + + git_rebase_free(rebase); + + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); + + git_reference_free(branch_ref); + git_reference_free(upstream_ref); +} + +void test_rebase_inmemory__can_resolve_conflicts(void) +{ + git_rebase *rebase; + git_reference *branch_ref, *upstream_ref; + git_annotated_commit *branch_head, *upstream_head; + git_rebase_operation *rebase_operation; + git_status_list *status_list; + git_oid pick_id, commit_id, expected_commit_id; + git_signature *signature; + git_index *rebase_index, *repo_index; + git_index_entry resolution = {{0}}; + git_rebase_options opts = GIT_REBASE_OPTIONS_INIT; + + cl_git_pass(git_signature_new(&signature, + "Rebaser", "rebaser@rebaser.rb", 1405694510, 0)); + + opts.inmemory = true; + + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/asparagus")); + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, &opts)); + + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); + + git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500"); + + cl_assert_equal_i(GIT_REBASE_OPERATION_PICK, rebase_operation->type); + cl_assert_equal_oid(&pick_id, &rebase_operation->id); + + /* ensure that we did not do anything stupid to the workdir or repo index */ + cl_git_pass(git_repository_index(&repo_index, repo)); + cl_assert(!git_index_has_conflicts(repo_index)); + + cl_git_pass(git_status_list_new(&status_list, repo, NULL)); + cl_assert_equal_i(0, git_status_list_entrycount(status_list)); + + /* but that the index returned from rebase does have conflicts */ + cl_git_pass(git_rebase_inmemory_index(&rebase_index, rebase)); + cl_assert(git_index_has_conflicts(rebase_index)); + + cl_git_fail_with(GIT_EUNMERGED, git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); + + /* ensure that we can work with the in-memory index to resolve the conflict */ + resolution.path = "asparagus.txt"; + resolution.mode = GIT_FILEMODE_BLOB; + git_oid_fromstr(&resolution.id, "414dfc71ead79c07acd4ea47fecf91f289afc4b9"); + cl_git_pass(git_index_conflict_remove(rebase_index, "asparagus.txt")); + cl_git_pass(git_index_add(rebase_index, &resolution)); + + /* and finally create a commit for the resolved rebase operation */ + cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); + + cl_git_pass(git_oid_fromstr(&expected_commit_id, "db7af47222181e548810da2ab5fec0e9357c5637")); + cl_assert_equal_oid(&commit_id, &expected_commit_id); + + git_signature_free(signature); + git_status_list_free(status_list); + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); + git_reference_free(branch_ref); + git_reference_free(upstream_ref); + git_index_free(repo_index); + git_index_free(rebase_index); + git_rebase_free(rebase); +} diff --git a/vendor/libgit2/tests/rebase/iterator.c b/vendor/libgit2/tests/rebase/iterator.c index acf2a92db..db57b0a83 100644 --- a/vendor/libgit2/tests/rebase/iterator.c +++ b/vendor/libgit2/tests/rebase/iterator.c @@ -13,7 +13,8 @@ void test_rebase_iterator__initialize(void) { repo = cl_git_sandbox_init("rebase"); cl_git_pass(git_repository_index(&_index, repo)); - cl_git_pass(git_signature_now(&signature, "Rebaser", "rebaser@rebaser.rb")); + cl_git_pass(git_signature_new(&signature, "Rebaser", + "rebaser@rebaser.rb", 1405694510, 0)); } void test_rebase_iterator__cleanup(void) @@ -46,54 +47,77 @@ static void test_operations(git_rebase *rebase, size_t expected_current) } } -void test_rebase_iterator__iterates(void) +void test_iterator(bool inmemory) { git_rebase *rebase; + git_rebase_options opts = GIT_REBASE_OPTIONS_INIT; git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_oid commit_id; + git_oid commit_id, expected_id; int error; + opts.inmemory = inmemory; + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, &opts)); test_operations(rebase, GIT_REBASE_NO_OPERATION); - git_rebase_free(rebase); - cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + if (!inmemory) { + git_rebase_free(rebase); + cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + } + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 0); + git_oid_fromstr(&expected_id, "776e4c48922799f903f03f5f6e51da8b01e4cce0"); + cl_assert_equal_oid(&expected_id, &commit_id); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 1); + git_oid_fromstr(&expected_id, "ba1f9b4fd5cf8151f7818be2111cc0869f1eb95a"); + cl_assert_equal_oid(&expected_id, &commit_id); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 2); - git_rebase_free(rebase); - cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + git_oid_fromstr(&expected_id, "948b12fe18b84f756223a61bece4c307787cd5d4"); + cl_assert_equal_oid(&expected_id, &commit_id); + + if (!inmemory) { + git_rebase_free(rebase); + cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + } cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 3); + git_oid_fromstr(&expected_id, "d9d5d59d72c9968687f9462578d79878cd80e781"); + cl_assert_equal_oid(&expected_id, &commit_id); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 4); + git_oid_fromstr(&expected_id, "9cf383c0a125d89e742c5dec58ed277dd07588b3"); + cl_assert_equal_oid(&expected_id, &commit_id); + cl_git_fail(error = git_rebase_next(&rebase_operation, rebase)); cl_assert_equal_i(GIT_ITEROVER, error); test_operations(rebase, 4); @@ -104,3 +128,13 @@ void test_rebase_iterator__iterates(void) git_reference_free(upstream_ref); git_rebase_free(rebase); } + +void test_rebase_iterator__iterates(void) +{ + test_iterator(false); +} + +void test_rebase_iterator__iterates_inmemory(void) +{ + test_iterator(true); +} diff --git a/vendor/libgit2/tests/rebase/merge.c b/vendor/libgit2/tests/rebase/merge.c index 33eadb7ed..c60113b64 100644 --- a/vendor/libgit2/tests/rebase/merge.c +++ b/vendor/libgit2/tests/rebase/merge.c @@ -565,3 +565,33 @@ void test_rebase_merge__custom_checkout_options(void) git_reference_free(upstream_ref); git_rebase_free(rebase); } + +void test_rebase_merge__custom_merge_options(void) +{ + git_rebase *rebase; + git_reference *branch_ref, *upstream_ref; + git_annotated_commit *branch_head, *upstream_head; + git_rebase_options rebase_options = GIT_REBASE_OPTIONS_INIT; + git_rebase_operation *rebase_operation; + + rebase_options.merge_options.flags |= + GIT_MERGE_FAIL_ON_CONFLICT | + GIT_MERGE_SKIP_REUC; + + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/asparagus")); + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, &rebase_options)); + + cl_git_fail_with(GIT_EMERGECONFLICT, git_rebase_next(&rebase_operation, rebase)); + + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); + git_reference_free(branch_ref); + git_reference_free(upstream_ref); + git_rebase_free(rebase); +} + diff --git a/vendor/libgit2/tests/refs/branches/delete.c b/vendor/libgit2/tests/refs/branches/delete.c index 343ff0f50..8807db231 100644 --- a/vendor/libgit2/tests/refs/branches/delete.c +++ b/vendor/libgit2/tests/refs/branches/delete.c @@ -132,6 +132,8 @@ void test_refs_branches_delete__removes_reflog(void) cl_git_pass(git_branch_delete(branch)); git_reference_free(branch); + cl_assert_equal_i(false, git_reference_has_log(repo, "refs/heads/track-local")); + /* Reading a nonexistant reflog creates it, but it should be empty */ cl_git_pass(git_reflog_read(&log, repo, "refs/heads/track-local")); cl_assert_equal_i(0, git_reflog_entrycount(log)); diff --git a/vendor/libgit2/tests/refs/create.c b/vendor/libgit2/tests/refs/create.c index 192551dbd..6d5a5f1f6 100644 --- a/vendor/libgit2/tests/refs/create.c +++ b/vendor/libgit2/tests/refs/create.c @@ -18,6 +18,8 @@ void test_refs_create__initialize(void) void test_refs_create__cleanup(void) { cl_git_sandbox_cleanup(); + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1)); } void test_refs_create__symbolic(void) @@ -119,9 +121,30 @@ void test_refs_create__oid(void) git_reference_free(looked_up_ref); } -void test_refs_create__oid_unknown(void) +/* Can by default create a reference that targets at an unknown id */ +void test_refs_create__oid_unknown_succeeds_without_strict(void) +{ + git_reference *new_reference, *looked_up_ref; + git_oid id; + + const char *new_head = "refs/heads/new-head"; + + git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644"); + + cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0)); + + /* Create and write the new object id reference */ + cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL)); + git_reference_free(new_reference); + + /* Ensure the reference can't be looked-up... */ + cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head)); + git_reference_free(looked_up_ref); +} + +/* Strict object enforcement enforces valid object id */ +void test_refs_create__oid_unknown_fails_by_default(void) { - // Can not create a new OID reference which targets at an unknown id git_reference *new_reference, *looked_up_ref; git_oid id; @@ -151,6 +174,23 @@ void test_refs_create__propagate_eexists(void) cl_assert(error == GIT_EEXISTS); } +void test_refs_create__existing_dir_propagates_edirectory(void) +{ + git_reference *new_reference, *fail_reference; + git_oid id; + const char *dir_head = "refs/heads/new-dir/new-head", + *fail_head = "refs/heads/new-dir"; + + git_oid_fromstr(&id, current_master_tip); + + /* Create and write the new object id reference */ + cl_git_pass(git_reference_create(&new_reference, g_repo, dir_head, &id, 1, NULL)); + cl_git_fail_with(GIT_EDIRECTORY, + git_reference_create(&fail_reference, g_repo, fail_head, &id, false, NULL)); + + git_reference_free(new_reference); +} + static void test_invalid_name(const char *name) { git_reference *new_reference; diff --git a/vendor/libgit2/tests/refs/lookup.c b/vendor/libgit2/tests/refs/lookup.c index d076e491f..456d0d2a8 100644 --- a/vendor/libgit2/tests/refs/lookup.c +++ b/vendor/libgit2/tests/refs/lookup.c @@ -58,3 +58,11 @@ void test_refs_lookup__namespace(void) error = git_reference_lookup(&ref, g_repo, "refs/heads/"); cl_assert_equal_i(error, GIT_EINVALIDSPEC); } + +void test_refs_lookup__dwim_notfound(void) +{ + git_reference *ref; + + cl_git_fail_with(GIT_ENOTFOUND, git_reference_dwim(&ref, g_repo, "idontexist")); + cl_assert_equal_s("no reference found for shorthand 'idontexist'", giterr_last()->message); +} diff --git a/vendor/libgit2/tests/refs/pack.c b/vendor/libgit2/tests/refs/pack.c index 7dfaf6d8f..bda86f69a 100644 --- a/vendor/libgit2/tests/refs/pack.c +++ b/vendor/libgit2/tests/refs/pack.c @@ -36,7 +36,7 @@ void test_refs_pack__empty(void) git_buf temp_path = GIT_BUF_INIT; cl_git_pass(git_buf_join_n(&temp_path, '/', 3, git_repository_path(g_repo), GIT_REFS_HEADS_DIR, "empty_dir")); - cl_git_pass(git_futils_mkdir_r(temp_path.ptr, NULL, GIT_REFS_DIR_MODE)); + cl_git_pass(git_futils_mkdir_r(temp_path.ptr, GIT_REFS_DIR_MODE)); git_buf_free(&temp_path); packall(); diff --git a/vendor/libgit2/tests/refs/reflog/reflog.c b/vendor/libgit2/tests/refs/reflog/reflog.c index 3fbf412e4..fdb15502c 100644 --- a/vendor/libgit2/tests/refs/reflog/reflog.c +++ b/vendor/libgit2/tests/refs/reflog/reflog.c @@ -125,6 +125,77 @@ void test_refs_reflog_reflog__renaming_the_reference_moves_the_reflog(void) git_buf_free(&master_log_path); } +void test_refs_reflog_reflog__deleting_the_reference_deletes_the_reflog(void) +{ + git_reference *master; + git_buf master_log_path = GIT_BUF_INIT; + + git_buf_joinpath(&master_log_path, git_repository_path(g_repo), GIT_REFLOG_DIR); + git_buf_joinpath(&master_log_path, git_buf_cstr(&master_log_path), "refs/heads/master"); + + cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&master_log_path))); + + cl_git_pass(git_reference_lookup(&master, g_repo, "refs/heads/master")); + cl_git_pass(git_reference_delete(master)); + git_reference_free(master); + + cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&master_log_path))); + git_buf_free(&master_log_path); +} + +void test_refs_reflog_reflog__removes_empty_reflog_dir(void) +{ + git_reference *ref; + git_buf log_path = GIT_BUF_INIT; + git_oid id; + + /* Create a new branch pointing at the HEAD */ + git_oid_fromstr(&id, current_master_tip); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir/new-head", &id, 0, NULL)); + + git_buf_joinpath(&log_path, git_repository_path(g_repo), GIT_REFLOG_DIR); + git_buf_joinpath(&log_path, git_buf_cstr(&log_path), "refs/heads/new-dir/new-head"); + + cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path))); + + cl_git_pass(git_reference_delete(ref)); + git_reference_free(ref); + + /* new ref creation should succeed since new-dir is empty */ + git_oid_fromstr(&id, current_master_tip); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL)); + git_reference_free(ref); + + git_buf_free(&log_path); +} + +void test_refs_reflog_reflog__fails_gracefully_on_nonempty_reflog_dir(void) +{ + git_reference *ref; + git_buf log_path = GIT_BUF_INIT; + git_oid id; + + /* Create a new branch pointing at the HEAD */ + git_oid_fromstr(&id, current_master_tip); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir/new-head", &id, 0, NULL)); + git_reference_free(ref); + + git_buf_joinpath(&log_path, git_repository_path(g_repo), GIT_REFLOG_DIR); + git_buf_joinpath(&log_path, git_buf_cstr(&log_path), "refs/heads/new-dir/new-head"); + + cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path))); + + /* delete the ref manually, leave the reflog */ + cl_must_pass(p_unlink("testrepo.git/refs/heads/new-dir/new-head")); + + /* new ref creation should fail since new-dir contains reflogs still */ + git_oid_fromstr(&id, current_master_tip); + cl_git_fail_with(GIT_EDIRECTORY, git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL)); + git_reference_free(ref); + + git_buf_free(&log_path); +} + static void assert_has_reflog(bool expected_result, const char *name) { cl_assert_equal_i(expected_result, git_reference_has_log(g_repo, name)); diff --git a/vendor/libgit2/tests/repo/discover.c b/vendor/libgit2/tests/repo/discover.c index 7904b6496..86bd7458f 100644 --- a/vendor/libgit2/tests/repo/discover.c +++ b/vendor/libgit2/tests/repo/discover.c @@ -77,7 +77,7 @@ void test_repo_discover__0(void) const char *ceiling_dirs; const mode_t mode = 0777; - git_futils_mkdir_r(DISCOVER_FOLDER, NULL, mode); + git_futils_mkdir_r(DISCOVER_FOLDER, mode); append_ceiling_dir(&ceiling_dirs_buf, TEMP_REPO_FOLDER); ceiling_dirs = git_buf_cstr(&ceiling_dirs_buf); @@ -88,15 +88,15 @@ void test_repo_discover__0(void) git_repository_free(repo); cl_git_pass(git_repository_init(&repo, SUB_REPOSITORY_FOLDER, 0)); - cl_git_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, mode)); cl_git_pass(git_repository_discover(&sub_repository_path, SUB_REPOSITORY_FOLDER, 0, ceiling_dirs)); - cl_git_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, mode)); ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB, ceiling_dirs, &sub_repository_path); ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB_SUB, ceiling_dirs, &sub_repository_path); ensure_repository_discover(SUB_REPOSITORY_FOLDER_SUB_SUB_SUB, ceiling_dirs, &sub_repository_path); - cl_git_pass(git_futils_mkdir_r(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, mode)); write_file(REPOSITORY_ALTERNATE_FOLDER "/" DOT_GIT, "gitdir: ../" SUB_REPOSITORY_FOLDER_NAME "/" DOT_GIT); write_file(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB "/" DOT_GIT, "gitdir: ../../../" SUB_REPOSITORY_FOLDER_NAME "/" DOT_GIT); write_file(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB "/" DOT_GIT, "gitdir: ../../../../"); @@ -105,13 +105,13 @@ void test_repo_discover__0(void) ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB, ceiling_dirs, &sub_repository_path); ensure_repository_discover(REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB, ceiling_dirs, &repository_path); - cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER1, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER1, mode)); write_file(ALTERNATE_MALFORMED_FOLDER1 "/" DOT_GIT, "Anything but not gitdir:"); - cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER2, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER2, mode)); write_file(ALTERNATE_MALFORMED_FOLDER2 "/" DOT_GIT, "gitdir:"); - cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER3, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(ALTERNATE_MALFORMED_FOLDER3, mode)); write_file(ALTERNATE_MALFORMED_FOLDER3 "/" DOT_GIT, "gitdir: \n\n\n"); - cl_git_pass(git_futils_mkdir_r(ALTERNATE_NOT_FOUND_FOLDER, NULL, mode)); + cl_git_pass(git_futils_mkdir_r(ALTERNATE_NOT_FOUND_FOLDER, mode)); write_file(ALTERNATE_NOT_FOUND_FOLDER "/" DOT_GIT, "gitdir: a_repository_that_surely_does_not_exist"); cl_git_fail(git_repository_discover(&found_path, ALTERNATE_MALFORMED_FOLDER1, 0, ceiling_dirs)); cl_git_fail(git_repository_discover(&found_path, ALTERNATE_MALFORMED_FOLDER2, 0, ceiling_dirs)); diff --git a/vendor/libgit2/tests/repo/init.c b/vendor/libgit2/tests/repo/init.c index 525020f5a..04d4a5c5e 100644 --- a/vendor/libgit2/tests/repo/init.c +++ b/vendor/libgit2/tests/repo/init.c @@ -11,6 +11,8 @@ enum repo_mode { }; static git_repository *_repo = NULL; +static git_buf _global_path = GIT_BUF_INIT; +static git_buf _tmp_path = GIT_BUF_INIT; static mode_t g_umask = 0; void test_repo_init__initialize(void) @@ -22,6 +24,20 @@ void test_repo_init__initialize(void) g_umask = p_umask(022); (void)p_umask(g_umask); } + + git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, + &_global_path); +} + +void test_repo_init__cleanup(void) +{ + git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, + _global_path.ptr); + git_buf_free(&_global_path); + + if (_tmp_path.size > 0 && git_path_isdir(_tmp_path.ptr)) + git_futils_rmdir_r(_tmp_path.ptr, NULL, GIT_RMDIR_REMOVE_FILES); + git_buf_free(&_tmp_path); } static void cleanup_repository(void *path) @@ -99,7 +115,7 @@ void test_repo_init__bare_repo_escaping_current_workdir(void) cl_git_pass(git_path_prettify_dir(&path_current_workdir, ".", NULL)); cl_git_pass(git_buf_joinpath(&path_repository, git_buf_cstr(&path_current_workdir), "a/b/c")); - cl_git_pass(git_futils_mkdir_r(git_buf_cstr(&path_repository), NULL, GIT_DIR_MODE)); + cl_git_pass(git_futils_mkdir_r(git_buf_cstr(&path_repository), GIT_DIR_MODE)); /* Change the current working directory */ cl_git_pass(chdir(git_buf_cstr(&path_repository))); @@ -312,7 +328,7 @@ void test_repo_init__extended_0(void) cl_git_fail(git_repository_init_ext(&_repo, "extended", &opts)); /* make the directory first, then it should succeed */ - cl_git_pass(git_futils_mkdir("extended", NULL, 0775, 0)); + cl_git_pass(git_futils_mkdir("extended", 0775, 0)); cl_git_pass(git_repository_init_ext(&_repo, "extended", &opts)); cl_assert(!git__suffixcmp(git_repository_workdir(_repo), "/extended/")); @@ -503,7 +519,8 @@ static void assert_mode_seems_okay( static const char *template_sandbox(const char *name) { - git_buf hooks_path = GIT_BUF_INIT, link_path = GIT_BUF_INIT; + git_buf hooks_path = GIT_BUF_INIT, link_path = GIT_BUF_INIT, + dotfile_path = GIT_BUF_INIT; const char *path = cl_fixture(name); cl_fixture_sandbox(name); @@ -521,19 +538,84 @@ static const char *template_sandbox(const char *name) cl_must_pass(symlink("update.sample", link_path.ptr)); #endif + /* create a file starting with a dot */ + cl_git_pass(git_buf_joinpath(&dotfile_path, hooks_path.ptr, ".dotfile")); + cl_git_mkfile(dotfile_path.ptr, "something\n"); + git_buf_free(&dotfile_path); + + git_buf_free(&dotfile_path); git_buf_free(&link_path); git_buf_free(&hooks_path); return path; } -void test_repo_init__extended_with_template(void) +static void configure_templatedir(const char *template_path) +{ + git_buf config_path = GIT_BUF_INIT; + git_buf config_data = GIT_BUF_INIT; + + cl_git_pass(git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, + GIT_CONFIG_LEVEL_GLOBAL, &_tmp_path)); + cl_git_pass(git_buf_puts(&_tmp_path, ".tmp")); + cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, + GIT_CONFIG_LEVEL_GLOBAL, _tmp_path.ptr)); + + cl_must_pass(p_mkdir(_tmp_path.ptr, 0777)); + + cl_git_pass(git_buf_joinpath(&config_path, _tmp_path.ptr, ".gitconfig")); + + cl_git_pass(git_buf_printf(&config_data, + "[init]\n\ttemplatedir = \"%s\"\n", template_path)); + + cl_git_mkfile(config_path.ptr, config_data.ptr); + + git_buf_free(&config_path); + git_buf_free(&config_data); +} + +static void validate_templates(git_repository *repo, const char *template_path) { + git_buf template_description = GIT_BUF_INIT; + git_buf repo_description = GIT_BUF_INIT; git_buf expected = GIT_BUF_INIT; git_buf actual = GIT_BUF_INIT; - git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; int filemode; + cl_git_pass(git_buf_joinpath(&template_description, template_path, + "description")); + cl_git_pass(git_buf_joinpath(&repo_description, git_repository_path(repo), + "description")); + + cl_git_pass(git_futils_readbuffer(&expected, template_description.ptr)); + cl_git_pass(git_futils_readbuffer(&actual, repo_description.ptr)); + + cl_assert_equal_s(expected.ptr, actual.ptr); + + filemode = cl_repo_get_bool(repo, "core.filemode"); + + assert_hooks_match( + template_path, git_repository_path(repo), + "hooks/update.sample", filemode); + + assert_hooks_match( + template_path, git_repository_path(repo), + "hooks/link.sample", filemode); + + assert_hooks_match( + template_path, git_repository_path(repo), + "hooks/.dotfile", filemode); + + git_buf_free(&expected); + git_buf_free(&actual); + git_buf_free(&repo_description); + git_buf_free(&template_description); +} + +void test_repo_init__external_templates_specified_in_options(void) +{ + git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; + cl_set_cleanup(&cleanup_repository, "templated.git"); template_sandbox("template"); @@ -547,32 +629,64 @@ void test_repo_init__extended_with_template(void) cl_assert(!git__suffixcmp(git_repository_path(_repo), "/templated.git/")); - cl_git_pass(git_futils_readbuffer(&expected, "template/description")); - cl_git_pass(git_futils_readbuffer( - &actual, "templated.git/description")); + validate_templates(_repo, "template"); + cl_fixture_cleanup("template"); +} - cl_assert_equal_s(expected.ptr, actual.ptr); +void test_repo_init__external_templates_specified_in_config(void) +{ + git_buf template_path = GIT_BUF_INIT; - git_buf_free(&expected); - git_buf_free(&actual); + git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; - filemode = cl_repo_get_bool(_repo, "core.filemode"); + cl_set_cleanup(&cleanup_repository, "templated.git"); + template_sandbox("template"); - assert_hooks_match( - "template", git_repository_path(_repo), - "hooks/update.sample", filemode); + cl_git_pass(git_buf_joinpath(&template_path, clar_sandbox_path(), + "template")); - assert_hooks_match( - "template", git_repository_path(_repo), - "hooks/link.sample", filemode); + configure_templatedir(template_path.ptr); + + opts.flags = GIT_REPOSITORY_INIT_MKPATH | GIT_REPOSITORY_INIT_BARE | + GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE; + + cl_git_pass(git_repository_init_ext(&_repo, "templated.git", &opts)); + validate_templates(_repo, "template"); cl_fixture_cleanup("template"); + + git_buf_free(&template_path); +} + +void test_repo_init__external_templates_with_leading_dot(void) +{ + git_buf template_path = GIT_BUF_INIT; + + git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; + + cl_set_cleanup(&cleanup_repository, "templated.git"); + template_sandbox("template"); + + cl_must_pass(p_rename("template", ".template_with_leading_dot")); + + cl_git_pass(git_buf_joinpath(&template_path, clar_sandbox_path(), + ".template_with_leading_dot")); + + configure_templatedir(template_path.ptr); + + opts.flags = GIT_REPOSITORY_INIT_MKPATH | GIT_REPOSITORY_INIT_BARE | + GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE; + + cl_git_pass(git_repository_init_ext(&_repo, "templated.git", &opts)); + + validate_templates(_repo, ".template_with_leading_dot"); + cl_fixture_cleanup(".template_with_leading_dot"); + + git_buf_free(&template_path); } void test_repo_init__extended_with_template_and_shared_mode(void) { - git_buf expected = GIT_BUF_INIT; - git_buf actual = GIT_BUF_INIT; git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; int filemode = true; const char *repo_path = NULL; @@ -592,16 +706,6 @@ void test_repo_init__extended_with_template_and_shared_mode(void) filemode = cl_repo_get_bool(_repo, "core.filemode"); - cl_git_pass(git_futils_readbuffer( - &expected, "template/description")); - cl_git_pass(git_futils_readbuffer( - &actual, "init_shared_from_tpl/.git/description")); - - cl_assert_equal_s(expected.ptr, actual.ptr); - - git_buf_free(&expected); - git_buf_free(&actual); - repo_path = git_repository_path(_repo); assert_mode_seems_okay(repo_path, "hooks", GIT_FILEMODE_TREE | GIT_REPOSITORY_INIT_SHARED_GROUP, true, filemode); @@ -610,17 +714,7 @@ void test_repo_init__extended_with_template_and_shared_mode(void) assert_mode_seems_okay(repo_path, "description", GIT_FILEMODE_BLOB, false, filemode); - /* for a non-symlinked hook, it should have shared permissions now */ - assert_hooks_match( - "template", git_repository_path(_repo), - "hooks/update.sample", filemode); - - /* for a symlinked hook, the permissions still should match the - * source link, not the GIT_REPOSITORY_INIT_SHARED_GROUP value - */ - assert_hooks_match( - "template", git_repository_path(_repo), - "hooks/link.sample", filemode); + validate_templates(_repo, "template"); cl_fixture_cleanup("template"); } @@ -631,7 +725,7 @@ void test_repo_init__can_reinit_an_initialized_repository(void) cl_set_cleanup(&cleanup_repository, "extended"); - cl_git_pass(git_futils_mkdir("extended", NULL, 0775, 0)); + cl_git_pass(git_futils_mkdir("extended", 0775, 0)); cl_git_pass(git_repository_init(&_repo, "extended", false)); cl_git_pass(git_repository_init(&reinit, "extended", false)); @@ -713,7 +807,7 @@ void test_repo_init__at_filesystem_root(void) git_buf root = GIT_BUF_INIT; int root_len; - if (!cl_getenv("GITTEST_INVASIVE_FS_STRUCTURE")) + if (!cl_is_env_set("GITTEST_INVASIVE_FS_STRUCTURE")) cl_skip(); root_len = git_path_root(sandbox); diff --git a/vendor/libgit2/tests/repo/iterator.c b/vendor/libgit2/tests/repo/iterator.c index bb2d3a186..6b5795b9c 100644 --- a/vendor/libgit2/tests/repo/iterator.c +++ b/vendor/libgit2/tests/repo/iterator.c @@ -126,6 +126,7 @@ static void expect_iterator_items( void test_repo_iterator__index(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; git_index *index; g_repo = cl_git_sandbox_init("icase"); @@ -133,19 +134,19 @@ void test_repo_iterator__index(void) cl_git_pass(git_repository_index(&index, g_repo)); /* autoexpand with no tree entries for index */ - cl_git_pass(git_iterator_for_index(&i, index, 0, NULL, NULL)); + cl_git_pass(git_iterator_for_index(&i, g_repo, index, NULL)); expect_iterator_items(i, 20, NULL, 20, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 22, NULL, 22, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 12, NULL, 22, NULL); git_iterator_free(i); @@ -155,6 +156,7 @@ void test_repo_iterator__index(void) void test_repo_iterator__index_icase(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; git_index *index; int caps; @@ -167,32 +169,45 @@ void test_repo_iterator__index_icase(void) cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE)); /* autoexpand with no tree entries over range */ - cl_git_pass(git_iterator_for_index(&i, index, 0, "c", "k/D")); + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 7, NULL, 7, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index(&i, index, 0, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 3, NULL, 3, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 8, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 4, NULL, 4, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 5, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 1, NULL, 4, NULL); git_iterator_free(i); @@ -200,33 +215,47 @@ void test_repo_iterator__index_icase(void) cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE)); /* autoexpand with no tree entries over range */ - cl_git_pass(git_iterator_for_index(&i, index, 0, "c", "k/D")); + i_opts.flags = 0; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 13, NULL, 13, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index(&i, index, 0, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 5, NULL, 5, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 14, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 6, NULL, 6, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 9, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_index( - &i, index, GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); expect_iterator_items(i, 1, NULL, 6, NULL); git_iterator_free(i); @@ -237,6 +266,7 @@ void test_repo_iterator__index_icase(void) void test_repo_iterator__tree(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; git_tree *head; g_repo = cl_git_sandbox_init("icase"); @@ -244,19 +274,21 @@ void test_repo_iterator__tree(void) cl_git_pass(git_repository_head_tree(&head, g_repo)); /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_tree(&i, head, 0, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&i, head, NULL)); expect_iterator_items(i, 20, NULL, 20, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_tree( - &i, head, GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 22, NULL, 22, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_tree( - &i, head, GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 12, NULL, 22, NULL); git_iterator_free(i); @@ -267,75 +299,98 @@ void test_repo_iterator__tree_icase(void) { git_iterator *i; git_tree *head; - git_iterator_flag_t flag; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; g_repo = cl_git_sandbox_init("icase"); cl_git_pass(git_repository_head_tree(&head, g_repo)); - flag = GIT_ITERATOR_DONT_IGNORE_CASE; + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_tree(&i, head, flag, "c", "k/D")); + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 7, NULL, 7, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree(&i, head, flag, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 3, NULL, 3, NULL); git_iterator_free(i); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.start = "c"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 8, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 4, NULL, 4, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_DONT_AUTOEXPAND; + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 5, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 1, NULL, 4, NULL); git_iterator_free(i); - flag = GIT_ITERATOR_IGNORE_CASE; - /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_tree(&i, head, flag, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 13, NULL, 13, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree(&i, head, flag, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 5, NULL, 5, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 14, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 6, NULL, 6, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_DONT_AUTOEXPAND; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 9, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, head, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 1, NULL, 6, NULL); git_iterator_free(i); @@ -345,6 +400,7 @@ void test_repo_iterator__tree_icase(void) void test_repo_iterator__tree_more(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; git_tree *head; static const char *expect_basic[] = { "current_file", @@ -396,19 +452,21 @@ void test_repo_iterator__tree_more(void) cl_git_pass(git_repository_head_tree(&head, g_repo)); /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_tree(&i, head, 0, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&i, head, NULL)); expect_iterator_items(i, 12, expect_basic, 12, expect_basic); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_tree( - &i, head, GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 13, expect_trees, 13, expect_trees); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_tree( - &i, head, GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + + cl_git_pass(git_iterator_for_tree(&i, head, &i_opts)); expect_iterator_items(i, 10, expect_noauto, 13, expect_trees); git_iterator_free(i); @@ -463,6 +521,8 @@ void test_repo_iterator__tree_case_conflicts_0(void) git_tree *tree; git_oid blob_id, biga_id, littlea_id, tree_id; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + const char *expect_cs[] = { "A/1.file", "A/3.file", "a/2.file", "a/4.file" }; const char *expect_ci[] = { @@ -486,25 +546,23 @@ void test_repo_iterator__tree_case_conflicts_0(void) cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 4, expect_cs, 4, expect_cs); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 4, expect_ci, 4, expect_ci); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_DONT_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 6, expect_cs_trees, 6, expect_cs_trees); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 5, expect_ci_trees, 5, expect_ci_trees); git_iterator_free(i); @@ -517,6 +575,8 @@ void test_repo_iterator__tree_case_conflicts_1(void) git_tree *tree; git_oid blob_id, Ab_id, biga_id, littlea_id, tree_id; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + const char *expect_cs[] = { "A/a", "A/b/1", "A/c", "a/C", "a/a", "a/b" }; const char *expect_ci[] = { @@ -541,25 +601,23 @@ void test_repo_iterator__tree_case_conflicts_1(void) cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 6, expect_cs, 6, expect_cs); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 4, expect_ci, 4, expect_ci); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_DONT_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 9, expect_cs_trees, 9, expect_cs_trees); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 6, expect_ci_trees, 6, expect_ci_trees); git_iterator_free(i); @@ -572,6 +630,8 @@ void test_repo_iterator__tree_case_conflicts_2(void) git_tree *tree; git_oid blob_id, d1, d2, c1, c2, b1, b2, a1, a2, tree_id; git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + const char *expect_cs[] = { "A/B/C/D/16", "A/B/C/D/foo", "A/B/C/d/15", "A/B/C/d/FOO", "A/B/c/D/14", "A/B/c/D/foo", "A/B/c/d/13", "A/B/c/d/FOO", @@ -639,19 +699,18 @@ void test_repo_iterator__tree_case_conflicts_2(void) cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id)); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 32, expect_cs, 32, expect_cs); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 17, expect_ci, 17, expect_ci); git_iterator_free(i); - cl_git_pass(git_iterator_for_tree( - &i, tree, GIT_ITERATOR_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); expect_iterator_items(i, 21, expect_ci_trees, 21, expect_ci_trees); git_iterator_free(i); @@ -661,23 +720,24 @@ void test_repo_iterator__tree_case_conflicts_2(void) void test_repo_iterator__workdir(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; g_repo = cl_git_sandbox_init("icase"); /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, 0, NULL, NULL)); + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 20, NULL, 20, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 22, NULL, 22, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 12, NULL, 22, NULL); git_iterator_free(i); } @@ -685,73 +745,97 @@ void test_repo_iterator__workdir(void) void test_repo_iterator__workdir_icase(void) { git_iterator *i; - git_iterator_flag_t flag; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; g_repo = cl_git_sandbox_init("icase"); - flag = GIT_ITERATOR_DONT_IGNORE_CASE; - /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, flag, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 7, NULL, 7, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, flag, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 3, NULL, 3, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 8, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 4, NULL, 4, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE | GIT_ITERATOR_DONT_AUTOEXPAND; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 5, NULL, 8, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 1, NULL, 4, NULL); git_iterator_free(i); - flag = GIT_ITERATOR_IGNORE_CASE; - /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, flag, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 13, NULL, 13, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, flag, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 5, NULL, 5, NULL); git_iterator_free(i); /* auto expand with tree entries */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_INCLUDE_TREES, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 14, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_INCLUDE_TREES, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 6, NULL, 6, NULL); git_iterator_free(i); /* no auto expand (implies trees included) */ - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "c", "k/D")); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_DONT_AUTOEXPAND; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 9, NULL, 14, NULL); git_iterator_free(i); - cl_git_pass(git_iterator_for_workdir( - &i, g_repo, NULL, NULL, flag | GIT_ITERATOR_DONT_AUTOEXPAND, "k", "k/Z")); + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); expect_iterator_items(i, 1, NULL, 6, NULL); git_iterator_free(i); } @@ -764,14 +848,14 @@ static void build_workdir_tree(const char *root, int dirs, int subs) for (i = 0; i < dirs; ++i) { if (i % 2 == 0) { p_snprintf(buf, sizeof(buf), "%s/dir%02d", root, i); - cl_git_pass(git_futils_mkdir(buf, NULL, 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir(buf, 0775, GIT_MKDIR_PATH)); p_snprintf(buf, sizeof(buf), "%s/dir%02d/file", root, i); cl_git_mkfile(buf, buf); buf[strlen(buf) - 5] = '\0'; } else { p_snprintf(buf, sizeof(buf), "%s/DIR%02d", root, i); - cl_git_pass(git_futils_mkdir(buf, NULL, 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir(buf, 0775, GIT_MKDIR_PATH)); } for (j = 0; j < subs; ++j) { @@ -781,7 +865,7 @@ static void build_workdir_tree(const char *root, int dirs, int subs) case 2: p_snprintf(sub, sizeof(sub), "%s/Sub%02d", buf, j); break; case 3: p_snprintf(sub, sizeof(sub), "%s/SUB%02d", buf, j); break; } - cl_git_pass(git_futils_mkdir(sub, NULL, 0775, GIT_MKDIR_PATH)); + cl_git_pass(git_futils_mkdir(sub, 0775, GIT_MKDIR_PATH)); if (j % 2 == 0) { size_t sublen = strlen(sub); @@ -796,6 +880,7 @@ static void build_workdir_tree(const char *root, int dirs, int subs) void test_repo_iterator__workdir_depth(void) { git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; g_repo = cl_git_sandbox_init("icase"); @@ -804,13 +889,13 @@ void test_repo_iterator__workdir_depth(void) build_workdir_tree("icase/dir02/sUB01", 50, 0); /* auto expand with no tree entries */ - cl_git_pass(git_iterator_for_workdir(&iter, g_repo, NULL, NULL, 0, NULL, NULL)); + cl_git_pass(git_iterator_for_workdir(&iter, g_repo, NULL, NULL, &iter_opts)); expect_iterator_items(iter, 125, NULL, 125, NULL); git_iterator_free(iter); /* auto expand with tree entries (empty dirs silently skipped) */ - cl_git_pass(git_iterator_for_workdir( - &iter, g_repo, NULL, NULL, GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + iter_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_workdir(&iter, g_repo, NULL, NULL, &iter_opts)); expect_iterator_items(iter, 337, NULL, 337, NULL); git_iterator_free(iter); } @@ -818,6 +903,8 @@ void test_repo_iterator__workdir_depth(void) void test_repo_iterator__fs(void) { git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + static const char *expect_base[] = { "DIR01/Sub02/file", "DIR01/sub00/file", @@ -863,18 +950,17 @@ void test_repo_iterator__fs(void) build_workdir_tree("status/subdir", 2, 4); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", 0, NULL, NULL)); + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", NULL)); expect_iterator_items(i, 8, expect_base, 8, expect_base); git_iterator_free(i); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", &i_opts)); expect_iterator_items(i, 18, expect_trees, 18, expect_trees); git_iterator_free(i); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", &i_opts)); expect_iterator_items(i, 5, expect_noauto, 18, expect_trees); git_iterator_free(i); @@ -882,20 +968,18 @@ void test_repo_iterator__fs(void) git__tsort((void **)expect_trees, 18, (git__tsort_cmp)git__strcasecmp); git__tsort((void **)expect_noauto, 5, (git__tsort_cmp)git__strcasecmp); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", GIT_ITERATOR_IGNORE_CASE, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", &i_opts)); expect_iterator_items(i, 8, expect_base, 8, expect_base); git_iterator_free(i); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", GIT_ITERATOR_IGNORE_CASE | - GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", &i_opts)); expect_iterator_items(i, 18, expect_trees, 18, expect_trees); git_iterator_free(i); - cl_git_pass(git_iterator_for_filesystem( - &i, "status/subdir", GIT_ITERATOR_IGNORE_CASE | - GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + i_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_filesystem(&i, "status/subdir", &i_opts)); expect_iterator_items(i, 5, expect_noauto, 18, expect_trees); git_iterator_free(i); } @@ -923,7 +1007,7 @@ void test_repo_iterator__fs2(void) g_repo = cl_git_sandbox_init("testrepo"); cl_git_pass(git_iterator_for_filesystem( - &i, "testrepo/.git/refs", 0, NULL, NULL)); + &i, "testrepo/.git/refs", NULL)); expect_iterator_items(i, 13, expect_base, 13, expect_base); git_iterator_free(i); } @@ -936,6 +1020,11 @@ void test_repo_iterator__unreadable_dir(void) if (!cl_is_chmod_supported()) return; +#ifndef GIT_WIN32 + if (geteuid() == 0) + cl_skip(); +#endif + g_repo = cl_git_sandbox_init("empty_standard_repo"); cl_must_pass(p_mkdir("empty_standard_repo/r", 0777)); @@ -947,7 +1036,7 @@ void test_repo_iterator__unreadable_dir(void) cl_git_mkfile("empty_standard_repo/r/d", "final"); cl_git_pass(git_iterator_for_filesystem( - &i, "empty_standard_repo/r", 0, NULL, NULL)); + &i, "empty_standard_repo/r", NULL)); cl_git_pass(git_iterator_advance(&e, i)); /* a */ cl_git_fail(git_iterator_advance(&e, i)); /* b */ @@ -963,6 +1052,7 @@ void test_repo_iterator__skips_fifos_and_such(void) #ifndef GIT_WIN32 git_iterator *i; const git_index_entry *e; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; g_repo = cl_git_sandbox_init("empty_standard_repo"); @@ -972,9 +1062,11 @@ void test_repo_iterator__skips_fifos_and_such(void) cl_assert(!mkfifo("empty_standard_repo/fifo", 0777)); cl_assert(!access("empty_standard_repo/fifo", F_OK)); + i_opts.flags = GIT_ITERATOR_INCLUDE_TREES | + GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_filesystem( - &i, "empty_standard_repo", GIT_ITERATOR_INCLUDE_TREES | - GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + &i, "empty_standard_repo", &i_opts)); cl_git_pass(git_iterator_advance(&e, i)); /* .git */ cl_assert(S_ISDIR(e->mode)); @@ -989,3 +1081,469 @@ void test_repo_iterator__skips_fifos_and_such(void) git_iterator_free(i); #endif } + +void test_repo_iterator__indexfilelist(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_index *index; + git_vector filelist; + int default_icase; + int expect; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + + cl_git_pass(git_repository_index(&index, g_repo)); + + /* In this test we DO NOT force a case setting on the index. */ + default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0); + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + /* All indexfilelist iterator tests are "autoexpand with no tree entries" */ + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, 8, NULL, 8, NULL); + git_iterator_free(i); + + i_opts.start = "c"; + i_opts.end = NULL; + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + /* (c D e k/1 k/a L ==> 6) vs (c e k/1 k/a ==> 4) */ + expect = ((default_icase) ? 6 : 4); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + i_opts.start = NULL; + i_opts.end = "e"; + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + /* (a B c D e ==> 5) vs (B D L/1 a c e ==> 6) */ + expect = ((default_icase) ? 5 : 6); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_index_free(index); + git_vector_free(&filelist); +} + +void test_repo_iterator__indexfilelist_2(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_index *index; + git_vector filelist = GIT_VECTOR_INIT; + int default_icase, expect; + + g_repo = cl_git_sandbox_init("icase"); + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "0")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + + /* In this test we DO NOT force a case setting on the index. */ + default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0); + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "b"; + i_opts.end = "k/D"; + + /* (c D e k/1 k/a ==> 5) vs (c e k/1 ==> 3) */ + expect = default_icase ? 5 : 3; + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_index_free(index); + git_vector_free(&filelist); +} + +void test_repo_iterator__indexfilelist_3(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_index *index; + git_vector filelist = GIT_VECTOR_INIT; + int default_icase, expect; + + g_repo = cl_git_sandbox_init("icase"); + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "0")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k/")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ")); + + /* In this test we DO NOT force a case setting on the index. */ + default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0); + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "b"; + i_opts.end = "k/D"; + + /* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */ + expect = default_icase ? 8 : 5; + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_index_free(index); + git_vector_free(&filelist); +} + +void test_repo_iterator__indexfilelist_4(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_index *index; + git_vector filelist = GIT_VECTOR_INIT; + int default_icase, expect; + + g_repo = cl_git_sandbox_init("icase"); + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "0")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ")); + + /* In this test we DO NOT force a case setting on the index. */ + default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0); + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "b"; + i_opts.end = "k/D"; + + /* (c D e k/1 k/a k/B k/c k/D) vs (c e k/1 k/B k/D) */ + expect = default_icase ? 8 : 5; + + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_index_free(index); + git_vector_free(&filelist); +} + +void test_repo_iterator__indexfilelist_icase(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_index *index; + int caps; + git_vector filelist; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + + cl_git_pass(git_repository_index(&index, g_repo)); + caps = git_index_caps(index); + + /* force case sensitivity */ + cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE)); + + /* All indexfilelist iterator tests are "autoexpand with no tree entries" */ + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, 3, NULL, 3, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, 1, NULL, 1, NULL); + git_iterator_free(i); + + /* force case insensitivity */ + cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE)); + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, 5, NULL, 5, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_index(&i, g_repo, index, &i_opts)); + expect_iterator_items(i, 2, NULL, 2, NULL); + git_iterator_free(i); + + cl_git_pass(git_index_set_caps(index, caps)); + git_index_free(index); + git_vector_free(&filelist); +} + +void test_repo_iterator__workdirfilelist(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_vector filelist; + bool default_icase; + int expect; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + + /* All indexfilelist iterator tests are "autoexpand with no tree entries" */ + /* In this test we DO NOT force a case on the iteratords and verify default behavior. */ + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + expect_iterator_items(i, 8, NULL, 8, NULL); + git_iterator_free(i); + + i_opts.start = "c"; + i_opts.end = NULL; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + default_icase = git_iterator_ignore_case(i); + /* (c D e k/1 k/a L ==> 6) vs (c e k/1 k/a ==> 4) */ + expect = ((default_icase) ? 6 : 4); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + i_opts.start = NULL; + i_opts.end = "e"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + default_icase = git_iterator_ignore_case(i); + /* (a B c D e ==> 5) vs (B D L/1 a c e ==> 6) */ + expect = ((default_icase) ? 5 : 6); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_vector_free(&filelist); +} + +void test_repo_iterator__workdirfilelist_icase(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_vector filelist; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZ")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + expect_iterator_items(i, 3, NULL, 3, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + expect_iterator_items(i, 1, NULL, 1, NULL); + git_iterator_free(i); + + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + expect_iterator_items(i, 5, NULL, 5, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_workdir(&i, g_repo, NULL, NULL, &i_opts)); + expect_iterator_items(i, 2, NULL, 2, NULL); + git_iterator_free(i); + + git_vector_free(&filelist); +} + +void test_repo_iterator__treefilelist(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_vector filelist; + git_tree *tree; + bool default_icase; + int expect; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + git_repository_head_tree(&tree, g_repo); + + /* All indexfilelist iterator tests are "autoexpand with no tree entries" */ + /* In this test we DO NOT force a case on the iteratords and verify default behavior. */ + + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + expect_iterator_items(i, 8, NULL, 8, NULL); + git_iterator_free(i); + + i_opts.start = "c"; + i_opts.end = NULL; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + default_icase = git_iterator_ignore_case(i); + /* (c D e k/1 k/a L ==> 6) vs (c e k/1 k/a ==> 4) */ + expect = ((default_icase) ? 6 : 4); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + i_opts.start = NULL; + i_opts.end = "e"; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + default_icase = git_iterator_ignore_case(i); + /* (a B c D e ==> 5) vs (B D L/1 a c e ==> 6) */ + expect = ((default_icase) ? 5 : 6); + expect_iterator_items(i, expect, NULL, expect, NULL); + git_iterator_free(i); + + git_vector_free(&filelist); + git_tree_free(tree); +} + +void test_repo_iterator__treefilelist_icase(void) +{ + git_iterator *i; + git_iterator_options i_opts = GIT_ITERATOR_OPTIONS_INIT; + git_vector filelist; + git_tree *tree; + + cl_git_pass(git_vector_init(&filelist, 100, &git__strcmp_cb)); + cl_git_pass(git_vector_insert(&filelist, "a")); + cl_git_pass(git_vector_insert(&filelist, "B")); + cl_git_pass(git_vector_insert(&filelist, "c")); + cl_git_pass(git_vector_insert(&filelist, "D")); + cl_git_pass(git_vector_insert(&filelist, "e")); + cl_git_pass(git_vector_insert(&filelist, "k.a")); + cl_git_pass(git_vector_insert(&filelist, "k.b")); + cl_git_pass(git_vector_insert(&filelist, "k/1")); + cl_git_pass(git_vector_insert(&filelist, "k/a")); + cl_git_pass(git_vector_insert(&filelist, "kZZZZ")); + cl_git_pass(git_vector_insert(&filelist, "L/1")); + + g_repo = cl_git_sandbox_init("icase"); + git_repository_head_tree(&tree, g_repo); + + i_opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE; + i_opts.pathlist.strings = (char **)filelist.contents; + i_opts.pathlist.count = filelist.length; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + expect_iterator_items(i, 3, NULL, 3, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + expect_iterator_items(i, 1, NULL, 1, NULL); + git_iterator_free(i); + + i_opts.flags = GIT_ITERATOR_IGNORE_CASE; + + i_opts.start = "c"; + i_opts.end = "k/D"; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + expect_iterator_items(i, 5, NULL, 5, NULL); + git_iterator_free(i); + + i_opts.start = "k"; + i_opts.end = "k/Z"; + cl_git_pass(git_iterator_for_tree(&i, tree, &i_opts)); + expect_iterator_items(i, 2, NULL, 2, NULL); + git_iterator_free(i); + + git_vector_free(&filelist); + git_tree_free(tree); +} diff --git a/vendor/libgit2/tests/repo/open.c b/vendor/libgit2/tests/repo/open.c index eb459e51d..d3d087231 100644 --- a/vendor/libgit2/tests/repo/open.c +++ b/vendor/libgit2/tests/repo/open.c @@ -91,7 +91,7 @@ static void make_gitlink_dir(const char *dir, const char *linktext) { git_buf path = GIT_BUF_INIT; - cl_git_pass(git_futils_mkdir(dir, NULL, 0777, GIT_MKDIR_VERIFY_DIR)); + cl_git_pass(git_futils_mkdir(dir, 0777, GIT_MKDIR_VERIFY_DIR)); cl_git_pass(git_buf_joinpath(&path, dir, ".git")); cl_git_rewritefile(path.ptr, linktext); git_buf_free(&path); @@ -222,7 +222,7 @@ void test_repo_open__bad_gitlinks(void) cl_git_sandbox_init("attr"); cl_git_pass(p_mkdir("invalid", 0777)); - cl_git_pass(git_futils_mkdir_r("invalid2/.git", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("invalid2/.git", 0777)); for (scan = bad_links; *scan != NULL; scan++) { make_gitlink_dir("alternate", *scan); diff --git a/vendor/libgit2/tests/repo/reservedname.c b/vendor/libgit2/tests/repo/reservedname.c index faea0cc2b..2a5b38239 100644 --- a/vendor/libgit2/tests/repo/reservedname.c +++ b/vendor/libgit2/tests/repo/reservedname.c @@ -106,3 +106,27 @@ void test_repo_reservedname__submodule_pointer(void) git_repository_free(sub_repo); #endif } + +/* Like the `submodule_pointer` test (above), this ensures that we do not + * follow the gitlink to the submodule's repository location and treat that + * as a reserved name. This tests at an initial submodule update, where the + * submodule repo is being created. + */ +void test_repo_reservedname__submodule_pointer_during_create(void) +{ + git_repository *repo; + git_submodule *sm; + git_submodule_update_options update_options = GIT_SUBMODULE_UPDATE_OPTIONS_INIT; + git_buf url = GIT_BUF_INIT; + + repo = setup_fixture_super(); + + cl_git_pass(git_buf_joinpath(&url, clar_sandbox_path(), "sub.git")); + cl_repo_set_string(repo, "submodule.sub.url", url.ptr); + + cl_git_pass(git_submodule_lookup(&sm, repo, "sub")); + cl_git_pass(git_submodule_update(sm, 1, &update_options)); + + git_submodule_free(sm); + git_buf_free(&url); +} diff --git a/vendor/libgit2/tests/repo/state.c b/vendor/libgit2/tests/repo/state.c index bf2633c17..7f20eebe8 100644 --- a/vendor/libgit2/tests/repo/state.c +++ b/vendor/libgit2/tests/repo/state.c @@ -57,6 +57,15 @@ void test_repo_state__revert(void) assert_repo_state(GIT_REPOSITORY_STATE_NONE); } +void test_repo_state__revert_sequence(void) +{ + setup_simple_state(GIT_REVERT_HEAD_FILE); + setup_simple_state(GIT_SEQUENCER_TODO_FILE); + assert_repo_state(GIT_REPOSITORY_STATE_REVERT_SEQUENCE); + cl_git_pass(git_repository_state_cleanup(_repo)); + assert_repo_state(GIT_REPOSITORY_STATE_NONE); +} + void test_repo_state__cherry_pick(void) { setup_simple_state(GIT_CHERRYPICK_HEAD_FILE); @@ -65,6 +74,15 @@ void test_repo_state__cherry_pick(void) assert_repo_state(GIT_REPOSITORY_STATE_NONE); } +void test_repo_state__cherrypick_sequence(void) +{ + setup_simple_state(GIT_CHERRYPICK_HEAD_FILE); + setup_simple_state(GIT_SEQUENCER_TODO_FILE); + assert_repo_state(GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE); + cl_git_pass(git_repository_state_cleanup(_repo)); + assert_repo_state(GIT_REPOSITORY_STATE_NONE); +} + void test_repo_state__bisect(void) { setup_simple_state(GIT_BISECT_LOG_FILE); diff --git a/vendor/libgit2/tests/reset/hard.c b/vendor/libgit2/tests/reset/hard.c index 88055adda..e461f8093 100644 --- a/vendor/libgit2/tests/reset/hard.c +++ b/vendor/libgit2/tests/reset/hard.c @@ -122,9 +122,9 @@ static void unmerged_index_init(git_index *index, int entries) int write_theirs = 4; git_oid ancestor, ours, theirs; - git_oid_fromstr(&ancestor, "6bb0d9f700543ba3d318ba7075fc3bd696b4287b"); - git_oid_fromstr(&ours, "b19a1e93bec1317dc6097229e12afaffbfa74dc2"); - git_oid_fromstr(&theirs, "950b81b7eee953d050aa05a641f8e056c85dd1bd"); + git_oid_fromstr(&ancestor, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); + git_oid_fromstr(&ours, "32504b727382542f9f089e24fddac5e78533e96c"); + git_oid_fromstr(&theirs, "061d42a44cacde5726057b67558821d95db96f19"); cl_git_rewritefile("status/conflicting_file", "conflicting file\n"); @@ -235,3 +235,55 @@ void test_reset_hard__reflog_is_correct(void) git_annotated_commit_free(annotated); } + +void test_reset_hard__switch_file_to_dir(void) +{ + git_index_entry entry = {{ 0 }}; + git_index *idx; + git_object *commit; + git_tree *tree; + git_signature *sig; + git_oid src_tree_id, tgt_tree_id; + git_oid src_id, tgt_id; + + entry.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")); + cl_git_pass(git_index_new(&idx)); + cl_git_pass(git_signature_now(&sig, "foo", "bar")); + + /* Create the old tree */ + entry.path = "README"; + cl_git_pass(git_index_add(idx, &entry)); + entry.path = "dir"; + cl_git_pass(git_index_add(idx, &entry)); + + cl_git_pass(git_index_write_tree_to(&src_tree_id, idx, repo)); + cl_git_pass(git_index_clear(idx)); + + cl_git_pass(git_tree_lookup(&tree, repo, &src_tree_id)); + cl_git_pass(git_commit_create(&src_id, repo, NULL, sig, sig, NULL, "foo", tree, 0, NULL)); + git_tree_free(tree); + + /* Create the new tree */ + entry.path = "README"; + cl_git_pass(git_index_add(idx, &entry)); + entry.path = "dir/FILE"; + cl_git_pass(git_index_add(idx, &entry)); + + cl_git_pass(git_index_write_tree_to(&tgt_tree_id, idx, repo)); + cl_git_pass(git_tree_lookup(&tree, repo, &tgt_tree_id)); + cl_git_pass(git_commit_create(&tgt_id, repo, NULL, sig, sig, NULL, "foo", tree, 0, NULL)); + git_tree_free(tree); + git_index_free(idx); + git_signature_free(sig); + + /* Let's go to a known state of the src commit with the file named 'dir' */ + cl_git_pass(git_object_lookup(&commit, repo, &src_id, GIT_OBJ_COMMIT)); + cl_git_pass(git_reset(repo, commit, GIT_RESET_HARD, NULL)); + git_object_free(commit); + + /* And now we move over to the commit with the directory named 'dir' */ + cl_git_pass(git_object_lookup(&commit, repo, &tgt_id, GIT_OBJ_COMMIT)); + cl_git_pass(git_reset(repo, commit, GIT_RESET_HARD, NULL)); + git_object_free(commit); +} diff --git a/vendor/libgit2/tests/resources/blametest.git/objects/37/681a80ca21064efd5c3bf2ef41eb3d05a1428b b/vendor/libgit2/tests/resources/blametest.git/objects/37/681a80ca21064efd5c3bf2ef41eb3d05a1428b new file mode 100644 index 0000000000000000000000000000000000000000..a6ca0fb71bc4e4628b259c54724aefb548e19f20 GIT binary patch literal 106 zcmV-w0G0oE0V^p=O;s>7Fk&z?FfcPQQApG)sVHIK*|p_L{584Ig(oxX=g-+tCG;@F z1F9eitl+)TeP7jy&XdhWk9!9GG`iWToN^JWAfq%r6|5#ITu*OGQ+&wI5b;;17Ia=s MIJ)#D0Ko1mZLd!-CIA2c literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/blametest.git/objects/4e/ecfea484f8005d101e547f6bfb07c99e2b114e b/vendor/libgit2/tests/resources/blametest.git/objects/4e/ecfea484f8005d101e547f6bfb07c99e2b114e new file mode 100644 index 0000000000000000000000000000000000000000..79e0ada916ce5490fbde3d8007cf2b9dc2483c7b GIT binary patch literal 163 zcmV;U09^lg0gcZ~3c@fDfMM4;MRr{XlF4%lB7)#r@C1`&LQCm`G~QoO58wel`2V!d z^Vp<@{?ID3G{GYfsze%;w_LJICKk=b0!NdTBd{8y*r@W-WK1DBN;*LE=r8w`vFfo40Hcy7m3*$}=mr8YUcQU}R?FkuVr#U<5*a K0)x|A=6C=U8&RYH literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/blametest.git/objects/66/53ff42313eb5c82806f145391b18a9699800c7 b/vendor/libgit2/tests/resources/blametest.git/objects/66/53ff42313eb5c82806f145391b18a9699800c7 new file mode 100644 index 0000000000000000000000000000000000000000..1f1140931319f17adda09ce614c93aca093ec200 GIT binary patch literal 160 zcmV;R0AK%j0hP~93c@fDKw;N8MRr{Xl9^7L1VjWEZUs*;NhVlIe@Nr~1wDZWc<{Zn z&hywbLO8T4qB(~YNjPDj3l^~gI1qZr);knNhEjY)wQ-fDX%b0Am^>A4jLl#`EV(ko z5{*kC2u1)B#qai7tA22+W194{$+*0@=BCfve%+@1G|m?dM83Dy1L>myV^sS3n*3j? O+i$JAcj^PtVntJpk4Ve_ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/blametest.git/objects/ad/9cb4eac23df2fe5e1264287a5872ea2a1ff8b2 b/vendor/libgit2/tests/resources/blametest.git/objects/ad/9cb4eac23df2fe5e1264287a5872ea2a1ff8b2 new file mode 100644 index 0000000000000000000000000000000000000000..077e658643b8f7d336e451489a3471e959f84683 GIT binary patch literal 106 zcmV-w0G0oE0V^p=O;s>7Fk&z?FfcPQQApG)sVHIK*|p_L{584Ig(oxX=g-+tCG;@F z1F9eitl+)TeP7jy&XdhWk9!9GG`iWToN^JWAfq%r6|Cmo{KxS#*&fdH;M1& literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/blametest.git/refs/heads/master b/vendor/libgit2/tests/resources/blametest.git/refs/heads/master index b763025d8..d1bc4ca6b 100644 --- a/vendor/libgit2/tests/resources/blametest.git/refs/heads/master +++ b/vendor/libgit2/tests/resources/blametest.git/refs/heads/master @@ -1 +1 @@ -bc7c5ac2bafe828a68e9d1d460343718d6fbe136 +6653ff42313eb5c82806f145391b18a9699800c7 diff --git a/vendor/libgit2/tests/resources/diff_format_email/.gitted/index b/vendor/libgit2/tests/resources/diff_format_email/.gitted/index index f73027e565387ebbe041eab863c6cce17c04085c..d94f87de830619993545c15c09363479043f1d9c 100644 GIT binary patch delta 222 zcmZo*TF7MJ;u+-3z`(!+#LS^82OT)v#q41;1H(T?h6eE`3=EBLfzmHPc%p%h3QQhG zL)AS6s#^kA*Pv1x7UC%*{ozgpnC@0)g{pgotPW_eYB6W3iR+sW7MCC2op&|vcFtDE zCA%0n(=u~XjrB?@N*F?dTwQ_cBpHkq47jfTPcQRn`mVXrMs2~=vT)uG-)ZfJIakiP VoZfL{_Pq~(g)TTLO|xf=002wANY?-W delta 189 zcmZ3;)WBrm;u+-3z`(!+#LU4SkugA;0Y)7k2CH-1tpHTF1g@?@B?gB&MPzkAbL3~~R&X79#r10M&PyxGp6&ksv0BH4fio>L hC)HT5q@sjjCbK1To7|RzlX5z99et-tKipgw3jp#`G1UM7 diff --git a/vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/62/7e7e12d87e07a83fad5b6bfa25e86ead4a5270 b/vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/62/7e7e12d87e07a83fad5b6bfa25e86ead4a5270 new file mode 100644 index 000000000..269a5bcf4 --- /dev/null +++ b/vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/62/7e7e12d87e07a83fad5b6bfa25e86ead4a5270 @@ -0,0 +1 @@ +xMN0YGر] !8@%$Nqb5#{Jq+`ޛE!*RR8=5(MT b)⺗AQގE3` W3- cZLO{}O3 Bh.Px쇾gޏ$;f\Ntkzc⊼O{|L3Hx5&hN]G5oxY ܺRL޾7SnG15jl׎׵~1f.f_* wt6 T; \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/73/09653445ecf038d3e3dd9ed55edb6cb541a4ba b/vendor/libgit2/tests/resources/diff_format_email/.gitted/objects/73/09653445ecf038d3e3dd9ed55edb6cb541a4ba new file mode 100644 index 0000000000000000000000000000000000000000..ba9c5fa577c6b40c213f96f53b4f253d2d919394 GIT binary patch literal 28 jcmb7v}7^;7QRxSqar2Nv% zoSaO!t8lt&Dyn&mZAYG+S^OsJfk@va!=FXr_j?TG7~>f@(~A5GG{O}FfcPQQAjKi J1OUKwTBN=BVB7!z literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8 new file mode 100644 index 000000000..d9399d71c --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/00/7f1ee2af8e5d99906867c4237510e1790a89b8 @@ -0,0 +1,3 @@ +xNI +1<FtgA05AV|0V^p=O;s>5GG{O}FfcPQQAjKNcK?DVcI~22@p9YGMvp&D4qwehTf=^DNYqjI@`Ot#YvJ KJq`f;l3aIJ+G3Re literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/05/c6a04ac101ab1a9836a95d5ec8d16b6f6304fd new file mode 100644 index 0000000000000000000000000000000000000000..c6a3a3b8def22521b0be327923d3bb028613e4e4 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKdv{d K)&Ky^dR($J31Z&> literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa new file mode 100644 index 000000000..85887e0f5 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/06/db153c36829fc656e05cdf5a3bf7183f3c10aa @@ -0,0 +1,2 @@ +x%Pn@ |_HN.}%)Qe819@R$&I!w6pF,Kң*HL s߯#0+300/`#Cib']l +RRqo,k>\vXɸPzIIM6iY],WzpBzPdF4V .xV!y~9ր0uhoU`$,_R:-a2%Sw^cJ>fFOv;+ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/07/10c3c796e0704361472ecb904413fca0107a25 new file mode 100644 index 0000000000000000000000000000000000000000..9f48594b5e9dd2d86998975017e8b841120dcc46 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKNcK?DVcI~22@p9YGMvp&6G05AV|0V^p=O;s>5GG{O}FfcPQQAjK9+jN$ zO%DLOR++W2fmr~9up}2^BE;EY8b=2(r$nAcM=`1=R(>=s*0GHgVqbY79#}-sM+Sn) z4Pd}HV6h6fwv?(b>4i1v>r(Ps9{R{V{irj4i=R7C$tP_AyoYJ_M(;bvsGjz-jsL_b PT>E>xZL4|%(vDH^g)m9w literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0e/8126647ec607f0a14122cec4b15315d790c8ff new file mode 100644 index 0000000000000000000000000000000000000000..c99a6865c2694d0e01ab408d95c2303c75596416 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjK*bF-)ZbitUz~A8-NutKB~y;hfT}7>P0RtSS-v4HxGwv-z^wgG{!ialdgVd+ KEd>DYnqMw)Z)Roy literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 new file mode 100644 index 000000000..b06362dd8 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/0f/a6ead2731b9d138afe38c336c9727ea05027a7 @@ -0,0 +1 @@ +xJAE+*hk"bhTw8̴-\0/2<݌nKI\9D`5Tdϩ4Jm I)ꈼ"-鄱晴O'„3YG JAXSd#(NPxzmpg{q>e9ѱsӞ3=Y1pFe2oz \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/12/4d4fe29d3433fdaa2f0f455d226f2c79d89cf3 new file mode 100644 index 0000000000000000000000000000000000000000..f0ea020fb001f27b4f65ca32006f9280676ad0e1 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKv0G{d^~5I z7I;MXskJ>b=jK#CR`l%o>z7Zy?6x;_w|_XSjd`;yy4r0&n8U+8UEkjCX-kLwJ>@Pj z)8lAU7K$xRHgj5?w_|WI2-RaI>87mz24v6(RP^J8KwOs)mR*$6uMhLRHo4DDm-=zJ087$Z!@b+qZ-_eBAKQvlgko}U&O z1v(laZ9OOgZ<;AU80A$&1g4q&sR*T|d^`$OjCci_ShFNKS+LEW6N5o{OaP;`wrNOW z&s292_B1ruB%bGu`jnOi^KM(lX4?W`EJ5mQSJ&aOj=FlN|}f<^bUuE|c=famI(PEej}x^9jBDKdgJ1v~@< zt>ro+88R^g$3>?i&Ex3MB=A&np{mp;4!~$8HKra@yp4pds6P_Xh1V0CCEy(MB*R~bm_Q0DrJM0F^qlsT?Z^~Sjz08H6$D*;luKjRmHj@k z6(-lg;${S$d`rm*Lx%RT)H`3m^f9*7;5gb$?$?C?#HoO6YtNqwMgd0yrJaXG=uI01 zfKgusA~bF6#{x=Ax$lK)wi%vR)71JD%X%jG6WLGR8b4^WeP@g+`?2LXCjBrgMX3SdZxXG9dS(%~Z#;KtB zu{bmdyq398D$U3N8qKP~G)rnd@>5<&8}4`X5EF8128(&1EiN?Kt<009HvR_Zu1=g^D_t1WDRayobo6It5Zuwb?oYP83U`9SO{JP?Q6U$TCA0F*VC^zbG5Bpqhk#Z#F~8I==~LNlF6$@t$me|db>MGGVSkT;MBOoNrj^%~6Yxstxo^mZp7Iv;f>@s$ z+FYKFlXO5E@vh^#(X$OS+2u^0K`m1oohQj`d*}B$HN}$TOftI#7fkFrD_{mjyHe#q z>rEBrEy?79F8|3Eod1VaRu#?o7)DNK%64Xo7zYmhV+BHoj=D4sL;XJ{w!-8FNZgG8 z$@i3;FlZ=_rP29n%ot-&9j*gralZ}+Ku!r{+j@RqZ4~%uz;y7C2)=2j0Ao~FH4&V4 z_H#8#M|m8DT1H5LHr7NWCkwTCa$>M3mjp68Yx|xgE==7N5l>I6P2zb!YfkC-C9$l? zl-iwohB%hSNOnnMIN%kj-p5I;joO6bG}OhAT_`S$gf`Wwf)lT^lNF;eVr%WeHFY=< zN=ED$IDEhQn(T%HWUi^{2Gx0@%V6}Q+6dJYP*@ag;4Y&XvN40l&8KS3TX6shywzT) zE8WZi9L=V|bS3p3`Kez>8|qK=7!z{qCW}7M9t$mYuYI!A$KUWdxs}0qu{nxyp`pPg zL6UY>?bm9+Gc+Ygqh6wMum-+Nyug{71`WLZ)$f9tpym45Hf=EO?sYYEqGVeAl^G76 z=!gDaY=0&01cSR$HA_(ot-gxerXqN+roGj_zMDjI UDBY|+At``qBPE~AAEX6|z4XmEIRF3v literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/1c/1bdb80c04233d1a9b9755913ee233987be6175 new file mode 100644 index 0000000000000000000000000000000000000000..a2146496decf282eba468c692c6f7e10bf64d1c0 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKTiU*U#^-LkMR!aGYktDm4!Z8PN+BWhADIj(I$tHqsf<(C--K0g3Jn zh#7aOC9GmctaS%$W+*M} zHA+gd?XtB<&#D+=;oi7$&6DgIS1aVc9uS(h4@K%UgP@Ub{IF6kH}7R|LA%8h_6k|d zOHEj$aP!N-gtP^8g=uJKMtg^C0;4YRNmr4qV@<8=Qq{v`K~JXcyv3A2!vG3n%#1P7 S&7TDG?e-h5cL@L5MT~_s`-Tqy literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/21/950d5e4e4d1a871b4dfcf72ecb6b9c162c434e new file mode 100644 index 0000000000000000000000000000000000000000..a87732611a38ea041d580d75e7e8b5a865babf96 GIT binary patch literal 670 zcmV;P0%84l0Zo*_Zrd;rM0@5}><738f&#txBtjIaa;d87*LRk( z+ukgRT+X~1y7IB2hlfv}KYTwOztZdZ?XoxK@^+=C=j)k{bU9z?`sL+xqHk} z)CFRF-qGT6zr9J@Xd~X$EV{z84b9_Ib1Zev7cgCn4b@nVF{Asn5r8-qkZtApW5FokXrQ$9un4_r zr2sJMt3ZUNmHkja=~nJKp^9yW=Y=&9$;rZP?wuGMl;;F7y4N-hNgSE#J|domCY!|b zdeEHG_DSMAA!VvoY8d8Nc1E&Gig6pSlgfI$DS#Ez6p?8iLv~?yp(AiFyJo!cy0^Dt zG)A0SdT>h}B*L5#J2q_GZ(NgI@B*1@YI=hD+|yHQ^r2vcYYH)=YpLZrqZzU=L&u#{ zLGxpF7!r6Xy-+IkzyTV~qQTU2YCQ5&UPv46_w*POa;tlbKF}Ix8tq#8WT}b2!8y5! zp?I`8ig95_txJL=?V#Ro)c`XzCCE-$qH#b2E05AV|0V^p=O;s>5GG{O}FfcPQQAjKg)K0v6%kS0w9qzZ~QX{-|)@a!g+#;RjyK8Fy*hv#=r z3%r2vQ)~O~e*c`kk9&G?adr9Z^LBGf54%tID`Q?Qi>|kucjkV~QX^5F}mze2k zv?&Y4mL{7yRrGlMal576-OcXqf!=<4q=yfi+uMp_VDn>H)N?v;Lv`%?7|4d2CC4QH zIbj(bgNs3^1}N#R_sfLW%QE*Ed~^4>qYd5f9{+~*U!C48i>$rki_4crh8ROTdZoJe zwm#Cp!@vnzjG^JC0*{9B6!n5wpDUVN?v|ajATZ(`xatkhHc)5#HGVrC*M$V!hoTDEFGLL!W?3Rt+~sf=Wo)P|+Kb}IL=QzEZ2A@mh8 z8?pLUkWG?N-rkE!wSPxXS^V85dGF~PUG zv&aL@airePB~O-`_#HYYH!u+QHb*foRMfg8aMB)?`zadG3`q%6sg_6_q=7CS_fV#| zK`l?e_`6^_a5;S_CQUHz&Sf-sB4ir5BwmAWJg2Gv$ntoIu3(4YHd1s)u x20ZmiOuG26OW$mw+4+s@3SfH*d1k#m|T6BTCc9KbA#j%6OCWNo&jMDVGs)~06qwj`R)7qM_6GAf&{vQ)tVR8c~?nW@l_mrG4 zVCWo6qw`gmF~*)clw-`|ejN$`oC3(U_58ZZDA3UW>EJ;Tc+*Y+!YHpQA~5aj=PH!8 z@;C~$43h$Ftd2-d7Hsq6#9&b_31GC>_B}~ln7S##o}N~l#PfbupVIM5Vp%B$YIo`x zrf(;4BOFg z=ziBV*$ofyTwT)*%JW1|gVB#FBUn>FU=g%|yNqPW#ta+}ovJiHio=k=Tg`>4(#;%z z(QIl=S5oicpXvp-!Tv;_VuEkoWRVBjW1+?FHBXlM_!~MWw=xhfHb*foG&Hy*aMI4o z{T>ZyhNJ{(R7)fd(m~`6+lS~pTjvYJ>A^dv2aa!Qk z*z@>aZslV|4-X$dz59MTexaB1>t%1u<@HKWU$196(&c=m>*wdwiN3uapRX@;ex$eK z_4K@>+$Uy=!Nnj{&zVBZlw%|rt@k_Ju#qXo(9WJ>OO?0vKod_BCz|3M8g6!ELqmCq zS|HZv9W5^R+ezA181b%V(F)HtP;bWrer0l*s^~mPX4^Qwmaaa|Ne(1~8&P0lU0VS{ zAX*hN2buuYg&eitlJqX<=$~wX`Twzss!TIJhK|#LvK>Ge?U+OVPyx`!qb!YWTkgBW zR+wB1imMS!@(m>?3>Z4cQs;aTri-zm8s!)>x?h_D0H*-5tvr7yG75AwK-zjx1m3h# zfH2CdhzLw8`=JP>t=x4&726EX3#%iNlLgz{J26<4=L9g?Ynz57j!bnQVNXMoP2zby zs84CTk~mNBl&X~)2050Uk?fMnxQ*9Ir5-0mV3lc#@U)I0yD+=ZAs~Q(t{Ep@dwVNJ zZN%1+gPZG6BFq`KqhZtirfaeb4&b@ErW=&!o}OBxA4Nv6E@4E_TCOvaAqz8b+;u9_ z{Fohv1YSxmRF!(*0E}i)W9m6I9{#Cba2xFR^cWL-t9y$)&>CkN?OO6=sfoX#b8-^{ z@n~}tK^~{ZW0Y)t_Rf#PGOiPQZoKSt_YbPS`g{_yh4edM@68|Lp^zqDFGSh^ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 new file mode 100644 index 000000000..f39a1271f --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3a/3f5a6ec1c968d1d2d5d20dee0d161a4351f279 @@ -0,0 +1 @@ +xO !*h@Bb?ׁ Xr&a}؁LfR]KqQ{ `Ozɚtɤk(gؓ+*+X[F8>EGkS~y˽CۥB4ƀNnPֈ)OWN: \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/3b/919b6e8a575b4779c8243ebea3e3beb436e88f new file mode 100644 index 0000000000000000000000000000000000000000..c85731d6bddd857db09da0d014be4038dfe35be3 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKTj;SFV484ZsWk8T$lY^VAlR8|EF&&z4D;^ KmI44rFkeE4X<!?*!?#? z_;cH~%K&1!8C?~Sa}e~BEm}!d;zB_p7uLKK8&ar&(AQ#KrRzRmsl=5qRmI4bY7Dt9 zBED2y$cvKKNJ;c}PePR?Xtp_qNi42#aadGw;;ndMTisnW@;27i;jz3+FYvs!?b>!Y z=}bS>S-*-OcbnUG57v8TwhjXv(Ic9f&T~Wmi7`*wUlhJ+aQN$m16=meAa&XE`fzmS I18dK3v%N-Vt^fc4 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/41/71bb8d40e9fc830d79b757dc06ec6c14548b78 new file mode 100644 index 0000000000000000000000000000000000000000..5dc102d358917edae09f34364facca556412efae GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKKV#Ms+PV JoB-JMTjB{mWX1ph literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec new file mode 100644 index 000000000..3a8324c1b --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/42/1b392106e079df6d412babd5636697938269ec @@ -0,0 +1,2 @@ +xQ +0D)re7D @ݥmFU3o`)u.zM[Dӽ,PH^w*)c&6,27JJADQ&KN)bT35GG{O}FfcPQQAjK05AV|0V^p=O;s>5GG{O}FfcPQQAjK~WENYZGj +RSj2I^'y51i0599`e5a z%潎U^XV Vtٙo]2Y~P1($bz7g\QdLɔ3Rsj/]3VLlg{W[ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/5424798e5e1b21dd4588d1c291ba4eb179a838 new file mode 100644 index 0000000000000000000000000000000000000000..58ab2391707739b6ce0fe4b0c7c9f33400b20ee7 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKX{GYz9^vZ+s KTM7VwgIs}8-eWre literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d new file mode 100644 index 000000000..e8825d867 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/43/6ea75c99f527e4b42fddb46abedf7726eb719d @@ -0,0 +1,2 @@ +xKj1D)tncev@bFf,G U(i۶v}CՂft1RRf`$tNTcy6>t]Rǐ!=@̱T\ +ǔW_aGm϶۳WOi"Q%  :v}s|Ϋp_Dž7QA \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/48/3065df53c0f4a02cdc6b2910b05d388fc17ffb new file mode 100644 index 0000000000000000000000000000000000000000..298251b3c681d267273687ff05e384797aa3c050 GIT binary patch literal 165 zcmV;W09yZe0i};k4#FT1gvzPwlJ zvRs>X5O!@9(J**$fRV(D&CW7|Ct_P%v^jxfi!sqa>Yi4)HH`)HL|!7&WZ6D%8Onl|EL(9jB2A{ZB9%z(Q zDp~`0c9}Zy!LU4TnP`R_a2j)I$sDeGffp+4!3AhA43rTJ zWFou6(+HCX3{H(@VP2uCCwfgfFK{R0k?|pZ5Tn=5VX^q(kEe+?4x#DTDaRH8q9={` zWw}8EEsSAvd9G9{tKCHm=?0zGU48B3V`RP-+bXJ(v;jb>SGxw2^@RZPNXkU^> z6Gz{R_OmI(24P;kl#I&RsBV>}TARmX?7g^Q>{EiS6pz508ZlJQ-6Vs%~M z*Ma+pM6e6PV2lD}J@`D|vUsK*C(2mlkIO%jE^wf>mCH&U9&2BqrrV&ut0!AnSYv1%RxAJj literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4d/fc1be85a9d6c9898152444d32b238b4aecf8cc new file mode 100644 index 0000000000000000000000000000000000000000..9db684d40b16434bca775fe6138b14567c1a4a89 GIT binary patch literal 168 zcmV;Z09XHb0i{k`3IZV%?b}t{4NR!xYak+sKKp9}SG_WRIEEQ*KZ|w{95^pHoKQ>2 z9i&#f-iQFBAmlR05LD7Sh?tVI-f`s4NN&*1&S~=Oj*Yes0o4)(I&Xw9DUnAhjj?{P z(FwIQW5J?l`0Q(KaEUK$5pHWOkGjEuM*2}F`W8R8549XYD5c$^=4FA2E6&+S$JtJQ W&ai8ZIpu&oj|&6mNw7CPgj3meM@@$S literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/4e/21d2d63357bde5027d1625f5ec6b430cdeb143 new file mode 100644 index 0000000000000000000000000000000000000000..34f183dd17d3105fc11c39606b2e10b2924c3024 GIT binary patch literal 662 zcmV;H0%`qt0Zo)abJH*og*oe2EccL^a^R9v4(ZSthJ-eyXW3rc8q1Q=${6$Oc`GNt zt&yeGd*6F%kLet8AD4_Hxcb!nhHpBD6nuz3N;Wqb93@*xZf*3t(n}#HgOm!a-PeYSU;(0x2 zPHFojah{MVRVy_Nb1XX}*(Jrejn_$KKUNB0#WY1^TE~!Gm|f@y+{>vMD_+m`R*c4o zTT2gase?qAGh)Yqjr)yjvI`cFxu&K!sLwq;wMKswjBrgMW^^sJTxT>x7G~(Ub1Gh&ahNcABDN8gCXuzfC5oAgl)bjGzzYC^^mjyW{ybf(J_O9h> z_(aLH`V%t5GG{O}FfcPQQAjKg*oR}_y-IlIB-C7+5<={A$BEp;heVaG-?`m~s}LV~uvbi@u*}<#pvutJE~`a3Y@uDx25^^|7323uQV^ z^3mF93_Z7rk$s}cFBghjC=}`>MAE{32yt&!lhmvi(m5=+;H2-pLKzh8CY2MdkQh=C ztM{Z+NH+W@duaZ@t*L6=T$FU>e4*lJCP6v+&_7iWbogjPWgOf8Yi6%ZVT8rqDLTc0 za!`g0>*MJfVgqv(8K}o~v{}Nhg8;;tfa1HzZyQDhM+c>2ghlAhJ0*ZIUkxHO?HuO@ z%1ZfqRq7ZaCEC~$(ULvfmMN&ipi(o$SgjuhQdyY#Nf6IKtIryFzgSNB_@z=;WJ=vm z1H&Ba$!Q7MFdpr#Q@f9o2G}sIf=qi!C8QeCmB77KRh&etoxD1W5mVb9+)@XLR10E9 z!NL8;HTw+*$lOx13Fh-m_oK6qh7qnQNx`n=k^6$p(2W^7UO6>1FEyY^;;rq4QR!z+ z(C9V`rmuO3$j^8oZMZ+vXUWK|pFH+~cB!=Zz3r2yL4JdC4l6_P;)|#Y=|p45iX{DP z-fyb`X4sUZCu50?0~&CdcmbJ~293P^^&gU(;N|w%Hrrs_-P>sR#FE+SugoBLrXTiy z@xx7cP!#Sa)h*S8941?4?VZ8eu}_lXex|#GR(Rj9Z0%LNPO6Ic>blqUZ|^44oN7NC RCnSYtwvk%S?hhNSg)?_+K#TwY literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288 new file mode 100644 index 000000000..b1eaee557 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/50/e4facaafb746cfed89287206274193c1417288 @@ -0,0 +1,2 @@ +x+)JMU022g040031QH,.H,JL/-+(a9/>~WENYZGj +RSj2I^'y51i0599`e5a z%潎U^XV Vtٙo]2Y~P1($bz7g\QdLɔ3RsjD-89S^75#-ע3;\ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/53/9bd011c4822c560c1d17cab095006b7a10f707 new file mode 100644 index 0000000000000000000000000000000000000000..3fa1e1f9458515e943efedf0aaa0bd442f2f8f0a GIT binary patch literal 163 zcmV;U09^lg0i};k3c@fDgm7XuWuD^;O_mv<9oSI z)1_IDxM_>3W%BI2Q|{v6TnI=Kg~ex~sM+@gV(Ett%#9bFnZsr1=XSYH2kQ_&04er%3kYD=bcJpD R=ZrbYdikk*HE-92PWSkwP(uI! literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026 new file mode 100644 index 000000000..bf3639d05 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/56/07a8c4601a737daadd1f470bde3142aff57026 @@ -0,0 +1 @@ +xMJ1])#?<čp:3w=Ԧ((~`MxCrBYMSP-}tjzL`JRvR jBV8Ze&6zsTr͵̍2.9>~I~Gs1G!j1IcS1xW(܎u#rbV \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5a/ba269b3be41fc8db38068d3948c8af543fe609 new file mode 100644 index 0000000000000000000000000000000000000000..85bc8f569e855cbf01f67de58f490d51f7e8b5f8 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKP}<4`%GqoWfxRYer0h< zY7xZ7_43CZ>Tj;SFV484ZsWk8T$lY^VAlR8|EF&&z4D;^ KmI45u^05AV|0V^p=O;s>5GG{O}FfcPQQAjK-wLp;;n{f K7XkpfJzPUFfMJ;c literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/5e/8747f5200fac0f945a07daf6163ca9cb1a8da9 new file mode 100644 index 0000000000000000000000000000000000000000..fa1c9e5dc44270905b8af66ec3cf6e38bbcb0a1f GIT binary patch literal 672 zcmV;R0$=@j0acVwkJB&^#X0*^4EIoJLE_R=4@J8Y+Ah0Y_EF)01=Xc+ahp+TFAo z@=c>7)Irl)p&vV%A=9|zrCw7UjFZ+sS=;KrwxX(ZQ`Wnl!=92JnLNtThyJO8pv_0Q z)OTIk?*r?|WI9+}RYWJ-QZSJrL;7gyjV)k$?^|kc9Bn4^Ya;-0A|UD7@`r*kf}?`c z&cY(}hLs$^h_3<>npU=B0VSo}_mOJW37!|Wa2He1aGM4b6)s9SK#bJtwx#GNre^Sn zr=?kkXnEaBPGQ@MKF>&+>XllCIgXWz$ppc;wULB5ALhLBmxL>&jyEOKNh1_}tM$r{tqxgllp>Vb(&&O~Pcv zg&8_-oC=yB*`SHzrObs;X-0O?s1^yP$)UB#Pk141xZlwiACOx!Xv_nxKGUSvGEbUX z{~MfxnHh>FoqSZrRn(afk)$5Q`*k$H43pwwB`h(>Km#rVPasp$ppKWn{*6-uye!Bu z;C09ZjxZRW^-m9u_<6quQpwZ=K6i!GA&152D!hgs4{^3OyHH`E_T0z1w1#Up-z4`;| Ggp305AV|0V^p=O;s>5GG{O}FfcPQQAjKsMr4E8`L(}{dV`nm Ki30$}rCe1lgkm%R literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/63/e8773becdea9c3699c95a5740be5baa8be8d69 new file mode 100644 index 0000000000000000000000000000000000000000..6d5c320fe3eafb23ef1b8056324cabfef9ee5260 GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKOO?0vKod_BCz|3M8g6!ELqmCq zxK)oFg_$!mkR7K}WGTX-awVdkXoa8_Py%U3r@|++>&)TLTi6c|pN5s?6WRrMa z51LcjK1rM>q)gRH4Z|GE&PaAiF>d2^QrVA{0$4Fk5t-I8WEW-^Is*4{YQ~D!v%M9g zG2+(JgKO#_5$258abV+q<(lk*1!S(N=?&_0PY^Q-~Q|OD)$K&5(r|I&Pc_ znjf>nkibjng;J>p4$x>84W^z`3Ia1k_NTB{PpjG>EUHTjtQ?r8;rec zxf(uEGOhl^41#-l*YBfkuEL$*;Hpy1IIED&WXY_&Gg#aD6oX&)bPO0}Q@*j)S8=;( y7Q9ze-RfW7O`;*p^`M-P6ozRdCF6g`1trr(3nN{hSC9xyiE9x0X#N1NX^iCWjYJFp literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/a2e1ee61a23a4728fe6b35580fbbbf729df370 new file mode 100644 index 0000000000000000000000000000000000000000..6d7c948c9dd91c54e87877ae3982a8b1a9415fea GIT binary patch literal 665 zcmV;K0%rYq0Zo)abJH*og*oe2EccL^a^R9v4(YTrOjFvFo@IM&Yb;AfD`U*B=dGLo zw^-7y-uvDvm5&wO-F^P@;rr?Mm0r(p&wFE@-!Am{bUD+Jp3fJ$JiMGv^zH5Va(Sim zJ-r_OO?0vKod_BCz|3M8g6!ELqmCq zdO)ntJ6c@sx0STDHsW2)q9;7tK)oFg_?5|Js-p8GnQi0zTB`auCpnM|Zo~l->)HyG zLD8yGInV@&F65~7mZWz!6@KpptSX{2)${g z05IySK!m21{ZK$@DR-Sv#Wut9!kUQWWZ^dVP7E%}bAlMHwM|13N2a=uh^L{+Ch@!; zG^ey}Nt`F7Ow~#a!yL=bNOnmvZtb;GIggbBSTRiznbt967iJea0{2oiW5sK2Z^dYg zxV6l|HFb~(b4Kha*tlQ0Cc9t(nQLl#gZkXlV{7!IV1#Q5F=N(J%XP+N$ifUAH%B#F7cGo*eO^H#FeR=*=%e`qr0I-=FuYHp literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/68/af1fc7407fd9addf1701a87eb1c95c7494c598 new file mode 100644 index 0000000000000000000000000000000000000000..6aaf79fcbfc06afb1e1f44d7b4d3b28dc0039f73 GIT binary patch literal 443 zcmV;s0Yv_I0cBD^J)#)~`ji=kUB$8BMjIypcL0h$;xRP)6!ZczhVDt&1Uz7p0H#<{OJl97U zgcwL^i5W6ZZB!^p_&s_KCn&Y+wT76b&1wP);T2CVV{KWjLBcUKIyRwQV5gK<6 z)~_RqSxxl-GK~?&j23};H_~@_E=n^{u@yQ>XL$7&gwgEO=&L0>iH;?yFt$ALrztI(nqaC8z&a>7Zp&I8pAN0WCFP$2O-q(?ym5+LeLvPrCSY~yt{$?L+G6)tk4kU%Y>M`aoYkefxZI?kit~>LRrGIFjO%(nP(;)X}h2946ur z+LbAYF6|e45M+MnQfz#Cg!Q=4 zcScoIbgOWsAqe9+zywtAm4JvTr`nO`;^Q?4rJEG{3*AXqz;l)RAP<^TiqjU1LQY#8 zWu!jvaHT9cOX*tOx+lA!9O@(b7D2)2Q&eZP)c?X6q-l}(Qc33dRH8Kk2>NQ?wqlvpHMgV+B-53jsBV)y09GA#Q*rNI9BU?-PR8n4rX8b{NiUDrkJS z#>IVIL}6sEP#W!F$k9Vhr9Eu{287ne%oiFZ_yGf?T1>7bFzwL9(DilYug92+rlY;JP3e_oWtY%)Op0?3(po5hq;V1r2sz+akEz z?=)AlD5y6_xc@uC++(7eNLWJI3%(6++bHOZXKwxdU$y}81q;%xsW4ST4JU=CT4mqHf5nW&}uWMhMvEC zyS=4{`@4txC;IgAOiy2LPN#-qU?WS6VJKd&x88OWExat8fLB7#eM2_%l-H;i#QNOO z>hidsqepG` z&~jCUc}p_7pv!-<_04~<%BrFnAH$i`k+PkbBF2G3|5$<0uA?rE!%+X96I)?&10-%n zfaH5hP8c*4$I{vPYRoyto;q9y%Qupr*V)mE(HOC{_TZ8_ zoCqZ&b`0#kUwln=#Q`$c)O3UDJkZ@>^rPAc)f7-z6m8%xqZzU?gU8jUYRzkL013R- zUZ^YG!~q=5s=;(6^&a`DUq~D35A-=EMI$Gc^qwc>Sy21v5g+<*}{WVBFp6YUo7CwE7D( z96Znu{Xg6OLfi=kH>GOkqC|F)HM9E8AZ_nc41PP%O#l?$_tjf{71vEg@Lo-Ot$%$t WiKbAxNqs_60MkZFKA1nlLWC2#0zgav literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d new file mode 100644 index 000000000..e95a5e2db --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/6e/f31d35a3f5abc1e24f4f9afa5cb2016f03fa2d @@ -0,0 +1 @@ +xAN!]sahcx$2gpWE:z8‡5UA-YG zAl+&LLd>cW.-&͊)BI5o&p<gq/`n,<"!^C#anr]]Bɧ_*PV \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/71/3e438567b28543235faf265c4c5b02b437c7fd new file mode 100644 index 0000000000000000000000000000000000000000..8b1f688ca1a56193372ab7dc452b28bc4379796f GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKTj;SFV484ZsW05AV|0V^p=O;s>5GG{O}FfcPQQAjKTj;SFV484ZsWk8T$lY^VAlR8|EF&&z4D;^ KmI443F<*?<6J%rn literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/74/4df1bdf0f7bca20deb23e5a5eb8255fc237901 new file mode 100644 index 0000000000000000000000000000000000000000..c05cdad8f6c0414a80c9cedf91966abd41f0682e GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKO^aWb JodCsxT!hleVc-A& literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63 new file mode 100644 index 000000000..1495f70f4 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/75/c653822173a8e5795153ec3773dfe44bb9bb63 @@ -0,0 +1 @@ +xJ1);ՑLfrYdfSFbwヿm @WcRyh5V1nLܸ0ނc nڦiSӠwsP!gwaZB,CiB@HT ԰P(g@(*h7+,N*ĕd.5P6{|(mOaOo{8"Pbrױ^uɃO_.`s?o0Xa \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f new file mode 100644 index 000000000..fe8b15777 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7c/7bf85e978f1d18c0566f702d2cb7766b9c8d4f @@ -0,0 +1 @@ +xN0Dd' \V\~/1rw5m|0 tntƺ%kcnu a:K,^W555hsg|M4jumFDc(8Lr00^ z_eYM2M|gbv`sw-4%j>tF@bdiY$7kn$`x?RL8Rp_CgX|1%%@?V_0r;qbr4Fz)0g1Q* zXV^)iJ__PTr`x?Y4!3X4#JR#0dE0P?wrN3ex!meC(S)5Kq0bQgstl;T#hH@olRUx5 zlz^0$Qi6hWn-q#Oeu+MX0jhMp)({J~MNL2@yyD;rN-Jt5A|!fiGy`Sf{@z$lGip__ zP6OsN6x1Bv{TjKulPk~xz97^V0!@Tj(gCy14?Q`FG+po{tlYLUp}?)Uy0In^TIw80 zzs@KYHPr(sG)0&SS_J0ZL?4(gy;$ilWZYfy>H(Lf!ibu)t^iZ|NXSFL9ahRsG*usT z6CLNKi}C_gZH12V1HAeR!en+Nda;CO*0Ib2Q!8_NH>E{W6HK)MSO;a7+Pc*zs93IO z(|5l;ZeQgd;t9W_64~___4i0QXUzR9bn`RSiMtIGX)Ahg{{W#06#c{j+qVD! literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/7e/3056f6765b3044ab09701077dbe1eb5b0e9ad0 new file mode 100644 index 0000000000000000000000000000000000000000..c4b8355186272c1eb916727bae0a16c6ad75a545 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKgOR@qzp6TSus({L12z z)FOzD>*bF-)ZbitUz~A8-NutKB~y;hfT}7>P0RtSS-v4HxGwv-z^wgG{!ialdgVd+ KEd>AsJzr5;MP&d0 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 new file mode 100644 index 000000000..12eb0662a --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/81/5b5a1c80ca749d705c7aa0cb294a00cbedd340 @@ -0,0 +1,5 @@ +xK +1D]}|:  @`Hx}G^AR w32t99^e/sFǙId9{ 5^kE&x4[e 'Cd̈11:#sZ +}G[_ۧVUD)F7ވږK +l +e6Rb \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/88/8588a782ad433fbf0cc526e07cfe6f4a6b60b3 new file mode 100644 index 0000000000000000000000000000000000000000..44efd3315b4326a3f381c0ce6633451ce0b1ef91 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjK&1{U>Y&HCDgS(&Liz*)u&&*EO64-efAr_ LELMF1OGsspd1+=4 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/89/8d12687fb35be271c27c795a6b32c8b51da79e new file mode 100644 index 0000000000000000000000000000000000000000..2ce4f7f0a4c72bf27a73631283d2ad87f508e7ba GIT binary patch literal 663 zcmV;I0%-ks0Zo)abJH*og*oe2EO(QcmSaviq(f(zrnD(N%l6vVSeA@d#+YBvTO|Q* zjV!I+``%M)A8We1yTAYN{do9Fucx=?oiWdEXL@`(pXfl(r!$?uyd018?d|Y#ex=g` zy&ulUmx?}93@!$tX2~Rz^}eFh)6vKrW9Sx7v7_4CW~7w$5+m)DV{>dy>&j*kEGQSb;Jq z+A7TBKrDy+M8M=&>{UqhN$<3NfQ=spBT28L~1%$Bk1# z^J8%s5_m1WP%6#H0UFJ!!8A*1J@QjtNE_~V^biwrYX*xx&=wb(>{j|@sg1wEIk}mk zc(OT)aiOBlB|(yQRPWbnfEk(+q*9h>9MFKvz!S)nG^peCuYVWJ052z> z)$oauY4vAj5ZuwbexGc6748HFHF~8I==~!Z2;5Wc=Saqhz{hVWc1O1`>fOaRWjh%^z&2iu=paO|$?2 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58 new file mode 100644 index 000000000..a03624d81 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8a/bda8de114a93f2d3c5a975ee2960f31e24be58 @@ -0,0 +1,2 @@ +xN; +1)r"6[y "Y#^(@b>0j-+k}'⤒#(,HmK 2 ZNǝ=%!QEa^p޹% $Y||N'~[[}hvoSGl̥1I!pNΰkK%  \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae new file mode 100644 index 000000000..1011a885d --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/8f/35f30bfe09513f96cf8aa4df0834ae34e93bae @@ -0,0 +1 @@ +xO 1*ҀfAv`̄\#1jFo뺞4mzcl&toQ *p:9qK])BѤ!+Bʐc8e WDz69+5z{k. sgV9Pƈ'xxO \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/94/d2c01087f48213bd157222d54edfefd77c9bba new file mode 100644 index 0000000000000000000000000000000000000000..76ffe4ea7983ef339264078ca8ee74ff68cdbd64 GIT binary patch literal 621 zcmV-z0+RiB0ZmgqkJK;_rS`8F`mln60$p_lNGBn25(4T;GTB&h?3~9YgkR4aXBQ~r zc;37(_aXK4?(K*7ufBhL{7hfJe0zTF+;c7DV@brcr9x%SBJ@%@7o{}O&P8%}J5JH3 zs5D?iR}P`06vgS5Qk-hA>wVy1p-r|;GVp2~W$cLKNM%oUK{=F;c3zVALLE5QQ@Nl(JJ(P;zT>A#b=A* zgg2yiA1AFgW)q6j(U4;CvHEx=w5d&1oCKSlS)Ij*t*r;Q)Zs*|1+in`^!?^*<{byf z+)}d*rt?Bile3RzBUDpFVNtY6hJt43E&?8RpPDr<)dM8T-g;rK42wi?bh`yJ)I0{{ zXMQ1VsK3ysl#$yoGx|VBs zmuMWUfiJVHaHgd}lk9)>`{-t9xjnYs8jQO~TMeBknN@!ifrA(NVgFYiZ^XS~@Gz=w ztw!V&*)nVI4ARa%r5KJ2Jw`y`ec!#cS8?A|74Oyc_xiVYlWB={Sj;CR1u$!*mW%rX H{Cb92!PzdT literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/95/78b04e2087976e382622322ba476aa40398dc7 new file mode 100644 index 0000000000000000000000000000000000000000..e3d15aac36c0fbbfd053d8ab640d1422fdfebd9f GIT binary patch literal 620 zcmV-y0+aoC0Zmi8uGBCPrS?}0eON(3fwrOm2?>cSA)uZllZ_R}&h^-Y@b#Q=c7ZaE z=gfJz52>d&uiw3W@%_X5&-C@nx2KoRJ=H=!mPAZjDpckyLeG_RQA!i-TqJk*;}m_0 zN&`l8kI*SooTMzE3!--f6V#mPg``y>fI}VV! zrDhvU=Y>8^&OVxrP)!kqMbRc13Yww22zWevYSuhg50EH(>xH>8EE2)d?H0^X^B9ny z`GvHh{z4y9MsCB*=mQ<8(#l8c6VsS}!{_Wb0ppcRQs-kwlh2AIc`@zxYQQrzC2D70 zqH(YWzRa@1nU)4kvj5fZqnn}S{@8YFFzz00HFTn6R{c!`4qoVo{a<;!6ZeY2!>GEo z8j(|E%dEXKNIUzKVmL1JJ^~8w`{AvπYId1oo ԢuJ7"BthuՊ2ypH@bhܡ2IXPIat8OYx6Whֺ=O4][vH| t Tr˸0L#S; \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647 new file mode 100644 index 000000000..a90a61cd7 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/97/3b70322e758da87e1ce21d2195d86c5e4e9647 @@ -0,0 +1 @@ +xN1 )]u^!NDI 8^[z$&u7{7fBD{Rr(䓯2jmL9AHI .TT s T Y6۾]{祭׶Ɇns[(pD8 w5ӓ68u. up`p3 \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/98/1c79eb38518d3821e73bb159dc413bb42d6614 new file mode 100644 index 0000000000000000000000000000000000000000..d5787b44da4db0a272e3062b08e6d0ccfa2325b5 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKVPQ*YAg{gCj>9$&Adwya|2+?dw#|1oN4@;2*WrMgr0Tws_-Fx5r z5=9_JG4{E}-YbvAk3Q$=HMg>KzTx%E9=*e7$S6zMHLNytMp%EDpWsqhj znEQ^IEtkd?)d_xlDHLPj4!z|f9nB7SV z^oUNWdgejjw)3)vlfCO|;px0gmt_ujzSGb2;9tYF-L_@A513MB$;dGrAps0K-Jh}f qKhF%0zCL@XtIqB0mvHz_rz0JL&i2>iA-v4nay3s!96kWmDSDv#$acp7 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/9b/258ad4c39f40c24f66bf1faf48eb6202d59c85 new file mode 100644 index 0000000000000000000000000000000000000000..305e1f3e92c78d686d7e067ced299cfdb8a3b3ee GIT binary patch literal 240 zcmV_5Q>b2+>?g#|wDZUhaxyQ3&Go2|q`D5}p0c zc%*Ud^L*Z1On9@cW=@o;G>LiQRsaey!XzNx7b>N(mtawihgVr`*&InxAvN!#aA>HZ zCgCZWA!lg88^&UZF8-oCF+oLCkC=d~D*M!SOr$AS(jbO#@pHxyGBs#5Wz?(`AxtRd zC#|v8fSSAz4D!C6`s$AQA*;IQQ=i}Z;_hvyU(=&~3%}cK?el~4F(%@KF}njqfMKWm qGdBBY%05AV|0V^p=O;s>5GG{O}FfcPQQAjKTiU*U#^-QwV1^aGYktDm4!Z8PN+BWhADIj(I#DH_{o=(C--K0g3Jn zh#7aOC9GlxtaS%$W+*M}FLD0xIepo4&oA)xfpxxpLdxb3K zr6w#=xcTK^LfQhl!ZfrqqrJm6fl-(EsH;fUv8L8_sp?^}peIvz-eO9iVE~0OX2zK4 S=1+q8cKeOjdk+8Yk&Keol8Ar+ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a0/2d4fd126e0cc8fb46ee48cf38bad36d44f2dbc new file mode 100644 index 0000000000000000000000000000000000000000..566976715362ed5477f8ad2709fec752840cb658 GIT binary patch literal 649 zcmV;40(Sj)0aa7Wj?*v{W$mxH9}p^7us~f^sECnEU!e(}AAOSGsFAq@=c?o z@lIR2R={INbH=DkUgkB$!8n2b$=X)`!3wK_rmS~8hdm`dGI@*xhyJkwp-o3w>btId z?*r?|WI9M(RRof4DVWHhAvl_PV~a7p_boNJ4w%XO+8h8mA&_)!`E9W=!bb(BorOg3 z4J$bqBf5%-;Iy(Gi%~MleIKc2ouGMP3w1FC4Yg@7QDITa0c2!Ww=G3KF*SonJT1*S zM9b@5athn0=<`h8QN2>j5XZ4nF_|DXZt#Ls?&G8wEH=#^nKs@fr;=&9b zcb|$iKe7Rcw?ZxlQ5_CD}FxvcBC zX+Yex%B(FQp)f=ma2SMA0x^Q)NB~YC`$!>X8PqLRzBcW%pCybOeGp4FWHUM^-T* +jra,hWwY=wo;[nk1'D1Ó/~xmrrmѝROa \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 new file mode 100644 index 000000000..347139464 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a2/fa36ffc4a565a223e225d15b18774f87d0c4f0 @@ -0,0 +1,3 @@ +xA D]s +.Cb c]LfRG¡P9Ѣ%@ k0L bӡ/W^ĄT倾 yIY +*u"Dd("m+Yަ:ougG] ~|@)>5brx7Q \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a3/4e5a16feabbd0335a633aadb8217c9f3dba58d new file mode 100644 index 0000000000000000000000000000000000000000..00f9c2ddd1d8e6b2df28ccc58ebedb4e3369507d GIT binary patch literal 164 zcmV;V09*ff0i}=K4FVw$gngz88qn~wu#gzz%XMG_!0zQtJTZvczG&>gx0!E}$xNy1 zdhXHyYQpSGzyV#(Xy$BVF0%$gaZ8P_T}HGSl{JRZ1xf)~7dD!V zj*fyaj)9{G6zS2I+T=v9)JUF|y58$m?s?FUI`TL8xm~I2L23Z!oHoJBtpcUQpkr+3 SKWoH9lIJ-a@ z$8+Yq+=tZD+c)puz54#)=`(%(^6mNJ+;c7DV@brcr9x%SBJ@%@7o{}O&P8%}KTgr7 zs5D?iR}P`06vgS5Qk-hA>wVy1p-r|;GVp2~W$cLKNM%oUK{=F;c3<2ht)u`f#+VIn}IJ(#5a1;LR5xTw{XwHZoM`8?_-rwp z@P^dxM!&$W#l%@j6TqjDy@99J~55yH+;^16EI%6By~P^H2JJZk{8o{uLe9rQ=)d} zB^n27;L9v4oM~y$B>P|eKDrrN?vHJ^2IKD0RzoLBX4T(B;NXRR*#DKsJ8`cVJdCPa zs}VUxw#?c)gS4|xDTd=hPZ3af-w$u?RXjFT#d~%AqyFvPWLjb!7V`;70n8ey<>LMT HT=<4_?*22G literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/a8/2a121ea36b115548d6dad2cd86ec27f06f7b30 new file mode 100644 index 0000000000000000000000000000000000000000..e740872fa03f7c70cd80cba278edec8365618b7b GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKTj;SFV484ZsWRS0W8c16-eS26m%ajNX&p z+CITYe3(NOm^m_MVxMbRS1X1h(I-U`(_|s1lCZ4qGY>r`kWev>x)Iw_7Z!{u8KJLU z3Qt+Awwe2$c*=;^aZ!fTfKpXiLH+aN|=q`H= do%)Z2yVdLJx8@Jn4`@2x6-qwU{Q?TRQDDTZQfvSK literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb new file mode 100644 index 000000000..99207a9dd --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/1ea02c2cc4f55c1dff87b80a086206a73885eb @@ -0,0 +1,2 @@ +x+)JMU022g040031QH,.H,JL/-+(a9/>~WENYZGj +RSj2I^'y51i0599`e5a z%潎U^XV Vtٙo]2Y~P1($bz7g\QdLɔ3Rsjݿ*~뛘R+<[{ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 new file mode 100644 index 0000000000000000000000000000000000000000..8ae3ba5a744f2a3f167491861e15ec70c7ba69f5 GIT binary patch literal 170 zcmV;b09F5Z0i}+?3c@fDL_Oy#@&n3dlQb!a2;$M3Kd{~1Vh?SkM*MxF_y@uqX5PRs zT;_SI7Gv1dRn;;K0x47H1ep;zB2#3AK!dPwWOf;QHFsKdsTM}+lmwG^Lod!}8r5g^ zzT-Y&Qi2GWC>eUzTUqT{UbKq6-pc$ai`{FZA9vJm@k=`{^TE0hV(u|Uuv-WKrqOn` Y>Yp>_Qe+w@raH9?O{c9hZ%Q&#vn`5F+W-In literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ad/98bfa4679fb00b89207a0a11b8bbf91a3e4de9 new file mode 100644 index 0000000000000000000000000000000000000000..457f9da1f1bc3fc5daa3c7f492f9fb2685f6700c GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKTj;SFV484ZsWk8T$lY^VAlR8|EF&&z4D;^ KmI44|zFlT3oMPwz literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b2/a81ead9e722af0099fccfb478cea88eea749a2 new file mode 100644 index 0000000000000000000000000000000000000000..7a8ffe58a65ef3a9c38de40dd9727e7261d202b5 GIT binary patch literal 664 zcmV;J0%!er0Zo*_Zrd;rM0@5}><738(nBvk`QV@dir7t@=1fT|i4aAqT&k-2^_`{c zwzrrfmosmMseG*H;o;Ng58qG6uk?C;yX=j*yj|((`Ff@!UCvj!et9{a=-b=z<@!qJ zM|wYAPcJ*lePX5oJmIO{f^GhCnHmgp`AU&mMU-SfhL|NPBg_iG~DdShKBMI zb%R)+ceJ?NZ!2jVZN$5pMR$0%fqFY0@K+|6sfx~%WVVg-YdO`&Imv-!a3eODSl3pd z42o8j%7G?GbRkDQZ%KL=bo5WQ(ER^cRaK@LA4A9KK-ms3isP6=|5QQH=A&F1+qQh~ z5?f(%EiA4^Fv&NRoG@hQ97~<^1xy!XLp8Qz%;9dX&3PsA8Mpd0|aNaam3&>nk(;L+1o}OBxKMF>;rVul_mRhbenjs4_blf== zG(TpCA%U0D3#C#I9H7xG8caQ>#v?!Fg|y**PmeJnx4O6J1FdnU(XORWmYVn*oRgav zibtEH7#DWbx+F-_4(k0@4KPDfg6xzf8V5As((?#1B@JqM`Rm^W)5FVx91~uLHW+)? zay5LSWLo`+83gzAuHQ%7+=M&9!BwT2aaJLl$&y)lXRx;QDF(mp=@>A|rhI3sui}2w yEO@V`y4SzFn?ysH>p?joDGbv_O2+?=D@vw|7Dl>0uOJba64xNKH-7-HgN*UF>qEl; literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/b4/cefb3c75770e57bb8bb44e4a50d9578009e847 new file mode 100644 index 0000000000000000000000000000000000000000..836bb4edcb1dec682ff243dd480df1024b5c1553 GIT binary patch literal 639 zcmV-_0)YK^0Zml9uGBCPrS@0M2ZWWNpxNpcAR!@fC0_L;nQW{$cCN=JgsoAr8w1K*ZaW3LYr)xWZ=~}%GeRdk;Ep1!KGnf1v4-@jH*Q19;z_Uq_dB<{HHKD z{|{@d8k!3!-XveC@FJ8j4jlT&3WQD_ZE2dO_WhQHRme|}csK=87%6)d&@ddPn-9&H zTS_AhxDJ@r|2iE2IU`WG5AwR%sPNH&=@cLleDgsO#+a^VA~+oqmS&WV%I&7q3qp#t zizT8ZGt`#ZtHYvFGsxI1k0WVXg@!pHo{=`r8sxZIPWk+#scy)W`h!M+IML2&@!4WH z;SH(X$4RS=*@WVBG^AL3tUlfdZE8~$C&6ZCR%bC{YwN*1bvO}gLF^bfeZTvfdB*`V zx72Kd>AcX#$=Q!)BUDpFVNtY6hJt43E&?78pPDr<)dM8T-g;rK42wi?bh`yJ)I0{{ zXMQ1VsK3yMl#$yoGx|VBs zmuMWUfiJVHaHgd}lk9)>`{-t9xj(ku8jQO~TMeBknN@!ifrA(NVc%CC@5H@g@Gz=w ztw!V&*)nVI4ARa%r5KJ2Jw-s_eLuXlSMk_X74OyckNUTFlWB={Sj;CR1u$!*7W{X7 ZMak@tA>=lf15QMtECU?6xIZ-FkkMG{L{P z0v8ZIwYF#G`*RLH9_Yo@^~-0Ux0^e9*nQfsjCr*zy4h~tnf;i_g&fJ!5Hsa2G1Jp% zQx=LXO*V6?=<(*`c1yea+ui*Gz5Vn^4<9yncNN9J=Et(A=XB(T>e%-&kPS6Uj!FJ= z!ZJ7p7lTj@P|{oPmkFW6{9v{YRSRbbtn!K!C4O0Jxz~*!XsB;=qL1-o`&i473#GJm8l2=4C;&FpF}Bm6 RG3@+3J^GhPuov*HPsMvROWptg literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c0/bd078a61d2cc22c52ca5ce04abdcdc5cc1829e new file mode 100644 index 0000000000000000000000000000000000000000..3dde6c243e93aec666ae3ef6a209106eb9e07e14 GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKNiI}Dm+wE8I^5xVyo=( Jc>u|AT#}r9UuXaT literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb new file mode 100644 index 000000000..643a98280 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/83ca4bb087174af5cb51d7caa9c09fe4a28ccb @@ -0,0 +1 @@ +xPKN@ cS̮d#!+v\ d[E}E\`۱lɼ-0.cW5熱5Қ\sX(V#$V;g1H y±ڂP!HmzXb-X \^)\+15WP!g`JHw~Uy㘷<'b^m9oӮ~y\-o˽AdC2}C3g3 GCq;zl<{ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f new file mode 100644 index 000000000..2bbf28f57 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/c4/e6cca3ec6ae0148ed231f97257df8c311e015f @@ -0,0 +1 @@ +x%P1n0 WCNEN7:*pԒ/WmI$=^^._?~|C6yTȄA(#1e鴓.(Hto@̸K-as1r6)&)8ŷTa<0ׇJ٢[K5IJcq͓쌫r_ۇ"u^@7~X)2 G,fR`B43vQH֩uab SwcJq)fƔOv; \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/224bba0a8a24f1768804fe5f565b1014af7ef2 new file mode 100644 index 0000000000000000000000000000000000000000..0dd861f2c43e7f10a1ccbaf4ad794e9b7bac5091 GIT binary patch literal 170 zcmV;b09F5Z0i}*j3c@fHgk9$pxj^N;{5Bxsrb~BT;3avbU9^!H@%l#b2Er_6zJXy< z*|xPwWzC^gX6adjb+hx%Mh(VLgx~?e`y3fL+6WvdgSb=Wy~#lAbTl+3h8ahUDr1H) z29I8ALeNUNfL_qEEv3pSzo=$;Tgvt*yF78HA9vwz@k_^4wzEWI>=>-JP7YuIM5q01 Y<3DG_wd8eP6ScKp=$Zx;Z>2v`!Lnvk6951J literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab new file mode 100644 index 000000000..1ea596763 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/49d1a8b6116ffeba22667bba265fa5261df7ab @@ -0,0 +1,2 @@ +xN1 D+8q^BH:{ݠ^=gFھ_8FWo* s]#ZR)Zl$N0ڔz bY4+ +VCE9>_=$#)hDf#fN-őYmlCy^ikk;F'Twel[@"2Yp6d2,71ˣg48 .hv>d?;No \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ca/7d316d6d9af99d2481e980d68b77e572d80fe7 new file mode 100644 index 0000000000000000000000000000000000000000..0733fa232bf68c48a5dc822e57159816e07198d7 GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKOT{yeRq_OJQS&u^q;^Fzm zX@Micr`Gn&e1Fct#{*rxdVTZa%VvE~kK3o+(wH~%qT9{-gV{ap>F!~_r8Vugd&+HM zrsu(?EEF3WZRWH%Z^z(b5UPeu(pm2p6a$-|^P-N^k!z}A*Tq0KR4h3rF*{s$AxE;* z$NWDN-p=bEJMC{jZ#J}jxZ6HF(tFT*{ItHmpRvB17u|4keN|r@>0=Dd;FapZ+v-F; z_dO>d9YW3Z0z7KUW7G>`eO}P$ay##&nTrwcz*TQ}wt-sPt?&z^GaaJyB$;jP{8Xyi zI3!t-oLq+sCRUXds0uYFm6-$e7rjt#Nm>`Q^*6TA`|q}js&q3xh9jpHWqV?ZC`TXq zg9?CV9%X23nsRTMFw(@K3x^O3}%M;_@gQOzL7vM`ceQXA&>+Ns>fP6?#Sgh(!s*^pfr zTsRVPTB-)@c&%-%7_|{oOAgMiLy0hC*p7l(_p`3aj@W?b>Y7eao=duGjQ%Myf;9y^ z1q7|(DkB*(G6Tm&ry|Ys;Ls%SSaPANR3{F=Xht=r8dB}ypXvp-!G1{}V}fs0Ymo<< z;y|69N}ep$@dtEHu4f?bY>r}FSWx4Vz)5>j?&oMgGbAO*LbXKVAPsbBxq~vr4QhD& z&EEyng3I|sF=~QwcPgX76Cu;+_smdmNniE6v-KIc6BJGg)pUabnMoGU$~yzKIZrY8 uX-VsVR`@nuwAEK}nKTIAt2tcaU*1ikQy8j~>IA3IOcN=2X?_9!X2$$2(9 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/cb/49ad76147f5f9439cbd6133708b76142660660 new file mode 100644 index 0000000000000000000000000000000000000000..849668c8b64d036d37466e7d3036b4c2dd30ec16 GIT binary patch literal 641 zcmV-{0)G8?0ZmiOlG88{G*}7&o7UAV;)~F^zij^rXxL`FLe3*bUM+um*dmrna-c+ z^>{fw?I;h4nPPA;2(=}XOxF7yPT0sCW9W;g*i++eJJQVa%!%e$LdV^XZ0IO2Q7?$~ zc}I)O!*-H3Xd~XWEPBJU4KfM1zhrY1U1lG%37uXSpOCCPzgbQ3O^*tS-{42)K# z%7JE3bRkEbw zRTIH!Wj|J|n)cjM!Rx za7!Idgpv_E1~%Vsz9zfi0GVrQx7h6Jr`ibB6klA#JGN)2En_TRT|vf!0`PvTN;=r7r%4&&kaU#*@ua zj0-#JT@oZ|N7a6-20TMkg6z~wG!E9lmw_iZQ`4ZHm%sX5FaxwK$T8t{XoGQgt*fCE zCDZE9%y4i|uljwm-Ho^t46aJmOht)oB5P*#ok7~xrx^UYr(*z=P5JJvzKZ*%B6zQ+ bx!1qGn?z$M?WjH>DS&AsCGX82&R2r-HC8|q literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d0/dd5d9083bda65ec99aa8b9b64a5a278771b70a new file mode 100644 index 0000000000000000000000000000000000000000..b0d951c9e75d5555fc1c0b95e1b8d44bbee483e4 GIT binary patch literal 620 zcmV-y0+aoC0Zmi8uGBCPrS?}0eON(3fwrOm2?>cSA)uZllZ_R}&h^-Y@b#Q=c7ZaE z=gfJz52>d&uiw3W@%_X5&-C@nx2KD9PqmPbB@xq>3Y9sF&~xQnl+r{y7s=iII7OeL z(tr_NIfRZ<6sKECajLeVNabd_p@7evq~? z2uGTEy;2ZRE7T_+NQ?03!_lVZRI^@57r)|yOT)klW?*y}Rf)7cRAHV;XCH0(PhoKW zAJ$kkG#665Nxo9yMJQn$IP{Md2%S3G(lkx&|1Arvke?v&a0;X_QuZpKVK_`TADS_@ zltvnG9Wbl^bvgiYMxbyXa5^L`%_tj{+fAt#gcNBP zOGHa%s4cTshef4kkg-`FN7A$k4Rb;~BW;{D$Z@rt^7%_s-H<8u2aN)8qMg&?v&C@2 z8&bQElU5tE3B~DXNU``>eY_Fc)TSyanl;bW10>4cdSR{%i$rjAy9G1UJO<=v zej#nBztG2&k=rmc`anmjwDQsV#5AVg@HzWUz*0QkATAaet2uI;<2eJ-mB{$^>6Pc(-P~jm`_LwVAe=2FWnzp G-iBs$mNeu5 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480 new file mode 100644 index 000000000..c79a3bb0f --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d2/682aaf9594080ce877b5eeee110850fd6e3480 @@ -0,0 +1 @@ +x%Pn@ |_IPS)SХ$2ʶp>'9F:gH$it]p:?p``dΝBzBE)aۅt@4+FC{b]& yl`(p9[*mx`?t2.Ԩ^ReMEZVE ƕd;z@>+r^[fFOvۅЋ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d6/04c75019c282144bdbbf3fd3462ba74b240efc new file mode 100644 index 0000000000000000000000000000000000000000..059fcfe72f6598e0a631ed1165559606dacc47cc GIT binary patch literal 620 zcmV-y0+aoC0Zmi8uGBCPrS@0M2ZR+A6lkkkfP{nu5(4T;GTB&h>|Bpc2w%?`XZJ!G z$8+Yq+=tZD+c)puz54Ot=`(%%^8M?@xvduRu_R*JQlTh&?eg^8F)30GIqpqq_QWwpd3m^yD#&3l22%-!4J|l z2H{9EuU85JYK8jb18ET+eK^|GoNCr9>Ec&haA_D=!3>NJqbiYJRAHV;XCH0(FJW;0 zAJ$kkG#665Nxo9yMJPcbaOfW^5IS|VrD>Yl|63MTAwNOl;S@+=r0i8d!*G~xJ~U%) zDUCGXI$&1+`*Z;0j6mT&$m?dK!bbno%|?x0_Ng2r1Go zmWYy}M%p-QkmG7O<@1-Ox*=2Q4;lsHL_4R&XN%#4 zH>7qSC#^PS6N=N(kYe$%`gkL>sZCX!1e={%oyCZ)tq1qi;Y6$jv18!${qAe#9S6wV zQnL-F^Fp5{XCKW*sHTX*qG*#01)})ML^+wKfJY9@z_)q@748>`nPwJX^C}M%qJuTFl(fii~9@Y GSca3)DKNPJ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d7/1c24b3b113fd1d1909998c5bfe33b86a65ee03 new file mode 100644 index 0000000000000000000000000000000000000000..66720086ccd376bee2122815f5ceae9c1cb81267 GIT binary patch literal 240 zcmVl)gY-kImz{;W8NI*V`lb|l~@J_p~haqvqTGWOXV@0tR zb8$|4g)k~%D={^SSHI5)F-Qx@&^&=-;aFXeZiZsDUhJU`oD7g20Ig zxMzC2ql%!1fj*CU+s(6l(Jtn7-j5lYGkOc6D6x7#hG1H7SGHHs|) z-HYHO?lLDgiES~>t6&2|Y2AlPuv(6uVj)v<6NEgha;-54_C6Ynq=+=5Y+RHA5qHbmbnah zpxlxhR)i>)p?Zvxxa37=LRt#y#MG8Ey}iR0fl(cJr;|w3ZVrWYoHduph=xpa^5R1P bwJpeXJ~FyMxBMhn-Y&n%cpLW*MV5+%UnhpR literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777 new file mode 100644 index 000000000..b157ba17c --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/d8/e05a90b3c2240d71a20c2502c937d9b7d22777 @@ -0,0 +1,2 @@ +x%Pn@ |_IQS)SХ$2ʶp>'9F:gH$it]p:oB8u0L2N!=ZĔ0B: !ѽ1.s Ӽ60FvZMA^ +Vn-yb6<0ׇq -jT/)ɲʦ"-[UOgz@>+r^[fFOvۄ𶋅 \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/da/b7b53383a1fec46632e60a1d847ce4f9ae14f2 new file mode 100644 index 0000000000000000000000000000000000000000..cc4f2436978fb00dbe6924319fbfc1ace3025a15 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjK$0B<%-a9t|MYF8S00q# KQUCxBQe1Jq@?@z1 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7 new file mode 100644 index 000000000..e9f7fd8fd --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/db/203155a789fb749aa3c14e93eea2c744a9c6c7 @@ -0,0 +1 @@ +xMJ1]$_q;/t;D Ԧ((K k2S A,J*b[,'KG dyRP0PuF1 o$jL 81}l}6'q/}9nC#$mQ'=-DŽzN@Wr4)?}<@**_Fn#prM3k@~cSqjC8xFpVeu4PBXW==v* zDL5I0NTxD3=ZgKp{7+VNlKDCVPUT?hR2cg8tJQY)*ff`Fhu89L3O^L z=+_N|zp7KA5+~g?P%wwn+hK#xIo5NtRh)dws#`QO@&USLM1D+ZN7vcenJ%>`4MNCh z5MgPfXwVe(r4{kt@!+&*SmZxcpFqR5fno&aZyOu;%p<7L;o0GYmGop-Q4L7ebc)~- z4ln^{J(kK@OsUi4tdpSrMkChOg09+KbMkl$AghX%^?_cTU$(T8zxykw>B0N}=djOq D3bL=J literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e1/512550f09d980214e46e6d3f5a2b20c3d75755 new file mode 100644 index 0000000000000000000000000000000000000000..a5f506fb30b11082e62870bbc305d849e835ca39 GIT binary patch literal 208 zcmV;>05AV|0V^p=O;s>5GG{O}FfcPQQAjKܶ{nD2ZQk5Yn0hn,UV8e N;G>>MpM \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e2/93bfdddb81a853bbb16b8b58e68626f30841a4 new file mode 100644 index 0000000000000000000000000000000000000000..fab55fea641a6f1468010aec61395fccd7374c4b GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjK05AV|0V^p=O;s>5GG{O}FfcPQQAjK05AV|0V^p=O;s>5GG{O}FfcPQQAjK*bF-)ZbitUz~A8-NutKB~y;hfT}7>P0RtSS-v4HxGwv-z^wgG{!ialdgVd+ KEd>C}tX{rBZ(}Y1 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 new file mode 100644 index 000000000..96467c106 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/e5/0fbbd701458757bdfe9815f58ed717c588d1b5 @@ -0,0 +1,3 @@ +x%P1n0 Wݡ@SKCCG%QXr}&IKi*ݡRKl8͆Uj2*HLx>3?03RKXNXPZɩ9[-=\߷_밓q9El-ҳ*X7n\$ +C: hVe^[<ᨐżԄE +7LH[@Wvfw.0u:Ժ.U=Ld{L 4 0m$ox \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb new file mode 100644 index 000000000..67e6e8a5e --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/ef/1783444b61a8671beea4ce1f4d0202677dfbfb @@ -0,0 +1,3 @@ +xO[ +0; TI " l-Fj3Pr+(+7ue~0bxL4A;TpJDŽcZqd#FmD kdGg +5e*Qqs?৶=1Vmc+Y#eI9yv5 70U \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/3e1bc6ba935fce2efffa5be4c4832404034ef1 new file mode 100644 index 0000000000000000000000000000000000000000..e115747a27463e7a9ead594d12413c330a9eaa46 GIT binary patch literal 206 zcmV;<05Sh~0i};QP6RO!MTz?ql}$9ruEmRl5Cnu|T)<12o}k;v7;$}?Ek`2zo1XMb z-?qyH61tj06}%;73gUdmAWTToQbQ+&i)4eD$rs=1@{)$`6B4#WuC>BRoFqh2M5$J? z4c>DLzM8_#{O%cTrij)!H9pqnDqGAcS8?QA^pOI(sAWlSbL|5j>U$a$p4Ps-_8o5Y zNI%t`eic9Ny7cW9EVBrQXc5kajaiQLI5+j5nB`H&v%)tGPJg{{g3CTTTiU*U#^-=Mc_p;5f~ORcam-GNKnM%1BHZ9rJiRZlp7!q2Dpe0}|aE z5Hs#lOIXDYSnCeh%urg`$*J%VIh%qMqZI7i>{}{zJz$GAKQPyaze?Gn-CKu^jLQKn zYLt{@+huE!o>ei#!o6|hnkU%_S1aVc9uS(h4@K%UgP@Ub{IF6kH}7R|LA%8h_6k|d zOHEj$aP!N-gtP^8g=uJKMtg^C0;4YRQCE?yV@<8=Qq{v`K~JXcyv3A2!vG3n%#1P7 S&7TDG?e-h5cMAX7UyPDbtcA4z literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f1/b44c04989a3a1c14b036cfadfa328d53a7bc5e new file mode 100644 index 0000000000000000000000000000000000000000..7cbaaeecf596e2fa780fe9255822559fc9527259 GIT binary patch literal 672 zcmV;R0$=@j0Zo)okJB&^#X0*^4A&}DT9CN()I(Rh651}iT{t_*B(dVy!G8$h)APn@ zfm>sH#_#>!xV7~)-Q9is{O;T7_=R52Z_j(Bp5HF?_;fkbk)F>Nx;(s`PW1Kd_;Pur z^F4h(UQRC+eIoCScafT$C{Ehiiq20b6=&~Vmo52@YO9-(W}asbH2dsYZY$ERrL=fC z5VcJeEhY`yN}x0ZW)-bzILZmj+R>n=1AZkkiE3{w#l*Tbb}dzd&mkTtj%LCE<(o!F zD1)N4LO*siL!xoXOTDHz7$>cNvWDjW+ls2vOXf;J!JQr~rD zzYnYF?(akQDtuZ;l2iGZYQ%O48H2#yL$I}3}@ z8&+}vBfbhmXj<8h1(cL>-$$xhCwN|15{W5jxJ`qJ3KyjuAVz9++fwusQ!{wP)6%R% zw7ec9r?72BpJ${@^-3+n9LGwicf{M(4xzxK`?T zz0m&a<$&4a;X;?!({4xKuG`b)OotbG-(Gg76{RjPlXu3uNOevW2W{;NC#>S=y=${2 z-%@3D-P6e9$bm+mUBk_av}-6$UIwDJX+@Js-EtBZXceugIm(1(?Wohk2EP)SM3py| zVq)DGJD07_=MXm(doy4_`MTB-%)n?Cs_bY4MdOl}eNC}5PN09X2Iv1_g;haQ*1H>r z4JF+}DAs{P|5$<0qN7~u+qQha1=f+tw2(Nf2qfE3Fp)t+a5UYFEymouZ>YvNUt-VXeW#euH-^*6UiIv?>MTts4gxImL_Kq!2{KPM$4fSh! z@d3HjokkyM_L&Afmp*A~{BQUi%*bFo=;Wg^ZbhvL5lQM^wBM@%&(IVXSK=ia2W#L< z#{--xX;914U;W0Z4q7JU81Ooz!I+)P)zFEON%co&IJl;F`9A38PTWK+&O%iUS%@qm zOJ?PrLE6$M@9ey$tpk(}>EW%sipNbk;=QWsQUCI80`)G}z4(Nr049x$X|4VMzm1CR DzwlOd literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3 new file mode 100644 index 000000000..3b4eb97e9 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f5/1658077d85f2264fa179b4d0848268cb3475c3 @@ -0,0 +1,2 @@ +xERN1W,}D@Jsl^'3Ǯz}{@٘o^X3y';K8ęOlI)g7d3Q FABFtc9*~)@a1L. ݜĔXiV1a2tP*$%ɝ׭q$ET<< UP;uKu*T⤛ +&U-q̱*nѥ fgg:ע4!AASmĹiQށm E 43FgFғaD5 Y)G8@*g1NN;_ jw3*Fzv~y|s \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/f7/929c5a67a4bdc98247fb4b5098675723932a64 new file mode 100644 index 0000000000000000000000000000000000000000..2861579e8554903dfcac5862b5881c7a8f3dea92 GIT binary patch literal 207 zcmV;=05Jb}0i};iPQ)+}L|Nw)eSsi%`xi?i#AX(=V8;d8?Ka6GG4dGA^$8N30M(}I zsZ>%)+xKmNHQ{M=RY(g;Oq%WDaVd5o)M#@?pNcpbslTxshTrE_?sgguFlNDY>tul#56DR%}YwK_=5AFrt*S6o= z0T(^#k9*xW>FwU?c$T)m06G^_q=*4#v78DTp{`^~qR Jrf(5uVo0VDWGVmv literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fa/567f568ed72157c0c617438d077695b99d9aac new file mode 100644 index 0000000000000000000000000000000000000000..ad5a3cf4f2289302c712888568f61f6afd43fa1a GIT binary patch literal 662 zcmV;H0%`qt0Zo*_a?~&oL^*we5nZCWAp06)- zd7!t`_555>9uhOf;9?MJmP|5P?<=gZkvYcDEuLaWwYSYkGtV<8n&T2$ZY#2(rMyPn zAlB!KR+oo;CGDe)c-OG#4$n5wV5cMg%H%TD(Rq^0wsn3hr-ryBIg*TS!UhwY#tM`{ z(WX*4&4&H{>c`a{~xQW$~5C+=s6uJ+Yv@_9CPTODhS$rluKjRmG6CG zD@?9~#mxvN`IeFsh76r!sdv7B>0@lE!FG(9+^?Mg#HoO6YtQcsMgd0yrJaXG=uI01 zfKgusA~bF6#{x=^a^DNpY%@HstcgfY7H;$4#NeX5B#6|30E2cRj(5<&8}1ME5EF8128%w>78jcAR{CVAjlaP;xtXDO zvN?)zp`y+uL6UY<@3(4z8JZHLQkG~O(16Rp6UdY_sN?moe;3REFDr6Pcpchc?A^-M z@QIRX^=D=fJkXndpKN;*?gR%nm1?F%h3qCvX62p1+TN!a{C1#Iz$lyYovpr#`%R1B wy_))7|MG4UjbUj<<%Fa#OdBZ~|2wWInJ!uw>4&_5L|{tXfY8DG0Xe~qQL@xg)c^nh literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fd/8b5fe88cda995e70a22ed98701e65b843e05ec new file mode 100644 index 0000000000000000000000000000000000000000..b6f14634e403147301851fbcdffc67b275b3bd7c GIT binary patch literal 165 zcmV;W09yZe0i}=44FVw$g*{UR4QPNJU`UMdvK`m}FhkbEieWLv?nPq<-ri60<-J_j z_1dKYx9g2r!eqgK56G5vGMWf1BI#^`P7ye1A0kdD?y>Q$OP_rzXgPQ+nlxr*ohx1$ zGC6tgTnZTpiinTC)Fx+o#zyk8)OD*jdE}9P)S17<&mD4IPf`O|3+N`4dj(2~k&dyQ T|HO!y#^w6j21&dDYs63!76MG; literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db b/vendor/libgit2/tests/resources/merge-recursive/.gitted/objects/fe/f01f3104c8047d05e8572e521c454f8fd4b8db new file mode 100644 index 0000000000000000000000000000000000000000..715b6a8657cb82115e844624d7b8153d1d17b9f3 GIT binary patch literal 207 zcmV;=05Jb}0V^p=O;s>5GG{O}FfcPQQAjKnBG<2*eK(fL(So$ovP zbpzpRbt+Wiq?-l`CRN`pUvSK^o|~=WB!phksfhaE=JlVLJ)Dn`~DdU1Yvrj>l_zo4eA`2mp_&;vFX BuR#C+ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1 new file mode 100644 index 000000000..b55325c3e --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-1 @@ -0,0 +1 @@ +539bd011c4822c560c1d17cab095006b7a10f707 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2 new file mode 100644 index 000000000..d35574340 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchA-2 @@ -0,0 +1 @@ +0bb7ed583d7e9ad507e8b902594f5c9126ea456b diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1 new file mode 100644 index 000000000..d2eecb741 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-1 @@ -0,0 +1 @@ +a34e5a16feabbd0335a633aadb8217c9f3dba58d diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2 new file mode 100644 index 000000000..d5cfb2762 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchB-2 @@ -0,0 +1 @@ +723181f1bfd30e47a6d1d36a4d874e31e7a0a1a4 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1 new file mode 100644 index 000000000..346b039b4 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-1 @@ -0,0 +1 @@ +ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 new file mode 100644 index 000000000..67f3153f5 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchC-2 @@ -0,0 +1 @@ +815b5a1c80ca749d705c7aa0cb294a00cbedd340 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1 new file mode 100644 index 000000000..fa96ccb28 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-1 @@ -0,0 +1 @@ +4dfc1be85a9d6c9898152444d32b238b4aecf8cc diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2 new file mode 100644 index 000000000..8a87f9868 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchD-2 @@ -0,0 +1 @@ +007f1ee2af8e5d99906867c4237510e1790a89b8 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1 new file mode 100644 index 000000000..b8d011e2d --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-1 @@ -0,0 +1 @@ +ca224bba0a8a24f1768804fe5f565b1014af7ef2 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2 new file mode 100644 index 000000000..5e1e1acd9 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-2 @@ -0,0 +1 @@ +436ea75c99f527e4b42fddb46abedf7726eb719d diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 new file mode 100644 index 000000000..eaec8d81a --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchE-3 @@ -0,0 +1 @@ +9b258ad4c39f40c24f66bf1faf48eb6202d59c85 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1 new file mode 100644 index 000000000..5f2ca915b --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-1 @@ -0,0 +1 @@ +783d6539dde96b8873c5b5da3e79cc14cd64830b diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2 new file mode 100644 index 000000000..abe2ea947 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchF-2 @@ -0,0 +1 @@ +ef1783444b61a8671beea4ce1f4d0202677dfbfb diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1 new file mode 100644 index 000000000..af511439b --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-1 @@ -0,0 +1 @@ +c483ca4bb087174af5cb51d7caa9c09fe4a28ccb diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2 new file mode 100644 index 000000000..24177a247 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchG-2 @@ -0,0 +1 @@ +d71c24b3b113fd1d1909998c5bfe33b86a65ee03 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1 new file mode 100644 index 000000000..ffe9f8cf3 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-1 @@ -0,0 +1 @@ +7a9277e0c5ec75339f011c176d0c20e513c4de1c diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2 new file mode 100644 index 000000000..84ed1a2a9 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchH-2 @@ -0,0 +1 @@ +db203155a789fb749aa3c14e93eea2c744a9c6c7 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1 new file mode 100644 index 000000000..2d1ecd026 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-1 @@ -0,0 +1 @@ +5607a8c4601a737daadd1f470bde3142aff57026 diff --git a/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2 b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2 new file mode 100644 index 000000000..fc360bae2 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/.gitted/refs/heads/branchI-2 @@ -0,0 +1 @@ +f7929c5a67a4bdc98247fb4b5098675723932a64 diff --git a/vendor/libgit2/tests/resources/merge-recursive/asparagus.txt b/vendor/libgit2/tests/resources/merge-recursive/asparagus.txt new file mode 100644 index 000000000..ffb36e513 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/asparagus.txt @@ -0,0 +1,10 @@ +ASPARAGUS SOUP. + +Take four large bunches of asparagus, scrape it nicely, cut off one inch +of the tops, and lay them in water, chop the stalks and put them on the +fire with a piece of bacon, a large onion cut up, and pepper and salt; +add two quarts of water, boil them till the stalks are quite soft, then +pulp them through a sieve, and strain the water to it, which must be put +back in the pot; put into it a chicken cut up, with the tops of +asparagus which had been laid by, boil it until these last articles are +sufficiently done, thicken with flour, butter and milk, and serve it up. diff --git a/vendor/libgit2/tests/resources/merge-recursive/beef.txt b/vendor/libgit2/tests/resources/merge-recursive/beef.txt new file mode 100644 index 000000000..68f6182f4 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/beef.txt @@ -0,0 +1,22 @@ +BEEF SOUP. + +Take the hind shin of beef, cut off all the flesh off the leg-bone, +which must be taken away entirely, or the soup will be greasy. Wash the +meat clean and lay it in a pot, sprinkle over it one small +table-spoonful of pounded black pepper, and two of salt; three onions +the size of a hen's egg, cut small, six small carrots scraped and cut +up, two small turnips pared and cut into dice; pour on three quarts of +water, cover the pot close, and keep it gently and steadily boiling five +hours, which will leave about three pints of clear soup; do not let the +pot boil over, but take off the scum carefully, as it rises. When it has +boiled four hours, put in a small bundle of thyme and parsley, and a +pint of celery cut small, or a tea-spoonful of celery seed pounded. +These latter ingredients would lose their delicate flavour if boiled too +much. Just before you take it up, brown it in the following manner: put +a small table-spoonful of nice brown sugar into an iron skillet, set it +on the fire and stir it till it melts and looks very dark, pour into it +a ladle full of the soup, a little at a time; stirring it all the while. +Strain this browning and mix it well with the soup; take out the bundle +of thyme and parsley, put the nicest pieces of meat in your tureen, and +pour on the soup and vegetables; put in some toasted bread cut in dice, +and serve it up. diff --git a/vendor/libgit2/tests/resources/merge-recursive/bouilli.txt b/vendor/libgit2/tests/resources/merge-recursive/bouilli.txt new file mode 100644 index 000000000..4b7c56500 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/bouilli.txt @@ -0,0 +1,18 @@ +SOUP WITH BOUILLI. + +Take the nicest part of the thick brisket of beef, about eight pounds, +put it into a pot with every thing directed for the other soup; make it +exactly in the same way, only put it on an hour sooner, that you may +have time to prepare the bouilli; after it has boiled five hours, take +out the beef, cover up the soup and set it near the fire that it may +keep hot. Take the skin off the beef, have the yelk of an egg well +beaten, dip a feather in it and wash the top of your beef, sprinkle over +it the crumb of stale bread finely grated, put it in a Dutch oven +previously heated, put the top on with coals enough to brown, but not +burn the beef; let it stand nearly an hour, and prepare your gravy +thus:--Take a sufficient quantity of soup and the vegetables boiled in +it; add to it a table-spoonful of red wine, and two of mushroom catsup, +thicken with a little bit of butter and a little brown flour; make it +very hot, pour it in your dish, and put the beef on it. Garnish it with +green pickle, cut in thin slices, serve up the soup in a tureen with +bits of toasted bread. diff --git a/vendor/libgit2/tests/resources/merge-recursive/gravy.txt b/vendor/libgit2/tests/resources/merge-recursive/gravy.txt new file mode 100644 index 000000000..c4e6cca3e --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/gravy.txt @@ -0,0 +1,8 @@ +GRAVY SOUP. + +Get eight pounds of coarse lean beef--wash it clean and lay it in your +pot, put in the same ingredients as for the shin soup, with the same +quantity of water, and follow the process directed for that. Strain the +soup through a sieve, and serve it up clear, with nothing more than +toasted bread in it; two table-spoonsful of mushroom catsup will add a +fine flavour to the soup. diff --git a/vendor/libgit2/tests/resources/merge-recursive/oyster.txt b/vendor/libgit2/tests/resources/merge-recursive/oyster.txt new file mode 100644 index 000000000..7c7e08f95 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/oyster.txt @@ -0,0 +1,13 @@ +OYSTER SOUP! + +Wash and drain two quarts of oysters, put them on with three quarts of +water, three onions chopped up, two or three slices of lean ham, pepper +and salt; boil it till reduced one-half, strain it through a sieve, +return the liquid into the pot, put in one quart of fresh oysters, boil +it till they are sufficiently done, and thicken the soup with four +spoonsful of flour, two gills of rich cream, and the yelks of six new +laid eggs beaten well; boil it a few minutes after the thickening is put +in. Take care that it does not curdle, and that the flour is not in +lumps; serve it up with the last oysters that were put in. If the +flavour of thyme be agreeable, you may put in a little, but take care +that it does not boil in it long enough to discolour the soup. diff --git a/vendor/libgit2/tests/resources/merge-recursive/veal.txt b/vendor/libgit2/tests/resources/merge-recursive/veal.txt new file mode 100644 index 000000000..898d12687 --- /dev/null +++ b/vendor/libgit2/tests/resources/merge-recursive/veal.txt @@ -0,0 +1,20 @@ +VEAL SOUP. + +PUT INTO A POT THREE QUARTS OF WATER, 3 onions cut small, ONE +spoonful of black pepper pounded, and two of salt, with two or three +slices of lean ham; let it boil steadily two hours; skim it +occasionally, then put into it a shin of veal, let it boil two hours +longer; take out the slices of ham, and skim off the grease if any +should rise, take a gill of good cream, mix with it two table-spoonsful +of flour very nicely, and the yelks of two eggs beaten well, strain this +mixture, and add some chopped parsley; pour some soup on by degrees, +stir it well, and pour it into the pot, continuing to stir until it has +boiled two or three minutes to take off the raw taste of the eggs. If +the cream be not perfectly sweet, and the eggs quite new, the thickening +will curdle in the soup. For a change you may put a dozen ripe tomatos +in, first taking off their skins, by letting them stand a few minutes in +hot water, when they may be easily peeled. When made in this way you +must thicken it with the flour only. Any part of the veal may be used, +but the shin or knuckle is the nicest. + +This is a mighty fine recipe! diff --git a/vendor/libgit2/tests/resources/status/.gitted/objects/2b/d0a343aeef7a2cf0d158478966a6e587ff3863 b/vendor/libgit2/tests/resources/status/.gitted/objects/2b/d0a343aeef7a2cf0d158478966a6e587ff3863 new file mode 100644 index 0000000000000000000000000000000000000000..d10ca636b6bf5f66bce633362d871d17d9a292c6 GIT binary patch literal 56 zcmV-80LTA$0ZYosPf{>3VkpVTELKR%%t=)M(#aW#dFiPs3YmEdNkxfy$r%cXc_|9H OiNz(UMO*-@y%7?c&=$P_ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/status/.gitted/objects/d4/27e0b2e138501a3d15cc376077a3631e15bd46 b/vendor/libgit2/tests/resources/status/.gitted/objects/d4/27e0b2e138501a3d15cc376077a3631e15bd46 new file mode 100644 index 0000000000000000000000000000000000000000..0b3611ae4c9dc635dafd5dc9560cbc2ff5e92198 GIT binary patch literal 38 ucmb4F=r^r$ShV!%gjkt0Mf}BiFxU%DGHf+3b~2JC8SOTvLu;?`=J4eDP*<*dE;n62`k)BYy+6Fc>Nra9wz(d_-EKB)6_f kRq%Rq_qhtM=fz>Ee_l3S@LMBvbgC8SC8;G(PQUH}02WnsssI20 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/sub.git/logs/HEAD b/vendor/libgit2/tests/resources/sub.git/logs/HEAD new file mode 100644 index 000000000..f636268f6 --- /dev/null +++ b/vendor/libgit2/tests/resources/sub.git/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b7a59b3f4ea13b985f8a1e0d3757d5cd3331add8 Edward Thomson 1442522322 -0400 commit (initial): Initial revision diff --git a/vendor/libgit2/tests/resources/sub.git/logs/refs/heads/master b/vendor/libgit2/tests/resources/sub.git/logs/refs/heads/master new file mode 100644 index 000000000..f636268f6 --- /dev/null +++ b/vendor/libgit2/tests/resources/sub.git/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b7a59b3f4ea13b985f8a1e0d3757d5cd3331add8 Edward Thomson 1442522322 -0400 commit (initial): Initial revision diff --git a/vendor/libgit2/tests/resources/sub.git/objects/10/ddd6d257e01349d514541981aeecea6b2e741d b/vendor/libgit2/tests/resources/sub.git/objects/10/ddd6d257e01349d514541981aeecea6b2e741d new file mode 100644 index 0000000000000000000000000000000000000000..a095b3fb822e3cde46d5d39ff21528c1e1fc70cf GIT binary patch literal 22 ecmb7F=sF|FfcPQQP4}zEJ-XWDauSLElDkA5YKY$pYq^UP|>;c z!`Yv?vtOS2rVLe?n3rFYky@lzQc=PnaQE7!@CU-4S4Bc38`r&gm91AI3sshunUjiB mjfnveC={0_F?TvpB(Aj# zP#zDX=M3Jai6%!5lQ)JGd5n0DNmG`}854s;^h*@sHCFC$qfh7rkCp4j4d%StA6;un toi|>_DRI4kvR0$kMr$}qE2Y@&J|6jxgt)gdN_axg@3Iwc;tNWyL3_OFJ+1%% literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/sub.git/objects/d0/ee23c41b28746d7e822511d7838bce784ae773 b/vendor/libgit2/tests/resources/sub.git/objects/d0/ee23c41b28746d7e822511d7838bce784ae773 new file mode 100644 index 0000000000000000000000000000000000000000..d9bb9c84d8053600309e1bd6393d26b61c47bd78 GIT binary patch literal 54 zcmV-60LlM&0V^p=O;s>9XD~D{Ff%bxNY2R2Nzp5*C}9w|d+k#A17XjrA|aBE>)yP| M)+><(08@Jq$s_(2XaE2J literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/sub.git/refs/heads/master b/vendor/libgit2/tests/resources/sub.git/refs/heads/master new file mode 100644 index 000000000..0e4d6e2a7 --- /dev/null +++ b/vendor/libgit2/tests/resources/sub.git/refs/heads/master @@ -0,0 +1 @@ +b7a59b3f4ea13b985f8a1e0d3757d5cd3331add8 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitmodules b/vendor/libgit2/tests/resources/submodule_with_path/.gitmodules new file mode 100644 index 000000000..ba34c47dc --- /dev/null +++ b/vendor/libgit2/tests/resources/submodule_with_path/.gitmodules @@ -0,0 +1,3 @@ +[submodule "testrepo"] + path = lib/testrepo + url = ../testrepo.git diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/HEAD b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/config b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/config new file mode 100644 index 000000000..78387c50b --- /dev/null +++ b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/config @@ -0,0 +1,8 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/index b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/index new file mode 100644 index 0000000000000000000000000000000000000000..a740b4b91e5595fef2e2b0983480d834da7bdf9e GIT binary patch literal 253 zcmZ?q402{*U|<5_Fsqa(Ak7eFmF@zf5ukAig3aK(%j8Jy$;%fu?lz8gJ$Wg6;fFsH zjx%uUrDvAp=BJeAq!vRJ1I-HqF@ba>l71lb0Sb3n{M*m7-alcwygN_jzOR4$laTTN z2A-VEB>j@q;*z4&f_#YbkRVrAAj_1&NWqY6V-nw|q+S8Xtd@&&D(sB!xQ3lP4AjD4 ys9?Z#)%8!d!<%{O#@bo3x^GY4mj3@b`_cPT!M_=Km$h&Qx=xo~|8AY~c_{$IhD+W6 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/18/372280a56a54340fa600aa91315065c6c4c693 b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/18/372280a56a54340fa600aa91315065c6c4c693 new file mode 100644 index 0000000000000000000000000000000000000000..d9b4313e187ed50eb03ad8c99a11ae9bbfa14879 GIT binary patch literal 85 zcmV-b0IL6Z0V^p=O;s?nWH2-^Ff%bx&`ZxO$<0qG%}Fh0Fv~DB3~ws^w&Jf$@I2nw r1vl3IS2HmH0)?E+B!;W5f3h9k%u6@c&XU!Ad-}HY|JT_795W{55>P0GzrDa}b$P%23+E-6Ya$XANx;w(rk$xyIW$jMC7 VhY53WmKNmz#q{(LLI7Du7m_mY8dU%Q literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/89/ca686bb21bfb75dda99a02313831a0c418f921 b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/89/ca686bb21bfb75dda99a02313831a0c418f921 new file mode 100644 index 0000000000000000000000000000000000000000..7c1af6645b3678f7cddabf69568fbe93b73c26c7 GIT binary patch literal 161 zcmV;S0ABxi0i}-14Z<)GL^-<(HvsbbvvDMZxX=L&*z1jwgW1S2qJ2yaoM!Z-HyV;! zx2~;&Q*X>V16sq2MH>qk5167aFw+zrJ6FhufHad+dusgZnxfB3m~yf<_%dP`IS_J& z1oOf%7sIBYO7Ff((~t5=t?1_}^^ljo@}R$VuNyTvWa$@@deh)NB1W*F&n6h71|3H` P|1qIN_CtLE2lz_SuD?t; literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/b1/620ef2628d10416a84d19c783e33dc4556c9c3 b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/b1/620ef2628d10416a84d19c783e33dc4556c9c3 new file mode 100644 index 0000000000000000000000000000000000000000..4475582597be6c70d7350a9d6e9dd3106b6d7d31 GIT binary patch literal 86 zcmV-c0IC0Y0V^p=O;s?nWH2-^Ff%bx&`ZxO$<0qG%}Fh0*ky90_T=RY8+RK=yPmw1 sz3{`I3CB$gfIuN9Gl}7<>z{0gH}leswX5XNWE?P0GzrDa}b$P%23+E-6Ya$XANx;w(rk$xyIW$jMC7 ahY53WmKNmz#q{*xLVD?$C0qc#AQ=eHq#alQ literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/c8/4bf57ba2254dba216ab5c6eb1a19fe8bd0e0d6 b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/objects/c8/4bf57ba2254dba216ab5c6eb1a19fe8bd0e0d6 new file mode 100644 index 0000000000000000000000000000000000000000..9f664569ce0477eeddf845279556266ded79ab69 GIT binary patch literal 127 zcmV-_0D%8^0i})04Z<)CKsjd$F933WZYm+v3mdS2up4eLK1{#Z}`(UZSY*b+*WvPS`U50JrDb%rS8)7 h(9&9V=y!`00M=Q)Z&t&)Pj75W$|x6&wBra>GJM8mHWQ_@lQg^ J0{~*65=1l57(D<0 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/submodule_with_path/.gitted/refs/heads/master b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/refs/heads/master new file mode 100644 index 000000000..4b5a5a21d --- /dev/null +++ b/vendor/libgit2/tests/resources/submodule_with_path/.gitted/refs/heads/master @@ -0,0 +1 @@ +89ca686bb21bfb75dda99a02313831a0c418f921 diff --git a/vendor/libgit2/tests/resources/super/.gitted/COMMIT_EDITMSG b/vendor/libgit2/tests/resources/super/.gitted/COMMIT_EDITMSG new file mode 100644 index 000000000..e2d6b8987 --- /dev/null +++ b/vendor/libgit2/tests/resources/super/.gitted/COMMIT_EDITMSG @@ -0,0 +1 @@ +submodule diff --git a/vendor/libgit2/tests/resources/super/.gitted/HEAD b/vendor/libgit2/tests/resources/super/.gitted/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/vendor/libgit2/tests/resources/super/.gitted/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/vendor/libgit2/tests/resources/super/.gitted/config b/vendor/libgit2/tests/resources/super/.gitted/config new file mode 100644 index 000000000..06a8b7790 --- /dev/null +++ b/vendor/libgit2/tests/resources/super/.gitted/config @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly +[submodule "sub"] + url = ../sub.git diff --git a/vendor/libgit2/tests/resources/super/.gitted/index b/vendor/libgit2/tests/resources/super/.gitted/index new file mode 100644 index 0000000000000000000000000000000000000000..cc2ffffb980f6eade02621e7431faffc830c96e9 GIT binary patch literal 217 zcmZ?q402{*U|<5_(BFmvK$-zYgV+$zxCF)m(!qfda}>M3SM{!ZdE@qh>DRML)YXnK zaOp0i)X@;dTKg{30SZ^EfSPb1kPO Nt$y+J!W`S|A^_*II9C7w literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/super/.gitted/objects/51/589c218bf77a8da9e9d8dbc097d76a742726c4 b/vendor/libgit2/tests/resources/super/.gitted/objects/51/589c218bf77a8da9e9d8dbc097d76a742726c4 new file mode 100644 index 0000000000000000000000000000000000000000..727d3a696894fe8d07899ae0b520da02596720cd GIT binary patch literal 90 zcmV-g0HyzU0ZYosPg1ZjW{55>P0GzrDa}b$Py#ZQV!1dA5=$}^Y!!e!F3!@T93V5< wDkdg9vm_=aCo>618|fOy#FV5KmlVgu6r~pDmlh?b0+~P!dO%q&0A7+GCFlAeGXMYp literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/super/.gitted/objects/79/d0d58ca6aa1688a073d280169908454cad5b91 b/vendor/libgit2/tests/resources/super/.gitted/objects/79/d0d58ca6aa1688a073d280169908454cad5b91 new file mode 100644 index 0000000000000000000000000000000000000000..7fd889d5f1cfe79f0b769d2682e3f5a888f0fa3b GIT binary patch literal 132 zcmV-~0DJ#<0i}&e3IZ_@06pgw{Q;%3nFxb;@dth&Nw>^^u^|h7-|-FJiaJyksdXEm zV?2z;3>16_=a_xK6fH+2G)$#vw1%>FK3Mi>ol0}8(%?>?)CeA{)GlvWc(*^g)vYw? m@*Jlk^$OZKAU@$Z=Ff%bx&`ZxO$<0qG%}Fh02#lDc*!{h#cje0)w+~Fe to>ii*cEr%k004F=r^r$ShV!%gjkt0Mf}BiFxU%DGHf+3b~2JC8WaR~zh<5!@R2oUp#XSw!IdGIQz z=v?~Y?9bfUFHe0_X5iCH&n!tSDJjZKDlJJZhL|Jy2bqSLXZjY+JiS{5F=8+@FfcPQQP4}zEJ-XWDauSLElDkA5YKY$pYq^UP|>;c z!`Yv?vtOS2rVLf-?C-~LE6Hl_)a*@v8-k8=9DnQlAy!h?94hToP-2KrJ~1&-ucV@c xq2G1YwNKVlIe%2-B-TkDR9{z?Fbir#Vrd0F6VftsQVAJRRaJ#k2>{B;WqZ3*KK=jz literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/17/6a458f94e0ea5272ce67c36bf30b6be9caf623 b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/17/6a458f94e0ea5272ce67c36bf30b6be9caf623 new file mode 100644 index 0000000000000000000000000000000000000000..ef83166706c43aabd3c68d155be9c92a23960f0f GIT binary patch literal 28 kcmb5Fkmn=FfcPQQE>M6W4M)MwRdXvroRnA$2pF_b^Z`5scR0E z_9-Ya#3!Gan5b7$QNqygy6V~|>#3YSDsmF*BoC^uD@&LKH6pRJ0-p(KnK`M1jHs%r L!l?uR{HIf1PD3w2 literal 0 HcmV?d00001 diff --git a/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/34/96991d72d500af36edef68bbfcccd1661d88db b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/34/96991d72d500af36edef68bbfcccd1661d88db new file mode 100644 index 000000000..71b6172c6 --- /dev/null +++ b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/34/96991d72d500af36edef68bbfcccd1661d88db @@ -0,0 +1,3 @@ +x +![whӢ}/8B*8N~@gu՜S ͡7a +f2"s e.%Q ؽ຾m[kjmGq_N3LBJŔFG:B VRO ͿҖj!= \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/8f/45aad6f23b9509f8786c617e19c127ae76609a b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/8f/45aad6f23b9509f8786c617e19c127ae76609a new file mode 100644 index 000000000..8bcd980c4 --- /dev/null +++ b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/8f/45aad6f23b9509f8786c617e19c127ae76609a @@ -0,0 +1,2 @@ +xA + ֝/k. ]`h޾"= ˕e* U+M%O4c˱ \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/da/623abd956bb2fd8052c708c7ed43f05d192d37 b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/objects/da/623abd956bb2fd8052c708c7ed43f05d192d37 new file mode 100644 index 0000000000000000000000000000000000000000..923462306f0fb2612820702c6b18f53f3c95b479 GIT binary patch literal 59 zcmbFMi#hOzsp>a%59Po8VGq(58w PWV-n4LPmy_m?BgqVJ =FdJTqDdBN'6Rp S+kpGrAR*Tz! vVGn5l_;U>H \ No newline at end of file diff --git a/vendor/libgit2/tests/resources/win32-forbidden/.gitted/refs/heads/master b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/refs/heads/master new file mode 100644 index 000000000..47fce0fe3 --- /dev/null +++ b/vendor/libgit2/tests/resources/win32-forbidden/.gitted/refs/heads/master @@ -0,0 +1 @@ +3496991d72d500af36edef68bbfcccd1661d88db diff --git a/vendor/libgit2/tests/revert/workdir.c b/vendor/libgit2/tests/revert/workdir.c index 9f83bd842..802819c75 100644 --- a/vendor/libgit2/tests/revert/workdir.c +++ b/vendor/libgit2/tests/revert/workdir.c @@ -410,7 +410,7 @@ void test_revert_workdir__rename_1_of_2(void) { 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" }, }; - opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5"); @@ -444,7 +444,7 @@ void test_revert_workdir__rename(void) { "file4.txt", "file5.txt", "" }, }; - opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965"); diff --git a/vendor/libgit2/tests/revwalk/basic.c b/vendor/libgit2/tests/revwalk/basic.c index 829d8e844..5ed7da4eb 100644 --- a/vendor/libgit2/tests/revwalk/basic.c +++ b/vendor/libgit2/tests/revwalk/basic.c @@ -456,7 +456,8 @@ void test_revwalk_basic__big_timestamp(void) cl_git_pass(git_signature_new(&sig, "Joe", "joe@example.com", 2399662595, 0)); cl_git_pass(git_commit_tree(&tree, tip)); - cl_git_pass(git_commit_create(&id, _repo, "HEAD", sig, sig, NULL, "some message", tree, 1, (const git_commit **) &tip)); + cl_git_pass(git_commit_create(&id, _repo, "HEAD", sig, sig, NULL, "some message", tree, 1, + (const git_commit **)&tip)); cl_git_pass(git_revwalk_push_head(_walk)); diff --git a/vendor/libgit2/tests/status/ignore.c b/vendor/libgit2/tests/status/ignore.c index ba1d69a99..c318046da 100644 --- a/vendor/libgit2/tests/status/ignore.c +++ b/vendor/libgit2/tests/status/ignore.c @@ -148,7 +148,7 @@ void test_status_ignore__ignore_pattern_contains_space(void) cl_git_pass(git_status_file(&flags, g_repo, "foo bar.txt")); cl_assert(flags == GIT_STATUS_IGNORED); - cl_git_pass(git_futils_mkdir_r("empty_standard_repo/foo", NULL, mode)); + cl_git_pass(git_futils_mkdir_r("empty_standard_repo/foo", mode)); cl_git_mkfile("empty_standard_repo/foo/look-ma.txt", "I'm not going to be ignored!"); cl_git_pass(git_status_file(&flags, g_repo, "foo/look-ma.txt")); @@ -206,7 +206,7 @@ void test_status_ignore__subdirectories(void) * used a rooted path for an ignore, so I changed this behavior. */ cl_git_pass(git_futils_mkdir_r( - "empty_standard_repo/test/ignore_me", NULL, 0775)); + "empty_standard_repo/test/ignore_me", 0775)); cl_git_mkfile( "empty_standard_repo/test/ignore_me/file", "I'm going to be ignored!"); cl_git_mkfile( @@ -230,9 +230,9 @@ static void make_test_data(const char *reponame, const char **files) g_repo = cl_git_sandbox_init(reponame); for (scan = files; *scan != NULL; ++scan) { - cl_git_pass(git_futils_mkdir( + cl_git_pass(git_futils_mkdir_relative( *scan + repolen, reponame, - 0777, GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST)); + 0777, GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST, NULL)); cl_git_mkfile(*scan, "contents"); } } @@ -612,7 +612,7 @@ void test_status_ignore__issue_1766_negated_ignores(void) g_repo = cl_git_sandbox_init("empty_standard_repo"); cl_git_pass(git_futils_mkdir_r( - "empty_standard_repo/a", NULL, 0775)); + "empty_standard_repo/a", 0775)); cl_git_mkfile( "empty_standard_repo/a/.gitignore", "*\n!.gitignore\n"); cl_git_mkfile( @@ -622,7 +622,7 @@ void test_status_ignore__issue_1766_negated_ignores(void) assert_is_ignored("a/ignoreme"); cl_git_pass(git_futils_mkdir_r( - "empty_standard_repo/b", NULL, 0775)); + "empty_standard_repo/b", 0775)); cl_git_mkfile( "empty_standard_repo/b/.gitignore", "*\n!.gitignore\n"); cl_git_mkfile( @@ -1022,3 +1022,20 @@ void test_status_ignore__negate_exact_previous(void) cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, ".buildpath")); cl_assert_equal_i(1, ignored); } + +void test_status_ignore__negate_starstar(void) +{ + int ignored; + + g_repo = cl_git_sandbox_init("empty_standard_repo"); + + cl_git_mkfile("empty_standard_repo/.gitignore", + "code/projects/**/packages/*\n" + "!code/projects/**/packages/repositories.config"); + + cl_git_pass(git_futils_mkdir_r("empty_standard_repo/code/projects/foo/bar/packages", 0777)); + cl_git_mkfile("empty_standard_repo/code/projects/foo/bar/packages/repositories.config", ""); + + cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "code/projects/foo/bar/packages/repositories.config")); + cl_assert_equal_i(0, ignored); +} diff --git a/vendor/libgit2/tests/status/worktree.c b/vendor/libgit2/tests/status/worktree.c index 75c7b71b0..5d3b4d55e 100644 --- a/vendor/libgit2/tests/status/worktree.c +++ b/vendor/libgit2/tests/status/worktree.c @@ -195,7 +195,7 @@ void test_status_worktree__swap_subdir_with_recurse_and_pathspec(void) cl_git_pass(p_rename("status/subdir", "status/current_file")); cl_git_pass(p_rename("status/swap", "status/subdir")); cl_git_mkfile("status/.new_file", "dummy"); - cl_git_pass(git_futils_mkdir_r("status/zzz_new_dir", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("status/zzz_new_dir", 0777)); cl_git_mkfile("status/zzz_new_dir/new_file", "dummy"); cl_git_mkfile("status/zzz_new_file", "dummy"); @@ -657,7 +657,7 @@ void test_status_worktree__conflict_has_no_oid(void) entry.mode = 0100644; entry.path = "modified_file"; - git_oid_fromstr(&entry.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); cl_git_pass(git_repository_index(&index, repo)); cl_git_pass(git_index_conflict_add(index, &entry, &entry, &entry)); @@ -917,7 +917,7 @@ void test_status_worktree__long_filenames(void) // Create directory with amazingly long filename sprintf(path, "empty_standard_repo/%s", longname); - cl_git_pass(git_futils_mkdir_r(path, NULL, 0777)); + cl_git_pass(git_futils_mkdir_r(path, 0777)); sprintf(path, "empty_standard_repo/%s/foo", longname); cl_git_mkfile(path, "dummy"); @@ -1006,8 +1006,11 @@ void test_status_worktree__unreadable(void) git_status_options opts = GIT_STATUS_OPTIONS_INIT; status_entry_counts counts = {0}; + if (geteuid() == 0) + cl_skip(); + /* Create directory with no read permission */ - cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777)); cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy"); p_chmod("empty_standard_repo/no_permission", 0644); @@ -1041,7 +1044,7 @@ void test_status_worktree__unreadable_not_included(void) status_entry_counts counts = {0}; /* Create directory with no read permission */ - cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777)); cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy"); p_chmod("empty_standard_repo/no_permission", 0644); @@ -1074,7 +1077,7 @@ void test_status_worktree__unreadable_as_untracked(void) status_entry_counts counts = {0}; /* Create directory with no read permission */ - cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", NULL, 0777)); + cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777)); cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy"); p_chmod("empty_standard_repo/no_permission", 0644); diff --git a/vendor/libgit2/tests/status/worktree_init.c b/vendor/libgit2/tests/status/worktree_init.c index cc7e126f1..9d5cfa5a3 100644 --- a/vendor/libgit2/tests/status/worktree_init.c +++ b/vendor/libgit2/tests/status/worktree_init.c @@ -191,10 +191,10 @@ void test_status_worktree_init__bracket_in_filename(void) cl_git_pass(git_status_file(&status_flags, repo, FILE_WITHOUT_BRACKET)); cl_assert(status_flags == GIT_STATUS_WT_NEW); - cl_git_pass(git_status_file(&status_flags, repo, "LICENSE\\[1\\].md")); - cl_assert(status_flags == GIT_STATUS_INDEX_NEW); + cl_git_fail_with(git_status_file(&status_flags, repo, "LICENSE\\[1\\].md"), GIT_ENOTFOUND); cl_git_pass(git_status_file(&status_flags, repo, FILE_WITH_BRACKET)); + cl_assert(status_flags == GIT_STATUS_INDEX_NEW); git_index_free(index); git_repository_free(repo); diff --git a/vendor/libgit2/tests/submodule/lookup.c b/vendor/libgit2/tests/submodule/lookup.c index ecea694e5..148f9273e 100644 --- a/vendor/libgit2/tests/submodule/lookup.c +++ b/vendor/libgit2/tests/submodule/lookup.c @@ -333,3 +333,58 @@ void test_submodule_lookup__prefix_name(void) git_submodule_free(sm); } + +void test_submodule_lookup__renamed(void) +{ + const char *newpath = "sm_actually_changed"; + git_index *idx; + sm_lookup_data data; + + cl_git_pass(git_repository_index__weakptr(&idx, g_repo)); + + /* We're replicating 'git mv sm_unchanged sm_actually_changed' in this test */ + + cl_git_pass(p_rename("submod2/sm_unchanged", "submod2/sm_actually_changed")); + + /* Change the path in .gitmodules and stage it*/ + { + git_config *cfg; + + cl_git_pass(git_config_open_ondisk(&cfg, "submod2/.gitmodules")); + cl_git_pass(git_config_set_string(cfg, "submodule.sm_unchanged.path", newpath)); + git_config_free(cfg); + + cl_git_pass(git_index_add_bypath(idx, ".gitmodules")); + } + + /* Change the worktree info in the submodule's config */ + { + git_config *cfg; + + cl_git_pass(git_config_open_ondisk(&cfg, "submod2/.git/modules/sm_unchanged/config")); + cl_git_pass(git_config_set_string(cfg, "core.worktree", "../../../sm_actually_changed")); + git_config_free(cfg); + } + + /* Rename the entry in the index */ + { + const git_index_entry *e; + git_index_entry entry = {{ 0 }}; + + e = git_index_get_bypath(idx, "sm_unchanged", 0); + cl_assert(e); + cl_assert_equal_i(GIT_FILEMODE_COMMIT, e->mode); + + entry.path = newpath; + entry.mode = GIT_FILEMODE_COMMIT; + git_oid_cpy(&entry.id, &e->id); + + cl_git_pass(git_index_remove(idx, "sm_unchanged", 0)); + cl_git_pass(git_index_add(idx, &entry)); + cl_git_pass(git_index_write(idx)); + } + + memset(&data, 0, sizeof(data)); + cl_git_pass(git_submodule_foreach(g_repo, sm_lookup_cb, &data)); + cl_assert_equal_i(8, data.count); +} diff --git a/vendor/libgit2/tests/submodule/status.c b/vendor/libgit2/tests/submodule/status.c index 6721ee92a..10f385ce9 100644 --- a/vendor/libgit2/tests/submodule/status.c +++ b/vendor/libgit2/tests/submodule/status.c @@ -92,7 +92,7 @@ void test_submodule_status__ignore_none(void) cl_assert((status & GIT_SUBMODULE_STATUS_WD_DELETED) != 0); /* now mkdir sm_unchanged to test uninitialized */ - cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); + cl_git_pass(git_futils_mkdir_relative("sm_unchanged", "submod2", 0755, 0, NULL)); status = get_submodule_status(g_repo, "sm_unchanged"); cl_assert((status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) != 0); @@ -141,7 +141,7 @@ void test_submodule_status__ignore_untracked(void) cl_assert((status & GIT_SUBMODULE_STATUS_WD_DELETED) != 0); /* now mkdir sm_unchanged to test uninitialized */ - cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); + cl_git_pass(git_futils_mkdir_relative("sm_unchanged", "submod2", 0755, 0, NULL)); cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) != 0); @@ -185,7 +185,7 @@ void test_submodule_status__ignore_dirty(void) cl_assert((status & GIT_SUBMODULE_STATUS_WD_DELETED) != 0); /* now mkdir sm_unchanged to test uninitialized */ - cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); + cl_git_pass(git_futils_mkdir_relative("sm_unchanged", "submod2", 0755, 0, NULL)); cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) != 0); @@ -229,7 +229,7 @@ void test_submodule_status__ignore_all(void) cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); /* now mkdir sm_unchanged to test uninitialized */ - cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); + cl_git_pass(git_futils_mkdir_relative("sm_unchanged", "submod2", 0755, 0, NULL)); cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); @@ -264,6 +264,7 @@ static int confirm_submodule_status( void test_submodule_status__iterator(void) { git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry; size_t i; static const char *expected[] = { @@ -308,9 +309,10 @@ void test_submodule_status__iterator(void) git_status_options opts = GIT_STATUS_OPTIONS_INIT; git_index *index; + iter_opts.flags = GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES; + cl_git_pass(git_repository_index(&index, g_repo)); - cl_git_pass(git_iterator_for_workdir(&iter, g_repo, index, NULL, - GIT_ITERATOR_IGNORE_CASE | GIT_ITERATOR_INCLUDE_TREES, NULL, NULL)); + cl_git_pass(git_iterator_for_workdir(&iter, g_repo, index, NULL, &iter_opts)); for (i = 0; !git_iterator_advance(&entry, iter); ++i) cl_assert_equal_s(expected[i], entry->path); @@ -336,7 +338,7 @@ void test_submodule_status__untracked_dirs_containing_ignored_files(void) "submod2/.git/modules/sm_unchanged/info/exclude", "\n*.ignored\n"); cl_git_pass( - git_futils_mkdir("sm_unchanged/directory", "submod2", 0755, 0)); + git_futils_mkdir_relative("sm_unchanged/directory", "submod2", 0755, 0, NULL)); cl_git_mkfile( "submod2/sm_unchanged/directory/i_am.ignored", "ignore this file, please\n"); diff --git a/vendor/libgit2/tests/submodule/submodule_helpers.c b/vendor/libgit2/tests/submodule/submodule_helpers.c index 1dc687231..4ff4b4da7 100644 --- a/vendor/libgit2/tests/submodule/submodule_helpers.c +++ b/vendor/libgit2/tests/submodule/submodule_helpers.c @@ -126,6 +126,22 @@ git_repository *setup_fixture_submod2(void) return repo; } +git_repository *setup_fixture_super(void) +{ + git_repository *repo = cl_git_sandbox_init("super"); + + cl_fixture_sandbox("sub.git"); + p_mkdir("super/sub", 0777); + + rewrite_gitmodules(git_repository_workdir(repo)); + + cl_set_cleanup(cleanup_fixture_submodules, "sub.git"); + + cl_git_pass(git_repository_reinit_filesystem(repo, 1)); + + return repo; +} + git_repository *setup_fixture_submodule_simple(void) { git_repository *repo = cl_git_sandbox_init("submodule_simple"); @@ -140,6 +156,21 @@ git_repository *setup_fixture_submodule_simple(void) return repo; } +git_repository *setup_fixture_submodule_with_path(void) +{ + git_repository *repo = cl_git_sandbox_init("submodule_with_path"); + + cl_fixture_sandbox("testrepo.git"); + p_mkdir("submodule_with_path/lib", 0777); + p_mkdir("submodule_with_path/lib/testrepo", 0777); + + cl_set_cleanup(cleanup_fixture_submodules, "testrepo.git"); + + cl_git_pass(git_repository_reinit_filesystem(repo, 1)); + + return repo; +} + void assert__submodule_exists( git_repository *repo, const char *name, const char *msg, const char *file, int line) diff --git a/vendor/libgit2/tests/submodule/submodule_helpers.h b/vendor/libgit2/tests/submodule/submodule_helpers.h index 1493f245f..42b14a7bc 100644 --- a/vendor/libgit2/tests/submodule/submodule_helpers.h +++ b/vendor/libgit2/tests/submodule/submodule_helpers.h @@ -4,6 +4,8 @@ extern void rewrite_gitmodules(const char *workdir); extern git_repository *setup_fixture_submodules(void); extern git_repository *setup_fixture_submod2(void); extern git_repository *setup_fixture_submodule_simple(void); +extern git_repository *setup_fixture_super(void); +extern git_repository *setup_fixture_submodule_with_path(void); extern unsigned int get_submodule_status(git_repository *, const char *); diff --git a/vendor/libgit2/tests/submodule/update.c b/vendor/libgit2/tests/submodule/update.c index 40d24d0a7..cbd519d81 100644 --- a/vendor/libgit2/tests/submodule/update.c +++ b/vendor/libgit2/tests/submodule/update.c @@ -131,6 +131,53 @@ void test_submodule_update__update_submodule(void) git_submodule_free(sm); } +void test_submodule_update__update_submodule_with_path(void) +{ + git_submodule *sm; + git_submodule_update_options update_options = GIT_SUBMODULE_UPDATE_OPTIONS_INIT; + unsigned int submodule_status = 0; + struct update_submodule_cb_payload update_payload = { 0 }; + + g_repo = setup_fixture_submodule_with_path(); + + update_options.checkout_opts.progress_cb = checkout_progress_cb; + update_options.checkout_opts.progress_payload = &update_payload; + + update_options.fetch_opts.callbacks.update_tips = update_tips; + update_options.fetch_opts.callbacks.payload = &update_payload; + + /* get the submodule */ + cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); + + /* verify the initial state of the submodule */ + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); + cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | + GIT_SUBMODULE_STATUS_IN_INDEX | + GIT_SUBMODULE_STATUS_IN_CONFIG | + GIT_SUBMODULE_STATUS_WD_UNINITIALIZED); + + /* initialize and update the submodule */ + cl_git_pass(git_submodule_init(sm, 0)); + cl_git_pass(git_submodule_update(sm, 0, &update_options)); + + /* verify state */ + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); + cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | + GIT_SUBMODULE_STATUS_IN_INDEX | + GIT_SUBMODULE_STATUS_IN_CONFIG | + GIT_SUBMODULE_STATUS_IN_WD); + + cl_assert(git_oid_streq(git_submodule_head_id(sm), "a65fedf39aefe402d3bb6e24df4d4f5fe4547750") == 0); + cl_assert(git_oid_streq(git_submodule_wd_id(sm), "a65fedf39aefe402d3bb6e24df4d4f5fe4547750") == 0); + cl_assert(git_oid_streq(git_submodule_index_id(sm), "a65fedf39aefe402d3bb6e24df4d4f5fe4547750") == 0); + + /* verify that the expected callbacks have been called. */ + cl_assert_equal_i(1, update_payload.checkout_progress_called); + cl_assert_equal_i(1, update_payload.update_tips_called); + + git_submodule_free(sm); +} + void test_submodule_update__update_and_init_submodule(void) { git_submodule *sm; @@ -390,3 +437,4 @@ void test_submodule_update__can_force_update(void) git_object_free(branch_commit); git_reference_free(branch_reference); } + diff --git a/vendor/libgit2/tests/threads/iterator.c b/vendor/libgit2/tests/threads/iterator.c index 8a2d79c2e..6b86cf1a0 100644 --- a/vendor/libgit2/tests/threads/iterator.c +++ b/vendor/libgit2/tests/threads/iterator.c @@ -13,10 +13,13 @@ static void *run_workdir_iterator(void *arg) { int error = 0; git_iterator *iter; + git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT; const git_index_entry *entry = NULL; + iter_opts.flags = GIT_ITERATOR_DONT_AUTOEXPAND; + cl_git_pass(git_iterator_for_workdir( - &iter, _repo, NULL, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, NULL, NULL)); + &iter, _repo, NULL, NULL, &iter_opts)); while (!error) { if (entry && entry->mode == GIT_FILEMODE_TREE) { diff --git a/vendor/libgit2/tests/trace/windows/stacktrace.c b/vendor/libgit2/tests/trace/windows/stacktrace.c new file mode 100644 index 000000000..c00c1b774 --- /dev/null +++ b/vendor/libgit2/tests/trace/windows/stacktrace.c @@ -0,0 +1,151 @@ +#include "clar_libgit2.h" +#include "win32/w32_stack.h" + +#if defined(GIT_MSVC_CRTDBG) +static void a(void) +{ + char buf[10000]; + + cl_assert(git_win32__stack(buf, sizeof(buf), 0, NULL, NULL) == 0); + +#if 0 + fprintf(stderr, "Stacktrace from [%s:%d]:\n%s\n", __FILE__, __LINE__, buf); +#endif +} + +static void b(void) +{ + a(); +} + +static void c(void) +{ + b(); +} +#endif + +void test_trace_windows_stacktrace__basic(void) +{ +#if defined(GIT_MSVC_CRTDBG) + c(); +#endif +} + + +void test_trace_windows_stacktrace__leaks(void) +{ +#if defined(GIT_MSVC_CRTDBG) + void * p1; + void * p2; + void * p3; + void * p4; + int before, after; + int leaks; + int error; + + /* remember outstanding leaks due to set setup + * and set mark/checkpoint. + */ + before = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL | + GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK, + NULL); + + p1 = git__malloc(5); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p1"); + cl_assert((leaks == 1)); + + p2 = git__malloc(5); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p1,p2"); + cl_assert((leaks == 2)); + + p3 = git__malloc(5); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p1,p2,p3"); + cl_assert((leaks == 3)); + + git__free(p2); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p1,p3"); + cl_assert((leaks == 2)); + + /* move the mark. only new leaks should appear afterwards */ + error = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK, + NULL); + cl_assert((error == 0)); + + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "not_p1,not_p3"); + cl_assert((leaks == 0)); + + p4 = git__malloc(5); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p4,not_p1,not_p3"); + cl_assert((leaks == 1)); + + git__free(p1); + git__free(p3); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "p4"); + cl_assert((leaks == 1)); + + git__free(p4); + leaks = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK, + "end"); + cl_assert((leaks == 0)); + + /* confirm current absolute leaks count matches beginning value. */ + after = git_win32__crtdbg_stacktrace__dump( + GIT_WIN32__CRTDBG_STACKTRACE__QUIET | + GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL, + "total"); + cl_assert((before == after)); +#endif +} + +#if defined(GIT_MSVC_CRTDBG) +static void aux_cb_alloc__1(unsigned int *aux_id) +{ + static unsigned int aux_counter = 0; + + *aux_id = aux_counter++; +} + +static void aux_cb_lookup__1(unsigned int aux_id, char *aux_msg, unsigned int aux_msg_len) +{ + p_snprintf(aux_msg, aux_msg_len, "\tQQ%08x\n", aux_id); +} + +#endif + +void test_trace_windows_stacktrace__aux1(void) +{ +#if defined(GIT_MSVC_CRTDBG) + git_win32__stack__set_aux_cb(aux_cb_alloc__1, aux_cb_lookup__1); + c(); + c(); + c(); + c(); + git_win32__stack__set_aux_cb(NULL, NULL); +#endif +} diff --git a/vendor/libgit2/tests/transport/register.c b/vendor/libgit2/tests/transport/register.c index ea917d5d3..97aae6b20 100644 --- a/vendor/libgit2/tests/transport/register.c +++ b/vendor/libgit2/tests/transport/register.c @@ -40,15 +40,23 @@ void test_transport_register__custom_transport_error_remove_non_existing(void) void test_transport_register__custom_transport_ssh(void) { + const char *urls[] = { + "ssh://somehost:somepath", + "ssh+git://somehost:somepath", + "git+ssh://somehost:somepath", + "git@somehost:somepath", + }; git_transport *transport; + unsigned i; + for (i = 0; i < ARRAY_SIZE(urls); i++) { #ifndef GIT_SSH - cl_git_fail_with(git_transport_new(&transport, NULL, "ssh://somehost:somepath"), -1); - cl_git_fail_with(git_transport_new(&transport, NULL, "git@somehost:somepath"), -1); + cl_git_fail_with(git_transport_new(&transport, NULL, urls[i]), -1); #else - cl_git_pass(git_transport_new(&transport, NULL, "git@somehost:somepath")); - transport->free(transport); + cl_git_pass(git_transport_new(&transport, NULL, urls[i])); + transport->free(transport); #endif + } cl_git_pass(git_transport_register("ssh", dummy_transport, NULL)); @@ -58,11 +66,12 @@ void test_transport_register__custom_transport_ssh(void) cl_git_pass(git_transport_unregister("ssh")); + for (i = 0; i < ARRAY_SIZE(urls); i++) { #ifndef GIT_SSH - cl_git_fail_with(git_transport_new(&transport, NULL, "ssh://somehost:somepath"), -1); - cl_git_fail_with(git_transport_new(&transport, NULL, "git@somehost:somepath"), -1); + cl_git_fail_with(git_transport_new(&transport, NULL, urls[i]), -1); #else - cl_git_pass(git_transport_new(&transport, NULL, "git@somehost:somepath")); - transport->free(transport); + cl_git_pass(git_transport_new(&transport, NULL, urls[i])); + transport->free(transport); #endif + } } diff --git a/vendor/libgit2/tests/win32/forbidden.c b/vendor/libgit2/tests/win32/forbidden.c new file mode 100644 index 000000000..e02f41179 --- /dev/null +++ b/vendor/libgit2/tests/win32/forbidden.c @@ -0,0 +1,183 @@ +#include "clar_libgit2.h" + +#include "repository.h" +#include "buffer.h" +#include "submodule.h" + +static const char *repo_name = "win32-forbidden"; +static git_repository *repo; + +void test_win32_forbidden__initialize(void) +{ + repo = cl_git_sandbox_init(repo_name); +} + +void test_win32_forbidden__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_win32_forbidden__can_open_index(void) +{ + git_index *index; + cl_git_pass(git_repository_index(&index, repo)); + cl_assert_equal_i(7, git_index_entrycount(index)); + + /* ensure we can even write the unmodified index */ + cl_git_pass(git_index_write(index)); + + git_index_free(index); +} + +void test_win32_forbidden__can_add_forbidden_filename_with_entry(void) +{ + git_index *index; + git_index_entry entry = {{0}}; + + cl_git_pass(git_repository_index(&index, repo)); + + entry.path = "aux"; + entry.mode = GIT_FILEMODE_BLOB; + git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37"); + + cl_git_pass(git_index_add(index, &entry)); + + git_index_free(index); +} + +void test_win32_forbidden__cannot_add_dot_git_even_with_entry(void) +{ + git_index *index; + git_index_entry entry = {{0}}; + + cl_git_pass(git_repository_index(&index, repo)); + + entry.path = "foo/.git"; + entry.mode = GIT_FILEMODE_BLOB; + git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37"); + + cl_git_fail(git_index_add(index, &entry)); + + git_index_free(index); +} + +void test_win32_forbidden__cannot_add_forbidden_filename_from_filesystem(void) +{ + git_index *index; + + /* since our function calls are very low-level, we can create `aux.`, + * but we should not be able to add it to the index + */ + cl_git_pass(git_repository_index(&index, repo)); + cl_git_write2file("win32-forbidden/aux.", "foo\n", 4, O_RDWR | O_CREAT, 0666); + +#ifdef GIT_WIN32 + cl_git_fail(git_index_add_bypath(index, "aux.")); +#else + cl_git_pass(git_index_add_bypath(index, "aux.")); +#endif + + cl_must_pass(p_unlink("win32-forbidden/aux.")); + git_index_free(index); +} + +static int dummy_submodule_cb( + git_submodule *sm, const char *name, void *payload) +{ + GIT_UNUSED(sm); + GIT_UNUSED(name); + GIT_UNUSED(payload); + return 0; +} + +void test_win32_forbidden__can_diff_tree_to_index(void) +{ + git_diff *diff; + git_tree *tree; + + cl_git_pass(git_repository_head_tree(&tree, repo)); + cl_git_pass(git_diff_tree_to_index(&diff, repo, tree, NULL, NULL)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + git_tree_free(tree); +} + +void test_win32_forbidden__can_diff_tree_to_tree(void) +{ + git_diff *diff; + git_tree *tree; + + cl_git_pass(git_repository_head_tree(&tree, repo)); + cl_git_pass(git_diff_tree_to_tree(&diff, repo, tree, tree, NULL)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + git_tree_free(tree); +} + +void test_win32_forbidden__can_diff_index_to_workdir(void) +{ + git_index *index; + git_diff *diff; + const git_diff_delta *delta; + git_tree *tree; + size_t i; + + cl_git_pass(git_repository_index(&index, repo)); + cl_git_pass(git_repository_head_tree(&tree, repo)); + cl_git_pass(git_diff_index_to_workdir(&diff, repo, index, NULL)); + + for (i = 0; i < git_diff_num_deltas(diff); i++) { + delta = git_diff_get_delta(diff, i); + cl_assert_equal_i(GIT_DELTA_DELETED, delta->status); + } + + git_diff_free(diff); + git_tree_free(tree); + git_index_free(index); +} + +void test_win32_forbidden__checking_out_forbidden_index_fails(void) +{ +#ifdef GIT_WIN32 + git_index *index; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_diff *diff; + const git_diff_delta *delta; + git_tree *tree; + size_t num_deltas, i; + + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_git_pass(git_repository_index(&index, repo)); + cl_git_fail(git_checkout_index(repo, index, &opts)); + + cl_git_pass(git_repository_head_tree(&tree, repo)); + cl_git_pass(git_diff_index_to_workdir(&diff, repo, index, NULL)); + + num_deltas = git_diff_num_deltas(diff); + + cl_assert(num_deltas > 0); + + for (i = 0; i < num_deltas; i++) { + delta = git_diff_get_delta(diff, i); + cl_assert_equal_i(GIT_DELTA_DELETED, delta->status); + } + + git_diff_free(diff); + git_tree_free(tree); + git_index_free(index); +#endif +} + +void test_win32_forbidden__can_query_submodules(void) +{ + cl_git_pass(git_submodule_foreach(repo, dummy_submodule_cb, NULL)); +} + +void test_win32_forbidden__can_blame_file(void) +{ + git_blame *blame; + + cl_git_pass(git_blame_file(&blame, repo, "aux", NULL)); + git_blame_free(blame); +} diff --git a/vendor/libgit2/tests/win32/longpath.c b/vendor/libgit2/tests/win32/longpath.c index 6de7d389a..5a36875ed 100644 --- a/vendor/libgit2/tests/win32/longpath.c +++ b/vendor/libgit2/tests/win32/longpath.c @@ -36,7 +36,7 @@ void assert_name_too_long(void) { const git_error *err; size_t expected_len, actual_len; - const char *expected_msg; + char *expected_msg; err = giterr_last(); actual_len = strlen(err->message); @@ -46,6 +46,8 @@ void assert_name_too_long(void) /* check the suffix */ cl_assert_equal_s(expected_msg, err->message + (actual_len - expected_len)); + + git__free(expected_msg); } #endif From 35580b5de51d2a7683216d685301a3e96a927dc5 Mon Sep 17 00:00:00 2001 From: John Haley Date: Thu, 21 Apr 2016 16:13:49 -0700 Subject: [PATCH 05/11] Sorted file sources in `libgit2.gyp` --- vendor/libgit2.gyp | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 8880a2438..5b87172e8 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -27,20 +27,21 @@ "libssh2" ], "sources": [ - "libgit2/src/annotated_commit.h", + "libgit2/include/git2/sys/hashsig.h", "libgit2/src/annotated_commit.c", + "libgit2/src/annotated_commit.h", "libgit2/src/array.h", - "libgit2/src/attr.c", - "libgit2/src/attr.h", "libgit2/src/attr_file.c", "libgit2/src/attr_file.h", + "libgit2/src/attr.c", + "libgit2/src/attr.h", "libgit2/src/attrcache.c", "libgit2/src/attrcache.h", "libgit2/src/bitvec.h", - "libgit2/src/blame.c", - "libgit2/src/blame.h", "libgit2/src/blame_git.c", "libgit2/src/blame_git.h", + "libgit2/src/blame.c", + "libgit2/src/blame.h", "libgit2/src/blob.c", "libgit2/src/blob.h", "libgit2/src/branch.c", @@ -58,24 +59,22 @@ "libgit2/src/cherrypick.c", "libgit2/src/clone.c", "libgit2/src/clone.h", - "libgit2/src/commit.c", - "libgit2/src/commit.h", "libgit2/src/commit_list.c", "libgit2/src/commit_list.h", + "libgit2/src/commit.c", + "libgit2/src/commit.h", "libgit2/src/common.h", - "libgit2/src/config.c", - "libgit2/src/config.h", "libgit2/src/config_cache.c", "libgit2/src/config_file.c", "libgit2/src/config_file.h", + "libgit2/src/config.c", + "libgit2/src/config.h", "libgit2/src/crlf.c", "libgit2/src/date.c", "libgit2/src/delta-apply.c", "libgit2/src/delta-apply.h", "libgit2/src/delta.c", "libgit2/src/delta.h", - "libgit2/src/diff.c", - "libgit2/src/diff.h", "libgit2/src/diff_driver.c", "libgit2/src/diff_driver.h", "libgit2/src/diff_file.c", @@ -87,6 +86,8 @@ "libgit2/src/diff_tform.c", "libgit2/src/diff_xdiff.c", "libgit2/src/diff_xdiff.h", + "libgit2/src/diff.c", + "libgit2/src/diff.h", "libgit2/src/errors.c", "libgit2/src/fetch.c", "libgit2/src/fetch.h", @@ -105,8 +106,10 @@ "libgit2/src/graph.c", "libgit2/src/hash.c", "libgit2/src/hash.h", + "libgit2/src/hash/hash_generic.c", + "libgit2/src/hash/hash_generic.h", + "libgit2/src/hash/hash_openssl.h", "libgit2/src/hashsig.c", - "libgit2/include/git2/sys/hashsig.h", "libgit2/src/ident.c", "libgit2/src/ignore.c", "libgit2/src/ignore.h", @@ -117,10 +120,10 @@ "libgit2/src/iterator.h", "libgit2/src/khash.h", "libgit2/src/map.h", - "libgit2/src/merge.c", - "libgit2/src/merge.h", "libgit2/src/merge_file.c", "libgit2/src/merge_file.h", + "libgit2/src/merge.c", + "libgit2/src/merge.h", "libgit2/src/message.c", "libgit2/src/message.h", "libgit2/src/mwindow.c", @@ -129,14 +132,14 @@ "libgit2/src/netops.h", "libgit2/src/notes.c", "libgit2/src/notes.h", + "libgit2/src/object_api.c", "libgit2/src/object.c", "libgit2/src/object.h", - "libgit2/src/object_api.c", - "libgit2/src/odb.c", - "libgit2/src/odb.h", "libgit2/src/odb_loose.c", "libgit2/src/odb_mempack.c", "libgit2/src/odb_pack.c", + "libgit2/src/odb.c", + "libgit2/src/odb.h", "libgit2/src/offmap.h", "libgit2/src/oid.c", "libgit2/src/oid.h", @@ -162,10 +165,10 @@ "libgit2/src/push.c", "libgit2/src/push.h", "libgit2/src/rebase.c", - "libgit2/src/refdb.c", - "libgit2/src/refdb.h", "libgit2/src/refdb_fs.c", "libgit2/src/refdb_fs.h", + "libgit2/src/refdb.c", + "libgit2/src/refdb.h", "libgit2/src/reflog.c", "libgit2/src/reflog.h", "libgit2/src/refs.c", @@ -209,6 +212,18 @@ "libgit2/src/trace.h", "libgit2/src/transaction.c", "libgit2/src/transport.c", + "libgit2/src/transports/auth.c", + "libgit2/src/transports/auth.h", + "libgit2/src/transports/cred_helpers.c", + "libgit2/src/transports/cred.c", + "libgit2/src/transports/git.c", + "libgit2/src/transports/http.c", + "libgit2/src/transports/local.c", + "libgit2/src/transports/smart_pkt.c", + "libgit2/src/transports/smart_protocol.c", + "libgit2/src/transports/smart.c", + "libgit2/src/transports/smart.h", + "libgit2/src/transports/ssh.c", "libgit2/src/tree-cache.c", "libgit2/src/tree-cache.h", "libgit2/src/tree.c", @@ -219,23 +234,6 @@ "libgit2/src/util.h", "libgit2/src/vector.c", "libgit2/src/vector.h", - "libgit2/src/zstream.c", - "libgit2/src/zstream.h", - "libgit2/src/hash/hash_generic.c", - "libgit2/src/hash/hash_generic.h", - "libgit2/src/hash/hash_openssl.h", - "libgit2/src/transports/auth.c", - "libgit2/src/transports/auth.h", - "libgit2/src/transports/cred.c", - "libgit2/src/transports/cred_helpers.c", - "libgit2/src/transports/git.c", - "libgit2/src/transports/http.c", - "libgit2/src/transports/local.c", - "libgit2/src/transports/smart.c", - "libgit2/src/transports/smart.h", - "libgit2/src/transports/smart_pkt.c", - "libgit2/src/transports/smart_protocol.c", - "libgit2/src/transports/ssh.c", "libgit2/src/xdiff/xdiff.h", "libgit2/src/xdiff/xdiffi.c", "libgit2/src/xdiff/xdiffi.h", @@ -251,6 +249,8 @@ "libgit2/src/xdiff/xtypes.h", "libgit2/src/xdiff/xutils.c", "libgit2/src/xdiff/xutils.h", + "libgit2/src/zstream.c", + "libgit2/src/zstream.h" ], "conditions": [ ["OS=='mac'", { From 49dcb78fd475c9524cf18cfd02b66275978a9730 Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 25 Apr 2016 11:29:18 -0700 Subject: [PATCH 06/11] libgit2 builds now --- vendor/libgit2.gyp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vendor/libgit2.gyp b/vendor/libgit2.gyp index 5b87172e8..fdcf123f0 100644 --- a/vendor/libgit2.gyp +++ b/vendor/libgit2.gyp @@ -255,7 +255,8 @@ "conditions": [ ["OS=='mac'", { "defines": [ - "GIT_SECURE_TRANSPORT" + "GIT_SECURE_TRANSPORT", + "GIT_USE_STAT_MTIMESPEC" ], "sources": [ "libgit2/src/stransport_stream.c", From e4e495f17c3628b1dacc58833d34c50c34a1f309 Mon Sep 17 00:00:00 2001 From: John Haley Date: Tue, 26 Apr 2016 10:59:36 -0700 Subject: [PATCH 07/11] NodeGit builds... AGAIN!!! --- generate/input/callbacks.json | 25 ++++++ generate/input/descriptor.json | 6 ++ generate/input/libgit2-supplement.json | 106 ------------------------- 3 files changed, 31 insertions(+), 106 deletions(-) diff --git a/generate/input/callbacks.json b/generate/input/callbacks.json index eb6b128a3..999ccd57f 100644 --- a/generate/input/callbacks.json +++ b/generate/input/callbacks.json @@ -285,6 +285,31 @@ "success": 0, "error": -1 } + },"git_diff_progress_cb": { + "args": [ + { + "name": "diff_so_far", + "cType": "const git_diff *" + }, + { + "name": "old_path", + "cType": "const char *" + }, + { + "name": "new_path", + "cType": "const char *" + }, + { + "name": "payload", + "cType": "void *" + } + ], + "return": { + "type": "int", + "noResults": 1, + "success": 0, + "error": -1 + } }, "git_index_matched_path_cb": { "args": [ diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index b4577b092..608ca3498 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -416,12 +416,18 @@ } } }, + "git_commit_create_buffer": { + "ignore": true + }, "git_commit_create_from_callback": { "ignore": true }, "git_commit_create_from_ids": { "ignore": true }, + "git_commit_extract_signature": { + "ignore": true + }, "git_commit_id": { "return": { "ownedByThis": true diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index f525a6390..5e7028f35 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -522,48 +522,6 @@ ] } ], - [ - "git_merge_options", - { - "type": "struct", - "fields": [ - { - "type": "unsigned int", - "name": "version" - }, - { - "type": "git_merge_tree_flag_t", - "name": "tree_flags" - }, - { - "type": "unsigned int", - "name": "rename_threshold" - }, - { - "type": "unsigned int", - "name": "target_limit" - }, - { - "type": "git_diff_similarity_metric *", - "name": "metric", - "ignore": true - }, - { - "type": "git_merge_file_favor_t", - "name": "file_favor" - }, - { - "type": "unsigned int", - "name": "file_flags" - } - ], - "used": { - "needs": [ - "git_merge_init_options" - ] - } - } - ], [ "git_off_t", { @@ -691,70 +649,6 @@ } } ], - [ - "git_diff_options", - { - "type": "struct", - "fields": [ - { - "type": "unsigned int", - "name": "version" - }, - { - "type": "uint32_t", - "name": "flags" - }, - { - "type": "git_submodule_ignore_t", - "name": "ignore_submodules" - }, - { - "type": "git_strarray", - "name": "pathspec" - }, - { - "type": "git_diff_notify_cb", - "name": "notify_cb" - }, - { - "type": "void *", - "name": "notify_payload" - }, - { - "type": "uint32_t", - "name": "context_lines" - }, - { - "type": "uint32_t", - "name": "interhunk_lines" - }, - { - "type": "uint16_t", - "name": "id_abbrev" - }, - { - "type": "git_off_t", - "name": "max_size" - }, - { - "type": "const char *", - "name": "old_prefix" - }, - { - "type": "const char *", - "name": "new_prefix" - } - ], - "used": { - "needs": [ - "git_diff_init_options", - "git_diff_tree_to_workdir", - "git_diff_tree_to_workdirext", - "git_diff_tree_to_tree" - ] - } - } - ], [ "git_stash_apply_options", { From 8cca9b4d8ed04efda3ba68d2eb2f858ba7f89222 Mon Sep 17 00:00:00 2001 From: Chris Bargren Date: Wed, 6 Apr 2016 11:46:35 -0700 Subject: [PATCH 08/11] Fixing checkout test --- lib/checkout.js | 6 +++--- test/tests/checkout.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/checkout.js b/lib/checkout.js index 01f0ef59b..652f6116a 100644 --- a/lib/checkout.js +++ b/lib/checkout.js @@ -15,7 +15,7 @@ var _tree = Checkout.tree; * @return {Void} checkout complete */ Checkout.head = function(url, options) { - options = normalizeOptions(options, NodeGit.CheckoutOptions); + options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); return _head.call(this, url, options); }; @@ -30,7 +30,7 @@ Checkout.head = function(url, options) { * @return {Void} checkout complete */ Checkout.index = function(repo, index, options) { - options = normalizeOptions(options, NodeGit.CheckoutOptions); + options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); return _index.call(this, repo, index, options); }; @@ -45,7 +45,7 @@ Checkout.index = function(repo, index, options) { * @return {Void} checkout complete */ Checkout.tree = function(repo, treeish, options) { - options = normalizeOptions(options, NodeGit.CheckoutOptions); + options = normalizeOptions(options || {}, NodeGit.CheckoutOptions); return _tree.call(this, repo, treeish, options); }; diff --git a/test/tests/checkout.js b/test/tests/checkout.js index cdde973ed..e3815a35f 100644 --- a/test/tests/checkout.js +++ b/test/tests/checkout.js @@ -75,7 +75,7 @@ describe("Checkout", function() { var test = this; return test.repository.getTagByName("annotated-tag").then(function(tag) { - return Checkout.tree(test.repository, test.tag); + return Checkout.tree(test.repository, tag); }).then(function() { return test.repository.getHeadCommit(); }).then(function(commit) { From ad097c7917c09225b600a2ebb3fd7e010a57efce Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 25 Apr 2016 17:19:50 -0700 Subject: [PATCH 09/11] Make graph error test more resilient. --- test/tests/graph.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/tests/graph.js b/test/tests/graph.js index abeaefa4c..34805cda0 100644 --- a/test/tests/graph.js +++ b/test/tests/graph.js @@ -9,9 +9,6 @@ describe("Graph", function() { var reposPath = local("../repos/workdir"); - var expectedError = "Object not found - no match for id " + - "(81b06facd90fe7a6e9bbd9cee59736a79105b7be)"; - beforeEach(function() { var test = this; @@ -54,14 +51,14 @@ describe("Graph", function() { }); }); - it("will error if provided bad commits", function() { + it("descendantOf will error if provided bad commits", function() { return Graph.descendantOf( this.repository, "81b06facd90fe7a6e9bbd9cee59736a79105b7be", "26744fc697849d370246749b67ac43b792a4af0c" ) .catch(function(result) { - assert.equal(result.message, expectedError); + assert(~result.message.indexOf("81b06fac")); }); }); }); From 76fb03cf5823854c7335155e6de6b63a631d483a Mon Sep 17 00:00:00 2001 From: John Haley Date: Mon, 25 Apr 2016 17:32:32 -0700 Subject: [PATCH 10/11] Fix remote tests --- lib/remote.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/remote.js b/lib/remote.js index 949702100..29b157c1a 100644 --- a/lib/remote.js +++ b/lib/remote.js @@ -25,13 +25,20 @@ Remote.lookup = lookupWrapper(Remote); * @async * @param {Enums.DIRECTION} direction The direction for the connection * @param {RemoteCallbacks} callbacks The callback functions for the connection + * @param {ProxyOptions} proxyOpts Proxy settings + * @param {Array[String]} customHeaders extra HTTP headers to use * @param {Function} callback * @return {Number} error code */ -Remote.prototype.connect = function(direction, callbacks) { +Remote.prototype.connect = function( + direction, + callbacks, + customHeaders +) { callbacks = normalizeOptions(callbacks, NodeGit.RemoteCallbacks); + customHeaders = customHeaders || []; - return connect.call(this, direction, callbacks); + return connect.call(this, direction, callbacks, customHeaders); }; /** From 295f50703e6d995ff02de37f96c3ab91336e56b4 Mon Sep 17 00:00:00 2001 From: John Haley Date: Tue, 26 Apr 2016 10:18:08 -0700 Subject: [PATCH 11/11] Fix `TreeEntry` --- generate/input/libgit2-supplement.json | 45 +++++++++++++------------- lib/tree_entry.js | 17 +++++----- test/tests/tree_entry.js | 6 ++-- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/generate/input/libgit2-supplement.json b/generate/input/libgit2-supplement.json index 5e7028f35..78f954255 100644 --- a/generate/input/libgit2-supplement.json +++ b/generate/input/libgit2-supplement.json @@ -82,28 +82,6 @@ }, "git_note_iterator": { "decl": "git_iterator" - }, - "git_tree_entry": { - "fields": [ - { - "name": "attr", - "type": "uint16_t" - }, - { - "name": "oid", - "type": "git_oid" - }, - { - "name": "filename_len", - "type": "size_t" - }, - { - "name": "filename", - "structType": "char", - "structName": "filename[1]", - "type": "char *" - } - ] } }, "new" : { @@ -305,6 +283,18 @@ "git_status_list_get_perfdata", "git_status_list_new" ] + ], + [ + "tree_entry", + [ + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type" + ] ] ], "types": [ @@ -722,6 +712,17 @@ "git_status_list_get_perfdata", "git_status_list_new" ] + }, + "tree": { + "functions": [ + "git_tree_entry_filemode", + "git_tree_entry_filemode_raw", + "git_tree_entry_free", + "git_tree_entry_id", + "git_tree_entry_name", + "git_tree_entry_to_object", + "git_tree_entry_type" + ] } }, "groups": { diff --git a/lib/tree_entry.js b/lib/tree_entry.js index f13e27a99..3b084c32e 100644 --- a/lib/tree_entry.js +++ b/lib/tree_entry.js @@ -1,6 +1,5 @@ var path = require("path"); var NodeGit = require("../"); -var Tree = NodeGit.Tree; var TreeEntry = NodeGit.TreeEntry; /** @@ -8,8 +7,8 @@ var TreeEntry = NodeGit.TreeEntry; * @return {Boolean} */ TreeEntry.prototype.isFile = function() { - return this.attr() === TreeEntry.FILEMODE.BLOB || - this.attr() === TreeEntry.FILEMODE.EXECUTABLE; + return this.filemode() === TreeEntry.FILEMODE.BLOB || + this.filemode() === TreeEntry.FILEMODE.EXECUTABLE; }; /** @@ -17,7 +16,7 @@ TreeEntry.prototype.isFile = function() { * @return {Boolean} */ TreeEntry.prototype.isTree = function() { - return this.attr() === TreeEntry.FILEMODE.TREE; + return this.filemode() === TreeEntry.FILEMODE.TREE; }; /** @@ -37,7 +36,7 @@ TreeEntry.prototype.isBlob = TreeEntry.prototype.isFile; * @return {String} */ TreeEntry.prototype.sha = function() { - return this.oid().toString(); + return this.id().toString(); }; /** @@ -48,7 +47,7 @@ TreeEntry.prototype.sha = function() { TreeEntry.prototype.getTree = function(callback) { var entry = this; - return this.parent.repo.getTree(this.oid()).then(function(tree) { + return this.parent.repo.getTree(this.id()).then(function(tree) { tree.entry = entry; if (typeof callback === "function") { @@ -65,7 +64,7 @@ TreeEntry.prototype.getTree = function(callback) { * @return {Blob} */ TreeEntry.prototype.getBlob = function(callback) { - return this.parent.repo.getBlob(this.oid()).then(function(blob) { + return this.parent.repo.getBlob(this.id()).then(function(blob) { if (typeof callback === "function") { callback(null, blob); } @@ -80,7 +79,7 @@ TreeEntry.prototype.getBlob = function(callback) { */ TreeEntry.prototype.path = function(callback) { var dirtoparent = this.dirtoparent || ""; - return path.join(this.parent.path(), dirtoparent, this.filename()); + return path.join(this.parent.path(), dirtoparent, this.name()); }; /** @@ -91,5 +90,5 @@ TreeEntry.prototype.toString = function() { }; TreeEntry.prototype.oid = function() { - return Tree.entryId(this).toString(); + return this.id().toString(); }; diff --git a/test/tests/tree_entry.js b/test/tests/tree_entry.js index 6585b4b94..b4d3abb18 100644 --- a/test/tests/tree_entry.js +++ b/test/tests/tree_entry.js @@ -41,14 +41,14 @@ describe("TreeEntry", function() { it("provides the correct length for a file", function() { return this.commit.getEntry("README.md") .then(function(entry) { - assert.equal(entry.filenameLen(), 9); + assert.equal(entry.name().length, 9); }); }); it("provides the filename", function() { return this.commit.getEntry("test/raw-commit.js") .then(function(entry) { - assert.equal(entry.filename(), "raw-commit.js"); + assert.equal(entry.name(), "raw-commit.js"); }); }); @@ -64,7 +64,7 @@ describe("TreeEntry", function() { var dir = _dir || "", testPromises = []; tree.entries().forEach(function(entry) { - var currentPath = path.join(dir, entry.filename()); + var currentPath = path.join(dir, entry.name()); if (entry.isTree()) { testPromises.push( entry.getTree().then(function (subtree) {