diff options
author | Olga Telezhnaya <olyatelezhnaya@gmail.com> | 2018-03-29 14:49:45 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-29 23:24:49 +0200 |
commit | 3019eca918d168d5f0cb773c8853222745e1b37a (patch) | |
tree | d6acfbf69e41f411174935099d10e01857c3c149 /ref-filter.h | |
parent | ref-filter: add shortcut to work with strbufs (diff) | |
download | git-3019eca918d168d5f0cb773c8853222745e1b37a.tar.xz git-3019eca918d168d5f0cb773c8853222745e1b37a.zip |
ref-filter: start adding strbufs with errors
This is a first step in removing die() calls from ref-filter
formatting logic, so that it could be used by other commands
that do not want to die during formatting process.
die() calls related to bugs in code will not be touched in this patch.
Everything would be the same for show_ref_array_item() users.
But, if you want to deal with errors by your own, you could invoke
format_ref_array_item(). It means that you need to print everything
(the result and errors) on your side.
This commit changes signature of format_ref_array_item() by adding
return value and strbuf parameter for errors, and adjusts
its callers. While at it, reduce the scope of the out-variable.
Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.h')
-rw-r--r-- | ref-filter.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ref-filter.h b/ref-filter.h index 0d98342b34..e13f8e6f87 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -110,9 +110,10 @@ int verify_ref_format(struct ref_format *format); /* Sort the given ref_array as per the ref_sorting provided */ void ref_array_sort(struct ref_sorting *sort, struct ref_array *array); /* Based on the given format and quote_style, fill the strbuf */ -void format_ref_array_item(struct ref_array_item *info, - const struct ref_format *format, - struct strbuf *final_buf); +int format_ref_array_item(struct ref_array_item *info, + const struct ref_format *format, + struct strbuf *final_buf, + struct strbuf *error_buf); /* Print the ref using the given format and quote_style */ void show_ref_array_item(struct ref_array_item *info, const struct ref_format *format); /* Parse a single sort specifier and add it to the list */ |