summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2020-11-25 22:12:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-25 22:43:48 (GMT)
commitc90702a1f6f7473a959994a2dff0f0dd450b8029 (patch)
tree5a325cc4e319cd8e4a8a1b425abb48eea1c2652e /config.h
parentfda43942d7b78d2c529a40e5e38fc34034d929cb (diff)
downloadgit-c90702a1f6f7473a959994a2dff0f0dd450b8029.zip
git-c90702a1f6f7473a959994a2dff0f0dd450b8029.tar.gz
git-c90702a1f6f7473a959994a2dff0f0dd450b8029.tar.bz2
config: plumb --fixed-value into config API
The git_config_set_multivar_in_file_gently() and related methods now take a 'flags' bitfield, so add a new bit representing the --fixed-value option from 'git config'. This alters the purpose of the value_pattern parameter to be an exact string match. This requires some initialization changes in git_config_set_multivar_in_file_gently() and a new strcmp() call in the matches() method. The new CONFIG_FLAGS_FIXED_VALUE flag is initialized in builtin/config.c based on the --fixed-value option, and that needs to be updated in several callers. This patch only affects some of the modes of 'git config', and the rest will be completed in the next change. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r--config.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.h b/config.h
index 7535b1f..c1449bb 100644
--- a/config.h
+++ b/config.h
@@ -269,6 +269,13 @@ int git_config_key_is_valid(const char *key);
*/
#define CONFIG_FLAGS_MULTI_REPLACE (1 << 0)
+/*
+ * When CONFIG_FLAGS_FIXED_VALUE is specified, match key/value pairs
+ * by string comparison (not regex match) to the provided value_pattern
+ * parameter.
+ */
+#define CONFIG_FLAGS_FIXED_VALUE (1 << 1)
+
int git_config_set_multivar_gently(const char *, const char *, const char *, unsigned);
void git_config_set_multivar(const char *, const char *, const char *, unsigned);
int git_config_set_multivar_in_file_gently(const char *, const char *, const char *, const char *, unsigned);