]> git.ipfire.org Git - thirdparty/git.git/blobdiff - pretty.c
pretty.c: make git_pretty_formats_config return -1 on git_config_string failure
[thirdparty/git.git] / pretty.c
index f64ff9a10c212df35ef2b31803a7bec78ff156ba..d3c2224de61a8c520e37e40dcffae1bd1edc7bf7 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -66,7 +66,9 @@ static int git_pretty_formats_config(const char *var, const char *value, void *c
 
        commit_format->name = xstrdup(name);
        commit_format->format = CMIT_FMT_USERFORMAT;
-       git_config_string(&fmt, var, value);
+       if (git_config_string(&fmt, var, value))
+               return -1;
+
        if (starts_with(fmt, "format:") || starts_with(fmt, "tformat:")) {
                commit_format->is_tformat = fmt[0] == 't';
                fmt = strchr(fmt, ':') + 1;