diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-05-08 09:59:18 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-08 09:59:18 +0300 |
commit | b7da73ac8b953afd788e096b5b216e3bd9845659 (patch) | |
tree | 5230b490ab355c93f807eba61e272d211a3af7a0 /builtin/branch.c | |
parent | 0c7ecb7c311d393db41f4d81a113ffc5f3b4498f (diff) | |
parent | e339611b12e68d4658252bf4c557e58dea6e4c18 (diff) |
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/branch.c')
-rw-r--r-- | builtin/branch.c | 7 |
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); } |