summaryrefslogtreecommitdiff
path: root/builtin/for-each-ref.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-10-20 12:23:48 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-10-20 12:23:48 -0700
commitb94657683996402228abb1694a5db4792c424f9e (patch)
treea553b8703be639bf1af8c74946337a5ebe08529f /builtin/for-each-ref.c
parentMerge branch 'rs/receive-pack-argv-leak-fix' (diff)
parentcolor_parse: do not mention variable name in error message (diff)
downloadtgif-b94657683996402228abb1694a5db4792c424f9e.tar.xz
Merge branch 'jn/parse-config-slot'
Code cleanup. * jn/parse-config-slot: color_parse: do not mention variable name in error message pass config slots as pointers instead of offsets
Diffstat (limited to 'builtin/for-each-ref.c')
-rw-r--r--builtin/for-each-ref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index fda0f04712..7ee86b3ae1 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -671,7 +671,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")) {
@@ -1004,7 +1005,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);
}