summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorLibravatar Neeraj Singh <neerajsi@microsoft.com>2022-03-10 22:43:22 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-03-10 15:10:22 -0800
commit844a8ad4f868dcac8851012fe6dafd49b301b2ae (patch)
tree776c72758537eea6abbd90ae515027fb9ff268c7 /environment.c
parentcore.fsync: introduce granular fsync control infrastructure (diff)
downloadtgif-844a8ad4f868dcac8851012fe6dafd49b301b2ae.tar.xz
core.fsync: add configuration parsing
This change introduces code to parse the core.fsync setting and configure the fsync_components variable. core.fsync is configured as a comma-separated list of component names to sync. Each time a core.fsync variable is encountered in the configuration heirarchy, we start off with a clean state with the platform default value. Passing 'none' resets the value to indicate nothing will be synced. We gather all negative and positive entries from the comma separated list and then compute the new value by removing all the negative entries and adding all of the positive entries. We issue a warning for components that are not recognized so that the configuration code is compatible with configs from future versions of Git with more repo components. Complete documentation for the new setting is included in a later patch in the series so that it can be reviewed once in final form. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/environment.c b/environment.c
index 36ca5fb2e7..698f03a2f4 100644
--- a/environment.c
+++ b/environment.c
@@ -42,7 +42,7 @@ const char *git_attributes_file;
const char *git_hooks_path;
int zlib_compression_level = Z_BEST_SPEED;
int pack_compression_level = Z_DEFAULT_COMPRESSION;
-int fsync_object_files;
+int fsync_object_files = -1;
int use_fsync = -1;
enum fsync_method fsync_method = FSYNC_METHOD_DEFAULT;
enum fsync_component fsync_components = FSYNC_COMPONENTS_DEFAULT;