Git fork
at reftables-rust 102 lines 3.1 kB view raw
1#ifndef REPO_SETTINGS_H 2#define REPO_SETTINGS_H 3 4struct fsmonitor_settings; 5struct repository; 6 7enum untracked_cache_setting { 8 UNTRACKED_CACHE_KEEP, 9 UNTRACKED_CACHE_REMOVE, 10 UNTRACKED_CACHE_WRITE, 11}; 12 13enum fetch_negotiation_setting { 14 FETCH_NEGOTIATION_CONSECUTIVE, 15 FETCH_NEGOTIATION_SKIPPING, 16 FETCH_NEGOTIATION_NOOP, 17}; 18 19enum log_refs_config { 20 LOG_REFS_UNSET = -1, 21 LOG_REFS_NONE = 0, 22 LOG_REFS_NORMAL, 23 LOG_REFS_ALWAYS 24}; 25 26struct repo_settings { 27 int initialized; 28 29 int core_commit_graph; 30 int commit_graph_generation_version; 31 int commit_graph_changed_paths_version; 32 int gc_write_commit_graph; 33 int fetch_write_commit_graph; 34 int command_requires_full_index; 35 int sparse_index; 36 int pack_read_reverse_index; 37 int pack_use_bitmap_boundary_traversal; 38 int pack_use_multi_pack_reuse; 39 40 int shared_repository; 41 int shared_repository_initialized; 42 43 /* 44 * Does this repository have core.useReplaceRefs=true (on by 45 * default)? This provides a repository-scoped version of this 46 * config, though it could be disabled process-wide via some Git 47 * builtins or the --no-replace-objects option. See 48 * replace_refs_enabled() for more details. 49 */ 50 int read_replace_refs; 51 52 struct fsmonitor_settings *fsmonitor; /* lazily loaded */ 53 54 int index_version; 55 int index_skip_hash; 56 enum untracked_cache_setting core_untracked_cache; 57 58 int pack_use_sparse; 59 int pack_use_path_walk; 60 enum fetch_negotiation_setting fetch_negotiation_algorithm; 61 62 int core_multi_pack_index; 63 int warn_ambiguous_refs; /* lazily loaded via accessor */ 64 65 size_t delta_base_cache_limit; 66 size_t packed_git_window_size; 67 size_t packed_git_limit; 68 unsigned long big_file_threshold; 69 70 char *hooks_path; 71}; 72#define REPO_SETTINGS_INIT { \ 73 .shared_repository = -1, \ 74 .index_version = -1, \ 75 .core_untracked_cache = UNTRACKED_CACHE_KEEP, \ 76 .fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE, \ 77 .warn_ambiguous_refs = -1, \ 78 .delta_base_cache_limit = DEFAULT_DELTA_BASE_CACHE_LIMIT, \ 79 .packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE, \ 80 .packed_git_limit = DEFAULT_PACKED_GIT_LIMIT, \ 81} 82 83void prepare_repo_settings(struct repository *r); 84void repo_settings_clear(struct repository *r); 85 86/* Read the value for "core.logAllRefUpdates". */ 87enum log_refs_config repo_settings_get_log_all_ref_updates(struct repository *repo); 88/* Read the value for "core.warnAmbiguousRefs". */ 89int repo_settings_get_warn_ambiguous_refs(struct repository *repo); 90/* Read the value for "core.hooksPath". */ 91const char *repo_settings_get_hooks_path(struct repository *repo); 92 93/* Read and set the value for "core.bigFileThreshold". */ 94unsigned long repo_settings_get_big_file_threshold(struct repository *repo); 95void repo_settings_set_big_file_threshold(struct repository *repo, unsigned long value); 96 97/* Read, set or reset the value for "core.sharedRepository". */ 98int repo_settings_get_shared_repository(struct repository *repo); 99void repo_settings_set_shared_repository(struct repository *repo, int value); 100void repo_settings_reset_shared_repository(struct repository *repo); 101 102#endif /* REPO_SETTINGS_H */