summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-05-08 15:59:18 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-08 15:59:18 +0900
commitb7da73ac8b953afd788e096b5b216e3bd9845659 (patch)
tree5230b490ab355c93f807eba61e272d211a3af7a0 /builtin
parentMerge branch 'sb/submodule-move-nested' (diff)
parentref-filter: libify get_ref_atom_value() (diff)
downloadtgif-b7da73ac8b953afd788e096b5b216e3bd9845659.tar.xz
Merge branch 'ot/libify-get-ref-atom-value'
Code restructuring, in preparation for further work. * ot/libify-get-ref-atom-value: ref-filter: libify get_ref_atom_value() ref-filter: add return value to parsers ref-filter: change parsing function error handling ref-filter: add return value && strbuf to handlers ref-filter: start adding strbufs with errors ref-filter: add shortcut to work with strbufs
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 5bd2a0dd48..efc9ac1922 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -391,7 +391,6 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
struct ref_array array;
int maxwidth = 0;
const char *remote_prefix = "";
- struct strbuf out = STRBUF_INIT;
char *to_free = NULL;
/*
@@ -419,7 +418,10 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
ref_array_sort(sorting, &array);
for (i = 0; i < array.nr; i++) {
- format_ref_array_item(array.items[i], format, &out);
+ struct strbuf out = STRBUF_INIT;
+ struct strbuf err = STRBUF_INIT;
+ if (format_ref_array_item(array.items[i], format, &out, &err))
+ die("%s", err.buf);
if (column_active(colopts)) {
assert(!filter->verbose && "--column and --verbose are incompatible");
/* format to a string_list to let print_columns() do its job */
@@ -428,6 +430,7 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin
fwrite(out.buf, 1, out.len, stdout);
putchar('\n');
}
+ strbuf_release(&err);
strbuf_release(&out);
}