summaryrefslogtreecommitdiff
path: root/builtin/config.c
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2020-11-25 22:12:49 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 14:43:47 -0800
commit504ee1290e38fb1ff0d76f940b124e21ab57a99f (patch)
tree804987ae0314b8243a4ec1c7d84e7dc6dbb2dd3b /builtin/config.c
parentSixth batch (diff)
downloadtgif-504ee1290e38fb1ff0d76f940b124e21ab57a99f.tar.xz
config: convert multi_replace to flags
We will extend the flexibility of the config API. Before doing so, let's take an existing 'int multi_replace' parameter and replace it with a new 'unsigned flags' parameter that can take multiple options as a bit field. Update all callers that specified multi_replace to now specify the CONFIG_FLAGS_MULTI_REPLACE flag. To add more clarity, extend the documentation of git_config_set_multivar_in_file() including a clear labeling of its arguments. Other config API methods in config.h require only a change of the final parameter from 'int' to 'unsigned'. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 963d65fd3f..7c15c5d743 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -844,7 +844,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
value = normalize_value(argv[0], argv[1]);
UNLEAK(value);
return git_config_set_multivar_in_file_gently(given_config_source.file,
- argv[0], value, argv[2], 1);
+ argv[0], value, argv[2],
+ CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_GET) {
check_argc(argc, 1, 2);
@@ -880,7 +881,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
check_write();
check_argc(argc, 1, 2);
return git_config_set_multivar_in_file_gently(given_config_source.file,
- argv[0], NULL, argv[1], 1);
+ argv[0], NULL, argv[1],
+ CONFIG_FLAGS_MULTI_REPLACE);
}
else if (actions == ACTION_RENAME_SECTION) {
int ret;