ls-tree: disable negative pathspec because it's not supported
[gitweb.git] / builtin / for-each-ref.c
index 3ee22b96a561ecba2fcd344379fbfb861530a3ae..603a90e29b808a86fa39f031d13a1ca94f5d236e 100644 (file)
@@ -672,7 +672,8 @@ static void populate_value(struct refinfo *ref)
                } else if (starts_with(name, "color:")) {
                        char color[COLOR_MAXLEN] = "";
 
-                       color_parse(name + 6, "--format", color);
+                       if (color_parse(name + 6, color) < 0)
+                               die(_("unable to parse format"));
                        v->s = xstrdup(color);
                        continue;
                } else if (!strcmp(name, "flag")) {
@@ -1011,7 +1012,8 @@ static void show_ref(struct refinfo *info, const char *format, int quote_style)
                struct atom_value resetv;
                char color[COLOR_MAXLEN] = "";
 
-               color_parse("reset", "--format", color);
+               if (color_parse("reset", color) < 0)
+                       die("BUG: couldn't parse 'reset' as a color");
                resetv.s = color;
                print_value(&resetv, quote_style);
        }