config: avoid a funny sentinel value "a^"

Introduce CONFIG_REGEX_NONE as a more explicit sentinel value to say
"we do not want to replace any existing entry" and use it in the
implementation of "git config --add".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2014-08-19 02:20:00 -04:00
committed by Junio C Hamano
parent c8466645ed
commit c1063be2a3
3 changed files with 21 additions and 7 deletions

View File

@ -599,7 +599,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
check_argc(argc, 2, 2);
value = normalize_value(argv[0], argv[1]);
return git_config_set_multivar_in_file(given_config_source.file,
argv[0], value, "a^", 0);
argv[0], value,
CONFIG_REGEX_NONE, 0);
}
else if (actions == ACTION_REPLACE_ALL) {
check_write();