summaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-08-13 18:37:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-13 20:33:54 (GMT)
commit7211b9e7534e021d7c46117ec0c64482e7930560 (patch)
tree57f3ae59a21af472b6bdc8e1482f6b8d1cfb879c /repository.h
parent9c9b961d7eb15fb583a2a812088713a68a85f1c0 (diff)
downloadgit-7211b9e7534e021d7c46117ec0c64482e7930560.zip
git-7211b9e7534e021d7c46117ec0c64482e7930560.tar.gz
git-7211b9e7534e021d7c46117ec0c64482e7930560.tar.bz2
repo-settings: consolidate some config settings
There are a few important config settings that are not loaded during git_default_config. These are instead loaded on-demand. Centralize these config options to a single scan, and store all of the values in a repo_settings struct. The values for each setting are initialized as negative to indicate "unset". This centralization will be particularly important in a later change to introduce "meta" config settings that change the defaults for these config settings. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/repository.h b/repository.h
index 4fb6a58..cc285ad 100644
--- a/repository.h
+++ b/repository.h
@@ -11,6 +11,17 @@ struct pathspec;
struct raw_object_store;
struct submodule_cache;
+struct repo_settings {
+ int initialized;
+
+ int core_commit_graph;
+ int gc_write_commit_graph;
+
+ int index_version;
+
+ int pack_use_sparse;
+};
+
struct repository {
/* Environment */
/*
@@ -72,6 +83,8 @@ struct repository {
*/
char *submodule_prefix;
+ struct repo_settings settings;
+
/* Subsystems */
/*
* Repository's config which contains key-value pairs from the usual
@@ -157,5 +170,6 @@ int repo_read_index_unmerged(struct repository *);
*/
void repo_update_index_if_able(struct repository *, struct lock_file *);
+void prepare_repo_settings(struct repository *r);
#endif /* REPOSITORY_H */