Skip to content

Commit 9c14bb0

Browse files
peffgitster
authored andcommitted
git_config_set_multivar_in_file: all non-zero returns are errors
This function is just a thin wrapper for the "_gently" form of the function. But the gently form is designed to feed builtin/config.c, which passes our return code directly to its exit status, and thus uses positive error values for some cases. We check only negative values, meaning we would fail to die in some cases (e.g., a malformed key). This may or may not be triggerable in practice; we tend to use this non-gentle form only when setting internal variables, which would not have malformed keys. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8c3ca35 commit 9c14bb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ void git_config_set_multivar_in_file(const char *config_filename,
22222222
const char *value_regex, int multi_replace)
22232223
{
22242224
if (git_config_set_multivar_in_file_gently(config_filename, key, value,
2225-
value_regex, multi_replace) < 0)
2225+
value_regex, multi_replace))
22262226
die(_("could not set '%s' to '%s'"), key, value);
22272227
}
22282228

0 commit comments

Comments
 (0)