diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-11-17 17:55:10 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-11-18 23:39:10 +0000 |
| commit | e226ad8f2fd76211809cf7b381fb55bb600df82f (patch) | |
| tree | f48c25905a7736c59305b5ce2730cf0fe424df25 /src/config_cache.c | |
| parent | 7321cff05df927c8d00755ef21289ec00d125c9c (diff) | |
| download | libgit2-e226ad8f2fd76211809cf7b381fb55bb600df82f.tar.gz | |
refs: add support for core.logAllRefUpdates=always
Since we were not expecting this config entry to contain a string, we
would fail as soon as its (cached) value would be accessed. Hence,
provide some constants for the 4 states we use, and account for "always"
when we decide to reflog changes.
Diffstat (limited to 'src/config_cache.c')
| -rw-r--r-- | src/config_cache.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config_cache.c b/src/config_cache.c index 0efb1a789..2530217c9 100644 --- a/src/config_cache.c +++ b/src/config_cache.c @@ -58,6 +58,12 @@ static git_cvar_map _cvar_map_safecrlf[] = { {GIT_CVAR_STRING, "warn", GIT_SAFE_CRLF_WARN} }; +static git_cvar_map _cvar_map_logallrefupdates[] = { + {GIT_CVAR_FALSE, NULL, GIT_LOGALLREFUPDATES_FALSE}, + {GIT_CVAR_TRUE, NULL, GIT_LOGALLREFUPDATES_TRUE}, + {GIT_CVAR_STRING, "always", GIT_LOGALLREFUPDATES_ALWAYS}, +}; + /* * Generic map for integer values */ @@ -76,7 +82,7 @@ static struct map_data _cvar_maps[] = { {"core.abbrev", _cvar_map_int, 1, GIT_ABBREV_DEFAULT }, {"core.precomposeunicode", NULL, 0, GIT_PRECOMPOSE_DEFAULT }, {"core.safecrlf", _cvar_map_safecrlf, ARRAY_SIZE(_cvar_map_safecrlf), GIT_SAFE_CRLF_DEFAULT}, - {"core.logallrefupdates", NULL, 0, GIT_LOGALLREFUPDATES_DEFAULT }, + {"core.logallrefupdates", _cvar_map_logallrefupdates, ARRAY_SIZE(_cvar_map_logallrefupdates), GIT_LOGALLREFUPDATES_DEFAULT}, {"core.protecthfs", NULL, 0, GIT_PROTECTHFS_DEFAULT }, {"core.protectntfs", NULL, 0, GIT_PROTECTNTFS_DEFAULT }, {"core.fsyncobjectfiles", NULL, 0, GIT_FSYNCOBJECTFILES_DEFAULT }, |
